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,23 @@
import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
import { runWorkflowAction } from './lib/actions/run-workflow';
import { PieceCategory } from '@activepieces/shared';
export const mindStudioAuth = PieceAuth.SecretText({
displayName: 'API Key',
description: 'Your MindStudio API key (Bearer token).',
required: true,
});
export const mindStudio = createPiece({
displayName: 'MindStudio',
description: 'Run MindStudio workflows and get AI results.',
auth: mindStudioAuth,
minimumSupportedRelease: '0.36.1',
logoUrl: 'https://cdn.activepieces.com/pieces/mind-studio.png',
authors: ['onyedikachi-david'],
categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],
actions: [runWorkflowAction],
triggers: [],
});

View File

@@ -0,0 +1,73 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient, HttpRequest } from '@activepieces/pieces-common';
import { mindStudioAuth } from '../..';
export const runWorkflowAction = createAction({
auth: mindStudioAuth,
name: 'run_workflow',
displayName: 'Run Workflow',
description: 'Run a workflow from your MindStudio app and start a thread.',
props: {
appId: Property.ShortText({
displayName: 'App ID',
description: 'MindStudio app ID to run.',
required: true,
}),
workflow: Property.ShortText({
displayName: 'Workflow',
description: 'Workflow name to run (without the .flow extension).',
required: false,
}),
variables: Property.Json({
displayName: 'Variables',
description: 'Key-value variables passed to the app.',
required: false,
defaultValue: {},
}),
callbackUrl: Property.ShortText({
displayName: 'Callback URL',
description: 'URL to receive the execution result asynchronously.',
required: false,
}),
includeBillingCost: Property.Checkbox({
displayName: 'Include Billing Cost',
description: 'Return the billing cost in the response.',
required: false,
defaultValue: false,
}),
},
async run({ auth, propsValue }) {
const body: Record<string, unknown> = {
appId: propsValue.appId,
};
if (propsValue.workflow) {
body['workflow'] = propsValue.workflow;
}
if (propsValue.variables) {
body['variables'] = propsValue.variables;
}
if (propsValue.callbackUrl) {
body['callbackUrl'] = propsValue.callbackUrl;
}
if (propsValue.includeBillingCost !== undefined) {
body['includeBillingCost'] = propsValue.includeBillingCost;
}
const request: HttpRequest = {
method: HttpMethod.POST,
url: 'https://api.mindstudio.ai/developer/v2/apps/run',
headers: {
Authorization: `Bearer ${auth.secret_text}`,
'Content-Type': 'application/json',
},
body,
};
const response = await httpClient.sendRequest(request);
return response.body;
},
});