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
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
feat(lead-connector): ui improvement (#16104)
Talal Jaber9fdef2a587fa
diff --git a/bun.lock b/bun.lockindex 02fc2777272..59610777960 100644--- a/bun.lock+++ b/bun.lock@@ -5029,7 +5029,7 @@},"packages/pieces/community/lead-connector": {"name": "@activepieces/piece-lead-connector",- "version": "0.3.0",+ "version": "0.4.0","dependencies": {"@activepieces/core-piece-types": "workspace:*","@activepieces/core-utils": "workspace:*",diff --git a/packages/pieces/community/lead-connector/package.json b/packages/pieces/community/lead-connector/package.jsonindex 9ae39bafb02..5b45eee781b 100644--- a/packages/pieces/community/lead-connector/package.json+++ b/packages/pieces/community/lead-connector/package.json@@ -1,6 +1,6 @@{"name": "@activepieces/piece-lead-connector",- "version": "0.3.0",+ "version": "0.4.0","main": "./dist/src/index.js","types": "./dist/src/index.d.ts","scripts": {diff --git a/packages/pieces/community/lead-connector/src/i18n/de.json b/packages/pieces/community/lead-connector/src/i18n/de.jsonindex d7e53dc7c3e..cd3d41e055a 100644--- a/packages/pieces/community/lead-connector/src/i18n/de.json+++ b/packages/pieces/community/lead-connector/src/i18n/de.json@@ -91,5 +91,31 @@"Trigger when a form is submitted.": "Auslösen wenn ein Formular abgeschickt wird.","Trigger when a new opportunity is added.": "Auslösen wenn eine neue Chance hinzugefügt wird.","Form": "Formular",- "The form you want to use.": "Das Formular, das Sie verwenden möchten."+ "The form you want to use.": "Das Formular, das Sie verwenden möchten.",+ "Street Address": "Straße und Hausnummer",+ "Author": "Autor",+ "Opportunity Name": "Name der Verkaufschance",+ "Value": "Wert",+ "Country code and digits only, no spaces.": "Nur Ländervorwahl und Ziffern, ohne Leerzeichen.",+ "In a dynamic value, use the two-letter code, e.g. US.": "In einem dynamischen Wert den Zwei-Buchstaben-Code verwenden, z. B. US.",+ "Where the lead came from.": "Woher der Lead stammt.",+ "Map it from a trigger or a Search Contacts step.": "Aus einem Trigger oder einem Schritt „Kontakte suchen“ zuordnen.",+ "Empty fields keep their current value.": "Leere Felder behalten ihren aktuellen Wert.",+ "Replaces the current tags. Leave empty to keep them.": "Ersetzt die aktuellen Tags. Leer lassen, um sie zu behalten.",+ "The team member the note is credited to.": "Das Teammitglied, dem die Notiz zugeordnet wird.",+ "Matched against name, email, phone and more. Up to 100 results.": "Wird mit Name, E-Mail, Telefon und mehr abgeglichen. Bis zu 100 Ergebnisse.",+ "In your account's currency.": "In der Währung Ihres Kontos.",+ "Leave empty to keep it unassigned.": "Leer lassen, um sie nicht zuzuweisen.",+ "Empty fields keep their current value, except Completed.": "Leere Felder behalten ihren aktuellen Wert, außer Abgeschlossen.",+ "Always applied: unticked marks a done task as open.": "Wird immer angewendet: Nicht angehakt setzt eine erledigte Aufgabe wieder auf offen.",+ "Runs for each new submission of this form.": "Wird für jede neue Einsendung dieses Formulars ausgelöst.",+ "Runs for each new opportunity in this pipeline.": "Wird für jede neue Verkaufschance in dieser Pipeline ausgelöst.",+ "\n1. Go to the [Marketplace](https://marketplace.gohighlevel.com/) and sign up for a developer account.\n2. Navigate to **My Apps** and click on **Create App**.\n3. Enter an app name, then select **Private** as App Type and **Sub-Account** as Distribution Type. Click **Create App**.\n4. Add the following scopes:\n - campaigns.readonly\n - contacts.write\n - contacts.readonly\n - locations.readonly\n - locations/tags.readonly\n - locations/tags.write\n - opportunities.readonly\n - opportunities.write\n ": "\n1. Gehen Sie zum [Marketplace](https://marketplace.gohighlevel.com/) und registrieren Sie sich für ein Entwicklerkonto.\n2. Öffnen Sie **My Apps** und klicken Sie auf **Create App**.\n3. Geben Sie einen App-Namen ein und wählen Sie **Private** als App Type und **Sub-Account** als Distribution Type. Klicken Sie auf **Create App**.\n4. Fügen Sie die folgenden Scopes hinzu:\n - campaigns.readonly\n - contacts.write\n - contacts.readonly\n - locations.readonly\n - locations/tags.readonly\n - locations/tags.write\n - opportunities.readonly\n - opportunities.write\n - users.readonly\n - workflows.readonly\n - forms.readonly\n5. Fügen Sie die in diesem Dialog angezeigte **Redirect URL** hinzu.\n6. Erstellen Sie einen neuen Client-Schlüssel und kopieren Sie dann **Client ID** und **Client Secret** in diesen Dialog.\n",+ "Response is Binary": "Antwort ist binär",+ "Return Error as Output": "Fehler als Ausgabe zurückgeben",+ "Timeout": "Zeitlimit",+ "Appended to the URL as ?key=value.": "Wird als ?key=value an die URL angehängt.",+ "On a failed request, output the error instead of failing the step.": "Bei einer fehlgeschlagenen Anfrage den Fehler ausgeben, statt den Schritt fehlschlagen zu lassen.",+ "Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Sekunden, die auf eine Antwort gewartet wird. Leer: bis zum Flow-Limit (10 Min.).",+ "Follow 3xx redirects instead of returning them as the response.": "3xx-Weiterleitungen folgen, statt sie als Antwort zurückzugeben."}\ No newline at end of filediff --git a/packages/pieces/community/lead-connector/src/i18n/es.json b/packages/pieces/community/lead-connector/src/i18n/es.jsonindex d61d999d258..ec315216a9a 100644--- a/packages/pieces/community/lead-connector/src/i18n/es.json+++ b/packages/pieces/community/lead-connector/src/i18n/es.json@@ -91,5 +91,30 @@"Trigger when a form is submitted.": "Activar cuando se envía un formulario.","Trigger when a new opportunity is added.": "Activar cuando se añade una nueva oportunidad.","Form": "Forma",- "The form you want to use.": "El formulario que desea utilizar."+ "The form you want to use.": "El formulario que desea utilizar.",+ "Street Address": "Dirección (calle y número)",+ "Author": "Autor",+ "Opportunity Name": "Nombre de la oportunidad",+ "Value": "Valor",+ "Country code and digits only, no spaces.": "Solo código de país y dígitos, sin espacios.",+ "In a dynamic value, use the two-letter code, e.g. US.": "En un valor dinámico, use el código de dos letras, p. ej., US.",+ "Where the lead came from.": "De dónde proviene el cliente potencial.",+ "Map it from a trigger or a Search Contacts step.": "Asígnelo desde un disparador o un paso «Buscar contactos».",+ "Empty fields keep their current value.": "Los campos vacíos conservan su valor actual.",+ "Replaces the current tags. Leave empty to keep them.": "Reemplaza las etiquetas actuales. Déjelo vacío para conservarlas.",+ "The team member the note is credited to.": "El miembro del equipo al que se atribuye la nota.",+ "Matched against name, email, phone and more. Up to 100 results.": "Se compara con nombre, correo, teléfono y más. Hasta 100 resultados.",+ "In your account's currency.": "En la moneda de su cuenta.",+ "Leave empty to keep it unassigned.": "Déjelo vacío para no asignarla.",+ "Empty fields keep their current value, except Completed.": "Los campos vacíos conservan su valor actual, excepto Completado.",+ "Always applied: unticked marks a done task as open.": "Siempre se aplica: sin marcar, una tarea completada vuelve a quedar abierta.",+ "Runs for each new submission of this form.": "Se ejecuta con cada nuevo envío de este formulario.",+ "Runs for each new opportunity in this pipeline.": "Se ejecuta con cada nueva oportunidad en este pipeline.",+ "Response is Binary": "La respuesta es binaria",+ "Return Error as Output": "Devolver error como salida",+ "Timeout": "Tiempo de espera",+ "Appended to the URL as ?key=value.": "Se añade a la URL como ?key=value.",+ "On a failed request, output the error instead of failing the step.": "Si la solicitud falla, devuelve el error en lugar de hacer fallar el paso.",+ "Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Segundos de espera para una respuesta. Vacío: hasta el límite del flujo (10 min).",+ "Follow 3xx redirects instead of returning them as the response.": "Sigue las redirecciones 3xx en lugar de devolverlas como respuesta."}\ No newline at end of filediff --git a/packages/pieces/community/lead-connector/src/i18n/fr.json b/packages/pieces/community/lead-connector/src/i18n/fr.jsonindex 3b4469ecabf..7ddc546cad4 100644--- a/packages/pieces/community/lead-connector/src/i18n/fr.json+++ b/packages/pieces/community/lead-connector/src/i18n/fr.json@@ -91,5 +91,30 @@"Trigger when a form is submitted.": "Déclencher lorsqu'un formulaire est soumis.","Trigger when a new opportunity is added.": "Déclencher quand une nouvelle opportunité est ajoutée.","Form": "Forme",- "The form you want to use.": "Le formulaire que vous souhaitez utiliser."+ "The form you want to use.": "Le formulaire que vous souhaitez utiliser.",+ "Street Address": "Adresse (rue)",+ "Author": "Auteur",+ "Opportunity Name": "Nom de l’opportunité",+ "Value": "Valeur",+ "Country code and digits only, no spaces.": "Indicatif pays et chiffres uniquement, sans espaces.",+ "In a dynamic value, use the two-letter code, e.g. US.": "Dans une valeur dynamique, utilisez le code à deux lettres, par ex. US.",+ "Where the lead came from.": "D’où vient le prospect.",+ "Map it from a trigger or a Search Contacts step.": "Reprenez-le d’un déclencheur ou d’une étape « Rechercher dans les contacts ».",+ "Empty fields keep their current value.": "Les champs vides conservent leur valeur actuelle.",+ "Replaces the current tags. Leave empty to keep them.": "Remplace les tags actuels. Laissez vide pour les conserver.",+ "The team member the note is credited to.": "Le membre de l’équipe auquel la note est attribuée.",+ "Matched against name, email, phone and more. Up to 100 results.": "Comparé au nom, à l’e-mail, au téléphone, etc. Jusqu’à 100 résultats.",+ "In your account's currency.": "Dans la devise de votre compte.",+ "Leave empty to keep it unassigned.": "Laissez vide pour ne pas l’attribuer.",+ "Empty fields keep their current value, except Completed.": "Les champs vides conservent leur valeur actuelle, sauf Terminé.",+ "Always applied: unticked marks a done task as open.": "Toujours appliqué : décoché, une tâche terminée redevient ouverte.",+ "Runs for each new submission of this form.": "S’exécute à chaque nouvelle soumission de ce formulaire.",+ "Runs for each new opportunity in this pipeline.": "S’exécute pour chaque nouvelle opportunité de ce pipeline.",+ "Response is Binary": "La réponse est binaire",+ "Return Error as Output": "Renvoyer l'erreur en sortie",+ "Timeout": "Délai d'expiration",+ "Appended to the URL as ?key=value.": "Ajouté à l'URL sous la forme ?key=value.",+ "On a failed request, output the error instead of failing the step.": "En cas d'échec de la requête, renvoie l'erreur au lieu de faire échouer l'étape.",+ "Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Secondes d'attente d'une réponse. Vide : jusqu'à la limite du flux (10 min).",+ "Follow 3xx redirects instead of returning them as the response.": "Suit les redirections 3xx au lieu de les renvoyer comme réponse."}\ No newline at end of filediff --git a/packages/pieces/community/lead-connector/src/i18n/ja.json b/packages/pieces/community/lead-connector/src/i18n/ja.jsonindex d4b8f8b1e73..889954c113a 100644--- a/packages/pieces/community/lead-connector/src/i18n/ja.json+++ b/packages/pieces/community/lead-connector/src/i18n/ja.json@@ -91,5 +91,30 @@"Trigger when a form is submitted.": "フォームが送信されたときにトリガーします。","Trigger when a new opportunity is added.": "新しい商談が追加されたときにトリガーします。","Form": "フォーム",- "The form you want to use.": "使用するフォーム。"+ "The form you want to use.": "使用するフォーム。",+ "Street Address": "住所(番地)",+ "Author": "作成者",+ "Opportunity Name": "商談名",+ "Value": "金額",+ "Country code and digits only, no spaces.": "国番号と数字のみ。スペースは入れないでください。",+ "In a dynamic value, use the two-letter code, e.g. US.": "動的な値では 2 文字のコード(例: US)を使用します。",+ "Where the lead came from.": "リードの獲得元。",+ "Map it from a trigger or a Search Contacts step.": "トリガーまたは「連絡先を検索」ステップから割り当てます。",+ "Empty fields keep their current value.": "空欄のフィールドは現在の値のままです。",+ "Replaces the current tags. Leave empty to keep them.": "現在のタグを置き換えます。空欄にすると現在のタグを保持します。",+ "The team member the note is credited to.": "メモの作成者として表示されるチームメンバー。",+ "Matched against name, email, phone and more. Up to 100 results.": "名前、メール、電話番号などと照合します。最大 100 件。",+ "In your account's currency.": "アカウントの通貨で指定します。",+ "Leave empty to keep it unassigned.": "空欄にすると未割り当てのままになります。",+ "Empty fields keep their current value, except Completed.": "空欄のフィールドは現在の値のままです(「完了」を除く)。",+ "Always applied: unticked marks a done task as open.": "常に適用されます。オフにすると完了済みのタスクが未完了に戻ります。",+ "Runs for each new submission of this form.": "このフォームへの新しい送信ごとに実行されます。",+ "Runs for each new opportunity in this pipeline.": "このパイプラインの新しい商談ごとに実行されます。",+ "Response is Binary": "レスポンスはバイナリ",+ "Return Error as Output": "エラーを出力として返す",+ "Timeout": "タイムアウト",+ "Appended to the URL as ?key=value.": "?key=value としてURLに追加されます。",+ "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).": "応答を待つ秒数。空欄: フローの上限(10分)まで。",+ "Follow 3xx redirects instead of returning them as the response.": "3xxリダイレクトをレスポンスとして返さずにたどります。"}\ No newline at end of filediff --git a/packages/pieces/community/lead-connector/src/i18n/nl.json b/packages/pieces/community/lead-connector/src/i18n/nl.jsonindex d4a9e3860a7..b3934bb19c6 100644--- a/packages/pieces/community/lead-connector/src/i18n/nl.json+++ b/packages/pieces/community/lead-connector/src/i18n/nl.json@@ -91,5 +91,31 @@"Trigger when a form is submitted.": "Trigger wanneer een formulier wordt ingediend.","Trigger when a new opportunity is added.": "Trigger wanneer een nieuwe kans wordt toegevoegd.","Form": "Vorm",- "The form you want to use.": "Het formulier dat u wilt gebruiken."+ "The form you want to use.": "Het formulier dat u wilt gebruiken.",+ "Street Address": "Straat en huisnummer",+ "Author": "Auteur",+ "Opportunity Name": "Naam van de kans",+ "Value": "Waarde",+ "Country code and digits only, no spaces.": "Alleen landcode en cijfers, zonder spaties.",+ "In a dynamic value, use the two-letter code, e.g. US.": "Gebruik in een dynamische waarde de tweeletterige code, bijv. US.",+ "Where the lead came from.": "Waar de lead vandaan komt.",+ "Map it from a trigger or a Search Contacts step.": "Haal het uit een trigger of een stap ‘Contactpersonen zoeken’.",+ "Empty fields keep their current value.": "Lege velden behouden hun huidige waarde.",+ "Replaces the current tags. Leave empty to keep them.": "Vervangt de huidige labels. Laat leeg om ze te behouden.",+ "The team member the note is credited to.": "Het teamlid aan wie de notitie wordt toegeschreven.",+ "Matched against name, email, phone and more. Up to 100 results.": "Vergeleken met naam, e-mail, telefoon en meer. Maximaal 100 resultaten.",+ "In your account's currency.": "In de valuta van je account.",+ "Leave empty to keep it unassigned.": "Laat leeg om niet toe te wijzen.",+ "Empty fields keep their current value, except Completed.": "Lege velden behouden hun huidige waarde, behalve Voltooid.",+ "Always applied: unticked marks a done task as open.": "Wordt altijd toegepast: niet aangevinkt zet een voltooide taak terug op open.",+ "Runs for each new submission of this form.": "Wordt uitgevoerd bij elke nieuwe inzending van dit formulier.",+ "Runs for each new opportunity in this pipeline.": "Wordt uitgevoerd bij elke nieuwe kans in deze pijplijn.",+ "\n1. Go to the [Marketplace](https://marketplace.gohighlevel.com/) and sign up for a developer account.\n2. Navigate to **My Apps** and click on **Create App**.\n3. Enter an app name, then select **Private** as App Type and **Sub-Account** as Distribution Type. Click **Create App**.\n4. Add the following scopes:\n - campaigns.readonly\n - contacts.write\n - contacts.readonly\n - locations.readonly\n - locations/tags.readonly\n - locations/tags.write\n - opportunities.readonly\n - opportunities.write\n ": "\n1. Ga naar de [Marketplace](https://marketplace.gohighlevel.com/) en meld je aan voor een ontwikkelaarsaccount.\n2. Ga naar **My Apps** en klik op **Create App**.\n3. Voer een app-naam in en kies **Private** als App Type en **Sub-Account** als Distribution Type. Klik op **Create App**.\n4. Voeg de volgende scopes toe:\n - campaigns.readonly\n - contacts.write\n - contacts.readonly\n - locations.readonly\n - locations/tags.readonly\n - locations/tags.write\n - opportunities.readonly\n - opportunities.write\n - users.readonly\n - workflows.readonly\n - forms.readonly\n5. Voeg de **Redirect URL** toe die in dit venster wordt getoond.\n6. Maak een nieuwe clientsleutel aan en kopieer daarna **Client ID** en **Client Secret** naar dit venster.\n",+ "Response is Binary": "Antwoord is binair",+ "Return Error as Output": "Fout als uitvoer teruggeven",+ "Timeout": "Time-out",+ "Appended to the URL as ?key=value.": "Wordt als ?key=value aan de URL toegevoegd.",+ "On a failed request, output the error instead of failing the step.": "Geef bij een mislukte aanvraag de fout als uitvoer in plaats van de stap te laten mislukken.",+ "Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Seconden wachten op een antwoord. Leeg: tot de flowlimiet (10 min).",+ "Follow 3xx redirects instead of returning them as the response.": "Volg 3xx-omleidingen in plaats van ze als antwoord terug te geven."}\ No newline at end of filediff --git a/packages/pieces/community/lead-connector/src/i18n/pt.json b/packages/pieces/community/lead-connector/src/i18n/pt.jsonindex c1421ca9176..04b75aa7ad6 100644--- a/packages/pieces/community/lead-connector/src/i18n/pt.json+++ b/packages/pieces/community/lead-connector/src/i18n/pt.json@@ -91,5 +91,30 @@"Trigger when a form is submitted.": "Disparar quando um formulário é submetido.","Trigger when a new opportunity is added.": "Acionar quando uma nova oportunidade for adicionada.","Form": "Formulário",- "The form you want to use.": "O formulário que você deseja usar."+ "The form you want to use.": "O formulário que você deseja usar.",+ "Street Address": "Endereço (rua e número)",+ "Author": "Autor",+ "Opportunity Name": "Nome da oportunidade",+ "Value": "Valor",+ "Country code and digits only, no spaces.": "Apenas código do país e dígitos, sem espaços.",+ "In a dynamic value, use the two-letter code, e.g. US.": "Em um valor dinâmico, use o código de duas letras, por ex. US.",+ "Where the lead came from.": "De onde veio o lead.",+ "Map it from a trigger or a Search Contacts step.": "Mapeie a partir de um gatilho ou de uma etapa “Pesquisar contatos”.",+ "Empty fields keep their current value.": "Campos vazios mantêm o valor atual.",+ "Replaces the current tags. Leave empty to keep them.": "Substitui as etiquetas atuais. Deixe vazio para mantê-las.",+ "The team member the note is credited to.": "O membro da equipe a quem a nota é atribuída.",+ "Matched against name, email, phone and more. Up to 100 results.": "Comparado com nome, e-mail, telefone e mais. Até 100 resultados.",+ "In your account's currency.": "Na moeda da sua conta.",+ "Leave empty to keep it unassigned.": "Deixe vazio para não atribuir.",+ "Empty fields keep their current value, except Completed.": "Campos vazios mantêm o valor atual, exceto Concluído.",+ "Always applied: unticked marks a done task as open.": "Sempre aplicado: desmarcado, uma tarefa concluída volta a ficar aberta.",+ "Runs for each new submission of this form.": "Executa a cada novo envio deste formulário.",+ "Runs for each new opportunity in this pipeline.": "Executa a cada nova oportunidade neste pipeline.",+ "Response is Binary": "A resposta é binária",+ "Return Error as Output": "Retornar erro como saída",+ "Timeout": "Tempo limite",+ "Appended to the URL as ?key=value.": "Adicionado à URL como ?key=value.",+ "On a failed request, output the error instead of failing the step.": "Se a solicitação falhar, retorna o erro em vez de falhar a etapa.",+ "Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Segundos de espera por uma resposta. Vazio: até o limite do fluxo (10 min).",+ "Follow 3xx redirects instead of returning them as the response.": "Segue redirecionamentos 3xx em vez de retorná-los como resposta."}\ No newline at end of filediff --git a/packages/pieces/community/lead-connector/src/i18n/ru.json b/packages/pieces/community/lead-connector/src/i18n/ru.jsonindex a48bfeb6b5a..55405b631e9 100644--- a/packages/pieces/community/lead-connector/src/i18n/ru.json+++ b/packages/pieces/community/lead-connector/src/i18n/ru.json@@ -84,5 +84,31 @@"Trigger when a form is submitted.": "Запуск при отправке формы.","Trigger when a new opportunity is added.": "Срабатывать при добавлении новой возможности.","Form": "Форма",- "The form you want to use.": "Форма, которую вы хотите использовать."+ "The form you want to use.": "Форма, которую вы хотите использовать.",+ "Street Address": "Адрес (улица, дом)",+ "Author": "Автор",+ "Opportunity Name": "Название сделки",+ "Value": "Сумма",+ "Country code and digits only, no spaces.": "Только код страны и цифры, без пробелов.",+ "In a dynamic value, use the two-letter code, e.g. US.": "В динамическом значении используйте двухбуквенный код, например US.",+ "Where the lead came from.": "Откуда пришёл лид.",+ "Map it from a trigger or a Search Contacts step.": "Подставьте его из триггера или шага «Поиск контактов».",+ "Empty fields keep their current value.": "Пустые поля сохраняют текущее значение.",+ "Replaces the current tags. Leave empty to keep them.": "Заменяет текущие теги. Оставьте пустым, чтобы сохранить их.",+ "The team member the note is credited to.": "Сотрудник, от имени которого добавляется заметка.",+ "Matched against name, email, phone and more. Up to 100 results.": "Ищется по имени, email, телефону и другим полям. До 100 результатов.",+ "In your account's currency.": "В валюте вашего аккаунта.",+ "Leave empty to keep it unassigned.": "Оставьте пустым, чтобы не назначать.",+ "Empty fields keep their current value, except Completed.": "Пустые поля сохраняют текущее значение, кроме «Выполнено».",+ "Always applied: unticked marks a done task as open.": "Применяется всегда: если не отмечено, выполненная задача снова станет открытой.",+ "Runs for each new submission of this form.": "Срабатывает при каждой новой отправке этой формы.",+ "Runs for each new opportunity in this pipeline.": "Срабатывает для каждой новой сделки в этой воронке.",+ "\n1. Go to the [Marketplace](https://marketplace.gohighlevel.com/) and sign up for a developer account.\n2. Navigate to **My Apps** and click on **Create App**.\n3. Enter an app name, then select **Private** as App Type and **Sub-Account** as Distribution Type. Click **Create App**.\n4. Add the following scopes:\n - campaigns.readonly\n - contacts.write\n - contacts.readonly\n - locations.readonly\n - locations/tags.readonly\n - locations/tags.write\n - opportunities.readonly\n - opportunities.write\n ": "\n1. Перейдите в [Marketplace](https://marketplace.gohighlevel.com/) и зарегистрируйте аккаунт разработчика.\n2. Откройте **My Apps** и нажмите **Create App**.\n3. Введите название приложения, затем выберите **Private** в App Type и **Sub-Account** в Distribution Type. Нажмите **Create App**.\n4. Добавьте следующие области доступа (scopes):\n - campaigns.readonly\n - contacts.write\n - contacts.readonly\n - locations.readonly\n - locations/tags.readonly\n - locations/tags.write\n - opportunities.readonly\n - opportunities.write\n - users.readonly\n - workflows.readonly\n - forms.readonly\n5. Добавьте **Redirect URL**, указанный в этом окне.\n6. Создайте новый ключ клиента, затем скопируйте **Client ID** и **Client Secret** в это окно.\n",+ "Response is Binary": "Ответ двоичный",+ "Return Error as Output": "Возвращать ошибку как результат",+ "Timeout": "Тайм-аут",+ "Appended to the URL as ?key=value.": "Добавляется к URL как ?key=value.",+ "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).": "Секунды ожидания ответа. Пусто: до лимита потока (10 мин).",+ "Follow 3xx redirects instead of returning them as the response.": "Следовать перенаправлениям 3xx, а не возвращать их как ответ."}\ No newline at end of filediff --git a/packages/pieces/community/lead-connector/src/i18n/translation.json b/packages/pieces/community/lead-connector/src/i18n/translation.jsonindex 9b28a28cda2..ebadbed887b 100644--- a/packages/pieces/community/lead-connector/src/i18n/translation.json+++ b/packages/pieces/community/lead-connector/src/i18n/translation.json@@ -1,6 +1,6 @@{"Lead Connector - Go High Level": "Lead Connector - Go High Level",- "\n1. Go to the [Marketplace](https://marketplace.gohighlevel.com/) and sign up for a developer account.\n2. Navigate to **My Apps** and click on **Create App**.\n3. Provide app name.Then select **Private** as App Type, **Sub-Account** as Distribution Type. Click **Create App** Button.\n4. Add following scopes.\n - campaigns.readonly\n - contacts.write\n - contacts.readonly\n - locations.readonly\n - locations/tags.readonly\n - locations/tags.write\n - opportunities.readonly\n - opportunities.write\n - ": "\n1. Go to the [Marketplace](https://marketplace.gohighlevel.com/) and sign up for a developer account.\n2. Navigate to **My Apps** and click on **Create App**.\n3. Provide app name.Then select **Private** as App Type, **Sub-Account** as Distribution Type. Click **Create App** Button.\n4. Add following scopes.\n - campaigns.readonly\n - contacts.write\n - contacts.readonly\n - locations.readonly\n - locations/tags.readonly\n - locations/tags.write\n - opportunities.readonly\n - opportunities.write\n - users.readonly\n - workflows.readonly\n - forms.readonly\n5. Add redirect URLs.\n6. Create new Client key with valid name.Copy Client ID and Client Secret.\n",+ "\n1. Go to the [Marketplace](https://marketplace.gohighlevel.com/) and sign up for a developer account.\n2. Navigate to **My Apps** and click on **Create App**.\n3. Enter an app name, then select **Private** as App Type and **Sub-Account** as Distribution Type. Click **Create App**.\n4. Add the following scopes:\n - campaigns.readonly\n - contacts.write\n - contacts.readonly\n - locations.readonly\n - locations/tags.readonly\n - locations/tags.write\n - opportunities.readonly\n - opportunities.write\n ": "\n1. Go to the [Marketplace](https://marketplace.gohighlevel.com/) and sign up for a developer account.\n2. Navigate to **My Apps** and click on **Create App**.\n3. Enter an app name, then select **Private** as App Type and **Sub-Account** as Distribution Type. Click **Create App**.\n4. Add the following scopes:\n - campaigns.readonly\n - contacts.write\n - contacts.readonly\n - locations.readonly\n - locations/tags.readonly\n - locations/tags.write\n - opportunities.readonly\n - opportunities.write\n - users.readonly\n - workflows.readonly\n - forms.readonly\n5. Add the **Redirect URL** shown in this dialog.\n6. Create a new client key, then copy the **Client ID** and **Client Secret** into this dialog.\n","Create Contact": "Create Contact","Update Contact": "Update Contact","Add Contact to Campaign": "Add Contact to Campaign",@@ -29,30 +29,32 @@"Phone": "Phone","Company Name": "Company Name","Website": "Website",- "Tags": "Tags",- "Source": "Source",- "Country": "Country",+ "Street Address": "Street Address","City": "City","State": "State",- "Address": "Address","Postal Code": "Postal Code",+ "Country": "Country","Time Zone": "Time Zone",+ "Tags": "Tags",+ "Source": "Source","Contact ID": "Contact ID",+ "Markdown": "Markdown","Contact": "Contact","Campaign": "Campaign","Workflow": "Workflow","Note": "Note",- "User": "User",+ "Author": "Author","Search Query": "Search Query","Pipeline": "Pipeline","Stage": "Stage",- "Title": "Title",+ "Opportunity Name": "Opportunity Name","Status": "Status",+ "Value": "Value","Assigned To": "Assigned To",- "Monetary Value": "Monetary Value","Opportunity": "Opportunity",- "Due Date": "Due Date",+ "Title": "Title","Description": "Description",+ "Due Date": "Due Date","Completed": "Completed","Task": "Task","Method": "Method",@@ -60,28 +62,34 @@"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",- "When using a dynamic value, make sure to use the ISO-2 country code, and not the country name.": "When using a dynamic value, make sure to use the ISO-2 country code, and not the country name.",- "The ID of the contact.": "The ID of the contact.",- "The contact to use.": "The contact to use.",- "The value you want to search for.": "The value you want to search for.",- "The ID of the pipeline to use.": "The ID of the pipeline to use.",- "The stage of the pipeline to use.": "The stage of the pipeline to use.",+ "Country code and digits only, no spaces.": "Country code and digits only, no spaces.",+ "In a dynamic value, use the two-letter code, e.g. US.": "In a dynamic value, use the two-letter code, e.g. US.",+ "Where the lead came from.": "Where the lead came from.",+ "Map it from a trigger or a Search Contacts step.": "Map it from a trigger or a Search Contacts step.",+ "Empty fields keep their current value.": "Empty fields keep their current value.",+ "Replaces the current tags. Leave empty to keep them.": "Replaces the current tags. Leave empty to keep them.",+ "The team member the note is credited to.": "The team member the note is credited to.",+ "Matched against name, email, phone and more. Up to 100 results.": "Matched against name, email, phone and more. Up to 100 results.",+ "In your account's currency.": "In your account's currency.",+ "Leave empty to keep it unassigned.": "Leave empty to keep it unassigned.",+ "Empty fields keep their current value, except Completed.": "Empty fields keep their current value, except Completed.",+ "Always applied: unticked marks a done task as open.": "Always applied: unticked marks a done task as open.","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.","GET": "GET","POST": "POST","PATCH": "PATCH","PUT": "PUT","DELETE": "DELETE","HEAD": "HEAD",- "None": "None",- "JSON": "JSON",- "Form Data": "Form Data",- "Raw": "Raw","New Contact": "New Contact","Contact Created or Updated": "Contact Created or Updated","New Form Submission": "New Form Submission",@@ -91,5 +99,6 @@"Trigger when a form is submitted.": "Trigger when a form is submitted.","Trigger when a new opportunity is added.": "Trigger when a new opportunity is added.","Form": "Form",- "The form you want to use.": "The form you want to use."+ "Runs for each new submission of this form.": "Runs for each new submission of this form.",+ "Runs for each new opportunity in this pipeline.": "Runs for each new opportunity in this pipeline."}\ No newline at end of filediff --git a/packages/pieces/community/lead-connector/src/i18n/zh.json b/packages/pieces/community/lead-connector/src/i18n/zh.jsonindex bf2d957d081..71c6040176b 100644--- a/packages/pieces/community/lead-connector/src/i18n/zh.json+++ b/packages/pieces/community/lead-connector/src/i18n/zh.json@@ -91,5 +91,30 @@"Trigger when a form is submitted.": "Trigger when a form is submitted.","Trigger when a new opportunity is added.": "Trigger when a new opportunity is added.","Form": "Form",- "The form you want to use.": "The form you want to use."+ "The form you want to use.": "The form you want to use.",+ "Street Address": "街道地址",+ "Author": "作者",+ "Opportunity Name": "商机名称",+ "Value": "金额",+ "Country code and digits only, no spaces.": "仅限国家代码和数字,不要包含空格。",+ "In a dynamic value, use the two-letter code, e.g. US.": "在动态值中使用两个字母的代码,例如 US。",+ "Where the lead came from.": "潜在客户的来源。",+ "Map it from a trigger or a Search Contacts step.": "从触发器或 Search Contacts 步骤中映射。",+ "Empty fields keep their current value.": "留空的字段将保留当前值。",+ "Replaces the current tags. Leave empty to keep them.": "替换当前标签。留空则保留现有标签。",+ "The team member the note is credited to.": "备注所归属的团队成员。",+ "Matched against name, email, phone and more. Up to 100 results.": "匹配姓名、邮箱、电话等。最多 100 条结果。",+ "In your account's currency.": "使用您账户的货币。",+ "Leave empty to keep it unassigned.": "留空则不分配。",+ "Empty fields keep their current value, except Completed.": "留空的字段将保留当前值,Completed 除外。",+ "Always applied: unticked marks a done task as open.": "始终生效:不勾选会将已完成的任务重新标记为未完成。",+ "Runs for each new submission of this form.": "此表单每有新提交时运行。",+ "Runs for each new opportunity in this pipeline.": "此管道中每有新商机时运行。",+ "Response is Binary": "响应为二进制",+ "Return Error as Output": "将错误作为输出返回",+ "Timeout": "超时",+ "Appended to the URL as ?key=value.": "以 ?key=value 的形式附加到 URL。",+ "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).": "等待响应的秒数。留空:最多到流程上限(10 分钟)。",+ "Follow 3xx redirects instead of returning them as the response.": "跟随 3xx 重定向,而不是将其作为响应返回。"}\ No newline at end of filediff --git a/packages/pieces/community/lead-connector/src/index.ts b/packages/pieces/community/lead-connector/src/index.tsindex 66df5d0cef4..83fd36ca19b 100644--- a/packages/pieces/community/lead-connector/src/index.ts+++ b/packages/pieces/community/lead-connector/src/index.ts@@ -25,8 +25,8 @@ import { newOpportunity } from './lib/triggers/new-opportunity';const markdownDescription = `1. Go to the [Marketplace](https://marketplace.gohighlevel.com/) and sign up for a developer account.2. Navigate to **My Apps** and click on **Create App**.-3. Provide app name.Then select **Private** as App Type, **Sub-Account** as Distribution Type. Click **Create App** Button.-4. Add following scopes.+3. Enter an app name, then select **Private** as App Type and **Sub-Account** as Distribution Type. Click **Create App**.+4. Add the following scopes:- campaigns.readonly- contacts.write- contacts.readonly@@ -38,8 +38,8 @@ const markdownDescription = `- users.readonly- workflows.readonly- forms.readonly-5. Add redirect URLs.-6. Create new Client key with valid name.Copy Client ID and Client Secret.+5. Add the **Redirect URL** shown in this dialog.+6. Create a new client key, then copy the **Client ID** and **Client Secret** into this dialog.`;export const leadConnectorAuth = PieceAuth.OAuth2({@@ -70,7 +70,7 @@ export const leadConnectorAuth = PieceAuth.OAuth2({} catch (e) {return {valid: false,- error: 'Invalid API key.',+ error: 'Could not connect to LeadConnector. Reconnect and try again.',};}},@@ -80,7 +80,7 @@ export const leadConnector = createPiece({displayName: 'LeadConnector',description: 'Lead Connector - Go High Level',auth: leadConnectorAuth,- minimumSupportedRelease: '0.30.0',+ minimumSupportedRelease: '0.88.2',logoUrl: 'https://cdn.activepieces.com/pieces/lead-connector.png',categories: [PieceCategory.SALES_AND_CRM],authors: ['kishanprmr', 'MoShizzle', 'abuaboud'],diff --git a/packages/pieces/community/lead-connector/src/lib/actions/add-contact-to-campaign.ts b/packages/pieces/community/lead-connector/src/lib/actions/add-contact-to-campaign.tsindex e208d3628d0..1e900177bd8 100644--- a/packages/pieces/community/lead-connector/src/lib/actions/add-contact-to-campaign.ts+++ b/packages/pieces/community/lead-connector/src/lib/actions/add-contact-to-campaign.ts@@ -1,5 +1,6 @@-import { createAction, OAuth2PropertyValue, Property } from '@activepieces/pieces-framework';-import { addContactToCampaign, getCampaigns, getContacts } from '../common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { addContactToCampaign, getCampaigns } from '../common';+import { leadConnectorProps } from '../common/props';import { leadConnectorAuth } from '../..';export const addContactToCampaignAction = createAction({@@ -11,32 +12,9 @@ export const addContactToCampaignAction = createAction({audience: 'both',aiMetadata: { description: 'Enrolls an existing GoHighLevel/LeadConnector contact into a marketing campaign by contact ID and campaign ID. Use to start a campaign sequence for a known contact. Not idempotent — each call re-enrolls the contact.', idempotent: false },props: {- contact: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Contact',- description: 'The contact to use.',- required: true,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const contacts = await getContacts(auth as OAuth2PropertyValue);- return {- options: contacts.map((contact) => {- return {- label: contact.contactName,- value: contact.id,- };- }),- };- },- }),+ contact: leadConnectorProps.contact({ required: true }),campaign: Property.Dropdown({- auth: leadConnectorAuth,+ auth: leadConnectorAuth,displayName: 'Campaign',required: true,refreshers: [],@@ -45,10 +23,11 @@ export const addContactToCampaignAction = createAction({return {disabled: true,options: [],+ placeholder: 'Connect your account first',};}- const campaigns = await getCampaigns(auth as OAuth2PropertyValue);+ const campaigns = await getCampaigns(auth);return {options: campaigns.map((campaign: any) => {return {diff --git a/packages/pieces/community/lead-connector/src/lib/actions/add-contact-to-workflow.ts b/packages/pieces/community/lead-connector/src/lib/actions/add-contact-to-workflow.tsindex 391141c6614..c1d56e37cd5 100644--- a/packages/pieces/community/lead-connector/src/lib/actions/add-contact-to-workflow.ts+++ b/packages/pieces/community/lead-connector/src/lib/actions/add-contact-to-workflow.ts@@ -1,5 +1,6 @@-import { createAction, OAuth2PropertyValue, Property } from '@activepieces/pieces-framework';-import { addContactToWorkflow, getContacts, getWorkflows } from '../common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { addContactToWorkflow, getWorkflows } from '../common';+import { leadConnectorProps } from '../common/props';import { leadConnectorAuth } from '../..';export const addContactToWorkflowAction = createAction({@@ -11,32 +12,9 @@ export const addContactToWorkflowAction = createAction({audience: 'both',aiMetadata: { description: 'Enrolls an existing GoHighLevel/LeadConnector contact into an automation workflow by contact ID and workflow ID. Use to trigger a workflow sequence for a known contact. Not idempotent — each call re-enrolls the contact.', idempotent: false },props: {- contact: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Contact',- description: 'The contact to use.',- required: true,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const contacts = await getContacts(auth as OAuth2PropertyValue);- return {- options: contacts.map((contact) => {- return {- label: contact.contactName,- value: contact.id,- };- }),- };- },- }),+ contact: leadConnectorProps.contact({ required: true }),workflow: Property.Dropdown({- auth: leadConnectorAuth,+ auth: leadConnectorAuth,displayName: 'Workflow',required: true,refreshers: [],@@ -45,10 +23,11 @@ export const addContactToWorkflowAction = createAction({return {disabled: true,options: [],+ placeholder: 'Connect your account first',};}- const campaigns = await getWorkflows(auth as OAuth2PropertyValue);+ const campaigns = await getWorkflows(auth);return {options: campaigns.map((campaign: any) => {return {diff --git a/packages/pieces/community/lead-connector/src/lib/actions/add-note-to-contact.ts b/packages/pieces/community/lead-connector/src/lib/actions/add-note-to-contact.tsindex f8d02be8258..eaa78b685ed 100644--- a/packages/pieces/community/lead-connector/src/lib/actions/add-note-to-contact.ts+++ b/packages/pieces/community/lead-connector/src/lib/actions/add-note-to-contact.ts@@ -1,9 +1,6 @@-import { createAction, OAuth2PropertyValue, Property } from '@activepieces/pieces-framework';-import {- addNoteToContact,- getContacts,- getUsers,-} from '../common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { addNoteToContact } from '../common';+import { leadConnectorProps } from '../common/props';import { leadConnectorAuth } from '../..';export const addNoteToContactAction = createAction({@@ -15,56 +12,16 @@ export const addNoteToContactAction = createAction({audience: 'both',aiMetadata: { description: 'Appends a note (free-text body attributed to a user) to an existing GoHighLevel/LeadConnector contact. Requires the contact ID and the authoring user ID. Not idempotent — each call appends a new note even if the text is identical.', idempotent: false },props: {- contact: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Contact',- description: 'The contact to use.',- required: true,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const contacts = await getContacts(auth as OAuth2PropertyValue);- return {- options: contacts.map((contact) => {- return {- label: contact.contactName,- value: contact.id,- };- }),- };- },- }),+ contact: leadConnectorProps.contact({ required: true }),note: Property.ShortText({displayName: 'Note',required: true,+ placeholder: 'Called and left a voicemail.',}),- user: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'User',+ user: leadConnectorProps.user({+ displayName: 'Author',+ description: 'The team member the note is credited to.',required: true,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const users = await getUsers(auth as OAuth2PropertyValue);- return {- options: users.map((user: any) => {- return {- label: `${user.firstName} ${user.lastName}`,- value: user.id,- };- }),- };- },}),},diff --git a/packages/pieces/community/lead-connector/src/lib/actions/create-contact.ts b/packages/pieces/community/lead-connector/src/lib/actions/create-contact.tsindex 33f9ad18b0f..9621a2ded27 100644--- a/packages/pieces/community/lead-connector/src/lib/actions/create-contact.ts+++ b/packages/pieces/community/lead-connector/src/lib/actions/create-contact.ts@@ -1,8 +1,4 @@-import {- createAction,- OAuth2PropertyValue,- Property,-} from '@activepieces/pieces-framework';+import { createAction, Property } from '@activepieces/pieces-framework';import {addContact,Country,@@ -23,63 +19,93 @@ export const createContact = createAction({description: 'Create a new contact.',audience: 'both',aiMetadata: { description: 'Creates a new contact in the GoHighLevel/LeadConnector location with optional name, email, phone, company, address, tags, and source. Use to add a lead or person to the CRM. Not idempotent — each call creates a separate contact, so de-duplicate beforehand if needed.', idempotent: false },+ propertyGroups: [+ {+ key: 'name',+ display: 'section',+ label: 'Name',+ icon: 'user',+ props: ['firstName', 'lastName'],+ },+ {+ key: 'reach',+ display: 'section',+ label: 'Contact details',+ icon: 'inbox',+ props: ['email', 'phone', 'companyName', 'website'],+ },+ {+ key: 'address',+ display: 'section',+ label: 'Address',+ icon: 'location',+ props: ['address', 'city', 'state', 'postalCode', 'country', 'timezone'],+ },+ {+ key: 'tags',+ display: 'section',+ label: 'Tags and source',+ icon: 'tag',+ props: ['tags', 'source'],+ },+ ],props: {firstName: Property.ShortText({displayName: 'First Name',required: false,+ width: 'half',}),lastName: Property.ShortText({displayName: 'Last Name',required: false,+ width: 'half',}),email: Property.ShortText({displayName: 'Email',required: false,+ placeholder: '[email protected]',+ width: 'half',}),phone: Property.ShortText({displayName: 'Phone',+ description: 'Country code and digits only, no spaces.',required: false,+ placeholder: '+15551234567',+ width: 'half',}),companyName: Property.ShortText({displayName: 'Company Name',required: false,+ width: 'half',}),website: Property.ShortText({displayName: 'Website',required: false,+ placeholder: 'https://example.com',+ width: 'half',}),- tags: Property.MultiSelectDropdown({- auth: leadConnectorAuth,- displayName: 'Tags',+ address: Property.LongText({+ displayName: 'Street Address',required: false,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const tags = await getTags(auth as OAuth2PropertyValue);- return {- options: tags.map((tag) => {- return {- label: tag.name,- value: tag.name,- };- }),- };- },}),- source: Property.ShortText({- displayName: 'Source',+ city: Property.ShortText({+ displayName: 'City',+ required: false,+ width: 'half',+ }),+ state: Property.ShortText({+ displayName: 'State',+ required: false,+ width: 'half',+ }),+ postalCode: Property.ShortText({+ displayName: 'Postal Code',required: false,}),country: Property.Dropdown({- auth: leadConnectorAuth,+ auth: leadConnectorAuth,displayName: 'Country',- description:- 'When using a dynamic value, make sure to use the ISO-2 country code, and not the country name.',+ description: 'In a dynamic value, use the two-letter code, e.g. US.',required: false,refreshers: [],options: async () => {@@ -94,24 +120,8 @@ export const createContact = createAction({};},}),- city: Property.ShortText({- displayName: 'City',- required: false,- }),- state: Property.ShortText({- displayName: 'State',- required: false,- }),- address: Property.LongText({- displayName: 'Address',- required: false,- }),- postalCode: Property.ShortText({- displayName: 'Postal Code',- required: false,- }),timezone: Property.Dropdown({- auth: leadConnectorAuth,+ auth: leadConnectorAuth,displayName: 'Time Zone',required: false,refreshers: [],@@ -120,9 +130,10 @@ export const createContact = createAction({return {disabled: true,options: [],+ placeholder: 'Connect your account first',};- const timezones = await getTimezones(auth as OAuth2PropertyValue);+ const timezones = await getTimezones(auth);return {options: timezones.map((timezone) => {return {@@ -133,6 +144,36 @@ export const createContact = createAction({};},}),+ tags: Property.MultiSelectDropdown({+ auth: leadConnectorAuth,+ displayName: 'Tags',+ required: false,+ refreshers: [],+ options: async ({ auth }) => {+ if (!auth)+ return {+ disabled: true,+ options: [],+ placeholder: 'Connect your account first',+ };++ const tags = await getTags(auth);+ return {+ options: tags.map((tag) => {+ return {+ label: tag.name,+ value: tag.name,+ };+ }),+ };+ },+ }),+ source: Property.ShortText({+ displayName: 'Source',+ description: 'Where the lead came from.',+ required: false,+ placeholder: 'Facebook ad',+ }),},async run({ auth, propsValue }) {diff --git a/packages/pieces/community/lead-connector/src/lib/actions/create-opportunity.ts b/packages/pieces/community/lead-connector/src/lib/actions/create-opportunity.tsindex 7863a2bffb8..3112f39c254 100644--- a/packages/pieces/community/lead-connector/src/lib/actions/create-opportunity.ts+++ b/packages/pieces/community/lead-connector/src/lib/actions/create-opportunity.ts@@ -1,16 +1,10 @@-import {- createAction,- OAuth2PropertyValue,- Property,-} from '@activepieces/pieces-framework';+import { createAction, Property } from '@activepieces/pieces-framework';import {createOpportunity,- getContacts,getPipeline,- getPipelines,- getUsers,LeadConnectorOpportunityStatus,} from '../common';+import { leadConnectorProps } from '../common/props';import { leadConnectorAuth } from '../..';import * as z from 'zod/mini'import { propsValidation } from '@activepieces/pieces-common';@@ -23,53 +17,49 @@ export const createOpportunityAction = createAction({description: 'Create a new opportunity.',audience: 'both',aiMetadata: { description: 'Creates a new sales opportunity in a GoHighLevel/LeadConnector pipeline, tied to a contact and placed in a chosen pipeline stage with a status (open/won/lost/abandoned). Use to start tracking a deal. Requires pipeline, stage, title, contact, and status; not idempotent — each call creates a separate opportunity.', idempotent: false },+ propertyGroups: [+ {+ key: 'pipeline',+ display: 'section',+ label: 'Pipeline and stage',+ icon: 'filter',+ props: ['pipeline', 'stage'],+ },+ {+ key: 'deal',+ display: 'section',+ label: 'Opportunity',+ icon: 'file',+ props: ['title', 'contact', 'status', 'monetaryValue', 'assignedTo'],+ },+ ],props: {- pipeline: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Pipeline',- description: 'The ID of the pipeline to use.',+ pipeline: leadConnectorProps.pipeline(),+ stage: Property.Dropdown({+ auth: leadConnectorAuth,+ displayName: 'Stage',required: true,- refreshers: [],- options: async ({ auth }) => {+ refreshers: ['pipeline'],+ options: async ({ auth, pipeline }) => {if (!auth) {return {disabled: true,options: [],+ placeholder: 'Connect your account first',};}-- const pipelines = await getPipelines(auth as OAuth2PropertyValue);- return {- options: pipelines.map((pipeline: any) => {- return {- label: pipeline.name,- value: pipeline.id,- };- }),- };- },- }),- stage: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Stage',- description: 'The stage of the pipeline to use.',- required: true,- refreshers: ['pipeline'],- options: async ({ auth, pipeline }) => {- if (!auth) {+ if (typeof pipeline !== 'string' || !pipeline) {return {disabled: true,options: [],+ placeholder: 'Select a pipeline first',};}- const pipelineObj = await getPipeline(- auth as OAuth2PropertyValue,- pipeline as string- );+ const pipelineObj = await getPipeline(auth, pipeline);return {options: pipelineObj- ? pipelineObj.stages.map((stage: any) => {+ ? pipelineObj.stages.map((stage: LeadConnectorStage) => {return {label: stage.name,value: stage.id,@@ -80,35 +70,12 @@ export const createOpportunityAction = createAction({},}),title: Property.ShortText({- displayName: 'Title',- required: true,- }),- contact: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Contact',- description: 'The contact to use.',+ displayName: 'Opportunity Name',required: true,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const contacts = await getContacts(auth as OAuth2PropertyValue);- return {- options: contacts.map((contact) => {- return {- label: contact.contactName,- value: contact.id,- };- }),- };- },}),+ contact: leadConnectorProps.contact({ required: true }),status: Property.Dropdown({- auth: leadConnectorAuth,+ auth: leadConnectorAuth,displayName: 'Status',required: true,refreshers: [],@@ -125,31 +92,14 @@ export const createOpportunityAction = createAction({};},}),- assignedTo: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Assigned To',+ monetaryValue: Property.Number({+ displayName: 'Value',+ description: "In your account's currency.",required: false,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const users = await getUsers(auth as OAuth2PropertyValue);- return {- options: users.map((user: any) => {- return {- label: `${user.firstName} ${user.lastName}`,- value: user.id,- };- }),- };- },}),- monetaryValue: Property.Number({- displayName: 'Monetary Value',+ assignedTo: leadConnectorProps.user({+ displayName: 'Assigned To',+ description: 'Leave empty to keep it unassigned.',required: false,}),},@@ -180,3 +130,8 @@ export const createOpportunityAction = createAction({});},});++type LeadConnectorStage = {+ id: string;+ name: string;+};diff --git a/packages/pieces/community/lead-connector/src/lib/actions/create-task.ts b/packages/pieces/community/lead-connector/src/lib/actions/create-task.tsindex 7f3832d81d3..a0b9aa012b6 100644--- a/packages/pieces/community/lead-connector/src/lib/actions/create-task.ts+++ b/packages/pieces/community/lead-connector/src/lib/actions/create-task.ts@@ -1,9 +1,6 @@-import { createAction, OAuth2PropertyValue, Property } from '@activepieces/pieces-framework';-import {- createTask,- getContacts,- getUsers,-} from '../common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { createTask } from '../common';+import { leadConnectorProps } from '../common/props';import { leadConnectorAuth } from '../..';export const createTaskAction = createAction({@@ -14,70 +11,43 @@ export const createTaskAction = createAction({description: 'Create a new task.',audience: 'both',aiMetadata: { description: 'Creates a task attached to a GoHighLevel/LeadConnector contact, with a title, due date, optional description, assignee, and completed flag. Use to schedule follow-up work against a contact. Requires contact, title, and due date; not idempotent — each call creates a separate task.', idempotent: false },+ propertyGroups: [+ {+ key: 'task',+ display: 'section',+ label: 'Task',+ icon: 'file',+ props: ['contact', 'title', 'description'],+ },+ {+ key: 'schedule',+ display: 'section',+ label: 'Due date and owner',+ icon: 'calendar',+ props: ['dueDate', 'assignedTo', 'completed'],+ },+ ],props: {- contact: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Contact',- description: 'The contact to use.',- required: true,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const contacts = await getContacts(auth as OAuth2PropertyValue);-- return {- options: contacts.map((contact) => {- return {- label: contact.contactName,- value: contact.id,- };- }),- };- },- }),+ contact: leadConnectorProps.contact({ required: true }),title: Property.ShortText({displayName: 'Title',required: true,}),- dueDate: Property.DateTime({- displayName: 'Due Date',- required: true,- }),description: Property.ShortText({displayName: 'Description',required: false,}),- assignedTo: Property.Dropdown({- auth: leadConnectorAuth,+ dueDate: Property.DateTime({+ displayName: 'Due Date',+ required: true,+ }),+ assignedTo: leadConnectorProps.user({displayName: 'Assigned To',required: false,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const users = await getUsers(auth as OAuth2PropertyValue);- return {- options: users.map((user: any) => {- return {- label: `${user.firstName} ${user.lastName}`,- value: user.id,- };- }),- };- },}),completed: Property.Checkbox({displayName: 'Completed',- required: true,+ required: false,defaultValue: false,}),},@@ -88,7 +58,6 @@ export const createTaskAction = createAction({return await createTask(auth.access_token, contact, {title: title,- // Needs to be ISO string without millisecondsdueDate: new Date(dueDate).toISOString().split('.')[0] + 'Z',body: description,assignedTo: assignedTo,diff --git a/packages/pieces/community/lead-connector/src/lib/actions/search-contacts.ts b/packages/pieces/community/lead-connector/src/lib/actions/search-contacts.tsindex 213cfb950fd..5df779ff08f 100644--- a/packages/pieces/community/lead-connector/src/lib/actions/search-contacts.ts+++ b/packages/pieces/community/lead-connector/src/lib/actions/search-contacts.ts@@ -13,8 +13,10 @@ export const searchContactsAction = createAction({props: {query: Property.ShortText({displayName: 'Search Query',- description: 'The value you want to search for.',+ description:+ 'Matched against name, email, phone and more. Up to 100 results.',required: true,+ placeholder: '[email protected]',}),},diff --git a/packages/pieces/community/lead-connector/src/lib/actions/update-contact.ts b/packages/pieces/community/lead-connector/src/lib/actions/update-contact.tsindex 31cf5a347de..1f713fa285f 100644--- a/packages/pieces/community/lead-connector/src/lib/actions/update-contact.ts+++ b/packages/pieces/community/lead-connector/src/lib/actions/update-contact.ts@@ -1,6 +1,6 @@import {createAction,- OAuth2PropertyValue,+ MarkdownVariant,Property,} from '@activepieces/pieces-framework';import {@@ -11,6 +11,7 @@ import {LeadConnectorContactDto,updateContact,} from '../common';+import { requestBodyUtils } from '../common/request-body';import { leadConnectorAuth } from '../..';import * as z from 'zod/mini'import { propsValidation } from '@activepieces/pieces-common';@@ -23,68 +24,109 @@ export const updateContactAction = createAction({description: 'Update an existing contact.',audience: 'both',aiMetadata: { description: 'Updates an existing GoHighLevel/LeadConnector contact identified by contact ID, overwriting any provided fields (name, email, phone, company, address, tags, source). Use to amend a known contact rather than create one. Idempotent — repeating with the same input leaves the contact in the same state.', idempotent: true },+ propertyGroups: [+ {+ key: 'contact',+ display: 'section',+ label: 'Contact to update',+ icon: 'user',+ props: ['id', 'changesInfo'],+ },+ {+ key: 'name',+ display: 'section',+ label: 'Name',+ icon: 'user',+ props: ['firstName', 'lastName'],+ },+ {+ key: 'reach',+ display: 'section',+ label: 'Contact details',+ icon: 'inbox',+ props: ['email', 'phone', 'companyName', 'website'],+ },+ {+ key: 'address',+ display: 'section',+ label: 'Address',+ icon: 'location',+ props: ['address', 'city', 'state', 'postalCode', 'country', 'timezone'],+ },+ {+ key: 'tags',+ display: 'section',+ label: 'Tags and source',+ icon: 'tag',+ props: ['tags', 'source'],+ },+ ],props: {id: Property.ShortText({displayName: 'Contact ID',- description: 'The ID of the contact.',+ description: 'Map it from a trigger or a Search Contacts step.',required: true,}),+ changesInfo: Property.MarkDown({+ value: 'Empty fields keep their current value.',+ variant: MarkdownVariant.INFO,+ }),firstName: Property.ShortText({displayName: 'First Name',required: false,+ width: 'half',}),lastName: Property.ShortText({displayName: 'Last Name',required: false,+ width: 'half',}),email: Property.ShortText({displayName: 'Email',required: false,+ placeholder: '[email protected]',+ width: 'half',}),phone: Property.ShortText({displayName: 'Phone',+ description: 'Country code and digits only, no spaces.',required: false,+ placeholder: '+15551234567',+ width: 'half',}),companyName: Property.ShortText({displayName: 'Company Name',required: false,+ width: 'half',}),website: Property.ShortText({displayName: 'Website',required: false,+ placeholder: 'https://example.com',+ width: 'half',}),- tags: Property.MultiSelectDropdown({- auth: leadConnectorAuth,- displayName: 'Tags',+ address: Property.LongText({+ displayName: 'Street Address',required: false,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const tags = await getTags(auth as OAuth2PropertyValue);- return {- options: tags.map((tag) => {- return {- label: tag.name,- value: tag.name,- };- }),- };- },}),- source: Property.ShortText({- displayName: 'Source',+ city: Property.ShortText({+ displayName: 'City',+ required: false,+ width: 'half',+ }),+ state: Property.ShortText({+ displayName: 'State',+ required: false,+ width: 'half',+ }),+ postalCode: Property.ShortText({+ displayName: 'Postal Code',required: false,}),country: Property.Dropdown({- auth: leadConnectorAuth,+ auth: leadConnectorAuth,displayName: 'Country',- description:- 'When using a dynamic value, make sure to use the ISO-2 country code, and not the country name.',+ description: 'In a dynamic value, use the two-letter code, e.g. US.',required: false,refreshers: [],options: async () => {@@ -99,24 +141,8 @@ export const updateContactAction = createAction({};},}),- city: Property.ShortText({- displayName: 'City',- required: false,- }),- state: Property.ShortText({- displayName: 'State',- required: false,- }),- address: Property.LongText({- displayName: 'Address',- required: false,- }),- postalCode: Property.ShortText({- displayName: 'Postal Code',- required: false,- }),timezone: Property.Dropdown({- auth: leadConnectorAuth,+ auth: leadConnectorAuth,displayName: 'Time Zone',required: false,refreshers: [],@@ -125,9 +151,10 @@ export const updateContactAction = createAction({return {disabled: true,options: [],+ placeholder: 'Connect your account first',};- const timezones = await getTimezones(auth as OAuth2PropertyValue);+ const timezones = await getTimezones(auth);return {options: timezones.map((timezone) => {return {@@ -138,6 +165,37 @@ export const updateContactAction = createAction({};},}),+ tags: Property.MultiSelectDropdown({+ auth: leadConnectorAuth,+ displayName: 'Tags',+ description: 'Replaces the current tags. Leave empty to keep them.',+ required: false,+ refreshers: [],+ options: async ({ auth }) => {+ if (!auth)+ return {+ disabled: true,+ options: [],+ placeholder: 'Connect your account first',+ };++ const tags = await getTags(auth);+ return {+ options: tags.map((tag) => {+ return {+ label: tag.name,+ value: tag.name,+ };+ }),+ };+ },+ }),+ source: Property.ShortText({+ displayName: 'Source',+ description: 'Where the lead came from.',+ required: false,+ placeholder: 'Facebook ad',+ }),},async run({ auth, propsValue }) {@@ -182,6 +240,10 @@ export const updateContactAction = createAction({timezone: timezone,};- return await updateContact(auth.access_token, id, contact);+ return await updateContact(+ auth.access_token,+ id,+ requestBodyUtils.omitEmptyValues(contact)+ );},});diff --git a/packages/pieces/community/lead-connector/src/lib/actions/update-opportunity.ts b/packages/pieces/community/lead-connector/src/lib/actions/update-opportunity.tsindex 26dd995163a..5c8f43435eb 100644--- a/packages/pieces/community/lead-connector/src/lib/actions/update-opportunity.ts+++ b/packages/pieces/community/lead-connector/src/lib/actions/update-opportunity.ts@@ -1,18 +1,17 @@import {createAction,- OAuth2PropertyValue,+ MarkdownVariant,Property,} from '@activepieces/pieces-framework';import {- getContacts,getOpportunities,getOpportunity,getPipeline,- getPipelines,- getUsers,LeadConnectorOpportunityStatus,updateOpportunity,} from '../common';+import { leadConnectorProps } from '../common/props';+import { requestBodyUtils } from '../common/request-body';import { leadConnectorAuth } from '../..';import * as z from 'zod/mini'import { propsValidation } from '@activepieces/pieces-common';@@ -25,63 +24,72 @@ export const updateOpportunityAction = createAction({description: 'Updates an existing opportunity.',audience: 'both',aiMetadata: { description: 'Updates an existing GoHighLevel/LeadConnector opportunity identified by pipeline and opportunity ID, changing stage, status, title, contact, assignee, or monetary value. Omitted stage/title/status are backfilled from the current opportunity. Use to advance or edit a known deal; idempotent — repeating with the same input leaves the opportunity in the same state.', idempotent: true },+ propertyGroups: [+ {+ key: 'opportunity',+ display: 'section',+ label: 'Opportunity to update',+ icon: 'filter',+ props: ['pipeline', 'opportunity', 'changesInfo'],+ },+ {+ key: 'changes',+ display: 'section',+ label: 'Changes',+ icon: 'sliders',+ props: [+ 'stage',+ 'title',+ 'contact',+ 'status',+ 'monetaryValue',+ 'assignedTo',+ ],+ },+ ],props: {- pipeline: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Pipeline',- description: 'The ID of the pipeline to use.',+ pipeline: leadConnectorProps.pipeline(),+ opportunity: Property.Dropdown({+ auth: leadConnectorAuth,+ displayName: 'Opportunity',required: true,- refreshers: [],- options: async ({ auth }) => {+ refreshers: ['pipeline'],+ options: async ({ auth, pipeline }) => {if (!auth) {return {disabled: true,options: [],+ placeholder: CONNECT_FIRST,};}-- const pipelines = await getPipelines(auth as OAuth2PropertyValue);- return {- options: pipelines.map((pipeline: any) => {- return {- label: pipeline.name,- value: pipeline.id,- };- }),- };- },- }),- opportunity: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Opportunity',- required: true,- refreshers: ['pipeline'],- options: async ({ auth, pipeline }) => {- if (!auth) {+ if (typeof pipeline !== 'string' || !pipeline) {return {disabled: true,options: [],+ placeholder: SELECT_PIPELINE_FIRST,};}- const opportunities = await getOpportunities(- auth as OAuth2PropertyValue,- pipeline as string- );+ const opportunities = await getOpportunities(auth, pipeline);return {- options: opportunities.map((opportunity: any) => {- return {- label: opportunity.name,- value: opportunity.id,- };- }),+ options: opportunities.map(+ (opportunity: LeadConnectorOpportunityOption) => {+ return {+ label: opportunity.name,+ value: opportunity.id,+ };+ }+ ),};},}),+ changesInfo: Property.MarkDown({+ value: 'Empty fields keep their current value.',+ variant: MarkdownVariant.INFO,+ }),stage: Property.Dropdown({- auth: leadConnectorAuth,+ auth: leadConnectorAuth,displayName: 'Stage',- description: 'The stage of the pipeline to use.',required: false,refreshers: ['pipeline'],options: async ({ auth, pipeline }) => {@@ -89,16 +97,21 @@ export const updateOpportunityAction = createAction({return {disabled: true,options: [],+ placeholder: CONNECT_FIRST,+ };+ }+ if (typeof pipeline !== 'string' || !pipeline) {+ return {+ disabled: true,+ options: [],+ placeholder: SELECT_PIPELINE_FIRST,};}- const pipelineObj = await getPipeline(- auth as OAuth2PropertyValue,- pipeline as string- );+ const pipelineObj = await getPipeline(auth, pipeline);return {options: pipelineObj- ? pipelineObj.stages.map((stage: any) => {+ ? pipelineObj.stages.map((stage: LeadConnectorStage) => {return {label: stage.name,value: stage.id,@@ -109,35 +122,12 @@ export const updateOpportunityAction = createAction({},}),title: Property.ShortText({- displayName: 'Title',+ displayName: 'Opportunity Name',required: false,}),- contact: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Contact',- description: 'The contact to use.',- required: false,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const contacts = await getContacts(auth as OAuth2PropertyValue);- return {- options: contacts.map((contact) => {- return {- label: contact.contactName,- value: contact.id,- };- }),- };- },- }),+ contact: leadConnectorProps.contact({ required: false }),status: Property.Dropdown({- auth: leadConnectorAuth,+ auth: leadConnectorAuth,displayName: 'Status',required: false,refreshers: [],@@ -154,31 +144,13 @@ export const updateOpportunityAction = createAction({};},}),- assignedTo: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Assigned To',+ monetaryValue: Property.Number({+ displayName: 'Value',+ description: "In your account's currency.",required: false,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const users = await getUsers(auth as OAuth2PropertyValue);- return {- options: users.map((user: any) => {- return {- label: `${user.firstName} ${user.lastName}`,- value: user.id,- };- }),- };- },}),- monetaryValue: Property.Number({- displayName: 'Monetary Value',+ assignedTo: leadConnectorProps.user({+ displayName: 'Assigned To',required: false,}),},@@ -210,11 +182,26 @@ export const updateOpportunityAction = createAction({return await updateOpportunity(auth.access_token, opportunity, {pipelineId: pipeline ?? originalData.pipelineId,pipelineStageId: stage ?? originalData.pipelineStageId,- contactId: contact,status: status ?? originalData.status,- name: title ?? originalData.name,- assignedTo: assignedTo,- monetaryValue: monetaryValue,+ name: title || originalData.name,+ ...requestBodyUtils.omitEmptyValues({+ contactId: contact,+ assignedTo: assignedTo,+ monetaryValue: monetaryValue,+ }),});},});++const CONNECT_FIRST = 'Connect your account first';+const SELECT_PIPELINE_FIRST = 'Select a pipeline first';++type LeadConnectorStage = {+ id: string;+ name: string;+};++type LeadConnectorOpportunityOption = {+ id: string;+ name: string;+};diff --git a/packages/pieces/community/lead-connector/src/lib/actions/update-task.ts b/packages/pieces/community/lead-connector/src/lib/actions/update-task.tsindex 46c17962d6b..4a1c3338af5 100644--- a/packages/pieces/community/lead-connector/src/lib/actions/update-task.ts+++ b/packages/pieces/community/lead-connector/src/lib/actions/update-task.ts@@ -1,15 +1,11 @@import {createAction,- OAuth2PropertyValue,+ MarkdownVariant,Property,} from '@activepieces/pieces-framework';-import {- getContacts,- getTask,- getTasks,- getUsers,- updateTask,-} from '../common';+import { getTasks, updateTask } from '../common';+import { leadConnectorProps } from '../common/props';+import { requestBodyUtils } from '../common/request-body';import { leadConnectorAuth } from '../..';export const updateTaskAction = createAction({@@ -20,50 +16,48 @@ export const updateTaskAction = createAction({description: 'Update a task.',audience: 'both',aiMetadata: { description: 'Updates an existing task on a GoHighLevel/LeadConnector contact, identified by contact ID and task ID, changing title, due date, description, assignee, or completed flag. Use to edit or complete a known task. Idempotent — repeating with the same input leaves the task in the same state.', idempotent: true },+ propertyGroups: [+ {+ key: 'task',+ display: 'section',+ label: 'Task to update',+ icon: 'file',+ props: ['contact', 'task', 'changesInfo'],+ },+ {+ key: 'changes',+ display: 'section',+ label: 'Changes',+ icon: 'sliders',+ props: ['title', 'description', 'dueDate', 'assignedTo', 'completed'],+ },+ ],props: {- contact: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Contact',- description: 'The contact to use.',- required: true,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const contacts = await getContacts(auth as OAuth2PropertyValue);-- return {- options: contacts.map((contact) => {- return {- label: contact.contactName,- value: contact.id,- };- }),- };- },- }),+ contact: leadConnectorProps.contact({ required: true }),task: Property.Dropdown({- auth: leadConnectorAuth,+ auth: leadConnectorAuth,displayName: 'Task',required: true,refreshers: ['contact'],options: async ({ auth, contact }) => {- if (!auth || !contact)+ if (!auth) {+ return {+ disabled: true,+ options: [],+ placeholder: 'Connect your account first',+ };+ }+ if (typeof contact !== 'string' || !contact) {return {disabled: true,options: [],+ placeholder: 'Select a contact first',};+ }- const tasks = await getTasks(- (auth as OAuth2PropertyValue).access_token,- contact as string- );+ const tasks = await getTasks(auth.access_token, contact);return {- options: tasks.map((task: any) => {+ options: tasks.map((task: LeadConnectorTaskOption) => {return {label: task.title,value: task.id,@@ -72,43 +66,29 @@ export const updateTaskAction = createAction({};},}),+ changesInfo: Property.MarkDown({+ value: 'Empty fields keep their current value, except Completed.',+ variant: MarkdownVariant.INFO,+ }),title: Property.ShortText({displayName: 'Title',required: false,}),- dueDate: Property.DateTime({- displayName: 'Due Date',- required: false,- }),description: Property.ShortText({displayName: 'Description',required: false,}),- assignedTo: Property.Dropdown({- auth: leadConnectorAuth,+ dueDate: Property.DateTime({+ displayName: 'Due Date',+ required: false,+ }),+ assignedTo: leadConnectorProps.user({displayName: 'Assigned To',required: false,- refreshers: [],- options: async ({ auth }) => {- if (!auth)- return {- disabled: true,- options: [],- };-- const users = await getUsers(auth as OAuth2PropertyValue);- return {- options: users.map((user: any) => {- return {- label: `${user.firstName} ${user.lastName}`,- value: user.id,- };- }),- };- },}),completed: Property.Checkbox({displayName: 'Completed',+ description: 'Always applied: unticked marks a done task as open.',required: false,defaultValue: false,}),@@ -125,21 +105,26 @@ export const updateTaskAction = createAction({completed,} = propsValue;- // let originalData: any;- // if (!title || !dueDate)- // originalData = await getTask(auth.access_token, contact, task);-- return await updateTask(auth.access_token, contact, task, {- title: title, //?? originalData.title,- // Needs to be ISO string without milliseconds- dueDate: dueDate, // ? formatDate(dueDate) : formatDate(originalData.dueDate),- body: description,- assignedTo: assignedTo,- completed,- });+ return await updateTask(+ auth.access_token,+ contact,+ task,+ requestBodyUtils.omitEmptyValues({+ title: title,+ dueDate: dueDate ? formatDate(dueDate) : undefined,+ body: description,+ assignedTo: assignedTo,+ completed,+ })+ );},});function formatDate(date: string) {return new Date(date).toISOString().split('.')[0] + 'Z';}++type LeadConnectorTaskOption = {+ id: string;+ title: string;+};diff --git a/packages/pieces/community/lead-connector/src/lib/common/props.ts b/packages/pieces/community/lead-connector/src/lib/common/props.tsnew file mode 100644index 00000000000..148f1fd5d1a--- /dev/null+++ b/packages/pieces/community/lead-connector/src/lib/common/props.ts@@ -0,0 +1,200 @@+import { Property, tryCatch } from '@activepieces/pieces-framework';+import { leadConnectorAuth } from '../..';+import { getContacts, getPipelines, getUsers, LeadConnectorContact } from '.';++function contact<R extends boolean>({+ description,+ required,+}: {+ description?: string;+ required: R;+}) {+ return Property.Dropdown<string, R, typeof leadConnectorAuth>({+ auth: leadConnectorAuth,+ displayName: 'Contact',+ description,+ required,+ refreshers: [],+ refreshOnSearch: true,+ options: async ({ auth }, { searchValue }) => {+ if (!auth) {+ return {+ disabled: true,+ options: [],+ placeholder: CONNECT_FIRST,+ };+ }+ const contacts = await listContacts({+ auth,+ query: searchValue ? searchValue : undefined,+ });+ return {+ disabled: false,+ options: contacts.map((item) => ({+ label: contactLabel(item),+ value: item.id,+ })),+ placeholder: searchValue+ ? 'No contacts match this search'+ : 'No contacts found',+ };+ },+ });+}++function user<R extends boolean>({+ displayName,+ description,+ required,+}: {+ displayName: string;+ description?: string;+ required: R;+}) {+ return Property.Dropdown<string, R, typeof leadConnectorAuth>({+ auth: leadConnectorAuth,+ displayName,+ description,+ required,+ refreshers: [],+ options: async ({ auth }) => {+ if (!auth) {+ return {+ disabled: true,+ options: [],+ placeholder: CONNECT_FIRST,+ };+ }+ const users: LeadConnectorUser[] = await getUsers(auth);+ return {+ disabled: false,+ options: users.map((item) => ({+ label: userLabel(item),+ value: item.id,+ })),+ placeholder: 'No users found',+ };+ },+ });+}++function pipeline({ description }: { description?: string } = {}) {+ return Property.Dropdown({+ auth: leadConnectorAuth,+ displayName: 'Pipeline',+ description,+ required: true,+ refreshers: [],+ options: async ({ auth }) => {+ if (!auth) {+ return {+ disabled: true,+ options: [],+ placeholder: CONNECT_FIRST,+ };+ }+ const pipelines: LeadConnectorPipeline[] = await getPipelines(auth);+ return {+ disabled: false,+ options: pipelines.map((item) => ({+ label: item.name,+ value: item.id,+ })),+ placeholder: 'No pipelines found',+ };+ },+ });+}++async function listContacts({+ auth,+ query,+}: {+ auth: ContactsAuth;+ query?: string;+}): Promise<LeadConnectorContact[]> {+ const firstPage = await getContacts(auth, { query });+ if (query) {+ return firstPage;+ }+ const laterPages = await nextContactPages({+ auth,+ previous: firstPage,+ remaining: EXTRA_CONTACT_PAGES,+ });+ return [...firstPage, ...laterPages];+}++async function nextContactPages({+ auth,+ previous,+ remaining,+}: {+ auth: ContactsAuth;+ previous: LeadConnectorContact[];+ remaining: number;+}): Promise<LeadConnectorContact[]> {+ const last = previous[previous.length - 1];+ if (remaining === 0 || previous.length < CONTACTS_PAGE_SIZE || !last) {+ return [];+ }+ const { data: page } = await tryCatch(() =>+ getContacts(auth, { startAfterId: last.id })+ );+ const seen = new Set(previous.map((item) => item.id));+ const fresh = (page ?? []).filter((item) => !seen.has(item.id));+ if (fresh.length === 0) {+ return [];+ }+ const rest = await nextContactPages({+ auth,+ previous: fresh,+ remaining: remaining - 1,+ });+ return [...fresh, ...rest];+}++function contactLabel(item: LeadConnectorContact): string {+ const name =+ item.contactName ||+ [item.firstName, item.lastName].filter((part) => !!part).join(' ');+ const detail = item.email || item.phone;+ if (name && detail) {+ return `${name} (${detail})`;+ }+ return name || detail || item.id;+}++function userLabel(item: LeadConnectorUser): string {+ const name = [item.firstName, item.lastName]+ .filter((part) => !!part)+ .join(' ');+ if (name && item.email) {+ return `${name} (${item.email})`;+ }+ return name || item.email || item.id;+}++const CONTACTS_PAGE_SIZE = 100;+const EXTRA_CONTACT_PAGES = 4;+const CONNECT_FIRST = 'Connect your account first';++export const leadConnectorProps = {+ contact,+ user,+ pipeline,+};++type ContactsAuth = Parameters<typeof getContacts>[0];++type LeadConnectorUser = {+ id: string;+ firstName?: string;+ lastName?: string;+ email?: string;+};++type LeadConnectorPipeline = {+ id: string;+ name: string;+};diff --git a/packages/pieces/community/lead-connector/src/lib/common/request-body.ts b/packages/pieces/community/lead-connector/src/lib/common/request-body.tsnew file mode 100644index 00000000000..79b9e582645--- /dev/null+++ b/packages/pieces/community/lead-connector/src/lib/common/request-body.ts@@ -0,0 +1,17 @@+function omitEmptyValues<T extends object>(body: T): Partial<T> {+ const result: Partial<T> = {};+ for (const key in body) {+ if (!isEmptyValue(body[key])) {+ result[key] = body[key];+ }+ }+ return result;+}++function isEmptyValue(value: unknown): boolean {+ return value === '' || (Array.isArray(value) && value.length === 0);+}++export const requestBodyUtils = {+ omitEmptyValues,+};diff --git a/packages/pieces/community/lead-connector/src/lib/triggers/new-form-submission.ts b/packages/pieces/community/lead-connector/src/lib/triggers/new-form-submission.tsindex f033f274fc2..bc1a2d851e8 100644--- a/packages/pieces/community/lead-connector/src/lib/triggers/new-form-submission.ts+++ b/packages/pieces/community/lead-connector/src/lib/triggers/new-form-submission.ts@@ -1,4 +1,4 @@-import { AppConnectionValueForAuthProperty, OAuth2PropertyValue, Property, createTrigger } from '@activepieces/pieces-framework';+import { AppConnectionValueForAuthProperty, Property, createTrigger } from '@activepieces/pieces-framework';import { TriggerStrategy } from '@activepieces/pieces-framework';import {DedupeStrategy,@@ -34,9 +34,9 @@ export const newFormSubmission = createTrigger({},props: {form: Property.Dropdown({- auth: leadConnectorAuth,+ auth: leadConnectorAuth,displayName: 'Form',- description: 'The form you want to use.',+ description: 'Runs for each new submission of this form.',required: true,refreshers: [],options: async ({ auth }) => {@@ -44,9 +44,10 @@ export const newFormSubmission = createTrigger({return {disabled: true,options: [],+ placeholder: 'Connect your account first',};- const forms = await getForms(auth as OAuth2PropertyValue);+ const forms = await getForms(auth);return {options: forms.map((form) => {diff --git a/packages/pieces/community/lead-connector/src/lib/triggers/new-opportunity.ts b/packages/pieces/community/lead-connector/src/lib/triggers/new-opportunity.tsindex 4cf66777ce3..615f5366134 100644--- a/packages/pieces/community/lead-connector/src/lib/triggers/new-opportunity.ts+++ b/packages/pieces/community/lead-connector/src/lib/triggers/new-opportunity.ts@@ -1,4 +1,4 @@-import { AppConnectionValueForAuthProperty, OAuth2PropertyValue, Property, createTrigger } from '@activepieces/pieces-framework';+import { AppConnectionValueForAuthProperty, createTrigger } from '@activepieces/pieces-framework';import { TriggerStrategy } from '@activepieces/pieces-framework';import {DedupeStrategy,@@ -6,7 +6,8 @@ import {pollingHelper,} from '@activepieces/pieces-common';import { leadConnectorAuth } from '../..';-import { getOpportunities, getPipelines } from '../common';+import { getOpportunities } from '../common';+import { leadConnectorProps } from '../common/props';const polling: Polling<AppConnectionValueForAuthProperty<typeof leadConnectorAuth>, { pipeline: string }> = {strategy: DedupeStrategy.LAST_ITEM,@@ -35,30 +36,8 @@ export const newOpportunity = createTrigger({description: 'Fires when a new opportunity is created in a specific GoHighLevel/LeadConnector pipeline (selected by pipeline ID). Represents the newly created opportunity; scoped to the chosen pipeline only.',},props: {- pipeline: Property.Dropdown({- auth: leadConnectorAuth,- displayName: 'Pipeline',- description: 'The ID of the pipeline to use.',- required: true,- refreshers: [],- options: async ({ auth }) => {- if (!auth) {- return {- disabled: true,- options: [],- };- }-- const pipelines = await getPipelines(auth as OAuth2PropertyValue);- return {- options: pipelines.map((pipeline: any) => {- return {- label: pipeline.name,- value: pipeline.id,- };- }),- };- },+ pipeline: leadConnectorProps.pipeline({+ description: 'Runs for each new opportunity in this pipeline.',}),},type: TriggerStrategy.POLLING,