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,57 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { createSNS } from '../common';
|
||||
import { amazonSnsAuth } from '../..';
|
||||
import { ListTopicsCommand, PublishCommand } from "@aws-sdk/client-sns";
|
||||
|
||||
export const sendMessageAction = createAction({
|
||||
auth: amazonSnsAuth,
|
||||
name: 'send-message',
|
||||
displayName: 'Send Message',
|
||||
description: 'Sends a message to an Amazon SNS topic.',
|
||||
props: {
|
||||
topic: Property.Dropdown({
|
||||
auth: amazonSnsAuth,
|
||||
displayName: 'Topic',
|
||||
description: 'Select a topic',
|
||||
required: true,
|
||||
refreshers: ['auth'],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please authenticate first',
|
||||
};
|
||||
}
|
||||
const sns = await createSNS(auth.props);
|
||||
const topics = await sns.send(new ListTopicsCommand({}));
|
||||
if (topics.Topics) {
|
||||
return {
|
||||
options: topics.Topics.map((topic) =>(
|
||||
{
|
||||
label: topic.TopicArn?.split(':').pop() as string,
|
||||
value: topic.TopicArn as string,
|
||||
}
|
||||
)),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
options: [],
|
||||
placeholder: 'No topics found',
|
||||
};
|
||||
}
|
||||
},
|
||||
}),
|
||||
message: Property.LongText({
|
||||
displayName: 'Message',
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { topic, message } = context.propsValue;
|
||||
const sns = createSNS(context.auth.props);
|
||||
const response = await sns.send(new PublishCommand({ TopicArn: topic, Message: message }));
|
||||
|
||||
return response;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
import { isNil } from '@activepieces/shared';
|
||||
import { SNSClient } from '@aws-sdk/client-sns';
|
||||
|
||||
export function createSNS(auth: {
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
region: string | undefined;
|
||||
endpoint: string | undefined;
|
||||
}) {
|
||||
const sns = new SNSClient({
|
||||
credentials: {
|
||||
accessKeyId: auth.accessKeyId,
|
||||
secretAccessKey: auth.secretAccessKey,
|
||||
},
|
||||
region: auth.region,
|
||||
endpoint:
|
||||
auth.endpoint === '' || isNil(auth.endpoint) ? undefined : auth.endpoint,
|
||||
});
|
||||
return sns;
|
||||
}
|
||||
Reference in New Issue
Block a user