- 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>
81 lines
2.4 KiB
TypeScript
81 lines
2.4 KiB
TypeScript
import {
|
|
EngineOperationType,
|
|
JobData,
|
|
ProgressUpdateType,
|
|
RunEnvironment,
|
|
} from '@activepieces/shared'
|
|
import { Static, Type } from '@sinclair/typebox'
|
|
|
|
export * from './runs-metadata-queue-factory'
|
|
|
|
export enum JobStatus {
|
|
COMPLETED = 'COMPLETED',
|
|
FAILED = 'FAILED',
|
|
}
|
|
|
|
export enum QueueName {
|
|
WORKER_JOBS = 'workerJobs',
|
|
RUNS_METADATA = 'runsMetadata',
|
|
}
|
|
|
|
export const getPlatformQueueName = (platformId: string): string => {
|
|
return `platform-${platformId}-jobs`
|
|
}
|
|
|
|
export const ApQueueJob = Type.Object({
|
|
id: Type.String(),
|
|
data: JobData,
|
|
engineToken: Type.String(),
|
|
attempsStarted: Type.Number(),
|
|
})
|
|
|
|
export type ApQueueJob = Static<typeof ApQueueJob>
|
|
export const SendEngineUpdateRequest = Type.Object({
|
|
workerServerId: Type.String(),
|
|
requestId: Type.String(),
|
|
response: Type.Unknown(),
|
|
})
|
|
export type SendEngineUpdateRequest = Static<typeof SendEngineUpdateRequest>
|
|
|
|
export const MigrateJobsRequest = Type.Object({
|
|
jobData: Type.Record(Type.String(), Type.Unknown()),
|
|
})
|
|
export type MigrateJobsRequest = Static<typeof MigrateJobsRequest>
|
|
|
|
export const SavePayloadRequest = Type.Object({
|
|
flowId: Type.String(),
|
|
projectId: Type.String(),
|
|
payloads: Type.Array(Type.Unknown()),
|
|
})
|
|
export type SavePayloadRequest = Static<typeof SavePayloadRequest>
|
|
|
|
export const SubmitPayloadsRequest = Type.Object({
|
|
flowVersionId: Type.String(),
|
|
projectId: Type.String(),
|
|
progressUpdateType: Type.Enum(ProgressUpdateType),
|
|
synchronousHandlerId: Type.Optional(Type.String()),
|
|
httpRequestId: Type.Optional(Type.String()),
|
|
payloads: Type.Array(Type.Unknown()),
|
|
environment: Type.Enum(RunEnvironment),
|
|
parentRunId: Type.Optional(Type.String()),
|
|
failParentOnFailure: Type.Optional(Type.Boolean()),
|
|
platformId: Type.String(),
|
|
})
|
|
|
|
export type SubmitPayloadsRequest = Static<typeof SubmitPayloadsRequest>
|
|
|
|
|
|
|
|
|
|
export function getEngineTimeout(operationType: EngineOperationType, flowTimeoutSandbox: number, triggerTimeoutSandbox: number): number {
|
|
switch (operationType) {
|
|
case EngineOperationType.EXECUTE_FLOW:
|
|
return flowTimeoutSandbox
|
|
case EngineOperationType.EXECUTE_PROPERTY:
|
|
case EngineOperationType.EXECUTE_VALIDATE_AUTH:
|
|
case EngineOperationType.EXTRACT_PIECE_METADATA:
|
|
case EngineOperationType.EXECUTE_TRIGGER_HOOK:
|
|
return triggerTimeoutSandbox
|
|
}
|
|
}
|