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:
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"Receive survey responses from SurveyMonkey": "Erhalte Umfrageantworten von SurveyMonkey",
|
||||
"Custom API Call": "Eigener API-Aufruf",
|
||||
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
|
||||
"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)",
|
||||
"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",
|
||||
"New Response": "Neue Antwort",
|
||||
"Triggers when a new response is submitted": "Wird ausgelöst, wenn eine neue Antwort gesendet wird",
|
||||
"Survey": "Umfrage"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"Receive survey responses from SurveyMonkey": "Recibir respuestas de encuestas de SurveyMonkey",
|
||||
"Custom API Call": "Llamada API personalizada",
|
||||
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
|
||||
"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)",
|
||||
"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",
|
||||
"New Response": "Nueva respuesta",
|
||||
"Triggers when a new response is submitted": "Dispara cuando se envía una nueva respuesta",
|
||||
"Survey": "Encuesta"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"Receive survey responses from SurveyMonkey": "Recevoir les réponses de l'enquête de SurveyMonkey",
|
||||
"Custom API Call": "Appel d'API personnalisé",
|
||||
"Make a custom API call to a specific endpoint": "Passer un appel API personnalisé à un endpoint spécifique",
|
||||
"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'expiration (en secondes)",
|
||||
"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": "GET",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "DELETE",
|
||||
"HEAD": "HEAD",
|
||||
"New Response": "Nouvelle réponse",
|
||||
"Triggers when a new response is submitted": "Déclenche quand une nouvelle réponse est envoyée",
|
||||
"Survey": "Enquête"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"Receive survey responses from SurveyMonkey": "SurveyMonkey からアンケートの回答を受け取る",
|
||||
"Custom API Call": "カスタムAPI通話",
|
||||
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
|
||||
"Method": "方法",
|
||||
"Headers": "ヘッダー",
|
||||
"Query Parameters": "クエリパラメータ",
|
||||
"Body": "本文",
|
||||
"Response is Binary ?": "応答はバイナリですか?",
|
||||
"No Error on Failure": "失敗時にエラーはありません",
|
||||
"Timeout (in seconds)": "タイムアウト(秒)",
|
||||
"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": "頭",
|
||||
"New Response": "新しい回答",
|
||||
"Triggers when a new response is submitted": "新しい応答が送信されたときにトリガーします",
|
||||
"Survey": "調査"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"Receive survey responses from SurveyMonkey": "Ontvang antwoorden van SurveyMonkey",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
|
||||
"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)",
|
||||
"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",
|
||||
"New Response": "Nieuw Antwoord",
|
||||
"Triggers when a new response is submitted": "Triggert wanneer een nieuw antwoord wordt verzonden",
|
||||
"Survey": "Vragenlijst"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"Receive survey responses from SurveyMonkey": "Receber respostas de pesquisas da SurveyMonkey",
|
||||
"Custom API Call": "Chamada de API personalizada",
|
||||
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
|
||||
"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)",
|
||||
"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",
|
||||
"New Response": "Nova Resposta",
|
||||
"Triggers when a new response is submitted": "Dispara quando uma nova resposta é enviada",
|
||||
"Survey": "Questionário"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"SurveyMonkey": "Опрос",
|
||||
"Receive survey responses from SurveyMonkey": "Получать ответы на анкету от SurveyMonkey",
|
||||
"Custom API Call": "Пользовательский вызов API",
|
||||
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
|
||||
"Method": "Метод",
|
||||
"Headers": "Заголовки",
|
||||
"Query Parameters": "Параметры запроса",
|
||||
"Body": "Тело",
|
||||
"No Error on Failure": "Нет ошибок при ошибке",
|
||||
"Timeout (in seconds)": "Таймаут (в секундах)",
|
||||
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
|
||||
"GET": "ПОЛУЧИТЬ",
|
||||
"POST": "ПОСТ",
|
||||
"PATCH": "ПАТЧ",
|
||||
"PUT": "ПОКУПИТЬ",
|
||||
"DELETE": "УДАЛИТЬ",
|
||||
"HEAD": "HEAD",
|
||||
"New Response": "Новый ответ",
|
||||
"Triggers when a new response is submitted": "Триггеры при отправке нового ответа",
|
||||
"Survey": "Опрос"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"Receive survey responses from SurveyMonkey": "Receive survey responses from SurveyMonkey",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
||||
"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)",
|
||||
"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",
|
||||
"New Response": "New Response",
|
||||
"Triggers when a new response is submitted": "Triggers when a new response is submitted",
|
||||
"Survey": "Survey"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"SurveyMonkey": "SurveyMonkey",
|
||||
"Receive survey responses from SurveyMonkey": "Receive survey responses from SurveyMonkey",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
||||
"Method": "Method",
|
||||
"Headers": "Headers",
|
||||
"Query Parameters": "Query Parameters",
|
||||
"Body": "Body",
|
||||
"No Error on Failure": "No Error on Failure",
|
||||
"Timeout (in seconds)": "Timeout (in seconds)",
|
||||
"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",
|
||||
"New Response": "New Response",
|
||||
"Triggers when a new response is submitted": "Triggers when a new response is submitted",
|
||||
"Survey": "Survey"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"Receive survey responses from SurveyMonkey": "Receive survey responses from SurveyMonkey",
|
||||
"Custom API Call": "自定义 API 呼叫",
|
||||
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
|
||||
"Method": "方法",
|
||||
"Headers": "信头",
|
||||
"Query Parameters": "查询参数",
|
||||
"Body": "正文内容",
|
||||
"Response is Binary ?": "Response is Binary ?",
|
||||
"No Error on Failure": "失败时没有错误",
|
||||
"Timeout (in seconds)": "超时(秒)",
|
||||
"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": "黑色",
|
||||
"New Response": "New Response",
|
||||
"Triggers when a new response is submitted": "Triggers when a new response is submitted",
|
||||
"Survey": "Survey"
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import {
|
||||
createPiece,
|
||||
OAuth2PropertyValue,
|
||||
PieceAuth,
|
||||
} from '@activepieces/pieces-framework';
|
||||
|
||||
import { createCustomApiCallAction } from '@activepieces/pieces-common';
|
||||
import { PieceCategory } from '@activepieces/shared';
|
||||
import { newResponse } from './lib/triggers/new-response';
|
||||
|
||||
export const smAuth = PieceAuth.OAuth2({
|
||||
authUrl: 'https://api.surveymonkey.com/oauth/authorize',
|
||||
tokenUrl: 'https://api.surveymonkey.com/oauth/token',
|
||||
required: true,
|
||||
scope: [
|
||||
'responses_read',
|
||||
'responses_read_detail',
|
||||
'webhooks_read',
|
||||
'webhooks_write',
|
||||
'surveys_read',
|
||||
],
|
||||
});
|
||||
|
||||
export const surveymonkey = createPiece({
|
||||
displayName: 'SurveyMonkey',
|
||||
description: 'Receive survey responses from SurveyMonkey',
|
||||
auth: smAuth,
|
||||
minimumSupportedRelease: '0.30.0',
|
||||
logoUrl: 'https://cdn.activepieces.com/pieces/surveymonkey.png',
|
||||
categories: [PieceCategory.FORMS_AND_SURVEYS],
|
||||
authors: ["kishanprmr","MoShizzle","khaledmashaly","abuaboud"],
|
||||
actions: [
|
||||
createCustomApiCallAction({
|
||||
baseUrl: () => 'https://api.surveymonkey.com/v3',
|
||||
auth: smAuth,
|
||||
authMapping: async (auth) => ({
|
||||
Authorization: `Bearer ${(auth as OAuth2PropertyValue).access_token}`,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
triggers: [newResponse],
|
||||
});
|
||||
@@ -0,0 +1,113 @@
|
||||
import { OAuth2PropertyValue, Property } from '@activepieces/pieces-framework';
|
||||
import {
|
||||
HttpRequest,
|
||||
HttpMethod,
|
||||
httpClient,
|
||||
AuthenticationType,
|
||||
} from '@activepieces/pieces-common';
|
||||
import { smAuth } from '../..';
|
||||
|
||||
export const smCommon = {
|
||||
baseUrl: 'https://api.surveymonkey.com/v3',
|
||||
survey: Property.Dropdown({
|
||||
auth: smAuth,
|
||||
displayName: 'Survey',
|
||||
required: true,
|
||||
refreshers: [],
|
||||
options: async (context) => {
|
||||
if (!context['auth']) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Connect your account',
|
||||
};
|
||||
}
|
||||
|
||||
const authProp: any = context['auth'];
|
||||
const options: any[] = await smCommon.getSurveys(authProp.access_token);
|
||||
return {
|
||||
options: options,
|
||||
placeholder: 'Choose survey to connect',
|
||||
};
|
||||
},
|
||||
}),
|
||||
getSurveys: async (accessToken: string) => {
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.GET,
|
||||
url: `${smCommon.baseUrl}/surveys`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BEARER_TOKEN,
|
||||
token: accessToken,
|
||||
},
|
||||
};
|
||||
const response = await httpClient.sendRequest(request);
|
||||
const newValues = response.body['data'].map((survey: any) => {
|
||||
return {
|
||||
label: survey.title,
|
||||
value: survey.id,
|
||||
};
|
||||
});
|
||||
|
||||
return newValues;
|
||||
},
|
||||
|
||||
subscribeWebhook: async (
|
||||
surveyId: string | number,
|
||||
webhookUrl: string,
|
||||
accessToken: string
|
||||
) => {
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.POST,
|
||||
url: `${smCommon.baseUrl}/webhooks`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BEARER_TOKEN,
|
||||
token: accessToken,
|
||||
},
|
||||
body: {
|
||||
name: 'New Response Webhook',
|
||||
event_type: 'response_created',
|
||||
object_type: 'survey',
|
||||
object_ids: [surveyId],
|
||||
subscription_url: webhookUrl,
|
||||
},
|
||||
};
|
||||
|
||||
const webhookData = await httpClient.sendRequest(request);
|
||||
return webhookData.body['id'];
|
||||
},
|
||||
|
||||
unsubscribeWebhook: async (
|
||||
webhookId: string | number,
|
||||
accessToken: string
|
||||
) => {
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.DELETE,
|
||||
url: `${smCommon.baseUrl}/webhooks/${webhookId}`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BEARER_TOKEN,
|
||||
token: accessToken,
|
||||
},
|
||||
};
|
||||
|
||||
const deleteResponse = await httpClient.sendRequest(request);
|
||||
return deleteResponse;
|
||||
},
|
||||
|
||||
async getResponseDetails(
|
||||
accessToken: string,
|
||||
surveyId: string | number,
|
||||
responseId: string | number
|
||||
) {
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.GET,
|
||||
url: `${smCommon.baseUrl}/surveys/${surveyId}/responses/${responseId}/details`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BEARER_TOKEN,
|
||||
token: accessToken,
|
||||
},
|
||||
};
|
||||
|
||||
const response = await httpClient.sendRequest(request);
|
||||
return response.body;
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,53 @@
|
||||
import { TriggerStrategy, createTrigger } from '@activepieces/pieces-framework';
|
||||
import { smCommon } from '../common';
|
||||
import { smAuth } from '../..';
|
||||
|
||||
export const newResponse = createTrigger({
|
||||
auth: smAuth,
|
||||
name: 'new_response',
|
||||
displayName: 'New Response',
|
||||
description: 'Triggers when a new response is submitted',
|
||||
type: TriggerStrategy.WEBHOOK,
|
||||
sampleData: {},
|
||||
props: {
|
||||
survey: smCommon.survey,
|
||||
},
|
||||
//Create the webhook in SurveyMonkey and save the webhook ID in store for disable behavior
|
||||
async onEnable(context) {
|
||||
const webhookId = await smCommon.subscribeWebhook(
|
||||
context.propsValue.survey as number,
|
||||
context.webhookUrl,
|
||||
context.auth['access_token']
|
||||
);
|
||||
|
||||
await context.store?.put('_new_response_trigger', {
|
||||
webhookId: webhookId,
|
||||
});
|
||||
},
|
||||
//Delete the webhook from SurveyMonkey
|
||||
async onDisable(context) {
|
||||
const response: any = await context.store?.get('_new_response_trigger');
|
||||
|
||||
if (response !== null && response !== undefined) {
|
||||
await smCommon.unsubscribeWebhook(
|
||||
response.webhookId,
|
||||
context.auth['access_token']
|
||||
);
|
||||
}
|
||||
},
|
||||
//Return new response
|
||||
async run(context) {
|
||||
const payloadBody = context.payload.body as PayloadBody;
|
||||
const responseData = await smCommon.getResponseDetails(
|
||||
context.auth['access_token'],
|
||||
context.propsValue['survey'] as number,
|
||||
payloadBody.object_id
|
||||
);
|
||||
|
||||
return [responseData];
|
||||
},
|
||||
});
|
||||
|
||||
type PayloadBody = {
|
||||
object_id: string | number;
|
||||
};
|
||||
Reference in New Issue
Block a user