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,6 @@
{
"You can obtain API token from [Account Settings](https://app.youform.com/account).": "You can obtain API token from [Account Settings](https://app.youform.com/account).",
"New Submission": "New Submission",
"Triggers When a new submission is recieved.": "Triggers When a new submission is recieved.",
"Form": "Form"
}

View File

@@ -0,0 +1,15 @@
import { createPiece } from '@activepieces/pieces-framework';
import { youformAuth } from './lib/common/auth';
import { PieceCategory } from '@activepieces/shared';
import { newSubmissionTrigger } from './lib/triggers/new-form-submission';
export const youform = createPiece({
displayName: 'Youform',
auth: youformAuth,
minimumSupportedRelease: '0.36.1',
logoUrl: 'https://cdn.activepieces.com/pieces/youform.png',
authors: ['kishanprmr'],
categories: [PieceCategory.FORMS_AND_SURVEYS],
actions: [],
triggers: [newSubmissionTrigger],
});

View File

@@ -0,0 +1,33 @@
import { PieceAuth } from '@activepieces/pieces-framework';
import {
AuthenticationType,
httpClient,
HttpMethod,
} from '@activepieces/pieces-common';
import { BASE_URL } from './constants';
export const youformAuth = PieceAuth.SecretText({
displayName: 'API Token',
description: `You can obtain API token from [Account Settings](https://app.youform.com/account).`,
required: true,
validate: async ({ auth }) => {
try {
await httpClient.sendRequest({
method: HttpMethod.GET,
url: BASE_URL + '/me',
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth,
},
});
return {
valid: true,
};
} catch {
return {
valid: false,
error: 'Invalid API Token',
};
}
},
});

View File

@@ -0,0 +1 @@
export const BASE_URL = 'https://app.youform.com/api'

View File

@@ -0,0 +1,42 @@
import {
AuthenticationType,
httpClient,
HttpMethod,
} from '@activepieces/pieces-common';
import { Property } from '@activepieces/pieces-framework';
import { BASE_URL } from './constants';
import { ListFormsResponse } from './types';
import { youformAuth } from './auth';
export const formIdDropdown = Property.Dropdown({
auth: youformAuth,
displayName: 'Form',
refreshers: [],
required: true,
options: async ({ auth }) => {
if (!auth) {
return {
placeholder: 'Please connect your account first.',
options: [],
disabled: false,
};
}
const response = await httpClient.sendRequest<ListFormsResponse>({
method: HttpMethod.GET,
url: BASE_URL + '/forms',
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
});
return {
disabled: false,
options: response.body.data.data.map((form) => ({
label: form.name,
value: form.slug,
})),
};
},
});

View File

@@ -0,0 +1,15 @@
export type ListFormsResponse = {
data:{
data: {
id: number;
name: string;
slug:string
}[];}
};
export type CreateWebhookResponse = {
data:{
id:number
}
}

View File

@@ -0,0 +1,66 @@
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { youformAuth } from '../common/auth';
import { formIdDropdown } from '../common/props';
import {
AuthenticationType,
httpClient,
HttpMethod,
} from '@activepieces/pieces-common';
import { BASE_URL } from '../common/constants';
import { CreateWebhookResponse } from '../common/types';
import { isNil } from '@activepieces/shared';
const TRIGGER_KEY = 'youform-new-submission-trigger';
export const newSubmissionTrigger = createTrigger({
name: 'new-submission',
auth: youformAuth,
displayName: 'New Submission',
description: 'Triggers When a new submission is recieved.',
type: TriggerStrategy.WEBHOOK,
props: {
formId: formIdDropdown,
},
async onEnable(context) {
const { formId } = context.propsValue;
const response = await httpClient.sendRequest<CreateWebhookResponse>({
method: HttpMethod.POST,
url: BASE_URL + '/webhooks',
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: context.auth.secret_text,
},
body:{},
queryParams: {
form_id: formId.toString(),
webhook_url: context.webhookUrl,
},
});
const webhookId = response.body.data.id;
await context.store.put<number>(TRIGGER_KEY, webhookId);
},
async onDisable(context) {
const webhookId = await context.store.get<number>(TRIGGER_KEY);
if (!isNil(webhookId)) {
await httpClient.sendRequest<CreateWebhookResponse>({
method: HttpMethod.DELETE,
url: BASE_URL + `/webhooks/${webhookId}`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: context.auth.secret_text,
},
});
}
},
async run(context) {
return [context.payload.body];
},
async test(context) {
return [context.payload.body];
},
sampleData: undefined,
});