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:
poduck
2025-12-18 22:59:37 -05:00
parent 9848268d34
commit 3aa7199503
16292 changed files with 1284892 additions and 4708 deletions

View File

@@ -0,0 +1,74 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { respaidAuth } from '../..';
import { respaidCommon } from '../common';
export const createNewCampaign = createAction({
name: 'create_new_campaign',
displayName: 'Create New Campaign',
description: 'Action for creating a new campaign.',
auth: respaidAuth,
props: {
campaign_name: Property.ShortText({
displayName: 'Campaign Name',
required: true,
}),
is_agency_collection: Property.Checkbox({
displayName: 'Agency collection?',
required: false,
defaultValue: false,
}),
importData: Property.Json({
displayName: 'Import Data (Array of Invoices)',
required: true,
description: `Provide an array of invoice objects with the following example structure:
[{
"unique_identifier": "123",
"company_name": "Company XYZ",
"email": "john@example.com",
"invoice_number": "INV123",
"invoice_date": "01/01/2025",
"description": "Invoice for service"
"due_amount": 1000,
"invoicing_entity_name": "Creditor ABC",
"invoicing_entity_address": "456 Avenue, City",
"full_name": "John Doe",
"phone_number": "1234567890",
"address": "123 Street, City",
}]`,
}),
},
async run({ auth, propsValue }) {
if (!Array.isArray(propsValue.importData)) {
throw new Error('Import Data must be an array of objects.');
}
const requestBody = {
campaign_name: propsValue.campaign_name,
is_agency_collection: propsValue.is_agency_collection,
import: propsValue.importData.map(invoice => ({
unique_identifier: invoice.unique_identifier,
full_name: invoice.full_name,
company_name: invoice.company_name,
email: invoice.email,
phone_number: invoice.phone_number,
address: invoice.address,
due_amount: invoice.due_amount,
invoicing_entity_name: invoice.invoicing_entity_name,
invoicing_entity_address: invoice.invoicing_entity_address,
invoice_number: invoice.invoice_number,
invoice_date: invoice.invoice_date,
description: invoice.description,
})),
};
const res = await httpClient.sendRequest<string[]>({
method: HttpMethod.POST,
url: `${respaidCommon.baseUrl}/actions/import_campaign`,
headers: respaidCommon.getHeadersStructure(auth.secret_text),
body: ({ type: 'active_pieces', import: JSON.stringify(requestBody) }),
});
return res.body;
},
});

View File

@@ -0,0 +1,11 @@
import { createNewCampaign } from "./create_new_campaign";
import { stopCollectionClientPaidDirectly } from "./stop_collection_client_paid_directly";
import { stopCollectionForDirectInstalmentPayment } from "./stop_collection_for_direct_instalment_payment";
import { stopCollectionForDirectPartialPayment } from "./stop_collection_for_direct_partial_payment";
export const respaidActions = [
createNewCampaign,
stopCollectionClientPaidDirectly,
stopCollectionForDirectPartialPayment,
stopCollectionForDirectInstalmentPayment
]

View File

@@ -0,0 +1,37 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { respaidAuth } from '../..';
import { respaidCommon, respaidActionsCommon } from '../common';
export const stopCollectionClientPaidDirectly = createAction({
name: 'stop_collection_client_paid_directly',
displayName: 'Stop Collection for Direct Full Payment',
description: 'Stops the collection process for a case and mark it as paid directly to the creditor.',
auth: respaidAuth,
props: {
unique_identifier: Property.ShortText({
displayName: 'Unique Identifier',
required: false,
}),
email: Property.ShortText({
displayName: 'Email',
required: false,
}),
invoice_number: Property.ShortText({
displayName: 'Invoice Number',
required: false,
}),
},
async run({ auth, propsValue }) {
respaidActionsCommon.validateProps(propsValue);
const res = await httpClient.sendRequest<string[]>({
method: HttpMethod.POST,
url: `${respaidCommon.baseUrl}/actions/stop_collection_client_paid_directly`,
headers: respaidCommon.getHeadersStructure(auth.secret_text),
body: respaidActionsCommon.getPayloadBodyStructure(propsValue),
});
return res.body;
},
});

View File

@@ -0,0 +1,37 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { respaidAuth } from '../..';
import { respaidCommon, respaidActionsCommon } from '../common';
export const stopCollectionForDirectInstalmentPayment = createAction({
name: 'stop_collection_for_direct_instalment_payment',
displayName: 'Stop Collection for Direct Instalment Payment',
description: 'Stops the collection process for a case when an instalment plan is set up with the creditor.',
auth: respaidAuth,
props: {
unique_identifier: Property.ShortText({
displayName: 'Unique Identifier',
required: false,
}),
email: Property.ShortText({
displayName: 'Email',
required: false,
}),
invoice_number: Property.ShortText({
displayName: 'Invoice Number',
required: false,
}),
},
async run({ auth, propsValue }) {
respaidActionsCommon.validateProps(propsValue);
const res = await httpClient.sendRequest<string[]>({
method: HttpMethod.POST,
url: `${respaidCommon.baseUrl}/actions/stop_collection_for_direct_instalment_payment`,
headers: respaidCommon.getHeadersStructure(auth.secret_text),
body: respaidActionsCommon.getPayloadBodyStructure(propsValue),
});
return res.body;
},
});

View File

@@ -0,0 +1,42 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { respaidAuth } from '../..';
import { respaidCommon, respaidActionsCommon } from '../common';
export const stopCollectionForDirectPartialPayment = createAction({
name: 'stop_collection_for_direct_partial_payment',
displayName: 'Stop Collection for Direct Partial Payment',
description: 'Stops the collection process for a case and mark it as partially paid directly to the creditor.',
auth: respaidAuth,
props: {
unique_identifier: Property.ShortText({
displayName: 'Unique Identifier',
required: false,
}),
amount: Property.ShortText({
displayName: 'Amount',
required: false,
}),
email: Property.ShortText({
displayName: 'Email',
required: false,
}),
invoice_number: Property.ShortText({
displayName: 'Invoice Number',
required: false,
}),
},
async run({ auth, propsValue }) {
respaidActionsCommon.validateProps(propsValue);
const res = await httpClient.sendRequest<string[]>({
method: HttpMethod.POST,
url: `${respaidCommon.baseUrl}/actions/stop_collection_for_direct_partial_payment`,
headers: respaidCommon.getHeadersStructure(auth.secret_text),
body: respaidActionsCommon.getPayloadBodyStructure(propsValue),
});
return res.body;
},
});