Files
smoothschedule/activepieces-fork/packages/pieces/community/saastic/src/index.ts
poduck 3aa7199503 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>
2025-12-18 22:59:37 -05:00

63 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import {
AuthenticationType,
createCustomApiCallAction,
httpClient,
HttpMethod,
} from '@activepieces/pieces-common';
import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/shared';
import { createCharge } from './lib/actions/create-charge';
import { createCustomer } from './lib/actions/create-customer';
export const saasticAuth = PieceAuth.SecretText({
description:
' You can find your projects API key here: https://saastic.com/settings/developers',
displayName: 'Api Key',
required: true,
validate: async (auth) => {
try {
await httpClient.sendRequest<{
data: { id: string }[];
}>({
url: 'https://api.saastic.com/beacon/customers',
method: HttpMethod.GET,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.auth,
},
});
return {
valid: true,
};
} catch (e) {
return {
valid: false,
error: 'Invalid API token',
};
}
},
});
export const saastic = createPiece({
displayName: 'Saastic',
description: 'Revenue and churn analytics for Stripe',
auth: saasticAuth,
minimumSupportedRelease: '0.30.0',
logoUrl: 'https://cdn.activepieces.com/pieces/saastic.png',
categories: [PieceCategory.MARKETING],
authors: ["joselupianez","kishanprmr","MoShizzle","abuaboud"],
actions: [
createCustomer,
createCharge,
createCustomApiCallAction({
baseUrl: () => 'https://api.saastic.com',
auth: saasticAuth,
authMapping: async (auth) => ({
Authorization: `Bearer ${auth.secret_text}`,
}),
}),
],
triggers: [],
});