mirror of
https://github.com/xtr-dev/payload-automation.git
synced 2025-12-10 17:03:22 +00:00
Compare commits
2 Commits
add-claude
...
v0.0.12
| Author | SHA1 | Date | |
|---|---|---|---|
| 7686495283 | |||
| 265d5affc6 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/payload-workflows",
|
"name": "@xtr-dev/payload-workflows",
|
||||||
"version": "0.0.11",
|
"version": "0.0.12",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@xtr-dev/payload-workflows",
|
"name": "@xtr-dev/payload-workflows",
|
||||||
"version": "0.0.11",
|
"version": "0.0.12",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jsonpath-plus": "^10.3.0",
|
"jsonpath-plus": "^10.3.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/payload-automation",
|
"name": "@xtr-dev/payload-automation",
|
||||||
"version": "0.0.11",
|
"version": "0.0.12",
|
||||||
"description": "PayloadCMS Automation Plugin - Comprehensive workflow automation system with visual workflow building, execution tracking, and step types",
|
"description": "PayloadCMS Automation Plugin - Comprehensive workflow automation system with visual workflow building, execution tracking, and step types",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
14
src/index.ts
14
src/index.ts
@@ -1,10 +1,16 @@
|
|||||||
// Main export contains only types and client-safe utilities
|
// Main export contains only types and client-safe utilities
|
||||||
// Server-side functions are exported via '@xtr-dev/payload-automation/server'
|
// Server-side functions are exported via '@xtr-dev/payload-automation/server'
|
||||||
|
|
||||||
// Types only - safe for client bundling
|
// Pure types only - completely safe for client bundling
|
||||||
export type { CustomTriggerOptions, TriggerResult } from './core/trigger-custom-workflow.js'
|
export type {
|
||||||
export type { ExecutionContext, Workflow, WorkflowStep, WorkflowTrigger } from './core/workflow-executor.js'
|
CustomTriggerOptions,
|
||||||
export type { WorkflowsPluginConfig } from './plugin/config-types.js'
|
TriggerResult,
|
||||||
|
ExecutionContext,
|
||||||
|
Workflow,
|
||||||
|
WorkflowStep,
|
||||||
|
WorkflowTrigger,
|
||||||
|
WorkflowsPluginConfig
|
||||||
|
} from './types/index.js'
|
||||||
|
|
||||||
// Server-side functions are NOT re-exported here to avoid bundling issues
|
// Server-side functions are NOT re-exported here to avoid bundling issues
|
||||||
// Import server-side functions from the /server export instead
|
// Import server-side functions from the /server export instead
|
||||||
|
|||||||
62
src/types/index.ts
Normal file
62
src/types/index.ts
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
// Pure type definitions for client-safe exports
|
||||||
|
// This file contains NO runtime code and can be safely bundled
|
||||||
|
|
||||||
|
export interface CustomTriggerOptions {
|
||||||
|
workflowId: string
|
||||||
|
triggerData?: any
|
||||||
|
req?: any // PayloadRequest type, but avoiding import to keep this client-safe
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TriggerResult {
|
||||||
|
success: boolean
|
||||||
|
runId?: string
|
||||||
|
error?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ExecutionContext {
|
||||||
|
trigger: {
|
||||||
|
type: string
|
||||||
|
doc?: any
|
||||||
|
data?: any
|
||||||
|
}
|
||||||
|
steps: Record<string, {
|
||||||
|
output?: any
|
||||||
|
state: 'pending' | 'running' | 'succeeded' | 'failed'
|
||||||
|
}>
|
||||||
|
payload: any // Payload instance
|
||||||
|
req: any // PayloadRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkflowStep {
|
||||||
|
id: string
|
||||||
|
type: string
|
||||||
|
input: Record<string, any>
|
||||||
|
dependencies?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkflowTrigger {
|
||||||
|
type: 'collection' | 'global' | 'webhook' | 'cron' | 'manual'
|
||||||
|
collection?: string
|
||||||
|
global?: string
|
||||||
|
event?: 'create' | 'update' | 'delete' | 'read'
|
||||||
|
path?: string
|
||||||
|
cron?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Workflow {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
description?: string
|
||||||
|
active: boolean
|
||||||
|
triggers: WorkflowTrigger[]
|
||||||
|
steps: WorkflowStep[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkflowsPluginConfig {
|
||||||
|
collections?: string[]
|
||||||
|
globals?: string[]
|
||||||
|
logging?: {
|
||||||
|
level?: 'debug' | 'info' | 'warn' | 'error'
|
||||||
|
enabled?: boolean
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user