import { z } from 'zod';

// src/automation/workflow.zod.ts
z.string().min(2, { message: "System identifier must be at least 2 characters" }).regex(/^[a-z][a-z0-9_.]*$/, {
  message: 'System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., "user_profile" or "order.created")'
}).describe("System identifier (lowercase with underscores or dots)");
var SnakeCaseIdentifierSchema = z.string().min(2, { message: "Identifier must be at least 2 characters" }).regex(/^[a-z][a-z0-9_]*$/, {
  message: 'Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., "user_profile")'
}).describe("Snake case identifier (lowercase with underscores only)");
z.string().min(3, { message: "Event name must be at least 3 characters" }).regex(/^[a-z][a-z0-9_.]*$/, {
  message: 'Event name must be lowercase with dots for namespacing (e.g., "user.created", "order.paid")'
}).describe("Event name (lowercase with dot notation for namespacing)");

// src/automation/workflow.zod.ts
var WorkflowTriggerType = z.enum([
  "on_create",
  // When record is created
  "on_update",
  // When record is updated
  "on_create_or_update",
  // Both
  "on_delete",
  // When record is deleted
  "schedule"
  // Time-based (cron)
]);
var FieldUpdateActionSchema = z.object({
  name: z.string().describe("Action name"),
  type: z.literal("field_update"),
  field: z.string().describe("Field to update"),
  value: z.unknown().describe("Value or Formula to set")
});
var EmailAlertActionSchema = z.object({
  name: z.string().describe("Action name"),
  type: z.literal("email_alert"),
  template: z.string().describe("Email template ID/DevName"),
  recipients: z.array(z.string()).describe("List of recipient emails or user IDs")
});
var ConnectorActionRefSchema = z.object({
  name: z.string().describe("Action name"),
  type: z.literal("connector_action"),
  connectorId: z.string().describe("Target Connector ID (e.g. slack, twilio)"),
  actionId: z.string().describe("Target Action ID (e.g. send_message)"),
  input: z.record(z.string(), z.unknown()).describe("Input parameters matching the action schema")
});
var HttpCallActionSchema = z.object({
  name: z.string().describe("Action name"),
  type: z.literal("http_call"),
  url: z.string().describe("Target URL"),
  method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).default("POST").describe("HTTP Method"),
  headers: z.record(z.string(), z.string()).optional().describe("HTTP Headers"),
  body: z.string().optional().describe("Request body (JSON or text)")
});
var TaskCreationActionSchema = z.object({
  name: z.string().describe("Action name"),
  type: z.literal("task_creation"),
  taskObject: z.string().describe('Task object name (e.g., "task", "project_task")'),
  subject: z.string().describe("Task subject/title"),
  description: z.string().optional().describe("Task description"),
  assignedTo: z.string().optional().describe("User ID or field reference for assignee"),
  dueDate: z.string().optional().describe("Due date (ISO string or formula)"),
  priority: z.string().optional().describe("Task priority"),
  relatedTo: z.string().optional().describe("Related record ID or field reference"),
  additionalFields: z.record(z.string(), z.unknown()).optional().describe("Additional custom fields")
});
var PushNotificationActionSchema = z.object({
  name: z.string().describe("Action name"),
  type: z.literal("push_notification"),
  title: z.string().describe("Notification title"),
  body: z.string().describe("Notification body text"),
  recipients: z.array(z.string()).describe("User IDs or device tokens"),
  data: z.record(z.string(), z.unknown()).optional().describe("Additional data payload"),
  badge: z.number().optional().describe("Badge count (iOS)"),
  sound: z.string().optional().describe("Notification sound"),
  clickAction: z.string().optional().describe("Action/URL when notification is clicked")
});
var CustomScriptActionSchema = z.object({
  name: z.string().describe("Action name"),
  type: z.literal("custom_script"),
  language: z.enum(["javascript", "typescript", "python"]).default("javascript").describe("Script language"),
  code: z.string().describe("Script code to execute"),
  timeout: z.number().default(3e4).describe("Execution timeout in milliseconds"),
  context: z.record(z.string(), z.unknown()).optional().describe("Additional context variables")
});
var WorkflowActionSchema = z.discriminatedUnion("type", [
  FieldUpdateActionSchema,
  EmailAlertActionSchema,
  HttpCallActionSchema,
  ConnectorActionRefSchema,
  TaskCreationActionSchema,
  PushNotificationActionSchema,
  CustomScriptActionSchema
]);
var TimeTriggerSchema = z.object({
  id: z.string().optional().describe("Unique identifier"),
  /** Timing Logic */
  timeLength: z.number().int().describe("Duration amount (e.g. 1, 30)"),
  timeUnit: z.enum(["minutes", "hours", "days"]).describe("Unit of time"),
  /** Reference Point */
  offsetDirection: z.enum(["before", "after"]).describe("Before or After the reference date"),
  offsetFrom: z.enum(["trigger_date", "date_field"]).describe("Basis for calculation"),
  dateField: z.string().optional().describe("Date field to calculate from (required if offsetFrom is date_field)"),
  /** Actions */
  actions: z.array(WorkflowActionSchema).describe("Actions to execute at the scheduled time")
});
var WorkflowRuleSchema = z.object({
  /** Machine name */
  name: SnakeCaseIdentifierSchema.describe("Unique workflow name (lowercase snake_case)"),
  /** Target Object */
  objectName: z.string().describe("Target Object"),
  /** When to evaluate the rule */
  triggerType: WorkflowTriggerType.describe("When to evaluate"),
  /** 
   * Condition to start the workflow.
   * If empty, runs on every trigger event.
   */
  criteria: z.string().optional().describe("Formula condition. If TRUE, actions execute."),
  /** Actions to execute immediately */
  actions: z.array(WorkflowActionSchema).optional().describe("Immediate actions"),
  /** 
   * Time-Dependent Actions 
   * Actions scheduled to run in the future.
   */
  timeTriggers: z.array(TimeTriggerSchema).optional().describe("Scheduled actions relative to trigger or date field"),
  /** Active status */
  active: z.boolean().default(true).describe("Whether this workflow is active"),
  /** Execution Order */
  executionOrder: z.number().int().min(0).default(100).describe("Deterministic execution order when multiple workflows match (lower runs first)"),
  /** Recursion Control */
  reevaluateOnChange: z.boolean().default(false).describe("Re-evaluate rule if field updates change the record validity")
});
var FlowNodeAction = z.enum([
  "start",
  // Trigger
  "end",
  // Return/Stop
  "decision",
  // If/Else logic
  "assignment",
  // Set Variable
  "loop",
  // For Each
  "create_record",
  // CRUD: Create
  "update_record",
  // CRUD: Update
  "delete_record",
  // CRUD: Delete
  "get_record",
  // CRUD: Get/Query
  "http_request",
  // Webhook/API Call
  "script",
  // Custom Script (JS/TS)
  "screen",
  // Screen / User-Input Element
  "wait",
  // Delay/Sleep
  "subflow",
  // Call another flow
  "connector_action"
  // Zapier-style integration action
]);
var FlowVariableSchema = z.object({
  name: z.string().describe("Variable name"),
  type: z.string().describe("Data type (text, number, boolean, object, list)"),
  isInput: z.boolean().default(false).describe("Is input parameter"),
  isOutput: z.boolean().default(false).describe("Is output parameter")
});
var FlowNodeSchema = z.object({
  id: z.string().describe("Node unique ID"),
  type: FlowNodeAction.describe("Action type"),
  label: z.string().describe("Node label"),
  /** Node Configuration Options (Specific to type) */
  config: z.record(z.string(), z.unknown()).optional().describe("Node configuration"),
  /** 
   * Connector Action Configuration
   * Used when type is 'connector_action'
   */
  connectorConfig: z.object({
    connectorId: z.string(),
    actionId: z.string(),
    input: z.record(z.string(), z.unknown()).describe("Mapped inputs for the action")
  }).optional(),
  /** UI Position (for the canvas) */
  position: z.object({ x: z.number(), y: z.number() }).optional()
});
var FlowEdgeSchema = z.object({
  id: z.string().describe("Edge unique ID"),
  source: z.string().describe("Source Node ID"),
  target: z.string().describe("Target Node ID"),
  /** Condition for this path (only for decision/branch nodes) */
  condition: z.string().optional().describe("Expression returning boolean used for branching"),
  type: z.enum(["default", "fault"]).default("default").describe("Connection type: Standard (Success) or Fault (Error) path"),
  label: z.string().optional().describe("Label on the connector")
});
var FlowSchema = z.object({
  /** Identity */
  name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Machine name"),
  label: z.string().describe("Flow label"),
  description: z.string().optional(),
  /** Metadata & Versioning */
  version: z.number().int().default(1).describe("Version number"),
  status: z.enum(["draft", "active", "obsolete", "invalid"]).default("draft").describe("Deployment status"),
  template: z.boolean().default(false).describe("Is logic template (Subflow)"),
  /** Trigger Type */
  type: z.enum(["autolaunched", "record_change", "schedule", "screen", "api"]).describe("Flow type"),
  /** Configuration Variables */
  variables: z.array(FlowVariableSchema).optional().describe("Flow variables"),
  /** Graph Definition */
  nodes: z.array(FlowNodeSchema).describe("Flow nodes"),
  edges: z.array(FlowEdgeSchema).describe("Flow connections"),
  /** Execution Config */
  active: z.boolean().default(false).describe("Is active (Deprecated: use status)"),
  runAs: z.enum(["system", "user"]).default("user").describe("Execution context"),
  /** Error Handling Strategy */
  errorHandling: z.object({
    strategy: z.enum(["fail", "retry", "continue"]).default("fail").describe("How to handle node execution errors"),
    maxRetries: z.number().int().min(0).max(10).default(0).describe("Number of retry attempts (only for retry strategy)"),
    retryDelayMs: z.number().int().min(0).default(1e3).describe("Delay between retries in milliseconds"),
    fallbackNodeId: z.string().optional().describe("Node ID to jump to on unrecoverable error")
  }).optional().describe("Flow-level error handling configuration")
});
function defineFlow(config) {
  return FlowSchema.parse(config);
}
var WebhookTriggerType = z.enum([
  "create",
  "update",
  "delete",
  "undelete",
  "api"
  // Manually triggered
]);
var WebhookSchema = z.object({
  name: SnakeCaseIdentifierSchema.describe("Webhook unique name (lowercase snake_case)"),
  label: z.string().optional().describe("Human-readable webhook label"),
  /** Scope */
  object: z.string().optional().describe("Object to listen to (optional for manual webhooks)"),
  triggers: z.array(WebhookTriggerType).optional().describe("Events that trigger execution"),
  /** Target */
  url: z.string().url().describe("External webhook endpoint URL"),
  method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).default("POST").describe("HTTP method"),
  /** Headers */
  headers: z.record(z.string(), z.string()).optional().describe("Custom HTTP headers"),
  /** Body/Payload */
  body: z.unknown().optional().describe("Request body payload (if not using default record data)"),
  /** Payload Configuration */
  payloadFields: z.array(z.string()).optional().describe("Fields to include. Empty = All"),
  includeSession: z.boolean().default(false).describe("Include user session info"),
  /** Authentication */
  authentication: z.object({
    type: z.enum(["none", "bearer", "basic", "api-key"]).describe("Authentication type"),
    credentials: z.record(z.string(), z.string()).optional().describe("Authentication credentials")
  }).optional().describe("Authentication configuration"),
  /** Retry Policy */
  retryPolicy: z.object({
    maxRetries: z.number().int().min(0).max(10).default(3).describe("Maximum retry attempts"),
    backoffStrategy: z.enum(["exponential", "linear", "fixed"]).default("exponential").describe("Backoff strategy"),
    initialDelayMs: z.number().int().min(100).default(1e3).describe("Initial retry delay in milliseconds"),
    maxDelayMs: z.number().int().min(1e3).default(6e4).describe("Maximum retry delay in milliseconds")
  }).optional().describe("Retry policy configuration"),
  /** Timeout */
  timeoutMs: z.number().int().min(1e3).max(3e5).default(3e4).describe("Request timeout in milliseconds"),
  /** Security */
  secret: z.string().optional().describe("Signing secret for HMAC signature verification"),
  /** Status */
  isActive: z.boolean().default(true).describe("Whether webhook is active"),
  /** Metadata */
  description: z.string().optional().describe("Webhook description"),
  tags: z.array(z.string()).optional().describe("Tags for organization")
});
var WebhookReceiverSchema = z.object({
  name: SnakeCaseIdentifierSchema.describe("Webhook receiver unique name (lowercase snake_case)"),
  path: z.string().describe("URL Path (e.g. /webhooks/stripe)"),
  /** Verification */
  verificationType: z.enum(["none", "header_token", "hmac", "ip_whitelist"]).default("none"),
  verificationParams: z.object({
    header: z.string().optional(),
    secret: z.string().optional(),
    ips: z.array(z.string()).optional()
  }).optional(),
  /** Action */
  action: z.enum(["trigger_flow", "script", "upsert_record"]).default("trigger_flow"),
  target: z.string().describe("Flow ID or Script name")
});
var ApproverType = z.enum([
  "user",
  // Specific user(s)
  "role",
  // Users with specific role
  "manager",
  // Submitter's manager
  "field",
  // User ID defined in a record field
  "queue"
  // Data ownership queue
]);
var ApprovalActionType = z.enum([
  "field_update",
  "email_alert",
  "webhook",
  "script",
  "connector_action"
  // Added for Zapier-style integrations
]);
var ApprovalActionSchema = z.object({
  type: ApprovalActionType,
  name: z.string().describe("Action name"),
  config: z.record(z.string(), z.unknown()).describe("Action configuration"),
  /** For connector actions */
  connectorId: z.string().optional(),
  actionId: z.string().optional()
});
var ApprovalStepSchema = z.object({
  name: SnakeCaseIdentifierSchema.describe("Step machine name"),
  label: z.string().describe("Step display label"),
  description: z.string().optional(),
  /** Entry criteria for this step */
  entryCriteria: z.string().optional().describe("Formula expression to enter this step"),
  /** Who can approve */
  approvers: z.array(z.object({
    type: ApproverType,
    value: z.string().describe("User ID, Role Name, or Field Name")
  })).min(1).describe("List of allowed approvers"),
  /** Approval Logic */
  behavior: z.enum(["first_response", "unanimous"]).default("first_response").describe("How to handle multiple approvers"),
  /** Rejection behavior */
  rejectionBehavior: z.enum(["reject_process", "back_to_previous"]).default("reject_process").describe("What happens if rejected"),
  /** Actions */
  onApprove: z.array(ApprovalActionSchema).optional().describe("Actions on step approval"),
  onReject: z.array(ApprovalActionSchema).optional().describe("Actions on step rejection")
});
var ApprovalProcessSchema = z.object({
  name: SnakeCaseIdentifierSchema.describe("Unique process name"),
  label: z.string().describe("Human readable label"),
  object: z.string().describe("Target Object Name"),
  active: z.boolean().default(false),
  description: z.string().optional(),
  /** Entry Criteria for the entire process */
  entryCriteria: z.string().optional().describe("Formula to allow submission"),
  /** Record Locking */
  lockRecord: z.boolean().default(true).describe("Lock record from editing during approval"),
  /** Steps */
  steps: z.array(ApprovalStepSchema).min(1).describe("Sequence of approval steps"),
  /** Escalation Configuration (SLA-based auto-escalation) */
  escalation: z.object({
    enabled: z.boolean().default(false).describe("Enable SLA-based escalation"),
    timeoutHours: z.number().min(1).describe("Hours before escalation triggers"),
    action: z.enum(["reassign", "auto_approve", "auto_reject", "notify"]).default("notify").describe("Action to take on escalation timeout"),
    escalateTo: z.string().optional().describe("User ID, role, or manager level to escalate to"),
    notifySubmitter: z.boolean().default(true).describe("Notify the original submitter on escalation")
  }).optional().describe("SLA escalation configuration for pending approval steps"),
  /** Global Actions */
  onSubmit: z.array(ApprovalActionSchema).optional().describe("Actions on initial submission"),
  onFinalApprove: z.array(ApprovalActionSchema).optional().describe("Actions on final approval"),
  onFinalReject: z.array(ApprovalActionSchema).optional().describe("Actions on final rejection"),
  onRecall: z.array(ApprovalActionSchema).optional().describe("Actions on recall")
});
var ApprovalProcess = Object.assign(ApprovalProcessSchema, {
  create: (config) => config
});
var ETLEndpointTypeSchema = z.enum([
  "database",
  // SQL/NoSQL databases
  "api",
  // REST/GraphQL APIs
  "file",
  // CSV, JSON, XML, Excel files
  "stream",
  // Kafka, RabbitMQ, Kinesis
  "object",
  // ObjectStack object
  "warehouse",
  // Data warehouse (Snowflake, BigQuery, Redshift)
  "storage",
  // S3, Azure Blob, Google Cloud Storage
  "spreadsheet"
  // Google Sheets, Excel Online
]);
var ETLSourceSchema = z.object({
  /**
   * Source type
   */
  type: ETLEndpointTypeSchema.describe("Source type"),
  /**
   * Connector identifier
   * References a registered connector
   * 
   * @example "salesforce", "postgres", "mysql", "s3"
   */
  connector: z.string().optional().describe("Connector ID"),
  /**
   * Source-specific configuration
   * Structure varies by source type
   * 
   * @example For database: { table: 'customers', schema: 'public' }
   * @example For API: { endpoint: '/api/users', method: 'GET' }
   * @example For file: { path: 's3://bucket/data.csv', format: 'csv' }
   */
  config: z.record(z.string(), z.unknown()).describe("Source configuration"),
  /**
   * Incremental sync configuration
   * Allows extracting only changed data
   */
  incremental: z.object({
    enabled: z.boolean().default(false),
    cursorField: z.string().describe("Field to track progress (e.g., updated_at)"),
    cursorValue: z.unknown().optional().describe("Last processed value")
  }).optional().describe("Incremental extraction config")
});
var ETLDestinationSchema = z.object({
  /**
   * Destination type
   */
  type: ETLEndpointTypeSchema.describe("Destination type"),
  /**
   * Connector identifier
   */
  connector: z.string().optional().describe("Connector ID"),
  /**
   * Destination-specific configuration
   */
  config: z.record(z.string(), z.unknown()).describe("Destination configuration"),
  /**
   * Write mode
   */
  writeMode: z.enum([
    "append",
    // Add new records
    "overwrite",
    // Replace all data
    "upsert",
    // Insert or update based on key
    "merge"
    // Smart merge based on business rules
  ]).default("append").describe("How to write data"),
  /**
   * Primary key fields for upsert/merge
   */
  primaryKey: z.array(z.string()).optional().describe("Primary key fields")
});
var ETLTransformationTypeSchema = z.enum([
  "map",
  // Field mapping/renaming
  "filter",
  // Row filtering
  "aggregate",
  // Aggregation/grouping
  "join",
  // Joining with other data
  "script",
  // Custom JavaScript/Python script
  "lookup",
  // Enrich with lookup data
  "split",
  // Split one record into multiple
  "merge",
  // Merge multiple records into one
  "normalize",
  // Data normalization
  "deduplicate"
  // Remove duplicates
]);
var ETLTransformationSchema = z.object({
  /**
   * Transformation name
   */
  name: z.string().optional().describe("Transformation name"),
  /**
   * Transformation type
   */
  type: ETLTransformationTypeSchema.describe("Transformation type"),
  /**
   * Transformation-specific configuration
   * 
   * @example For map: { oldField: 'newField' }
   * @example For filter: { condition: 'status == "active"' }
   * @example For script: { language: 'javascript', code: '...' }
   */
  config: z.record(z.string(), z.unknown()).describe("Transformation config"),
  /**
   * Whether to continue on error
   */
  continueOnError: z.boolean().default(false).describe("Continue on error")
});
var ETLSyncModeSchema = z.enum([
  "full",
  // Full refresh - extract all data every time
  "incremental",
  // Only extract changed data
  "cdc"
  // Change Data Capture - real-time streaming
]);
var ETLPipelineSchema = z.object({
  /**
   * Pipeline identifier (snake_case)
   */
  name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Pipeline identifier (snake_case)"),
  /**
   * Human-readable pipeline name
   */
  label: z.string().optional().describe("Pipeline display name"),
  /**
   * Pipeline description
   */
  description: z.string().optional().describe("Pipeline description"),
  /**
   * Data source configuration
   */
  source: ETLSourceSchema.describe("Data source"),
  /**
   * Data destination configuration
   */
  destination: ETLDestinationSchema.describe("Data destination"),
  /**
   * Transformation steps
   * Applied in order from source to destination
   */
  transformations: z.array(ETLTransformationSchema).optional().describe("Transformation pipeline"),
  /**
   * Sync mode
   */
  syncMode: ETLSyncModeSchema.default("full").describe("Sync mode"),
  /**
   * Execution schedule (cron expression)
   * 
   * @example "0 2 * * *" - Daily at 2 AM
   * @example "0 *\/4 * * *" - Every 4 hours
   * @example "0 0 * * 0" - Weekly on Sunday
   */
  schedule: z.string().optional().describe("Cron schedule expression"),
  /**
   * Whether pipeline is enabled
   */
  enabled: z.boolean().default(true).describe("Pipeline enabled status"),
  /**
   * Retry configuration for failed runs
   */
  retry: z.object({
    maxAttempts: z.number().int().min(0).default(3).describe("Max retry attempts"),
    backoffMs: z.number().int().min(0).default(6e4).describe("Backoff in milliseconds")
  }).optional().describe("Retry configuration"),
  /**
   * Notification configuration
   */
  notifications: z.object({
    onSuccess: z.array(z.string()).optional().describe("Email addresses for success notifications"),
    onFailure: z.array(z.string()).optional().describe("Email addresses for failure notifications")
  }).optional().describe("Notification settings"),
  /**
   * Pipeline tags for organization
   */
  tags: z.array(z.string()).optional().describe("Pipeline tags"),
  /**
   * Custom metadata
   */
  metadata: z.record(z.string(), z.unknown()).optional().describe("Custom metadata")
});
var ETLRunStatusSchema = z.enum([
  "pending",
  // Queued for execution
  "running",
  // Currently executing
  "succeeded",
  // Completed successfully
  "failed",
  // Failed with errors
  "cancelled",
  // Manually cancelled
  "timeout"
  // Timed out
]);
var ETLPipelineRunSchema = z.object({
  /**
   * Run ID
   */
  id: z.string().describe("Run identifier"),
  /**
   * Pipeline name
   */
  pipelineName: z.string().describe("Pipeline name"),
  /**
   * Run status
   */
  status: ETLRunStatusSchema.describe("Run status"),
  /**
   * Start timestamp
   */
  startedAt: z.string().datetime().describe("Start time"),
  /**
   * End timestamp
   */
  completedAt: z.string().datetime().optional().describe("Completion time"),
  /**
   * Duration in milliseconds
   */
  durationMs: z.number().optional().describe("Duration in ms"),
  /**
   * Statistics
   */
  stats: z.object({
    recordsRead: z.number().int().default(0).describe("Records extracted"),
    recordsWritten: z.number().int().default(0).describe("Records loaded"),
    recordsErrored: z.number().int().default(0).describe("Records with errors"),
    bytesProcessed: z.number().int().default(0).describe("Bytes processed")
  }).optional().describe("Run statistics"),
  /**
   * Error information
   */
  error: z.object({
    message: z.string().describe("Error message"),
    code: z.string().optional().describe("Error code"),
    details: z.unknown().optional().describe("Error details")
  }).optional().describe("Error information"),
  /**
   * Execution logs
   */
  logs: z.array(z.string()).optional().describe("Execution logs")
});
var ETL = {
  /**
   * Create a simple database-to-database pipeline
   */
  databaseSync: (params) => ({
    name: params.name,
    source: {
      type: "database",
      config: { table: params.sourceTable }
    },
    destination: {
      type: "database",
      config: { table: params.destTable },
      writeMode: "upsert"
    },
    syncMode: "incremental",
    schedule: params.schedule,
    enabled: true
  }),
  /**
   * Create an API to database pipeline
   */
  apiToDatabase: (params) => ({
    name: params.name,
    source: {
      type: "api",
      connector: params.apiConnector,
      config: {}
    },
    destination: {
      type: "database",
      config: { table: params.destTable },
      writeMode: "append"
    },
    syncMode: "full",
    schedule: params.schedule,
    enabled: true
  })
};
var ConnectorCategorySchema = z.enum([
  "crm",
  // Customer Relationship Management
  "payment",
  // Payment processors
  "communication",
  // Email, SMS, Chat
  "storage",
  // File storage
  "analytics",
  // Analytics platforms
  "database",
  // Databases
  "marketing",
  // Marketing automation
  "accounting",
  // Accounting software
  "hr",
  // Human resources
  "productivity",
  // Productivity tools
  "ecommerce",
  // E-commerce platforms
  "support",
  // Customer support
  "devtools",
  // Developer tools
  "social",
  // Social media
  "other"
  // Other category
]);
var AuthenticationTypeSchema = z.enum([
  "none",
  // No authentication
  "apiKey",
  // API key
  "basic",
  // Basic auth (username/password)
  "bearer",
  // Bearer token
  "oauth1",
  // OAuth 1.0
  "oauth2",
  // OAuth 2.0
  "custom"
  // Custom authentication
]);
var AuthFieldSchema = z.object({
  /**
   * Field name (machine name)
   */
  name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Field name (snake_case)"),
  /**
   * Field label
   */
  label: z.string().describe("Field label"),
  /**
   * Field type
   */
  type: z.enum(["text", "password", "url", "select"]).default("text").describe("Field type"),
  /**
   * Field description
   */
  description: z.string().optional().describe("Field description"),
  /**
   * Whether field is required
   */
  required: z.boolean().default(true).describe("Required field"),
  /**
   * Default value
   */
  default: z.string().optional().describe("Default value"),
  /**
   * Options for select fields
   */
  options: z.array(z.object({
    label: z.string(),
    value: z.string()
  })).optional().describe("Select field options"),
  /**
   * Placeholder text
   */
  placeholder: z.string().optional().describe("Placeholder text")
});
var OAuth2ConfigSchema = z.object({
  /**
   * Authorization URL
   */
  authorizationUrl: z.string().url().describe("Authorization endpoint URL"),
  /**
   * Token URL
   */
  tokenUrl: z.string().url().describe("Token endpoint URL"),
  /**
   * Scopes to request
   */
  scopes: z.array(z.string()).optional().describe("OAuth scopes"),
  /**
   * Client ID field name
   */
  clientIdField: z.string().default("client_id").describe("Client ID field name"),
  /**
   * Client secret field name
   */
  clientSecretField: z.string().default("client_secret").describe("Client secret field name")
});
var AuthenticationSchema = z.object({
  /**
   * Authentication type
   */
  type: AuthenticationTypeSchema.describe("Authentication type"),
  /**
   * Authentication fields
   * Configuration fields needed for this auth type
   */
  fields: z.array(AuthFieldSchema).optional().describe("Authentication fields"),
  /**
   * OAuth 2.0 configuration (when type is oauth2)
   */
  oauth2: OAuth2ConfigSchema.optional().describe("OAuth 2.0 configuration"),
  /**
   * Test authentication instructions
   */
  test: z.object({
    url: z.string().optional().describe("Test endpoint URL"),
    method: z.enum(["GET", "POST", "PUT", "DELETE"]).default("GET").describe("HTTP method")
  }).optional().describe("Authentication test configuration")
});
var OperationTypeSchema = z.enum([
  "read",
  // Read/query data
  "write",
  // Create/update data
  "delete",
  // Delete data
  "search",
  // Search operation
  "trigger",
  // Webhook/polling trigger
  "action"
  // Custom action
]);
var OperationParameterSchema = z.object({
  /**
   * Parameter name
   */
  name: z.string().describe("Parameter name"),
  /**
   * Parameter label
   */
  label: z.string().describe("Parameter label"),
  /**
   * Parameter description
   */
  description: z.string().optional().describe("Parameter description"),
  /**
   * Parameter type
   */
  type: z.enum(["string", "number", "boolean", "array", "object", "date", "file"]).describe("Parameter type"),
  /**
   * Whether parameter is required
   */
  required: z.boolean().default(false).describe("Required parameter"),
  /**
   * Default value
   */
  default: z.unknown().optional().describe("Default value"),
  /**
   * Validation schema
   */
  validation: z.record(z.string(), z.unknown()).optional().describe("Validation rules"),
  /**
   * Dynamic options function
   */
  dynamicOptions: z.string().optional().describe("Function to load dynamic options")
});
var ConnectorOperationSchema = z.object({
  /**
   * Operation identifier
   */
  id: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Operation ID (snake_case)"),
  /**
   * Operation name
   */
  name: z.string().describe("Operation name"),
  /**
   * Operation description
   */
  description: z.string().optional().describe("Operation description"),
  /**
   * Operation type
   */
  type: OperationTypeSchema.describe("Operation type"),
  /**
   * Input parameters
   */
  inputSchema: z.array(OperationParameterSchema).optional().describe("Input parameters"),
  /**
   * Output schema
   */
  outputSchema: z.record(z.string(), z.unknown()).optional().describe("Output schema"),
  /**
   * Sample output for documentation
   */
  sampleOutput: z.unknown().optional().describe("Sample output"),
  /**
   * Whether operation supports pagination
   */
  supportsPagination: z.boolean().default(false).describe("Supports pagination"),
  /**
   * Whether operation supports filtering
   */
  supportsFiltering: z.boolean().default(false).describe("Supports filtering")
});
var ConnectorTriggerSchema = z.object({
  /**
   * Trigger identifier
   */
  id: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Trigger ID (snake_case)"),
  /**
   * Trigger name
   */
  name: z.string().describe("Trigger name"),
  /**
   * Trigger description
   */
  description: z.string().optional().describe("Trigger description"),
  /**
   * Trigger type
   */
  type: z.enum(["webhook", "polling", "stream"]).describe("Trigger mechanism"),
  /**
   * Trigger configuration
   */
  config: z.record(z.string(), z.unknown()).optional().describe("Trigger configuration"),
  /**
   * Output schema
   */
  outputSchema: z.record(z.string(), z.unknown()).optional().describe("Event payload schema"),
  /**
   * Polling interval (for polling triggers)
   * In milliseconds
   */
  pollingIntervalMs: z.number().int().min(1e3).optional().describe("Polling interval in ms")
});
var ConnectorSchema = z.object({
  /**
   * Connector identifier
   * Must be globally unique
   */
  id: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Connector ID (snake_case)"),
  /**
   * Connector name
   */
  name: z.string().describe("Connector name"),
  /**
   * Connector description
   */
  description: z.string().optional().describe("Connector description"),
  /**
   * Connector version (semver)
   */
  version: z.string().optional().describe("Connector version"),
  /**
   * Connector icon URL or name
   */
  icon: z.string().optional().describe("Connector icon"),
  /**
   * Connector category
   */
  category: ConnectorCategorySchema.describe("Connector category"),
  /**
   * Base URL for API calls
   */
  baseUrl: z.string().url().optional().describe("API base URL"),
  /**
   * Authentication configuration
   */
  authentication: AuthenticationSchema.describe("Authentication config"),
  /**
   * Available operations
   */
  operations: z.array(ConnectorOperationSchema).optional().describe("Connector operations"),
  /**
   * Available triggers
   */
  triggers: z.array(ConnectorTriggerSchema).optional().describe("Connector triggers"),
  /**
   * Rate limiting information
   */
  rateLimit: z.object({
    requestsPerSecond: z.number().optional().describe("Max requests per second"),
    requestsPerMinute: z.number().optional().describe("Max requests per minute"),
    requestsPerHour: z.number().optional().describe("Max requests per hour")
  }).optional().describe("Rate limiting"),
  /**
   * Connector author
   */
  author: z.string().optional().describe("Connector author"),
  /**
   * Documentation URL
   */
  documentation: z.string().url().optional().describe("Documentation URL"),
  /**
   * Homepage URL
   */
  homepage: z.string().url().optional().describe("Homepage URL"),
  /**
   * License
   */
  license: z.string().optional().describe("License (SPDX identifier)"),
  /**
   * Tags for discovery
   */
  tags: z.array(z.string()).optional().describe("Connector tags"),
  /**
   * Whether connector is verified/certified
   */
  verified: z.boolean().default(false).describe("Verified connector"),
  /**
   * Custom metadata
   */
  metadata: z.record(z.string(), z.unknown()).optional().describe("Custom metadata")
});
var ConnectorInstanceSchema = z.object({
  /**
   * Instance ID
   */
  id: z.string().describe("Instance ID"),
  /**
   * Connector ID this instance uses
   */
  connectorId: z.string().describe("Connector ID"),
  /**
   * Instance name
   */
  name: z.string().describe("Instance name"),
  /**
   * Instance description
   */
  description: z.string().optional().describe("Instance description"),
  /**
   * Authentication credentials (encrypted)
   */
  credentials: z.record(z.string(), z.unknown()).describe("Encrypted credentials"),
  /**
   * Additional configuration
   */
  config: z.record(z.string(), z.unknown()).optional().describe("Additional config"),
  /**
   * Whether instance is active
   */
  active: z.boolean().default(true).describe("Instance active status"),
  /**
   * Created timestamp
   */
  createdAt: z.string().datetime().optional().describe("Creation time"),
  /**
   * Last tested timestamp
   */
  lastTestedAt: z.string().datetime().optional().describe("Last test time"),
  /**
   * Test status
   */
  testStatus: z.enum(["unknown", "success", "failed"]).default("unknown").describe("Connection test status")
});
var Connector = {
  /**
   * Create a basic API key connector
   */
  apiKey: (params) => ({
    id: params.id,
    name: params.name,
    category: params.category,
    baseUrl: params.baseUrl,
    authentication: {
      type: "apiKey",
      fields: [
        {
          name: "api_key",
          label: "API Key",
          type: "password",
          required: true
        }
      ]
    },
    verified: false
  }),
  /**
   * Create an OAuth 2.0 connector
   */
  oauth2: (params) => ({
    id: params.id,
    name: params.name,
    category: params.category,
    baseUrl: params.baseUrl,
    authentication: {
      type: "oauth2",
      oauth2: {
        authorizationUrl: params.authUrl,
        tokenUrl: params.tokenUrl,
        clientIdField: "client_id",
        clientSecretField: "client_secret",
        scopes: params.scopes
      }
    },
    verified: false
  })
};
var TransformTypeSchema = z.discriminatedUnion("type", [
  z.object({
    type: z.literal("constant"),
    value: z.unknown().describe("Constant value to use")
  }).describe("Set a constant value"),
  z.object({
    type: z.literal("cast"),
    targetType: z.enum(["string", "number", "boolean", "date"]).describe("Target data type")
  }).describe("Cast to a specific data type"),
  z.object({
    type: z.literal("lookup"),
    table: z.string().describe("Lookup table name"),
    keyField: z.string().describe("Field to match on"),
    valueField: z.string().describe("Field to retrieve")
  }).describe("Lookup value from another table"),
  z.object({
    type: z.literal("javascript"),
    expression: z.string().describe('JavaScript expression (e.g., "value.toUpperCase()")')
  }).describe("Custom JavaScript transformation"),
  z.object({
    type: z.literal("map"),
    mappings: z.record(z.string(), z.unknown()).describe('Value mappings (e.g., {"Active": "active"})')
  }).describe("Map values using a dictionary")
]);
var FieldMappingSchema = z.object({
  /**
   * Source field name
   */
  source: z.string().describe("Source field name"),
  /**
   * Target field name (should be snake_case for ObjectStack)
   */
  target: z.string().describe("Target field name"),
  /**
   * Transformation to apply
   */
  transform: TransformTypeSchema.optional().describe("Transformation to apply"),
  /**
   * Default value if source is null/undefined
   */
  defaultValue: z.unknown().optional().describe("Default if source is null/undefined")
});

