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,95 @@
|
||||
import { apId, FlowAction, FlowActionType, FlowStatus, FlowTrigger, FlowTriggerType, FlowVersion, FlowVersionState, PopulatedFlow } from '@activepieces/shared'
|
||||
import { faker } from '@faker-js/faker'
|
||||
|
||||
|
||||
export const flowGenerator = {
|
||||
simpleActionAndTrigger(externalId?: string): PopulatedFlow {
|
||||
return flowGenerator.randomizeMetadata(externalId, flowVersionGenerator.simpleActionAndTrigger())
|
||||
},
|
||||
randomizeMetadata(externalId: string | undefined, version: Omit<FlowVersion, 'flowId'>): PopulatedFlow {
|
||||
const flowId = apId()
|
||||
const result = {
|
||||
externalId: externalId ?? flowId,
|
||||
version: {
|
||||
...version,
|
||||
trigger: randomizeTriggerMetadata(version.trigger),
|
||||
flowId,
|
||||
},
|
||||
schedule: null,
|
||||
status: faker.helpers.enumValue(FlowStatus),
|
||||
id: flowId,
|
||||
projectId: apId(),
|
||||
folderId: apId(),
|
||||
created: faker.date.recent().toISOString(),
|
||||
updated: faker.date.recent().toISOString(),
|
||||
}
|
||||
return result
|
||||
},
|
||||
}
|
||||
|
||||
const flowVersionGenerator = {
|
||||
simpleActionAndTrigger(): Omit<FlowVersion, 'flowId'> {
|
||||
return {
|
||||
id: apId(),
|
||||
displayName: faker.animal.dog(),
|
||||
created: faker.date.recent().toISOString(),
|
||||
updated: faker.date.recent().toISOString(),
|
||||
updatedBy: apId(),
|
||||
valid: true,
|
||||
trigger: {
|
||||
...randomizeTriggerMetadata(generateTrigger()),
|
||||
nextAction: generateAction(),
|
||||
},
|
||||
state: FlowVersionState.DRAFT,
|
||||
connectionIds: [],
|
||||
agentIds: [],
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
function randomizeTriggerMetadata(trigger: FlowTrigger): FlowTrigger {
|
||||
return {
|
||||
...trigger,
|
||||
settings: {
|
||||
...trigger.settings,
|
||||
propertySettings: {
|
||||
server: faker.internet.url(),
|
||||
port: faker.color.cmyk(),
|
||||
username: faker.internet.userName(),
|
||||
password: faker.internet.password(),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
function generateAction(): FlowAction {
|
||||
return {
|
||||
type: FlowActionType.PIECE,
|
||||
displayName: faker.hacker.noun(),
|
||||
name: apId(),
|
||||
skip: false,
|
||||
settings: {
|
||||
input: {},
|
||||
pieceName: faker.helpers.arrayElement(['@activepieces/piece-schedule', '@activepieces/piece-webhook']),
|
||||
pieceVersion: faker.system.semver(),
|
||||
actionName: faker.hacker.noun(),
|
||||
propertySettings: {},
|
||||
},
|
||||
valid: true,
|
||||
}
|
||||
}
|
||||
|
||||
function generateTrigger(): FlowTrigger {
|
||||
return {
|
||||
type: FlowTriggerType.PIECE,
|
||||
displayName: faker.hacker.noun(),
|
||||
name: apId(),
|
||||
settings: {
|
||||
pieceName: faker.helpers.arrayElement(['@activepieces/piece-schedule', '@activepieces/piece-webhook']),
|
||||
pieceVersion: faker.system.semver(),
|
||||
triggerName: faker.hacker.noun(),
|
||||
input: {},
|
||||
propertySettings: {},
|
||||
},
|
||||
valid: true,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user