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-anyhook-graphql
This library was generated with [Nx](https://nx.dev).
## Building
Run `nx build pieces-anyhook-graphql` to build the library.

View File

@@ -0,0 +1,4 @@
{
"name": "@activepieces/piece-anyhook-graphql",
"version": "0.0.5"
}

View File

@@ -0,0 +1,65 @@
{
"name": "pieces-anyhook-graphql",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/pieces/community/anyhook-graphql/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/anyhook-graphql",
"tsConfig": "packages/pieces/community/anyhook-graphql/tsconfig.lib.json",
"packageJson": "packages/pieces/community/anyhook-graphql/package.json",
"main": "packages/pieces/community/anyhook-graphql/src/index.ts",
"assets": [
"packages/pieces/community/anyhook-graphql/*.md",
{
"input": "packages/pieces/community/anyhook-graphql/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/anyhook-graphql",
"command": "bun install --no-save --silent"
},
"dependsOn": [
"^build"
]
}
}
}

View File

@@ -0,0 +1,13 @@
{
"AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events": "AnyHook GraphQL ermöglicht die Echtzeit-Kommunikation über den AnyHook Proxy-Server, indem Sie es Ihnen erlauben sich zu abonnieren und auf GraphQL Abonnement-Events zu hören",
"AnyHook Server URL": "AnyHook Server URL",
"The URL of your AnyHook server": "Die URL deines AnyHook Servers",
"New GraphQL Subscription Event": "Neues GraphQL-Abonnement Ereignis",
"Triggers on a new GraphQL subscription event": "Löst ein neues GraphQL-Abonnement-Ereignis aus",
"Endpoint URL": "Endpoint URL",
"Headers": "Kopfzeilen",
"GraphQL Query": "GraphQL-Abfrage",
"The GraphQL websocket to connect to.": "Der GraphQL Websocket zu dem eine Verbindung hergestellt werden soll.",
"Custom headers for the GraphQL connection, such as authentication tokens.": "Benutzerdefinierte Header für die GraphQL-Verbindung, wie zum Beispiel Authentifizierungs-Token.",
"GraphQL subscription query to listen to events": "GraphQL-Abonnementabfrage zum Anhören von Ereignissen"
}

View File

@@ -0,0 +1,13 @@
{
"AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events": "AnyHook GraphQL permite la comunicación en tiempo real a través del servidor proxy AnyHook al permitirte suscribirte y escuchar los eventos de suscripción GraphQL",
"AnyHook Server URL": "URL del servidor AnyHook",
"The URL of your AnyHook server": "La URL de tu servidor AnyHook",
"New GraphQL Subscription Event": "Nuevo evento de suscripción GraphQL",
"Triggers on a new GraphQL subscription event": "Dispara un nuevo evento de suscripción GraphQL",
"Endpoint URL": "Endpoint URL",
"Headers": "Encabezados",
"GraphQL Query": "Consulta GraphQL",
"The GraphQL websocket to connect to.": "El websocket GraphQL al que conectar.",
"Custom headers for the GraphQL connection, such as authentication tokens.": "Cabeceras personalizadas para la conexión GraphQL, como tokens de autenticación.",
"GraphQL subscription query to listen to events": "Consulta de suscripción GraphQL para escuchar eventos"
}

View File

@@ -0,0 +1,13 @@
{
"AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events": "AnyHook GraphQL permet la communication en temps réel via le serveur proxy AnyHook en vous permettant de vous abonner et d'écouter les événements d'abonnement GraphQL",
"AnyHook Server URL": "URL du serveur AnyHook",
"The URL of your AnyHook server": "L'URL de votre serveur AnyHook",
"New GraphQL Subscription Event": "Nouvel événement d'abonnement GraphQL",
"Triggers on a new GraphQL subscription event": "Déclenche sur un nouvel événement d'abonnement GraphQL",
"Endpoint URL": "Endpoint URL",
"Headers": "En-têtes",
"GraphQL Query": "Requête GraphQL",
"The GraphQL websocket to connect to.": "La Websocket GraphQL à laquelle se connecter.",
"Custom headers for the GraphQL connection, such as authentication tokens.": "En-têtes personnalisés pour la connexion GraphQL, tels que les jetons d'authentification.",
"GraphQL subscription query to listen to events": "Requête d'abonnement GraphQL pour écouter les événements"
}

