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,17 @@
|
||||
import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
|
||||
import { scanFile } from './lib/actions/scan-file';
|
||||
import { scanText } from './lib/actions/scan-text';
|
||||
import { PieceCategory } from '@activepieces/shared';
|
||||
import { gptzeroDetectAiAuth } from './lib/common/auth';
|
||||
|
||||
export const gptzeroDetectAi = createPiece({
|
||||
displayName: 'GPTZero',
|
||||
auth: gptzeroDetectAiAuth,
|
||||
minimumSupportedRelease: '0.36.1',
|
||||
logoUrl: 'https://cdn.activepieces.com/pieces/gptzero-detect-ai.png',
|
||||
authors: ['sanket-a11y'],
|
||||
description: 'Detect AI-generated text with GPTZero API',
|
||||
categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],
|
||||
actions: [scanFile, scanText],
|
||||
triggers: [],
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
||||
import { gptzeroDetectAiAuth } from '../common/auth';
|
||||
|
||||
export const scanFile = createAction({
|
||||
auth: gptzeroDetectAiAuth,
|
||||
name: 'scanFile',
|
||||
displayName: 'Scan File',
|
||||
description: 'Scan a file for AI-generated content detection',
|
||||
props: {
|
||||
file: Property.File({
|
||||
displayName: 'File',
|
||||
description: 'The file to scan for AI-generated content',
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const file = context.propsValue.file;
|
||||
|
||||
const formData = new FormData();
|
||||
const fileBuffer = Buffer.from(file.base64, 'base64');
|
||||
const mimeType = file.extension
|
||||
? `application/${file.extension}`
|
||||
: 'application/octet-stream';
|
||||
const blob = new Blob([fileBuffer], { type: mimeType });
|
||||
formData.append('files', blob, file.filename);
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: 'https://api.gptzero.me/v2/predict/files',
|
||||
headers: {
|
||||
'x-api-key': context.auth.secret_text,
|
||||
},
|
||||
body: formData,
|
||||
});
|
||||
|
||||
return response.body;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
||||
import { gptzeroDetectAiAuth } from '../common/auth';
|
||||
|
||||
export const scanText = createAction({
|
||||
auth: gptzeroDetectAiAuth,
|
||||
name: 'scanText',
|
||||
displayName: 'Scan Text',
|
||||
description: 'Scan text content for AI-generated content detection',
|
||||
props: {
|
||||
text: Property.LongText({
|
||||
displayName: 'Text',
|
||||
description: 'The text content to scan for AI-generated content',
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const payload = {
|
||||
document: context.propsValue.text,
|
||||
};
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: 'https://api.gptzero.me/v2/predict/text',
|
||||
headers: {
|
||||
'x-api-key': context.auth.secret_text,
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
body: payload,
|
||||
});
|
||||
|
||||
return response.body;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
import { PieceAuth } from '@activepieces/pieces-framework';
|
||||
|
||||
export const gptzeroDetectAiAuth = PieceAuth.SecretText({
|
||||
displayName: 'GPTZero API Key',
|
||||
description: 'https://app.gptzero.me/app/api to get your API key',
|
||||
required: true,
|
||||
});
|
||||
Reference in New Issue
Block a user