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,87 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { youcanbookmeAuth } from '../common/auth';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
export const createprofile = createAction({
auth: youcanbookmeAuth,
name: 'create-profile',
displayName: 'Create Profile',
description: 'Create a new profile in YouCanBookMe',
props: {
accountId: Property.ShortText({
displayName: 'Account ID',
required: true,
}),
title: Property.ShortText({
displayName: 'Profile Title',
description: 'The title of the profile',
required: true,
}),
description: Property.LongText({
displayName: 'Description',
description: 'A description of the profile',
required: false,
}),
subdomain: Property.ShortText({
displayName: 'Subdomain',
description: 'The subdomain for the profile',
required: false,
}),
timeZone: Property.ShortText({
displayName: 'Time Zone',
description: 'The time zone for the profile (e.g., America/New_York)',
required: false,
}),
locale: Property.ShortText({
displayName: 'Locale',
description: 'The locale for the profile (e.g., en-US)',
required: false,
}),
logo: Property.ShortText({
displayName: 'Logo URL',
description: 'URL to the profile logo',
required: false,
}),
accessCode: Property.ShortText({
displayName: 'Access Code',
description: 'An access code for the profile',
required: false,
}),
},
async run({ propsValue, auth }) {
const {
accountId,
title,
description,
subdomain,
timeZone,
locale,
logo,
accessCode,
} = propsValue;
const body: any = {
accountId,
title,
};
if (description) body.description = description;
if (subdomain) body.subdomain = subdomain;
if (timeZone) body.timeZone = timeZone;
if (locale) body.locale = locale;
if (logo) body.logo = logo;
if (accessCode) body.accessCode = accessCode;
const response = await httpClient.sendRequest({
method: HttpMethod.POST,
url: 'https://api.youcanbook.me/v1/profiles',
headers: {
Authorization: `Bearer ${auth}`,
'Content-Type': 'application/json',
},
body,
});
return response.body;
},
});

View File

@@ -0,0 +1,51 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { youcanbookmeAuth } from '../common/auth';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
export const retrieveBookingById = createAction({
auth: youcanbookmeAuth,
name: 'retrieveBookingById',
displayName: 'Retrieve Booking by ID',
description: 'Retrieve a booking by its ID from YouCanBookMe',
props: {
bookingId: Property.ShortText({
displayName: 'Booking ID',
description: 'The ID of the booking to retrieve',
required: true,
}),
displayTimeZone: Property.ShortText({
displayName: 'Display Time Zone',
description: 'The time zone to display times in (e.g., America/New_York)',
required: false,
}),
fields: Property.ShortText({
displayName: 'Fields',
description:
'Comma-separated list of fields to return. Default: id,title,accountId,profileId,createdAt,startsAt,endsAt,location,tentative,timeZone,cancelled,numberOfSlots',
required: false,
}),
},
async run({ propsValue, auth }) {
const { bookingId, displayTimeZone, fields } = propsValue;
const queryParams: any = {};
if (displayTimeZone) {
queryParams.displayTimeZone = displayTimeZone;
}
if (fields) {
queryParams.fields = fields;
}
const response = await httpClient.sendRequest({
method: HttpMethod.GET,
url: `https://api.youcanbook.me/v1/bookings/${bookingId}`,
headers: {
Authorization: `Bearer ${auth}`,
'Content-Type': 'application/json',
},
queryParams,
});
return response.body;
},
});

View File

@@ -0,0 +1,9 @@
import { PieceAuth } from '@activepieces/pieces-framework';
export const youcanbookmeAuth = PieceAuth.SecretText({
displayName: 'YouCanBookMe API Key',
description: `
Go to [app.youcanbookme.com](https://app.youcanbook.me/#/account/security/)
`,
required: true,
});

View File

@@ -0,0 +1,51 @@
import {
createTrigger,
TriggerStrategy,
Property,
} from '@activepieces/pieces-framework';
import { youcanbookmeAuth } from '../common/auth';
export const newBooking = createTrigger({
auth: youcanbookmeAuth,
name: 'newBooking',
displayName: 'New Booking',
description: 'Trigger when a new booking is made',
props: {
webhook_setup: Property.MarkDown({
value: `
## Setting up a Webhook
1. Select the booking page you want to add a webhook to and click **Edit Settings**
2. Select **Additional options** from the left menu
3. Click **Notifications** under the sub-menu
4. Click into the notification you wish to have the webhook fire (After new booking made, rescheduled, cancelled, reminder, after appointment ends, etc)
5. Click the **+** to add a new notification
6. Click **Webhook**
7. Enter the URL provided by Activepieces (copy from the input field below)
\`\`\`text
{{webhookUrl}}
\`\`\`
8. Choose method:
- **POST**
9. Add payload (optional)
10. Click **Save changes**
`,
}),
},
sampleData: {
startsAt: '2025-12-17',
endsAt: '08:30',
timeZone: 'UTC',
firstName: 'sa',
email: 'test@test.com',
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
// implement webhook creation logic
},
async onDisable(context) {
// implement webhook deletion logic
},
async run(context) {
return [context.payload.body];
},
});