Files
smoothschedule/activepieces-fork/packages/pieces/community/deepl/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

69 lines
1.8 KiB
TypeScript

import { createCustomApiCallAction } from '@activepieces/pieces-common';
import {
createPiece,
PieceAuth,
Property,
} from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/shared';
import { translateText } from './lib/actions/translate-text';
const markdownDescription = `
Follow these instructions to get your DeepL API Key:
1. Log in to your DeepL account.
2. Visit https://www.deepl.com/account/summary
3. Go to the API section and obtain your DeepL API Key.
`;
export const deeplAuth = PieceAuth.CustomAuth({
description: markdownDescription,
props: {
key: Property.ShortText({
displayName: 'Api key',
description: 'Enter the api key',
required: true,
}),
type: Property.StaticDropdown({
displayName: 'Api url',
description: 'Select api url',
required: true,
options: {
options: [
{
label: 'Free API',
value: 'free',
},
{
label: 'Paid API',
value: 'paid',
},
],
},
}),
},
required: true,
});
export const deepl = createPiece({
displayName: 'DeepL',
description: 'AI-powered language translation',
auth: deeplAuth,
minimumSupportedRelease: '0.30.0',
logoUrl: 'https://cdn.activepieces.com/pieces/deepl.png',
categories: [],
authors: ["BBND","kishanprmr","MoShizzle","abuaboud"],
actions: [
translateText,
createCustomApiCallAction({
baseUrl: (auth) =>
(auth as { type: string }).type === 'free'
? 'https://api-free.deepl.com/v2'
: 'https://api.deepl.com/v2', // Replace with the actual base URL
auth: deeplAuth,
authMapping: async (auth) => ({
Authorization: `DeepL-Auth-Key ${auth.props.key}`,
}),
}),
],
triggers: [],
});