View File

@@ -0,0 +1,13 @@
{
"AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events": "AnyHookのGraphQLを使用すると、GraphQLサブスクリプションイベントを購読して視聴できるようになり、AnyHookプロキシサーバーを介してリアルタイム通信が可能になります。",
"AnyHook Server URL": "AnyHookサーバーのURL",
"The URL of your AnyHook server": "AnyHookサーバーのURL",
"New GraphQL Subscription Event": "新しいGraphQLサブスクリプションイベント",
"Triggers on a new GraphQL subscription event": "新しいGraphQLサブスクリプションイベントでトリガー",
"Endpoint URL": "Endpoint URL",
"Headers": "ヘッダー",
"GraphQL Query": "GraphQLクエリ",
"The GraphQL websocket to connect to.": "接続するGraphQL websocket 。",
"Custom headers for the GraphQL connection, such as authentication tokens.": "認証トークンなどのGraphQL接続のカスタムヘッダー。",
"GraphQL subscription query to listen to events": "イベントをリッスンするGraphQLサブスクリプションクエリ"
}

View File

@@ -0,0 +1,13 @@
{
"AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events": "AnyHook GraphQL activeert real-time communicatie via AnyHook proxy server door u in staat te stellen zich te abonneren op en te luisteren naar abonnementsgebeurtenissen",
"AnyHook Server URL": "AnyHook server-URL",
"The URL of your AnyHook server": "De URL van uw AnyHook server",
"New GraphQL Subscription Event": "Nieuw GraphQL Abonnement Evenement",
"Triggers on a new GraphQL subscription event": "Triggert een nieuwe GraphQL abonnement gebeurtenis",
"Endpoint URL": "Endpoint URL",
"Headers": "Kopteksten",
"GraphQL Query": "GraphQL query",
"The GraphQL websocket to connect to.": "De GraphQL websocket waarmee je verbinding kunt maken.",
"Custom headers for the GraphQL connection, such as authentication tokens.": "Aangepaste headers voor de GraphQL-verbinding, zoals authenticatietokens.",
"GraphQL subscription query to listen to events": "GraphQL abonnement query om naar gebeurtenissen te luisteren"
}

View File

@@ -0,0 +1,13 @@
{
"AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events": "AnyHook GraphQL permite comunicação em tempo real através do servidor proxy AnyHook, permitindo que você assine e ouça eventos de assinatura GraphQL",
"AnyHook Server URL": "URL do servidor AnyHook",
"The URL of your AnyHook server": "A URL do seu servidor AnyHook",
"New GraphQL Subscription Event": "Novo Evento de Assinatura do GraphQL",
"Triggers on a new GraphQL subscription event": "Aciona em um novo evento de assinatura GraphQL",
"Endpoint URL": "Endpoint URL",
"Headers": "Cabeçalhos",
"GraphQL Query": "Consulta GraphQL",
"The GraphQL websocket to connect to.": "O GraphQL websocket para se conectar.",
"Custom headers for the GraphQL connection, such as authentication tokens.": "Cabeçalhos personalizados para a conexão GraphQL, tais como tokens de autenticação.",
"GraphQL subscription query to listen to events": "Consulta de inscrição GraphQL para escutar eventos"
}

View File