// src/automation/sync.zod.ts
var SyncDirectionSchema = z.enum([
  "push",
  // ObjectStack -> External (one-way)
  "pull",
  // External -> ObjectStack (one-way)
  "bidirectional"
  // Both directions
]);
var SyncModeSchema = z.enum([
  "full",
  // Full refresh every time
  "incremental",
  // Only sync changed records
  "realtime"
  // Real-time streaming sync
]);
var ConflictResolutionSchema = z.enum([
  "source_wins",
  // Source system always wins
  "destination_wins",
  // Destination system always wins
  "latest_wins",
  // Most recently modified wins
  "manual",
  // Flag for manual resolution
  "merge"
  // Smart merge (custom logic)
]);
var DataSourceConfigSchema = z.object({
  /**
   * Source object name
   * For ObjectStack objects
   */
  object: z.string().optional().describe("ObjectStack object name"),
  /**
   * Filter conditions
   * Only sync records matching these filters
   */
  filters: z.unknown().optional().describe("Filter conditions"),
  /**
   * Fields to include
   * If not specified, all fields are synced
   */
  fields: z.array(z.string()).optional().describe("Fields to sync"),
  /**
   * External connector instance ID
   * For external data sources
   */
  connectorInstanceId: z.string().optional().describe("Connector instance ID"),
  /**
   * External resource identifier
   * e.g., Salesforce object name, database table, API endpoint
   */
  externalResource: z.string().optional().describe("External resource ID")
});
var DataDestinationConfigSchema = z.object({
  /**
   * Destination object name
   * For ObjectStack objects
   */
  object: z.string().optional().describe("ObjectStack object name"),
  /**
   * Connector instance ID
   * For external destinations
   */
  connectorInstanceId: z.string().optional().describe("Connector instance ID"),
  /**
   * Operation to perform
   */
  operation: z.enum([
    "insert",
    // Create new records only
    "update",
    // Update existing records only
    "upsert",
    // Insert or update based on key
    "delete",
    // Delete records
    "sync"
    // Full synchronization
  ]).describe("Sync operation"),
  /**
   * Field mappings
   * Maps source fields to destination fields
   */
  mapping: z.union([
    z.record(z.string(), z.string()),
    // Simple mapping: { sourceField: 'destField' }
    z.array(FieldMappingSchema)
    // Advanced mapping with transformations
  ]).optional().describe("Field mappings"),
  /**
   * External resource identifier
   */
  externalResource: z.string().optional().describe("External resource ID"),
  /**
   * Match key for upsert operations
   * Fields to use for matching existing records
   */
  matchKey: z.array(z.string()).optional().describe("Match key fields")
});
var DataSyncConfigSchema = z.object({
  /**
   * Sync configuration name (snake_case)
   */
  name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Sync configuration name (snake_case)"),
  /**
   * Human-readable label
   */
  label: z.string().optional().describe("Sync display name"),
  /**
   * Description
   */
  description: z.string().optional().describe("Sync description"),
  /**
   * Source configuration
   */
  source: DataSourceConfigSchema.describe("Data source"),
  /**
   * Destination configuration
   */
  destination: DataDestinationConfigSchema.describe("Data destination"),
  /**
   * Sync direction
   */
  direction: SyncDirectionSchema.default("push").describe("Sync direction"),
  /**
   * Sync mode
   */
  syncMode: SyncModeSchema.default("incremental").describe("Sync mode"),
  /**
   * Conflict resolution strategy
   */
  conflictResolution: ConflictResolutionSchema.default("latest_wins").describe("Conflict resolution"),
  /**
   * Execution schedule (cron expression)
   * For scheduled syncs
   * 
   * @example "0 * * * *" - Hourly
   * @example "*\/15 * * * *" - Every 15 minutes
   */
  schedule: z.string().optional().describe("Cron schedule"),
  /**
   * Whether sync is enabled
   */
  enabled: z.boolean().default(true).describe("Sync enabled"),
  /**
   * Change tracking field
   * Field to track when records were last modified
   * Used for incremental sync
   * 
   * @example "updated_at", "modified_date"
   */
  changeTrackingField: z.string().optional().describe("Field for change tracking"),
  /**
   * Batch size
   * Number of records to process per batch
   */
  batchSize: z.number().int().min(1).max(1e4).default(100).describe("Batch size for processing"),
  /**
   * Retry configuration
   */
  retry: z.object({
    maxAttempts: z.number().int().min(0).default(3).describe("Max retries"),
    backoffMs: z.number().int().min(0).default(3e4).describe("Backoff duration")
  }).optional().describe("Retry configuration"),
  /**
   * Pre-sync validation rules
   */
  validation: z.object({
    required: z.array(z.string()).optional().describe("Required fields"),
    unique: z.array(z.string()).optional().describe("Unique constraint fields"),
    custom: z.array(z.object({
      name: z.string(),
      condition: z.string().describe("Validation condition"),
      message: z.string().describe("Error message")
    })).optional().describe("Custom validation rules")
  }).optional().describe("Validation rules"),
  /**
   * Error handling configuration
   */
  errorHandling: z.object({
    onValidationError: z.enum(["skip", "fail", "log"]).default("skip"),
    onSyncError: z.enum(["skip", "fail", "retry"]).default("retry"),
    notifyOnError: z.array(z.string()).optional().describe("Email notifications")
  }).optional().describe("Error handling"),
  /**
   * Performance optimization
   */
  optimization: z.object({
    parallelBatches: z.boolean().default(false).describe("Process batches in parallel"),
    cacheEnabled: z.boolean().default(true).describe("Enable caching"),
    compressionEnabled: z.boolean().default(false).describe("Enable compression")
  }).optional().describe("Performance optimization"),
  /**
   * Audit and logging
   */
  audit: z.object({
    logLevel: z.enum(["none", "error", "warn", "info", "debug"]).default("info"),
    retainLogsForDays: z.number().int().min(1).default(30),
    trackChanges: z.boolean().default(true).describe("Track all changes")
  }).optional().describe("Audit configuration"),
  /**
   * Tags for organization
   */
  tags: z.array(z.string()).optional().describe("Sync tags"),
  /**
   * Custom metadata
   */
  metadata: z.record(z.string(), z.unknown()).optional().describe("Custom metadata")
});
var SyncExecutionStatusSchema = z.enum([
  "pending",
  // Queued
  "running",
  // Currently executing
  "completed",
  // Successfully completed
  "partial",
  // Completed with some errors
  "failed",
  // Failed
  "cancelled"
  // Manually cancelled
]);
var SyncExecutionResultSchema = z.object({
  /**
   * Execution ID
   */
  id: z.string().describe("Execution ID"),
  /**
   * Sync configuration name
   */
  syncName: z.string().describe("Sync name"),
  /**
   * Execution status
   */
  status: SyncExecutionStatusSchema.describe("Execution status"),
  /**
   * Start timestamp
   */
  startedAt: z.string().datetime().describe("Start time"),
  /**
   * End timestamp
   */
  completedAt: z.string().datetime().optional().describe("Completion time"),
  /**
   * Duration in milliseconds
   */
  durationMs: z.number().optional().describe("Duration in ms"),
  /**
   * Statistics
   */
  stats: z.object({
    recordsProcessed: z.number().int().default(0).describe("Total records processed"),
    recordsInserted: z.number().int().default(0).describe("Records inserted"),
    recordsUpdated: z.number().int().default(0).describe("Records updated"),
    recordsDeleted: z.number().int().default(0).describe("Records deleted"),
    recordsSkipped: z.number().int().default(0).describe("Records skipped"),
    recordsErrored: z.number().int().default(0).describe("Records with errors"),
    conflictsDetected: z.number().int().default(0).describe("Conflicts detected"),
    conflictsResolved: z.number().int().default(0).describe("Conflicts resolved")
  }).optional().describe("Execution statistics"),
  /**
   * Errors encountered
   */
  errors: z.array(z.object({
    recordId: z.string().optional().describe("Record ID"),
    field: z.string().optional().describe("Field name"),
    message: z.string().describe("Error message"),
    code: z.string().optional().describe("Error code")
  })).optional().describe("Errors"),
  /**
   * Execution logs
   */
  logs: z.array(z.string()).optional().describe("Execution logs")
});
var Sync = {
  /**
   * Create a simple object-to-object sync
   */
  objectSync: (params) => ({
    name: params.name,
    source: {
      object: params.sourceObject
    },
    destination: {
      object: params.destObject,
      operation: "upsert",
      mapping: params.mapping
    },
    direction: "push",
    syncMode: "incremental",
    conflictResolution: "latest_wins",
    batchSize: 100,
    schedule: params.schedule,
    enabled: true
  }),
  /**
   * Create a connector sync
   */
  connectorSync: (params) => ({
    name: params.name,
    source: {
      object: params.sourceObject
    },
    destination: {
      connectorInstanceId: params.connectorInstanceId,
      externalResource: params.externalResource,
      operation: "upsert",
      mapping: params.mapping
    },
    direction: "push",
    syncMode: "incremental",
    conflictResolution: "latest_wins",
    batchSize: 100,
    schedule: params.schedule,
    enabled: true
  }),
  /**
   * Create a bidirectional sync
   */
  bidirectionalSync: (params) => ({
    name: params.name,
    source: {
      object: params.object
    },
    destination: {
      connectorInstanceId: params.connectorInstanceId,
      externalResource: params.externalResource,
      operation: "sync",
      mapping: params.mapping
    },
    direction: "bidirectional",
    syncMode: "incremental",
    conflictResolution: "latest_wins",
    batchSize: 100,
    schedule: params.schedule,
    enabled: true
  })
};
var ActionRefSchema = z.union([
  z.string().describe("Action Name"),
  z.object({
    type: z.string(),
    // e.g., 'xstate.assign', 'log', 'email'
    params: z.record(z.string(), z.unknown()).optional()
  })
]);
var GuardRefSchema = z.union([
  z.string().describe('Guard Name (e.g., "isManager", "amountGT1000")'),
  z.object({
    type: z.string(),
    params: z.record(z.string(), z.unknown()).optional()
  })
]);
var TransitionSchema = z.object({
  target: z.string().optional().describe("Target State ID"),
  cond: GuardRefSchema.optional().describe("Condition (Guard) required to take this path"),
  actions: z.array(ActionRefSchema).optional().describe("Actions to execute during transition"),
  description: z.string().optional().describe("Human readable description of this rule")
});
var EventSchema = z.object({
  type: z.string().describe('Event Type (e.g. "APPROVE", "REJECT", "Submit")'),
  // Payload validation schema could go here if we want deep validation
  schema: z.record(z.string(), z.unknown()).optional().describe("Expected event payload structure")
});
var StateNodeSchema = z.lazy(() => z.object({
  /** Type of state */
  type: z.enum(["atomic", "compound", "parallel", "final", "history"]).default("atomic"),
  /** Entry/Exit Actions */
  entry: z.array(ActionRefSchema).optional().describe("Actions to run when entering this state"),
  exit: z.array(ActionRefSchema).optional().describe("Actions to run when leaving this state"),
  /** Transitions (Events) */
  on: z.record(z.string(), z.union([
    z.string(),
    // Shorthand target
    TransitionSchema,
    z.array(TransitionSchema)
  ])).optional().describe("Map of Event Type -> Transition Definition"),
  /** Always Transitions (Eventless) */
  always: z.array(TransitionSchema).optional(),
  /** Nesting (Hierarchical States) */
  initial: z.string().optional().describe("Initial child state (if compound)"),
  states: z.record(z.string(), StateNodeSchema).optional(),
  /** Metadata for UI/AI */
  meta: z.object({
    label: z.string().optional(),
    description: z.string().optional(),
    color: z.string().optional(),
    // For UI diagrams
    // Instructions for AI Agent when in this state
    aiInstructions: z.string().optional().describe("Specific instructions for AI when in this state")
  }).optional()
}));
var StateMachineSchema = z.object({
  id: SnakeCaseIdentifierSchema.describe("Unique Machine ID"),
  description: z.string().optional(),
  /** Context (Memory) Schema */
  contextSchema: z.record(z.string(), z.unknown()).optional().describe("Zod Schema for the machine context/memory"),
  /** Initial State */
  initial: z.string().describe("Initial State ID"),
  /** State Definitions */
  states: z.record(z.string(), StateNodeSchema).describe("State Nodes"),
  /** Global Listeners */
  on: z.record(z.string(), z.union([z.string(), TransitionSchema, z.array(TransitionSchema)])).optional()
});

