- 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>
63 lines
1.7 KiB
TypeScript
63 lines
1.7 KiB
TypeScript
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 project’s 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: [],
|
||
});
|