@@ -0,0 +1,14 @@
{
"AnyHook GraphQL": "График AnyHook",
"AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events": "AnyHook GraphQL позволяет общаться в реальном времени через AnyHook прокси-сервер, позволяя вам подписаться и слушать события подписки GraphQL",
"AnyHook Server URL": "URL сервера AnyHook",
"The URL of your AnyHook server": "URL вашего сервера AnyHook",
"New GraphQL Subscription Event": "Новое событие GraphQL подписки",
"Triggers on a new GraphQL subscription event": "Триггеры на новом событии GraphQL подписки",
"Endpoint URL": "Endpoint URL",
"Headers": "Заголовки",
"GraphQL Query": "GraphQL-запрос",
"The GraphQL websocket to connect to.": "Веб-сокет GraphQL для подключения.",
"Custom headers for the GraphQL connection, such as authentication tokens.": "Пользовательские заголовки для соединения GraphQL, такие как токены аутентификации.",
"GraphQL subscription query to listen to events": "GraphQL запрос для прослушивания событий"
}

View File

@@ -0,0 +1,13 @@
{
"AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events": "AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events",
"AnyHook Server URL": "AnyHook Server URL",
"The URL of your AnyHook server": "The URL of your AnyHook server",
"New GraphQL Subscription Event": "New GraphQL Subscription Event",
"Triggers on a new GraphQL subscription event": "Triggers on a new GraphQL subscription event",
"Endpoint URL": "Endpoint URL",
"Headers": "Headers",
"GraphQL Query": "GraphQL Query",
"The GraphQL websocket to connect to.": "The GraphQL websocket to connect to.",
"Custom headers for the GraphQL connection, such as authentication tokens.": "Custom headers for the GraphQL connection, such as authentication tokens.",
"GraphQL subscription query to listen to events": "GraphQL subscription query to listen to events"
}

View File

@@ -0,0 +1,14 @@
{
"AnyHook GraphQL": "AnyHook GraphQL",
"AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events": "AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events",
"AnyHook Server URL": "AnyHook Server URL",
"The URL of your AnyHook server": "The URL of your AnyHook server",
"New GraphQL Subscription Event": "New GraphQL Subscription Event",
"Triggers on a new GraphQL subscription event": "Triggers on a new GraphQL subscription event",
"Endpoint URL": "Endpoint URL",
"Headers": "Headers",
"GraphQL Query": "GraphQL Query",
"The GraphQL websocket to connect to.": "The GraphQL websocket to connect to.",
"Custom headers for the GraphQL connection, such as authentication tokens.": "Custom headers for the GraphQL connection, such as authentication tokens.",
"GraphQL subscription query to listen to events": "GraphQL subscription query to listen to events"
}

View File

@@ -0,0 +1,13 @@
{
"AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events": "AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events",
"AnyHook Server URL": "AnyHook Server URL",
"The URL of your AnyHook server": "The URL of your AnyHook server",
"New GraphQL Subscription Event": "New GraphQL Subscription Event",
"Triggers on a new GraphQL subscription event": "Triggers on a new GraphQL subscription event",
"Endpoint URL": "Endpoint URL",
"Headers": "信头",
"GraphQL Query": "GraphQL Query",
"The GraphQL websocket to connect to.": "The GraphQL websocket to connect to.",
"Custom headers for the GraphQL connection, such as authentication tokens.": "Custom headers for the GraphQL connection, such as authentication tokens.",
"GraphQL subscription query to listen to events": "GraphQL subscription query to listen to events"
}

View File

@@ -0,0 +1,18 @@
import { createPiece } from '@activepieces/pieces-framework';
import { graphqlCommon } from './lib/common/common';
import { graphqlSubscriptionTrigger } from './lib/triggers/graphql-subscription-trigger';
export const anyHookGraphql = createPiece({
displayName: 'AnyHook GraphQL',
description:
'AnyHook GraphQL enables real-time communication through AnyHook proxy server by allowing you to subscribe and listen to GraphQL subscription events',
auth: graphqlCommon.auth,
minimumSupportedRelease: '0.20.0',
logoUrl:
'https://cdn.activepieces.com/pieces/anyhook-graphql.png',
authors: ['ahmad-swanblocks'],
actions: [],
triggers: [
graphqlSubscriptionTrigger,
],
});

