Add Activepieces integration for workflow automation

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

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

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

View File

@@ -0,0 +1,33 @@
{
"extends": [
"../../../../.eslintrc.base.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
}
]
}

View File

@@ -0,0 +1,7 @@
# pieces-cloutly
This library was generated with [Nx](https://nx.dev).
## Building
Run `nx build pieces-cloutly` to build the library.

View File

@@ -0,0 +1,4 @@
{
"name": "@activepieces/piece-cloutly",
"version": "0.0.7"
}

View File

@@ -0,0 +1,65 @@
{
"name": "pieces-cloutly",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/pieces/community/cloutly/src",
"projectType": "library",
"release": {
"version": {
"currentVersionResolver": "git-tag",
"preserveLocalDependencyProtocols": false,
"manifestRootsToUpdate": [
"dist/{projectRoot}"
]
}
},
"tags": [],
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": [
"{options.outputPath}"
],
"options": {
"outputPath": "dist/packages/pieces/community/cloutly",
"tsConfig": "packages/pieces/community/cloutly/tsconfig.lib.json",
"packageJson": "packages/pieces/community/cloutly/package.json",
"main": "packages/pieces/community/cloutly/src/index.ts",
"assets": [
"packages/pieces/community/cloutly/*.md",
{
"input": "packages/pieces/community/cloutly/src/i18n",
"output": "./src/i18n",
"glob": "**/!(i18n.json)"
}
],
"buildableProjectDepsInPackageJsonType": "dependencies",
"updateBuildableProjectDepsInPackageJson": true
},
"dependsOn": [
"^build",
"prebuild"
]
},
"nx-release-publish": {
"options": {
"packageRoot": "dist/{projectRoot}"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": [
"{options.outputFile}"
]
},
"prebuild": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/pieces/community/cloutly",
"command": "bun install --no-save --silent"
},
"dependsOn": [
"^build"
]
}
}
}

View File

