- 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>
60 lines
1.9 KiB
TypeScript
60 lines
1.9 KiB
TypeScript
import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
|
|
import { AppConnectionType, PieceCategory } from '@activepieces/shared';
|
|
import { createEntryAction } from './lib/actions/create-entry';
|
|
import { updateEntryAction } from './lib/actions/update-entry';
|
|
import { deleteEntryAction } from './lib/actions/delete-entry';
|
|
import { getEntryAction } from './lib/actions/get-entry';
|
|
import { newEntryTrigger } from './lib/triggers/new-entry-submitted';
|
|
import { entryUpdatedTrigger } from './lib/triggers/entry-updated';
|
|
import {
|
|
createCustomApiCallAction,
|
|
HttpMethod,
|
|
} from '@activepieces/pieces-common';
|
|
import { makeRequest } from './lib/common';
|
|
|
|
export const cognitoFormsAuth = PieceAuth.SecretText({
|
|
displayName: 'API Key',
|
|
required: true,
|
|
description: `
|
|
1. Click your organization's name in the top left corner and then click Settings.
|
|
2. Go to the Integrations section and select + New API Key.
|
|
3. Make sure to copy and store your API key, as it cannot be retrieved later.
|
|
`,
|
|
validate: async ({ auth }) => {
|
|
try {
|
|
await makeRequest({secret_text: auth, type: AppConnectionType.SECRET_TEXT}, HttpMethod.GET, '/forms');
|
|
|
|
return { valid: true };
|
|
} catch {
|
|
return {
|
|
valid: false,
|
|
error: 'Invalid API Key.',
|
|
};
|
|
}
|
|
},
|
|
});
|
|
|
|
export const cognitoForms = createPiece({
|
|
displayName: 'Cognito Forms',
|
|
auth: cognitoFormsAuth,
|
|
logoUrl: 'https://cdn.activepieces.com/pieces/cognito-forms.png',
|
|
authors: ['krushnarout'],
|
|
categories: [PieceCategory.PRODUCTIVITY, PieceCategory.FORMS_AND_SURVEYS],
|
|
actions: [
|
|
createEntryAction,
|
|
updateEntryAction,
|
|
deleteEntryAction,
|
|
getEntryAction,
|
|
createCustomApiCallAction({
|
|
auth: cognitoFormsAuth,
|
|
baseUrl: () => 'https://www.cognitoforms.com/api',
|
|
authMapping: async (auth) => {
|
|
return {
|
|
Authorization: `Bearer ${auth}`,
|
|
};
|
|
},
|
|
}),
|
|
],
|
|
triggers: [newEntryTrigger, entryUpdatedTrigger],
|
|
});
|