View File

@@ -0,0 +1,30 @@
import { PieceAuth, Property } from '@activepieces/pieces-framework';
export const graphqlCommon = {
connectionType: "graphql",
auth: PieceAuth.CustomAuth({
required: true,
props: {
proxyBaseUrl: Property.ShortText({
displayName: 'AnyHook Server URL',
description: 'The URL of your AnyHook server',
required: true,
defaultValue: 'http://10.0.0.101:3001'
}),
},
}),
apiCall: async function (
url: string,
method: string,
data: object | undefined = undefined
) {
const response = await fetch(url, {
method,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
});
return response.json();
},
};

View File

@@ -0,0 +1,61 @@
import { TriggerStrategy, createTrigger, PieceAuth, Property } from '@activepieces/pieces-framework';
import { createGraphQLSubscription, deleteGraphQLSubscription } from './helpers';
import { graphqlCommon } from '../common/common';
export const graphqlSubscriptionTrigger = createTrigger({
auth: graphqlCommon.auth,
name: 'graphql_subscription_trigger',
displayName: 'New GraphQL Subscription Event',
description: 'Triggers on a new GraphQL subscription event',
type: TriggerStrategy.WEBHOOK,
props: {
websocketUrl: Property.ShortText({
displayName: 'Endpoint URL',
description: 'The GraphQL websocket to connect to.',
required: true,
defaultValue: 'wss://streaming.bitquery.io/graphql?token=xxxx',
}),
headers: Property.Object({
displayName: 'Headers',
description: 'Custom headers for the GraphQL connection, such as authentication tokens.',
required: false,
}),
query: Property.LongText({
displayName: 'GraphQL Query',
description: 'GraphQL subscription query to listen to events',
required: true,
defaultValue: 'subscription { EVM(network: eth, trigger_on: head) { Blocks { Block { BaseFee BaseFeeInUSD Bloom Coinbase } } } }',
}),
},
async onEnable(context) {
const subscriptionInfo = await createGraphQLSubscription(
context.propsValue.websocketUrl,
context.propsValue.headers,
context.propsValue.query,
context.webhookUrl,
context.auth.props.proxyBaseUrl
);
// Store subscription info
await context.store.put('graphql_subscription_trigger', subscriptionInfo.subscriptionId);
},
async onDisable(context) {
const subscriptionId: string = (await context.store.get('graphql_subscription_trigger')) as string;
if (subscriptionId) {
await deleteGraphQLSubscription(subscriptionId, context.auth.props.proxyBaseUrl);
await context.store.delete('graphql_subscription_trigger');
}
},
async run(context) {
return [context.payload.body];
},
async test(context) {
return [
{
event: 'GraphQL event data',
details: 'Details of the event',
},
];
},
sampleData: {},
});

View File

@@ -0,0 +1,32 @@
import { graphqlCommon } from '../common/common';
export async function createGraphQLSubscription(
websocketUrl: string,
headers: Record<string, unknown> | undefined,
query: string,
webhookUrl: string,
proxyBaseUrl: string
) {
const subscriptionApiUrl = `${proxyBaseUrl}/subscribe`;
const data = {
connection_type: graphqlCommon.connectionType,
webhook_url: webhookUrl,
args: {
endpoint_url: websocketUrl,
headers: headers ? JSON.stringify(headers) : undefined,
query,
},
};
const response = await graphqlCommon.apiCall(subscriptionApiUrl, 'POST', data);
return response;
}
export async function deleteGraphQLSubscription(subscriptionId: string, proxyBaseUrl: string) {
const deleteApiUrl = `${proxyBaseUrl}/unsubscribe`;
const data = {
subscription_id: subscriptionId,
};
const response = await graphqlCommon.apiCall(deleteApiUrl, 'POST', data);
return response;
}

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"]
}