export { ActionRefSchema, ApprovalActionSchema, ApprovalActionType, ApprovalProcess, ApprovalProcessSchema, ApprovalStepSchema, ApproverType, AuthFieldSchema, AuthenticationSchema, AuthenticationTypeSchema, ConflictResolutionSchema, Connector, ConnectorActionRefSchema, ConnectorCategorySchema, ConnectorInstanceSchema, ConnectorOperationSchema, ConnectorSchema, ConnectorTriggerSchema, CustomScriptActionSchema, DataDestinationConfigSchema, DataSourceConfigSchema, DataSyncConfigSchema, ETL, ETLDestinationSchema, ETLEndpointTypeSchema, ETLPipelineRunSchema, ETLPipelineSchema, ETLRunStatusSchema, ETLSourceSchema, ETLSyncModeSchema, ETLTransformationSchema, ETLTransformationTypeSchema, EmailAlertActionSchema, EventSchema, FieldUpdateActionSchema, FlowEdgeSchema, FlowNodeAction, FlowNodeSchema, FlowSchema, FlowVariableSchema, GuardRefSchema, HttpCallActionSchema, OAuth2ConfigSchema, OperationParameterSchema, OperationTypeSchema, PushNotificationActionSchema, StateMachineSchema, StateNodeSchema, Sync, SyncDirectionSchema, SyncExecutionResultSchema, SyncExecutionStatusSchema, SyncModeSchema, TaskCreationActionSchema, TimeTriggerSchema, TransitionSchema, WebhookReceiverSchema, WebhookSchema, WebhookTriggerType, WorkflowActionSchema, WorkflowRuleSchema, WorkflowTriggerType, defineFlow };
//# sourceMappingURL=index.mjs.map
//# sourceMappingURL=index.mjs.map