AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { TriggerStrategy, createTrigger } from '@activepieces/pieces-framework';
import { lemonSqueezyAuth } from '../common/auth';
import { createStoreDropdownProperty, disableWebhook, enableWebhook, handleWebhook } from '../common/webhook';
import { webhookSchemas } from '../common/output-schemas';
export const subscriptionResumedTrigger = createTrigger({
auth: lemonSqueezyAuth,
name: 'subscription_resumed',
classification: 'READ',
displayName: 'Subscription Resumed',
description: 'Triggers when a subscription is resumed after being previously cancelled',
aiMetadata: {
description: 'Fires when a previously cancelled subscription in Lemon Squeezy is resumed and returns to active billing. Represents the reactivated subscription with its restored renewal date.',
},
type: TriggerStrategy.WEBHOOK,
props: {
store_id: createStoreDropdownProperty()
},
async onEnable(context) {
await enableWebhook({
auth: context.auth,
store: context.store,
storeId: context.propsValue.store_id,
webhookUrl: context.webhookUrl,
eventName: 'subscription_resumed',
});
},
async onDisable(context) {
await disableWebhook({ auth: context.auth, store: context.store, eventName: 'subscription_resumed' });
},
async run(context) {
return handleWebhook({ payload: context.payload, store: context.store, eventName: 'subscription_resumed' });
},
outputSchema: webhookSchemas.subscription,
sampleData: {
meta: {
event_name: 'subscription_resumed',
custom_data: {
user_id: 123
}
},
data: {
type: 'subscriptions',
id: '1',
attributes: {
store_id: 1,
customer_id: 1,
order_id: 1,
order_item_id: 1,
product_id: 1,
variant_id: 1,
product_name: 'Lemonade - 2 years',
variant_name: 'Default',
user_name: 'John Doe',
user_email: '[email protected]',
currency: 'USD',
currency_rate: '1.0000',
status: 'active',
status_formatted: 'Active',
trial_ends_at: null,
ends_at: '2023-08-17T09:45:53.000000Z',
created_at: '2021-08-17T09:45:53.000000Z',
updated_at: '2021-08-17T10:45:53.000000Z',
test_mode: false,
pause_mode: null,
cancelled_at: null,
billing_anchor: 17,
billing_anchor_type: 'day_of_month',
renews_at: '2021-09-17T09:45:53.000000Z'
}
}
}
});