@@ -0,0 +1,36 @@
{
"Review Management Tool": "Bewertungs-Management-Werkzeug",
"Please enter the API Key obtained from Cloutly.": "Bitte geben Sie den von Cloutly erhaltenen API-Schlüssel ein.",
"Send Review Invite": "Bewertungseinladung senden",
"Custom API Call": "Eigener API-Aufruf",
"Sends a review invite to your customer.": "Sendet eine Bewertungseinladung an Ihren Kunden.",
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
"First Name": "Vorname",
"Last Name": "Nachname",
"Email": "E-Mail",
"Phone Number": "Telefonnummer",
"Source Customer ID": "Quellkunden-ID",
"Business ID": "Business-ID",
"Campaign ID": "Kampagnen-ID",
"Invite Delay Days": "Verzögerungstage einladen",
"Sales Rep Email": "Außendienstler-E-Mail",
"Method": "Methode",
"Headers": "Kopfzeilen",
"Query Parameters": "Abfrageparameter",
"Body": "Körper",
"Response is Binary ?": "Antwort ist binär?",
"No Error on Failure": "Kein Fehler bei Fehler",
"Timeout (in seconds)": "Timeout (in Sekunden)",
"The email of the customer to send the invite to (required if Phone Number is empty)": "Die E-Mail des Kunden an den die Einladung gesendet wird (erforderlich, wenn die Telefonnummer leer ist)",
"The phone number of the customer to send the invite to (required if Email is empty)": "Die Telefonnummer des Kunden, an den die Einladung gesendet werden soll (erforderlich, wenn E-Mail leer ist)",
"The number of days to delay the invite (i.e send after X days)": "Die Anzahl der Tage, die die Einladung verzögern (d.h. nach X Tagen senden)",
"The email of the sales rep to associate the review and customer": "Die E-Mail des Außendienstlers, um die Bewertung und den Kunden zu verknüpfen",
"Authorization headers are injected automatically from your connection.": "Autorisierungs-Header werden automatisch von Ihrer Verbindung injiziert.",
"Enable for files like PDFs, images, etc..": "Aktivieren für Dateien wie PDFs, Bilder, etc..",
"GET": "ERHALTEN",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "LÖSCHEN",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,36 @@
{
"Review Management Tool": "Revisar herramienta de gestión",
"Please enter the API Key obtained from Cloutly.": "Por favor, introduzca la clave de API obtenida de Cloutly.",
"Send Review Invite": "Enviar invitación de revisión",
"Custom API Call": "Llamada API personalizada",
"Sends a review invite to your customer.": "Envía una invitación de reseña a tu cliente.",
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
"First Name": "Nombre",
"Last Name": "Apellido",
"Email": "E-mail",
"Phone Number": "Número de teléfono",
"Source Customer ID": "ID de cliente origen",
"Business ID": "ID de Negocio",
"Campaign ID": "ID de Campaña",
"Invite Delay Days": "Días de retraso de invitación",
"Sales Rep Email": "Correo de representante de ventas",
"Method": "Método",
"Headers": "Encabezados",
"Query Parameters": "Parámetros de consulta",
"Body": "Cuerpo",
"Response is Binary ?": "¿Respuesta es binaria?",
"No Error on Failure": "No hay ningún error en fallo",
"Timeout (in seconds)": "Tiempo de espera (en segundos)",
"The email of the customer to send the invite to (required if Phone Number is empty)": "El correo electrónico del cliente al que enviar la invitación (obligatorio si el número de teléfono está vacío)",
"The phone number of the customer to send the invite to (required if Email is empty)": "El número de teléfono del cliente al que enviar la invitación (obligatorio si el correo electrónico está vacío)",
"The number of days to delay the invite (i.e send after X days)": "El número de días para retrasar la invitación (es decir, enviar después de X días)",
"The email of the sales rep to associate the review and customer": "El correo electrónico del representante de ventas para asociar la revisión y el cliente",
"Authorization headers are injected automatically from your connection.": "Las cabeceras de autorización se inyectan automáticamente desde tu conexión.",
"Enable for files like PDFs, images, etc..": "Activar para archivos como PDFs, imágenes, etc.",
"GET": "RECOGER",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "BORRAR",
"HEAD": "LIMPIO"
}

View File

@@ -0,0 +1,36 @@
{
"Review Management Tool": "Outil de gestion des avis",
"Please enter the API Key obtained from Cloutly.": "Veuillez entrer la clé API obtenue de Cloutly.",
"Send Review Invite": "Envoyer une invitation à un commentaire",
"Custom API Call": "Appel API personnalisé",
"Sends a review invite to your customer.": "Envoie une invitation à un commentaire à votre client.",
"Make a custom API call to a specific endpoint": "Passez un appel API personnalisé à un point de terminaison spécifique",
"First Name": "First Name",
"Last Name": "Last Name",
"Email": "Courriel",
"Phone Number": "Numéro de téléphone",
"Source Customer ID": "ID du client source",
"Business ID": "ID de l'entreprise",
"Campaign ID": "ID de la campagne",
"Invite Delay Days": "Jours de retard d'invitation",
"Sales Rep Email": "E-mail du représentant",
"Method": "Méthode",
"Headers": "En-têtes",
"Query Parameters": "Paramètres de requête",
"Body": "Corps",
"Response is Binary ?": "La réponse est Binaire ?",
"No Error on Failure": "Aucune erreur en cas d'échec",
"Timeout (in seconds)": "Délai d'attente (en secondes)",
"The email of the customer to send the invite to (required if Phone Number is empty)": "L'e-mail du client à qui envoyer l'invitation (requis si le numéro de téléphone est vide)",
"The phone number of the customer to send the invite to (required if Email is empty)": "Le numéro de téléphone du client auquel envoyer l'invitation (requis si l'e-mail est vide)",
"The number of days to delay the invite (i.e send after X days)": "Le nombre de jours pour retarder l'invitation (par exemple envoyer après X jours)",
"The email of the sales rep to associate the review and customer": "L'e-mail du représentant pour associer la revue et le client",
"Authorization headers are injected automatically from your connection.": "Les en-têtes d'autorisation sont injectés automatiquement à partir de votre connexion.",
"Enable for files like PDFs, images, etc..": "Activer pour les fichiers comme les PDFs, les images, etc.",
"GET": "OBTENIR",
"POST": "POSTER",
"PATCH": "PATCH",
"PUT": "EFFACER",
"DELETE": "SUPPRIMER",
"HEAD": "TÊTE"
}

View File

@@ -0,0 +1,36 @@
{
"Review Management Tool": "レビュー管理ツール",
"Please enter the API Key obtained from Cloutly.": "Cloutly から取得した API キーを入力してください。",
"Send Review Invite": "レビュー招待を送信",
"Custom API Call": "カスタムAPI通話",
"Sends a review invite to your customer.": "顧客にレビューの招待状を送信します。",
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
"First Name": "名",
"Last Name": "姓",
"Email": "Eメールアドレス",
"Phone Number": "電話番号",
"Source Customer ID": "ソース顧客ID",
"Business ID": "ビジネス ID",
"Campaign ID": "キャンペーンID",
"Invite Delay Days": "招待の遅延",
"Sales Rep Email": "営業担当者のメール",
"Method": "方法",
"Headers": "ヘッダー",
"Query Parameters": "クエリパラメータ",
"Body": "本文",
"Response is Binary ?": "応答はバイナリですか?",
"No Error on Failure": "失敗時にエラーはありません",
"Timeout (in seconds)": "タイムアウト(秒)",
"The email of the customer to send the invite to (required if Phone Number is empty)": "招待を送信する顧客のメール (電話番号が空の場合は必須)",
"The phone number of the customer to send the invite to (required if Email is empty)": "招待を送信する顧客の電話番号 (メールが空の場合は必須)",
"The number of days to delay the invite (i.e send after X days)": "招待を遅らせる日数X日後に送信する日数",
"The email of the sales rep to associate the review and customer": "レビューと顧客に関連付ける営業担当のメール",
"Authorization headers are injected automatically from your connection.": "認証ヘッダは接続から自動的に注入されます。",
"Enable for files like PDFs, images, etc..": "PDF、画像などのファイルを有効にします。",
"GET": "取得",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "削除",
"HEAD": "頭"
}

View File

@@ -0,0 +1,36 @@
{
"Review Management Tool": "Beoordeel beheertool",
"Please enter the API Key obtained from Cloutly.": "Voer de API-sleutel van Cloud in.",
"Send Review Invite": "Uitnodiging voor Review verzenden",
"Custom API Call": "Custom API Call",
"Sends a review invite to your customer.": "Stuurt een review uitnodiging naar uw klant.",
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
"First Name": "Voornaam",
"Last Name": "Achternaam",
"Email": "E-mail",
"Phone Number": "Telefoon nummer",
"Source Customer ID": "Bron klant-ID",
"Business ID": "Zakelijke ID",
"Campaign ID": "Campagne ID",
"Invite Delay Days": "Uitnodigen Vertraag Dagen",
"Sales Rep Email": "E-mail verkoper",
"Method": "Methode",
"Headers": "Kopteksten",
"Query Parameters": "Query parameters",
"Body": "Lichaam",
"Response is Binary ?": "Antwoord is binair?",
"No Error on Failure": "Geen fout bij fout",
"Timeout (in seconds)": "Time-out (in seconden)",
"The email of the customer to send the invite to (required if Phone Number is empty)": "De e-mail van de klant om de uitnodiging naar te sturen (vereist als het telefoonnummer leeg is)",
"The phone number of the customer to send the invite to (required if Email is empty)": "Het telefoonnummer van de klant om de uitnodiging naar te sturen (vereist dat E-mail leeg is)",
"The number of days to delay the invite (i.e send after X days)": "Het aantal dagen om de uitnodiging te vertragen (dat wil zeggen na X dagen)",
"The email of the sales rep to associate the review and customer": "De e-mail van de verkoper om de beoordeling en klant te koppelen",
"Authorization headers are injected automatically from your connection.": "Autorisatie headers worden automatisch geïnjecteerd vanuit uw verbinding.",
"Enable for files like PDFs, images, etc..": "Inschakelen voor bestanden zoals PDF's, afbeeldingen etc..",
"GET": "KRIJG",
"POST": "POSTE",
"PATCH": "BEKIJK",
"PUT": "PUT",
"DELETE": "VERWIJDEREN",
"HEAD": "HOOFD"
}

View File

@@ -0,0 +1,36 @@
{
"Review Management Tool": "Ferramenta de Gestão",
"Please enter the API Key obtained from Cloutly.": "Digite a chave de API obtida do Cloutly.",
"Send Review Invite": "Enviar convite de revisão",
"Custom API Call": "Chamada de API personalizada",
"Sends a review invite to your customer.": "Envia um convite de avaliação ao seu cliente.",
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
"First Name": "Nome",
"Last Name": "Sobrenome",
"Email": "e-mail",
"Phone Number": "Número de telefone",
"Source Customer ID": "ID do cliente de origem",
"Business ID": "ID comercial",
"Campaign ID": "ID da Campanha",
"Invite Delay Days": "Dias de atraso do convite",
"Sales Rep Email": "Email do Representante",
"Method": "Método",
"Headers": "Cabeçalhos",
"Query Parameters": "Parâmetros da consulta",
"Body": "Conteúdo",
"Response is Binary ?": "A resposta é binária ?",
"No Error on Failure": "Nenhum erro no Failure",
"Timeout (in seconds)": "Tempo limite (em segundos)",
"The email of the customer to send the invite to (required if Phone Number is empty)": "O e-mail do cliente para enviar o convite (necessário se o Número de Telefone estiver vazio)",
"The phone number of the customer to send the invite to (required if Email is empty)": "O número de telefone do cliente para enviar o convite (necessário se o E-mail estiver vazio)",
"The number of days to delay the invite (i.e send after X days)": "O número de dias para atrasar o convite (ou seja, enviar após X dias)",
"The email of the sales rep to associate the review and customer": "O e-mail do representante de vendas para associar a revisão e o cliente",
"Authorization headers are injected automatically from your connection.": "Os cabeçalhos de autorização são inseridos automaticamente a partir da sua conexão.",
"Enable for files like PDFs, images, etc..": "Habilitar para arquivos como PDFs, imagens, etc..",
"GET": "OBTER",
"POST": "POSTAR",
"PATCH": "COMPRAR",
"PUT": "COLOCAR",
"DELETE": "EXCLUIR",
"HEAD": "CABEÇA"
}

View File

@@ -0,0 +1,35 @@
{
"Cloutly": "Облачно",
"Review Management Tool": "Инструмент управления отзывами",
"Please enter the API Key obtained from Cloutly.": "Пожалуйста, введите API-ключ, полученный из Cloutly.",
"Send Review Invite": "Отправить Отзыв Приглашение",
"Custom API Call": "Пользовательский вызов API",
"Sends a review invite to your customer.": "Отправляет клиенту приглашение на отзыв.",
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
"First Name": "First Name",
"Last Name": "Last Name",
"Email": "Почта",
"Phone Number": "Номер телефона",
"Source Customer ID": "ID клиента источника",
"Business ID": "Бизнес ID",
"Campaign ID": "ID Кампании",
"Invite Delay Days": "Пригласить задержка дней",
"Sales Rep Email": "Электронная почта агента",
"Method": "Метод",
"Headers": "Заголовки",
"Query Parameters": "Параметры запроса",
"Body": "Тело",
"No Error on Failure": "Нет ошибок при ошибке",
"Timeout (in seconds)": "Таймаут (в секундах)",
"The email of the customer to send the invite to (required if Phone Number is empty)": "E-mail клиента для отправки приглашения (обязательно, если номер телефона пуст)",
"The phone number of the customer to send the invite to (required if Email is empty)": "Телефон клиента для отправки приглашения (обязательно, если E-mail пуст)",
"The number of days to delay the invite (i.e send after X days)": "Количество дней для задержки приглашения (отправка после X дней)",
"The email of the sales rep to associate the review and customer": "Письмо агента по продажам для привязки отзыва и клиента",
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
"GET": "ПОЛУЧИТЬ",
"POST": "ПОСТ",
"PATCH": "ПАТЧ",
"PUT": "ПОКУПИТЬ",
"DELETE": "УДАЛИТЬ",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,36 @@
{
"Review Management Tool": "Review Management Tool",
"Please enter the API Key obtained from Cloutly.": "Please enter the API Key obtained from Cloutly.",
"Send Review Invite": "Send Review Invite",
"Custom API Call": "Custom API Call",
"Sends a review invite to your customer.": "Sends a review invite to your customer.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"First Name": "First Name",
"Last Name": "Last Name",
"Email": "Email",
"Phone Number": "Phone Number",
"Source Customer ID": "Source Customer ID",
"Business ID": "Business ID",
"Campaign ID": "Campaign ID",
"Invite Delay Days": "Invite Delay Days",
"Sales Rep Email": "Sales Rep Email",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"The email of the customer to send the invite to (required if Phone Number is empty)": "The email of the customer to send the invite to (required if Phone Number is empty)",
"The phone number of the customer to send the invite to (required if Email is empty)": "The phone number of the customer to send the invite to (required if Email is empty)",
"The number of days to delay the invite (i.e send after X days)": "The number of days to delay the invite (i.e send after X days)",
"The email of the sales rep to associate the review and customer": "The email of the sales rep to associate the review and customer",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,35 @@
{
"Cloutly": "Cloutly",
"Review Management Tool": "Review Management Tool",
"Please enter the API Key obtained from Cloutly.": "Please enter the API Key obtained from Cloutly.",
"Send Review Invite": "Send Review Invite",
"Custom API Call": "Custom API Call",
"Sends a review invite to your customer.": "Sends a review invite to your customer.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"First Name": "First Name",
"Last Name": "Last Name",
"Email": "Email",
"Phone Number": "Phone Number",
"Source Customer ID": "Source Customer ID",
"Business ID": "Business ID",
"Campaign ID": "Campaign ID",
"Invite Delay Days": "Invite Delay Days",
"Sales Rep Email": "Sales Rep Email",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"The email of the customer to send the invite to (required if Phone Number is empty)": "The email of the customer to send the invite to (required if Phone Number is empty)",
"The phone number of the customer to send the invite to (required if Email is empty)": "The phone number of the customer to send the invite to (required if Email is empty)",
"The number of days to delay the invite (i.e send after X days)": "The number of days to delay the invite (i.e send after X days)",
"The email of the sales rep to associate the review and customer": "The email of the sales rep to associate the review and customer",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,36 @@
{
"Review Management Tool": "Review Management Tool",
"Please enter the API Key obtained from Cloutly.": "Please enter the API Key obtained from Cloutly.",
"Send Review Invite": "Send Review Invite",
"Custom API Call": "自定义 API 呼叫",
"Sends a review invite to your customer.": "Sends a review invite to your customer.",
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
"First Name": "名字",
"Last Name": "名字",
"Email": "电子邮件地址",
"Phone Number": "Phone Number",
"Source Customer ID": "Source Customer ID",
"Business ID": "Business ID",
"Campaign ID": "Campaign ID",
"Invite Delay Days": "Invite Delay Days",
"Sales Rep Email": "Sales Rep Email",
"Method": "方法",
"Headers": "信头",
"Query Parameters": "查询参数",
"Body": "正文内容",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "失败时没有错误",
"Timeout (in seconds)": "超时(秒)",
"The email of the customer to send the invite to (required if Phone Number is empty)": "The email of the customer to send the invite to (required if Phone Number is empty)",
"The phone number of the customer to send the invite to (required if Email is empty)": "The phone number of the customer to send the invite to (required if Email is empty)",
"The number of days to delay the invite (i.e send after X days)": "The number of days to delay the invite (i.e send after X days)",
"The email of the sales rep to associate the review and customer": "The email of the sales rep to associate the review and customer",
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"GET": "获取",
"POST": "帖子",
"PATCH": "PATCH",
"PUT": "弹出",
"DELETE": "删除",
"HEAD": "黑色"
}

View File

@@ -0,0 +1,34 @@
import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
import { sendReviewInvite } from './lib/actions/send-review-invite';
import { PieceCategory } from '@activepieces/shared';
import { createCustomApiCallAction } from '@activepieces/pieces-common';
export const cloutlyAuth = PieceAuth.SecretText({
displayName: 'API Key',
required: true,
description: 'Please enter the API Key obtained from Cloutly.',
});
export const cloutly = createPiece({
displayName: 'Cloutly',
description: 'Review Management Tool',
auth: cloutlyAuth,
minimumSupportedRelease: '0.36.1',
logoUrl: 'https://cdn.activepieces.com/pieces/cloutly.svg',
categories: [PieceCategory.MARKETING],
authors: ['joshuaheslin'],
actions: [
sendReviewInvite,
createCustomApiCallAction({
baseUrl: () => {
return 'https://app.cloutly.com/api/v1';
},
auth: cloutlyAuth,
authMapping: async (auth) => ({
'x-app': 'activepieces',
'x-api-key': auth.secret_text,
}),
}),
],
triggers: [],
});

View File

@@ -0,0 +1,83 @@
import { cloutlyAuth } from '../../index';
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
export const sendReviewInvite = createAction({
auth:cloutlyAuth,
name: 'sendReviewInvite',
displayName: 'Send Review Invite',
description: 'Sends a review invite to your customer.',
props: {
firstName: Property.ShortText({
displayName: 'First Name',
required: true
}),
lastName: Property.ShortText({
displayName: 'Last Name',
required: false,
}),
email: Property.ShortText({
displayName: 'Email',
description: 'The email of the customer to send the invite to (required if Phone Number is empty)',
required: false
}),
phoneNumber: Property.ShortText({
displayName: 'Phone Number',
description: 'The phone number of the customer to send the invite to (required if Email is empty)',
required: false
}),
sourceCustomerId: Property.ShortText({
displayName: 'Source Customer ID',
required: false
}),
businessId: Property.ShortText({
displayName: 'Business ID',
required: true
}),
campaignId: Property.ShortText({
displayName: 'Campaign ID',
required: true
}),
inviteDelayDays: Property.Number({
displayName: 'Invite Delay Days',
description: 'The number of days to delay the invite (i.e send after X days)',
required: false
}),
salesRepEmail: Property.ShortText({
displayName: 'Sales Rep Email',
description: 'The email of the sales rep to associate the review and customer',
required: false
}),
},
async run(context) {
const data = {
firstName: context.propsValue.firstName,
lastName: context.propsValue.lastName,
channel: {
email: context.propsValue.email,
phoneNumber: context.propsValue.phoneNumber,
},
source: 'api',
sourceCustomerId: context.propsValue.sourceCustomerId,
businessId: context.propsValue.businessId,
campaignId: context.propsValue.campaignId,
inviteDelayDays: context.propsValue.inviteDelayDays,
salesRepEmail: context.propsValue.salesRepEmail,
};
const apiKey = context.auth.secret_text;
const response = await httpClient.sendRequest({
method: HttpMethod.POST,
url: 'https://app.cloutly.com/api/v1/send-review-invite',
body: data,
headers: {
'Content-Type': 'application/json',
'x-app': 'activepieces',
'x-api-key': apiKey
}
})
return response.body;
},
});

View File

@@ -0,0 +1,19 @@
{
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noPropertyAccessFromIndexSignature": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
}

View File

@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "../../../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"],
"include": ["src/**/*.ts"]
}