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,44 @@
|
||||
import { Property, createAction } from '@activepieces/pieces-framework';
|
||||
import { lineAuth2 } from '../..';
|
||||
import {
|
||||
AuthenticationType,
|
||||
HttpMethod,
|
||||
httpClient,
|
||||
} from '@activepieces/pieces-common';
|
||||
|
||||
export const pushMessage = createAction({
|
||||
name: 'push_message', // Must be a unique across the piece, this shouldn't be changed.
|
||||
auth: lineAuth2,
|
||||
displayName: 'Push Message',
|
||||
description: 'Push message to the line account',
|
||||
props: {
|
||||
userId: Property.ShortText({
|
||||
displayName: 'User Id',
|
||||
description: 'The user id can be obtained from the webhook payload',
|
||||
required: true,
|
||||
}),
|
||||
text: Property.ShortText({
|
||||
displayName: 'Text',
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
return httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: `https://api.line.me/v2/bot/message/push`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BEARER_TOKEN,
|
||||
token: context.auth.secret_text,
|
||||
},
|
||||
body: {
|
||||
to: context.propsValue.userId,
|
||||
messages: [
|
||||
{
|
||||
type: 'text',
|
||||
text: context.propsValue.text,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,43 @@
|
||||
import {
|
||||
createTrigger,
|
||||
PieceAuth,
|
||||
Property,
|
||||
TriggerStrategy,
|
||||
} from '@activepieces/pieces-framework';
|
||||
|
||||
const markdown = `
|
||||
- Create Line bot account from Developer Console
|
||||
- Go to the "Messaging API" section.
|
||||
- In the webhook settings, paste this URL:
|
||||
\`{{webhookUrl}}\`
|
||||
- Publish Activepieces flow first then click "Verify" button
|
||||
`;
|
||||
|
||||
export const newMessage = createTrigger({
|
||||
name: 'new-message',
|
||||
displayName: 'New Message',
|
||||
auth: PieceAuth.None(),
|
||||
description: 'Triggers when a new message is received',
|
||||
props: {
|
||||
md: Property.MarkDown({
|
||||
value: markdown,
|
||||
}),
|
||||
},
|
||||
type: TriggerStrategy.WEBHOOK,
|
||||
sampleData: {},
|
||||
async onEnable(context) {
|
||||
// Empty
|
||||
},
|
||||
async onDisable(context) {
|
||||
// Empty
|
||||
},
|
||||
async run(context) {
|
||||
const { events } = context.payload.body as { events: unknown[] };
|
||||
if (!events) {
|
||||
return [];
|
||||
}
|
||||
return events.filter(
|
||||
(event: any) => event.mode === 'active' && event.type === 'message'
|
||||
);
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user