@objectstack/spec 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -1
- package/dist/ai/index.d.mts +2 -1
- package/dist/ai/index.d.ts +2 -1
- package/dist/ai/index.js +2047 -1944
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/index.mjs +2047 -1944
- package/dist/ai/index.mjs.map +1 -1
- package/dist/api/index.d.mts +3 -1
- package/dist/api/index.d.ts +3 -1
- package/dist/api/index.js +2599 -2292
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +2587 -2292
- package/dist/api/index.mjs.map +1 -1
- package/dist/automation/index.d.mts +2 -1
- package/dist/automation/index.d.ts +2 -1
- package/dist/automation/index.js +83 -0
- package/dist/automation/index.js.map +1 -1
- package/dist/automation/index.mjs +77 -0
- package/dist/automation/index.mjs.map +1 -1
- package/dist/contracts/index.d.mts +3 -2
- package/dist/contracts/index.d.ts +3 -2
- package/dist/data/index.d.mts +3 -2
- package/dist/data/index.d.ts +3 -2
- package/dist/data/index.js +658 -556
- package/dist/data/index.js.map +1 -1
- package/dist/data/index.mjs +656 -556
- package/dist/data/index.mjs.map +1 -1
- package/dist/{driver.zod-lfi00zVT.d.ts → driver.zod-CfGk9GYh.d.ts} +2164 -11
- package/dist/{driver.zod-BOM_Etco.d.mts → driver.zod-y1cX6R3c.d.mts} +2164 -11
- package/dist/hub/index.d.mts +1 -1
- package/dist/hub/index.d.ts +1 -1
- package/dist/hub/index.js +789 -724
- package/dist/hub/index.js.map +1 -1
- package/dist/hub/index.mjs +789 -724
- package/dist/hub/index.mjs.map +1 -1
- package/dist/{index-C67cfwmW.d.ts → index-B0Hf65bV.d.ts} +13 -5
- package/dist/{index-DLcySG7U.d.ts → index-B5pKM0My.d.ts} +335 -4370
- package/dist/{index-Os7lItRe.d.mts → index-BA022mg2.d.ts} +6178 -129
- package/dist/{index-B5-VbOKg.d.mts → index-BGeLoH2z.d.ts} +4251 -74
- package/dist/{index-CH5zloR3.d.ts → index-BwO__aqV.d.ts} +1 -1
- package/dist/{index-Dp7GFJ8V.d.mts → index-Cia3JPQ8.d.mts} +13 -5
- package/dist/{index-D12rNohm.d.mts → index-CpD1q1FP.d.ts} +35 -18
- package/dist/{index-Os7lItRe.d.ts → index-D5RSFPuB.d.mts} +6178 -129
- package/dist/{index-CU4m6noq.d.mts → index-DGjpaj0X.d.mts} +1 -1
- package/dist/{index-D12rNohm.d.ts → index-Dfn5VXl6.d.mts} +35 -18
- package/dist/{index-l6WIlmOD.d.mts → index-Dgybxlky.d.mts} +177 -158
- package/dist/{index-l6WIlmOD.d.ts → index-Dgybxlky.d.ts} +177 -158
- package/dist/{index-DLcySG7U.d.mts → index-Dpsk8PF4.d.mts} +335 -4370
- package/dist/{index-CyognKSZ.d.ts → index-DrNah5E0.d.ts} +1952 -6990
- package/dist/{index-DE_lJ11p.d.mts → index-OO84R20k.d.mts} +1952 -6990
- package/dist/{index-B5-VbOKg.d.ts → index-upA3Xt04.d.mts} +4251 -74
- package/dist/index.d.mts +8072 -1922
- package/dist/index.d.ts +8072 -1922
- package/dist/index.js +8563 -8249
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8563 -8249
- package/dist/index.mjs.map +1 -1
- package/dist/integration/index.d.mts +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/kernel/index.d.mts +2 -1
- package/dist/kernel/index.d.ts +2 -1
- package/dist/kernel/index.js +884 -684
- package/dist/kernel/index.js.map +1 -1
- package/dist/kernel/index.mjs +870 -684
- package/dist/kernel/index.mjs.map +1 -1
- package/dist/package-registry.zod-JMcOYNxM.d.mts +21119 -0
- package/dist/package-registry.zod-JMcOYNxM.d.ts +21119 -0
- package/dist/state-machine.zod-B-lFFSxQ.d.mts +285 -0
- package/dist/state-machine.zod-B-lFFSxQ.d.ts +285 -0
- package/dist/system/index.d.mts +2 -1
- package/dist/system/index.d.ts +2 -1
- package/dist/system/index.js +749 -651
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.mjs +749 -651
- package/dist/system/index.mjs.map +1 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/json-schema/ai/Agent.json +499 -0
- package/json-schema/ai/DevOpsAgent.json +499 -0
- package/json-schema/ai/FeedbackLoop.json +2188 -186
- package/json-schema/ai/Resolution.json +2188 -186
- package/json-schema/api/ApiRoutes.json +4 -0
- package/json-schema/api/CompileManifestResponse.json +40 -10
- package/json-schema/api/DisablePackageRequest.json +18 -0
- package/json-schema/api/DisablePackageResponse.json +1521 -0
- package/json-schema/api/Discovery.json +4 -0
- package/json-schema/api/EnablePackageRequest.json +18 -0
- package/json-schema/api/EnablePackageResponse.json +1521 -0
- package/json-schema/api/GetDiscoveryResponse.json +4 -0
- package/json-schema/api/GetPackageRequest.json +18 -0
- package/json-schema/api/GetPackageResponse.json +1518 -0
- package/json-schema/api/InstallPackageRequest.json +1483 -0
- package/json-schema/api/InstallPackageResponse.json +1521 -0
- package/json-schema/api/ListPackagesRequest.json +42 -0
- package/json-schema/api/ListPackagesResponse.json +1525 -0
- package/json-schema/api/ObjectDefinitionResponse.json +1001 -0
- package/json-schema/api/ObjectStackProtocol.json +86 -1
- package/json-schema/api/RestApiConfig.json +5 -0
- package/json-schema/api/RestServerConfig.json +5 -0
- package/json-schema/api/UninstallPackageRequest.json +18 -0
- package/json-schema/api/UninstallPackageResponse.json +25 -0
- package/json-schema/automation/ActionRef.json +30 -0
- package/json-schema/automation/Event.json +24 -0
- package/json-schema/automation/Flow.json +1 -0
- package/json-schema/automation/FlowNode.json +1 -0
- package/json-schema/automation/FlowNodeAction.json +1 -0
- package/json-schema/automation/GuardRef.json +30 -0
- package/json-schema/automation/StateMachine.json +504 -0
- package/json-schema/automation/StateNode.json +324 -0
- package/json-schema/automation/Transition.json +73 -0
- package/json-schema/data/Object.json +1001 -0
- package/json-schema/data/ObjectExtension.json +2376 -0
- package/json-schema/data/ObjectOwnershipEnum.json +13 -0
- package/json-schema/hub/ComposerResponse.json +40 -10
- package/json-schema/kernel/DisablePackageRequest.json +18 -0
- package/json-schema/kernel/DisablePackageResponse.json +1521 -0
- package/json-schema/kernel/EnablePackageRequest.json +18 -0
- package/json-schema/kernel/EnablePackageResponse.json +1521 -0
- package/json-schema/kernel/EventBusConfig.json +15 -0
- package/json-schema/kernel/EventHandler.json +6 -0
- package/json-schema/kernel/EventPersistence.json +3 -0
- package/json-schema/kernel/EventRoute.json +3 -0
- package/json-schema/kernel/EventWebhookConfig.json +3 -0
- package/json-schema/kernel/GetPackageRequest.json +18 -0
- package/json-schema/kernel/GetPackageResponse.json +1518 -0
- package/json-schema/kernel/InstallPackageRequest.json +1483 -0
- package/json-schema/kernel/InstallPackageResponse.json +1521 -0
- package/json-schema/kernel/InstalledPackage.json +1509 -0
- package/json-schema/kernel/ListPackagesRequest.json +42 -0
- package/json-schema/kernel/ListPackagesResponse.json +1525 -0
- package/json-schema/kernel/Manifest.json +40 -10
- package/json-schema/kernel/PackageStatusEnum.json +16 -0
- package/json-schema/kernel/Plugin.json +5 -0
- package/json-schema/kernel/PluginContext.json +31 -7
- package/json-schema/kernel/PluginLifecycle.json +7 -1
- package/json-schema/kernel/RealTimeNotificationConfig.json +3 -0
- package/json-schema/kernel/UninstallPackageRequest.json +18 -0
- package/json-schema/kernel/UninstallPackageResponse.json +25 -0
- package/json-schema/system/ChangeSet.json +2188 -186
- package/json-schema/system/CreateObjectOperation.json +1001 -0
- package/json-schema/system/MigrationOperation.json +1001 -0
- package/package.json +29 -15
- package/prompts/create-new-project.md +37 -19
- package/dist/{index-I3piy4U4.d.mts → index-BmU_sD1f.d.mts} +8 -8
- package/dist/{index-CkhpsEUw.d.ts → index-BnXuc_HO.d.ts} +8 -8
- package/dist/{index-CIDI-8zR.d.mts → index-C_NTOcet.d.mts} +98 -98
- package/dist/{index-CIDI-8zR.d.ts → index-C_NTOcet.d.ts} +98 -98
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/automation/index.ts","../../src/automation/workflow.zod.ts","../../src/shared/identifiers.zod.ts","../../src/automation/flow.zod.ts","../../src/automation/webhook.zod.ts","../../src/automation/approval.zod.ts","../../src/automation/etl.zod.ts","../../src/automation/trigger-registry.zod.ts","../../src/automation/sync.zod.ts","../../src/shared/mapping.zod.ts"],"sourcesContent":["\nexport * from './workflow.zod';\nexport * from './flow.zod';\nexport * from './webhook.zod';\nexport * from './approval.zod';\nexport * from './etl.zod';\nexport * from './trigger-registry.zod';\nexport * from './sync.zod';\n","import { z } from 'zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\n\n/**\n * Trigger events for workflow automation\n */\nexport const WorkflowTriggerType = z.enum([\n 'on_create', // When record is created\n 'on_update', // When record is updated\n 'on_create_or_update', // Both\n 'on_delete', // When record is deleted\n 'schedule' // Time-based (cron)\n]);\n\n/**\n * Schema for Workflow Field Update Action\n * @example\n * {\n * name: \"update_status\",\n * type: \"field_update\",\n * field: \"status\",\n * value: \"approved\"\n * }\n */\nexport const FieldUpdateActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('field_update'),\n field: z.string().describe('Field to update'),\n value: z.any().describe('Value or Formula to set'),\n});\n\n/**\n * Schema for Workflow Email Alert Action\n * @example\n * {\n * name: \"send_approval_email\",\n * type: \"email_alert\",\n * template: \"approval_request_email\",\n * recipients: [\"user_id_123\", \"manager_field\"]\n * }\n */\nexport const EmailAlertActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('email_alert'),\n template: z.string().describe('Email template ID/DevName'),\n recipients: z.array(z.string()).describe('List of recipient emails or user IDs'),\n});\n\n/**\n * Schema for Connector Action Reference\n * Executes a capability defined in an integration connector.\n * Replaces hardcoded vendor actions (Slack, Twilio, etc).\n * \n * @example Send Slack Message\n * {\n * name: \"notify_slack\",\n * type: \"connector_action\",\n * connectorId: \"slack\",\n * actionId: \"post_message\",\n * input: {\n * channel: \"#general\",\n * text: \"New deal closed: {name}\"\n * }\n * }\n */\nexport const ConnectorActionRefSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('connector_action'),\n connectorId: z.string().describe('Target Connector ID (e.g. slack, twilio)'),\n actionId: z.string().describe('Target Action ID (e.g. send_message)'),\n input: z.record(z.string(), z.any()).describe('Input parameters matching the action schema'),\n});\n\n/**\n * Schema for HTTP Callout Action\n * Makes a REST API call to an external service.\n * @example\n * {\n * name: \"sync_to_erp\",\n * type: \"http_call\",\n * url: \"https://erp.api/orders\",\n * method: \"POST\",\n * headers: { \"Authorization\": \"Bearer {token}\" },\n * body: \"{ ... }\"\n * }\n */\nexport const HttpCallActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('http_call'),\n url: z.string().describe('Target URL'),\n method: z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH']).default('POST').describe('HTTP Method'),\n headers: z.record(z.string(), z.string()).optional().describe('HTTP Headers'),\n body: z.string().optional().describe('Request body (JSON or text)'),\n});\n\n/**\n * Schema for Workflow Task Creation Action\n * @example\n * {\n * name: \"create_followup_task\",\n * type: \"task_creation\",\n * taskObject: \"tasks\",\n * subject: \"Follow up with client\",\n * dueDate: \"TODAY() + 3\"\n * }\n */\nexport const TaskCreationActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('task_creation'),\n taskObject: z.string().describe('Task object name (e.g., \"task\", \"project_task\")'),\n subject: z.string().describe('Task subject/title'),\n description: z.string().optional().describe('Task description'),\n assignedTo: z.string().optional().describe('User ID or field reference for assignee'),\n dueDate: z.string().optional().describe('Due date (ISO string or formula)'),\n priority: z.string().optional().describe('Task priority'),\n relatedTo: z.string().optional().describe('Related record ID or field reference'),\n additionalFields: z.record(z.string(), z.any()).optional().describe('Additional custom fields'),\n});\n\n/**\n * Schema for Workflow Push Notification Action\n */\nexport const PushNotificationActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('push_notification'),\n title: z.string().describe('Notification title'),\n body: z.string().describe('Notification body text'),\n recipients: z.array(z.string()).describe('User IDs or device tokens'),\n data: z.record(z.string(), z.any()).optional().describe('Additional data payload'),\n badge: z.number().optional().describe('Badge count (iOS)'),\n sound: z.string().optional().describe('Notification sound'),\n clickAction: z.string().optional().describe('Action/URL when notification is clicked'),\n});\n\n/**\n * Schema for Workflow Custom Script Action\n */\nexport const CustomScriptActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('custom_script'),\n language: z.enum(['javascript', 'typescript', 'python']).default('javascript').describe('Script language'),\n code: z.string().describe('Script code to execute'),\n timeout: z.number().default(30000).describe('Execution timeout in milliseconds'),\n context: z.record(z.string(), z.any()).optional().describe('Additional context variables'),\n});\n\n/**\n * Universal Workflow Action Schema\n * Union of all supported action types.\n */\nexport const WorkflowActionSchema = z.discriminatedUnion('type', [\n FieldUpdateActionSchema,\n EmailAlertActionSchema,\n HttpCallActionSchema,\n ConnectorActionRefSchema,\n TaskCreationActionSchema,\n PushNotificationActionSchema,\n CustomScriptActionSchema,\n]);\n\nexport type WorkflowAction = z.infer<typeof WorkflowActionSchema>;\n\n/**\n * Time Trigger Definition\n * Schedules actions to run relative to a specific time or date field.\n */\nexport const TimeTriggerSchema = z.object({\n id: z.string().optional().describe('Unique identifier'),\n \n /** Timing Logic */\n timeLength: z.number().int().describe('Duration amount (e.g. 1, 30)'),\n timeUnit: z.enum(['minutes', 'hours', 'days']).describe('Unit of time'),\n \n /** Reference Point */\n offsetDirection: z.enum(['before', 'after']).describe('Before or After the reference date'),\n offsetFrom: z.enum(['trigger_date', 'date_field']).describe('Basis for calculation'),\n dateField: z.string().optional().describe('Date field to calculate from (required if offsetFrom is date_field)'),\n \n /** Actions */\n actions: z.array(WorkflowActionSchema).describe('Actions to execute at the scheduled time'),\n});\n\n/**\n * Schema for Workflow Rules (Automation)\n * \n * **NAMING CONVENTION:**\n * Workflow names are machine identifiers and must be lowercase snake_case.\n * \n * @example Good workflow names\n * - 'send_welcome_email'\n * - 'update_lead_status'\n * - 'notify_manager_on_close'\n * - 'calculate_discount'\n * \n * @example Bad workflow names (will be rejected)\n * - 'SendWelcomeEmail' (PascalCase)\n * - 'updateLeadStatus' (camelCase)\n * - 'Send Welcome Email' (spaces)\n * \n * @example Complete Workflow\n * {\n * name: \"new_lead_process\",\n * objectName: \"lead\",\n * triggerType: \"on_create\",\n * criteria: \"amount > 1000\",\n * active: true,\n * actions: [\n * {\n * name: \"set_status\",\n * type: \"field_update\",\n * field: \"status\",\n * value: \"new\"\n * },\n * {\n * name: \"notify_team\",\n * type: \"connector_action\",\n * connectorId: \"slack\",\n * actionId: \"post_message\",\n * input: { channel: \"#sales\", text: \"New high value lead!\" }\n * }\n * ],\n * timeTriggers: [\n * {\n * timeLength: 2,\n * timeUnit: \"days\",\n * offsetDirection: \"after\",\n * offsetFrom: \"trigger_date\",\n * actions: [\n * {\n * name: \"followup_check\",\n * type: \"task_creation\",\n * taskObject: \"task\",\n * subject: \"Follow up lead\",\n * dueDate: \"TODAY()\"\n * }\n * ]\n * }\n * ]\n * }\n */\nexport const WorkflowRuleSchema = z.object({\n /** Machine name */\n name: SnakeCaseIdentifierSchema.describe('Unique workflow name (lowercase snake_case)'),\n \n /** Target Object */\n objectName: z.string().describe('Target Object'),\n \n /** When to evaluate the rule */\n triggerType: WorkflowTriggerType.describe('When to evaluate'),\n \n /** \n * Condition to start the workflow.\n * If empty, runs on every trigger event.\n */\n criteria: z.string().optional().describe('Formula condition. If TRUE, actions execute.'),\n \n /** Actions to execute immediately */\n actions: z.array(WorkflowActionSchema).optional().describe('Immediate actions'),\n \n /** \n * Time-Dependent Actions \n * Actions scheduled to run in the future.\n */\n timeTriggers: z.array(TimeTriggerSchema).optional().describe('Scheduled actions relative to trigger or date field'),\n \n /** Active status */\n active: z.boolean().default(true).describe('Whether this workflow is active'),\n \n /** Recursion Control */\n reevaluateOnChange: z.boolean().default(false).describe('Re-evaluate rule if field updates change the record validity'),\n});\n\nexport type WorkflowRule = z.infer<typeof WorkflowRuleSchema>;\nexport type TimeTrigger = z.infer<typeof TimeTriggerSchema>;\n","import { z } from 'zod';\n\n/**\n * System Identifier Schema\n * \n * Universal naming convention for all machine identifiers (API Names) in ObjectStack.\n * Enforces lowercase with underscores or dots to ensure:\n * - Cross-platform compatibility (case-insensitive filesystems)\n * - URL-friendliness (no encoding needed)\n * - Database consistency (no collation issues)\n * - Security (no case-sensitivity bugs in permission checks)\n * \n * **Applies to all metadata that acts as a machine identifier:**\n * - Object names (tables/collections)\n * - Field names\n * - Role names\n * - Permission set names\n * - Action/trigger names\n * - Event keys\n * - App IDs\n * - Menu/page IDs\n * - Select option values\n * - Workflow names\n * - Webhook names\n * \n * **Naming Convention Summary:**\n * | Type | Pattern | Example |\n * |------|---------|---------|\n * | Machine ID | snake_case | `crm_account`, `btn_submit`, `role_admin` |\n * | Event keys | dot.notation | `user.login`, `order.created` |\n * | Labels | Any case | `Client Account`, `Submit Form` |\n * \n * @example Valid identifiers\n * - 'account'\n * - 'crm_account'\n * - 'user_profile'\n * - 'order.created' (for events)\n * - 'api_v2_endpoint'\n * \n * @example Invalid identifiers (will be rejected)\n * - 'Account' (uppercase)\n * - 'CrmAccount' (camelCase)\n * - 'crm-account' (kebab-case - use underscore instead)\n * - 'user profile' (spaces)\n */\nexport const SystemIdentifierSchema = z\n .string()\n .min(2, { message: 'System identifier must be at least 2 characters' })\n .regex(/^[a-z][a-z0-9_.]*$/, {\n message:\n 'System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., \"user_profile\" or \"order.created\")',\n })\n .describe('System identifier (lowercase with underscores or dots)');\n\n/**\n * Strict Snake Case Identifier\n * \n * More restrictive than SystemIdentifierSchema - only allows underscores (no dots).\n * Use this for identifiers that should NOT contain dots (e.g., database table/column names).\n * \n * @example Valid\n * - 'account'\n * - 'crm_account'\n * - 'user_profile'\n * \n * @example Invalid\n * - 'user.profile' (dots not allowed)\n * - 'UserProfile' (uppercase)\n */\nexport const SnakeCaseIdentifierSchema = z\n .string()\n .min(2, { message: 'Identifier must be at least 2 characters' })\n .regex(/^[a-z][a-z0-9_]*$/, {\n message:\n 'Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., \"user_profile\")',\n })\n .describe('Snake case identifier (lowercase with underscores only)');\n\n/**\n * Event Name Identifier\n * \n * Specialized identifier for event names that encourages dot notation.\n * Used in event-driven systems, message queues, and webhooks.\n * \n * Pattern: `namespace.action` or `entity.event_type`\n * \n * @example Valid\n * - 'user.created'\n * - 'order.paid'\n * - 'user.login_success'\n * - 'alarm.high_cpu'\n * \n * @example Invalid\n * - 'UserCreated' (camelCase)\n * - 'user_created' (should use dots for namespacing)\n */\nexport const EventNameSchema = z\n .string()\n .min(3, { message: 'Event name must be at least 3 characters' })\n .regex(/^[a-z][a-z0-9_.]*$/, {\n message:\n 'Event name must be lowercase with dots for namespacing (e.g., \"user.created\", \"order.paid\")',\n })\n .describe('Event name (lowercase with dot notation for namespacing)');\n\n/**\n * Type Exports\n */\nexport type SystemIdentifier = z.infer<typeof SystemIdentifierSchema>;\nexport type SnakeCaseIdentifier = z.infer<typeof SnakeCaseIdentifierSchema>;\nexport type EventName = z.infer<typeof EventNameSchema>;\n","import { z } from 'zod';\n\n/**\n * Flow Node Types\n */\nexport const FlowNodeAction = z.enum([\n 'start', // Trigger\n 'end', // Return/Stop\n 'decision', // If/Else logic\n 'assignment', // Set Variable\n 'loop', // For Each\n 'create_record', // CRUD: Create\n 'update_record', // CRUD: Update\n 'delete_record', // CRUD: Delete\n 'get_record', // CRUD: Get/Query\n 'http_request', // Webhook/API Call\n 'script', // Custom Script (JS/TS)\n 'wait', // Delay/Sleep\n 'subflow', // Call another flow\n 'connector_action' // Zapier-style integration action\n]);\n\n/**\n * Flow Variable Schema\n * Variables available within the flow execution context.\n */\nexport const FlowVariableSchema = z.object({\n name: z.string().describe('Variable name'),\n type: z.string().describe('Data type (text, number, boolean, object, list)'),\n isInput: z.boolean().default(false).describe('Is input parameter'),\n isOutput: z.boolean().default(false).describe('Is output parameter'),\n});\n\n/**\n * Flow Node Schema\n * A single step in the visual logic graph.\n * \n * @example Decision Node\n * {\n * id: \"dec_1\",\n * type: \"decision\",\n * label: \"Is High Value?\",\n * config: {\n * conditions: [\n * { label: \"Yes\", expression: \"{amount} > 10000\" },\n * { label: \"No\", expression: \"true\" } // default\n * ]\n * },\n * position: { x: 300, y: 200 }\n * }\n */\nexport const FlowNodeSchema = z.object({\n id: z.string().describe('Node unique ID'),\n type: FlowNodeAction.describe('Action type'),\n label: z.string().describe('Node label'),\n \n /** Node Configuration Options (Specific to type) */\n config: z.record(z.string(), z.any()).optional().describe('Node configuration'),\n \n /** \n * Connector Action Configuration\n * Used when type is 'connector_action'\n */\n connectorConfig: z.object({\n connectorId: z.string(),\n actionId: z.string(),\n input: z.record(z.string(), z.any()).describe('Mapped inputs for the action'),\n }).optional(),\n\n /** UI Position (for the canvas) */\n position: z.object({ x: z.number(), y: z.number() }).optional(),\n});\n\n/**\n * Flow Edge Schema\n * Connections between nodes.\n */\nexport const FlowEdgeSchema = z.object({\n id: z.string().describe('Edge unique ID'),\n source: z.string().describe('Source Node ID'),\n target: z.string().describe('Target Node ID'),\n \n /** Condition for this path (only for decision/branch nodes) */\n condition: z.string().optional().describe('Expression returning boolean used for branching'),\n \n type: z.enum(['default', 'fault']).default('default').describe('Connection type: Standard (Success) or Fault (Error) path'),\n label: z.string().optional().describe('Label on the connector'),\n});\n\n/**\n * Flow Schema\n * Visual Business Logic Orchestration.\n * \n * @example Simple Approval Logic\n * {\n * name: \"approve_order_flow\",\n * label: \"Approve Large Orders\",\n * type: \"record_change\",\n * status: \"active\",\n * nodes: [\n * { id: \"start\", type: \"start\", label: \"Start\", position: {x: 0, y: 0} },\n * { id: \"check_amount\", type: \"decision\", label: \"Check Amount\", position: {x: 0, y: 100} },\n * { id: \"auto_approve\", type: \"update_record\", label: \"Auto Approve\", position: {x: -100, y: 200} },\n * { id: \"submit_for_approval\", type: \"connector_action\", label: \"Submit\", position: {x: 100, y: 200} }\n * ],\n * edges: [\n * { id: \"e1\", source: \"start\", target: \"check_amount\" },\n * { id: \"e2\", source: \"check_amount\", target: \"auto_approve\", condition: \"{amount} < 500\" },\n * { id: \"e3\", source: \"check_amount\", target: \"submit_for_approval\", condition: \"{amount} >= 500\" }\n * ]\n * }\n */\nexport const FlowSchema = z.object({\n /** Identity */\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Machine name'),\n label: z.string().describe('Flow label'),\n description: z.string().optional(),\n \n /** Metadata & Versioning */\n version: z.number().int().default(1).describe('Version number'),\n status: z.enum(['draft', 'active', 'obsolete', 'invalid']).default('draft').describe('Deployment status'),\n template: z.boolean().default(false).describe('Is logic template (Subflow)'),\n\n /** Trigger Type */\n type: z.enum(['autolaunched', 'record_change', 'schedule', 'screen', 'api']).describe('Flow type'),\n \n /** Configuration Variables */\n variables: z.array(FlowVariableSchema).optional().describe('Flow variables'),\n \n /** Graph Definition */\n nodes: z.array(FlowNodeSchema).describe('Flow nodes'),\n edges: z.array(FlowEdgeSchema).describe('Flow connections'),\n \n /** Execution Config */\n active: z.boolean().default(false).describe('Is active (Deprecated: use status)'),\n runAs: z.enum(['system', 'user']).default('user').describe('Execution context'),\n});\n\nexport type Flow = z.infer<typeof FlowSchema>;\nexport type FlowNode = z.infer<typeof FlowNodeSchema>;\nexport type FlowEdge = z.infer<typeof FlowEdgeSchema>;\n","import { z } from 'zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\n\n/**\n * Webhook Trigger Event\n * When should this webhook fire?\n */\nexport const WebhookTriggerType = z.enum([\n 'create', \n 'update', \n 'delete', \n 'undelete',\n 'api' // Manually triggered\n]);\n\n/**\n * CANONICAL WEBHOOK DEFINITION\n * \n * This is the single source of truth for webhook configuration across ObjectStack.\n * All other protocols (workflow, connector, etc.) should import and reference this schema.\n * \n * Webhook Protocol - Outbound HTTP Integration\n * Push data to external URLs when events occur in the system.\n * \n * **NAMING CONVENTION:**\n * Webhook names are machine identifiers and must be lowercase snake_case.\n * \n * @example Good webhook names\n * - 'stripe_payment_sync'\n * - 'slack_notification'\n * - 'crm_lead_export'\n * \n * @example Bad webhook names (will be rejected)\n * - 'StripePaymentSync' (PascalCase)\n * - 'slackNotification' (camelCase)\n * \n * @example Basic webhook configuration\n * ```typescript\n * const webhook: Webhook = {\n * name: 'slack_notification',\n * label: 'Slack Order Notification',\n * object: 'order',\n * triggers: ['create', 'update'],\n * url: 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXX',\n * method: 'POST',\n * headers: { 'Content-Type': 'application/json' },\n * authentication: {\n * type: 'bearer',\n * credentials: { token: process.env.SLACK_TOKEN }\n * },\n * retryPolicy: {\n * maxRetries: 3,\n * backoffStrategy: 'exponential'\n * }\n * }\n * ```\n */\nexport const WebhookSchema = z.object({\n name: SnakeCaseIdentifierSchema.describe('Webhook unique name (lowercase snake_case)'),\n label: z.string().optional().describe('Human-readable webhook label'),\n \n /** Scope */\n object: z.string().optional().describe('Object to listen to (optional for manual webhooks)'),\n triggers: z.array(WebhookTriggerType).optional().describe('Events that trigger execution'),\n \n /** Target */\n url: z.string().url().describe('External webhook endpoint URL'),\n method: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']).default('POST').describe('HTTP method'),\n \n /** Headers */\n headers: z.record(z.string(), z.string()).optional().describe('Custom HTTP headers'),\n \n /** Body/Payload */\n body: z.any().optional().describe('Request body payload (if not using default record data)'),\n \n /** Payload Configuration */\n payloadFields: z.array(z.string()).optional().describe('Fields to include. Empty = All'),\n includeSession: z.boolean().default(false).describe('Include user session info'),\n \n /** Authentication */\n authentication: z.object({\n type: z.enum(['none', 'bearer', 'basic', 'api-key']).describe('Authentication type'),\n credentials: z.record(z.string(), z.string()).optional().describe('Authentication credentials'),\n }).optional().describe('Authentication configuration'),\n \n /** Retry Policy */\n retryPolicy: z.object({\n maxRetries: z.number().int().min(0).max(10).default(3).describe('Maximum retry attempts'),\n backoffStrategy: z.enum(['exponential', 'linear', 'fixed']).default('exponential').describe('Backoff strategy'),\n initialDelayMs: z.number().int().min(100).default(1000).describe('Initial retry delay in milliseconds'),\n maxDelayMs: z.number().int().min(1000).default(60000).describe('Maximum retry delay in milliseconds'),\n }).optional().describe('Retry policy configuration'),\n \n /** Timeout */\n timeoutMs: z.number().int().min(1000).max(300000).default(30000).describe('Request timeout in milliseconds'),\n \n /** Security */\n secret: z.string().optional().describe('Signing secret for HMAC signature verification'),\n \n /** Status */\n isActive: z.boolean().default(true).describe('Whether webhook is active'),\n \n /** Metadata */\n description: z.string().optional().describe('Webhook description'),\n tags: z.array(z.string()).optional().describe('Tags for organization'),\n});\n\n/**\n * Webhook Receiver Schema (Inbound)\n * Handling incoming HTTP hooks from Stripe, Slack, etc.\n * \n * **NAMING CONVENTION:**\n * Webhook receiver names are machine identifiers and must be lowercase snake_case.\n * \n * @example Good names\n * - 'stripe_webhook_handler'\n * - 'github_events'\n * - 'twilio_status_callback'\n * \n * @example Bad names (will be rejected)\n * - 'StripeWebhookHandler' (PascalCase)\n */\nexport const WebhookReceiverSchema = z.object({\n name: SnakeCaseIdentifierSchema.describe('Webhook receiver unique name (lowercase snake_case)'),\n path: z.string().describe('URL Path (e.g. /webhooks/stripe)'),\n \n /** Verification */\n verificationType: z.enum(['none', 'header_token', 'hmac', 'ip_whitelist']).default('none'),\n verificationParams: z.object({\n header: z.string().optional(),\n secret: z.string().optional(),\n ips: z.array(z.string()).optional()\n }).optional(),\n \n /** Action */\n action: z.enum(['trigger_flow', 'script', 'upsert_record']).default('trigger_flow'),\n target: z.string().describe('Flow ID or Script name'),\n});\n\nexport type Webhook = z.infer<typeof WebhookSchema>;\nexport type WebhookReceiver = z.infer<typeof WebhookReceiverSchema>;\n","import { z } from 'zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\n\n/**\n * Approval Step Approver Type\n */\nexport const ApproverType = z.enum([\n 'user', // Specific user(s)\n 'role', // Users with specific role\n 'manager', // Submitter's manager\n 'field', // User ID defined in a record field\n 'queue' // Data ownership queue\n]);\n\n/**\n * Approval Action Type\n * Actions to execute on transition\n */\nexport const ApprovalActionType = z.enum([\n 'field_update',\n 'email_alert',\n 'webhook',\n 'script',\n 'connector_action' // Added for Zapier-style integrations\n]);\n\n/**\n * definition of an action to perform\n */\nexport const ApprovalActionSchema = z.object({\n type: ApprovalActionType,\n name: z.string().describe('Action name'),\n config: z.record(z.string(), z.any()).describe('Action configuration'),\n \n /** For connector actions */\n connectorId: z.string().optional(),\n actionId: z.string().optional(),\n});\n\n/**\n * Approval Process Step\n */\nexport const ApprovalStepSchema = z.object({\n name: SnakeCaseIdentifierSchema.describe('Step machine name'),\n label: z.string().describe('Step display label'),\n description: z.string().optional(),\n \n /** Entry criteria for this step */\n entryCriteria: z.string().optional().describe('Formula expression to enter this step'),\n \n /** Who can approve */\n approvers: z.array(z.object({\n type: ApproverType,\n value: z.string().describe('User ID, Role Name, or Field Name')\n })).min(1).describe('List of allowed approvers'),\n \n /** Approval Logic */\n behavior: z.enum(['first_response', 'unanimous']).default('first_response')\n .describe('How to handle multiple approvers'),\n \n /** Rejection behavior */\n rejectionBehavior: z.enum(['reject_process', 'back_to_previous'])\n .default('reject_process').describe('What happens if rejected'),\n\n /** Actions */\n onApprove: z.array(ApprovalActionSchema).optional().describe('Actions on step approval'),\n onReject: z.array(ApprovalActionSchema).optional().describe('Actions on step rejection'),\n});\n\n/**\n * Approval Process Protocol\n * \n * Defines a complex review and approval cycle for a record.\n * Manages state locking, notifications, and transition logic.\n */\nexport const ApprovalProcessSchema = z.object({\n name: SnakeCaseIdentifierSchema.describe('Unique process name'),\n label: z.string().describe('Human readable label'),\n object: z.string().describe('Target Object Name'),\n \n active: z.boolean().default(false),\n description: z.string().optional(),\n \n /** Entry Criteria for the entire process */\n entryCriteria: z.string().optional().describe('Formula to allow submission'),\n \n /** Record Locking */\n lockRecord: z.boolean().default(true).describe('Lock record from editing during approval'),\n \n /** Steps */\n steps: z.array(ApprovalStepSchema).min(1).describe('Sequence of approval steps'),\n \n /** Global Actions */\n onSubmit: z.array(ApprovalActionSchema).optional().describe('Actions on initial submission'),\n onFinalApprove: z.array(ApprovalActionSchema).optional().describe('Actions on final approval'),\n onFinalReject: z.array(ApprovalActionSchema).optional().describe('Actions on final rejection'),\n onRecall: z.array(ApprovalActionSchema).optional().describe('Actions on recall'),\n});\n\nexport const ApprovalProcess = Object.assign(ApprovalProcessSchema, {\n create: <T extends z.input<typeof ApprovalProcessSchema>>(config: T) => config,\n});\n\nexport type ApprovalProcess = z.infer<typeof ApprovalProcessSchema>;\nexport type ApprovalStep = z.infer<typeof ApprovalStepSchema>;\n","import { z } from 'zod';\n\n/**\n * ETL (Extract, Transform, Load) Pipeline Protocol - LEVEL 2: Data Engineering\n * \n * Inspired by modern data integration platforms like Airbyte, Fivetran, and Apache NiFi.\n * \n * **Positioning in 3-Layer Architecture:**\n * - **L1: Simple Sync** (automation/sync.zod.ts) - Business users - Sync Salesforce to Sheets\n * - **L2: ETL Pipeline** (THIS FILE) - Data engineers - Aggregate 10 sources to warehouse\n * - **L3: Enterprise Connector** (integration/connector.zod.ts) - System integrators - Full SAP integration\n * \n * ETL pipelines enable automated data synchronization between systems, transforming\n * data as it moves from source to destination.\n * \n * **SCOPE: Advanced multi-source, multi-stage transformations.**\n * Supports complex operations: joins, aggregations, filtering, custom SQL.\n * \n * ## When to Use This Layer\n * \n * **Use ETL Pipeline when:**\n * - Combining data from multiple sources\n * - Need aggregations, joins, transformations\n * - Building data warehouses or analytics platforms\n * - Complex data transformations required\n * \n * **Examples:**\n * - Sales data from Salesforce + Marketing from HubSpot → Data Warehouse\n * - Multi-region databases → Consolidated reporting\n * - Legacy system migration with transformation\n * \n * **When to downgrade:**\n * - Simple 1:1 sync → Use {@link file://./sync.zod.ts | Simple Sync}\n * \n * **When to upgrade:**\n * - Need full connector lifecycle (auth, webhooks, rate limits) → Use {@link file://../integration/connector.zod.ts | Enterprise Connector}\n * \n * @see {@link file://./sync.zod.ts} for Level 1 (simple sync)\n * @see {@link file://../integration/connector.zod.ts} for Level 3 (enterprise integration)\n * \n * ## Use Cases\n * \n * 1. **Data Warehouse Population**\n * - Extract from multiple operational systems\n * - Transform to analytical schema\n * - Load into data warehouse\n * \n * 2. **System Integration**\n * - Sync data between CRM and Marketing Automation\n * - Keep product catalog synchronized across e-commerce platforms\n * - Replicate data for backup/disaster recovery\n * \n * 3. **Data Migration**\n * - Move data from legacy systems to modern platforms\n * - Consolidate data from multiple sources\n * - Split monolithic databases into microservices\n * \n * @see https://airbyte.com/\n * @see https://docs.fivetran.com/\n * @see https://nifi.apache.org/\n * \n * @example\n * ```typescript\n * const salesforceToDB: ETLPipeline = {\n * name: 'salesforce_to_postgres',\n * label: 'Salesforce Accounts to PostgreSQL',\n * source: {\n * type: 'api',\n * connector: 'salesforce',\n * config: { object: 'Account' }\n * },\n * destination: {\n * type: 'database',\n * connector: 'postgres',\n * config: { table: 'accounts' }\n * },\n * transformations: [\n * { type: 'map', config: { 'Name': 'account_name' } }\n * ],\n * schedule: '0 2 * * *' // Daily at 2 AM\n * }\n * ```\n */\n\n/**\n * ETL Source/Destination Type\n */\nexport const ETLEndpointTypeSchema = z.enum([\n 'database', // SQL/NoSQL databases\n 'api', // REST/GraphQL APIs\n 'file', // CSV, JSON, XML, Excel files\n 'stream', // Kafka, RabbitMQ, Kinesis\n 'object', // ObjectStack object\n 'warehouse', // Data warehouse (Snowflake, BigQuery, Redshift)\n 'storage', // S3, Azure Blob, Google Cloud Storage\n 'spreadsheet', // Google Sheets, Excel Online\n]);\n\nexport type ETLEndpointType = z.infer<typeof ETLEndpointTypeSchema>;\n\n/**\n * ETL Source Configuration\n */\nexport const ETLSourceSchema = z.object({\n /**\n * Source type\n */\n type: ETLEndpointTypeSchema.describe('Source type'),\n\n /**\n * Connector identifier\n * References a registered connector\n * \n * @example \"salesforce\", \"postgres\", \"mysql\", \"s3\"\n */\n connector: z.string().optional().describe('Connector ID'),\n\n /**\n * Source-specific configuration\n * Structure varies by source type\n * \n * @example For database: { table: 'customers', schema: 'public' }\n * @example For API: { endpoint: '/api/users', method: 'GET' }\n * @example For file: { path: 's3://bucket/data.csv', format: 'csv' }\n */\n config: z.record(z.string(), z.any()).describe('Source configuration'),\n\n /**\n * Incremental sync configuration\n * Allows extracting only changed data\n */\n incremental: z.object({\n enabled: z.boolean().default(false),\n cursorField: z.string().describe('Field to track progress (e.g., updated_at)'),\n cursorValue: z.any().optional().describe('Last processed value'),\n }).optional().describe('Incremental extraction config'),\n});\n\nexport type ETLSource = z.infer<typeof ETLSourceSchema>;\n\n/**\n * ETL Destination Configuration\n */\nexport const ETLDestinationSchema = z.object({\n /**\n * Destination type\n */\n type: ETLEndpointTypeSchema.describe('Destination type'),\n\n /**\n * Connector identifier\n */\n connector: z.string().optional().describe('Connector ID'),\n\n /**\n * Destination-specific configuration\n */\n config: z.record(z.string(), z.any()).describe('Destination configuration'),\n\n /**\n * Write mode\n */\n writeMode: z.enum([\n 'append', // Add new records\n 'overwrite', // Replace all data\n 'upsert', // Insert or update based on key\n 'merge', // Smart merge based on business rules\n ]).default('append').describe('How to write data'),\n\n /**\n * Primary key fields for upsert/merge\n */\n primaryKey: z.array(z.string()).optional().describe('Primary key fields'),\n});\n\nexport type ETLDestination = z.infer<typeof ETLDestinationSchema>;\n\n/**\n * ETL Transformation Type\n */\nexport const ETLTransformationTypeSchema = z.enum([\n 'map', // Field mapping/renaming\n 'filter', // Row filtering\n 'aggregate', // Aggregation/grouping\n 'join', // Joining with other data\n 'script', // Custom JavaScript/Python script\n 'lookup', // Enrich with lookup data\n 'split', // Split one record into multiple\n 'merge', // Merge multiple records into one\n 'normalize', // Data normalization\n 'deduplicate', // Remove duplicates\n]);\n\nexport type ETLTransformationType = z.infer<typeof ETLTransformationTypeSchema>;\n\n/**\n * ETL Transformation Configuration\n */\nexport const ETLTransformationSchema = z.object({\n /**\n * Transformation name\n */\n name: z.string().optional().describe('Transformation name'),\n\n /**\n * Transformation type\n */\n type: ETLTransformationTypeSchema.describe('Transformation type'),\n\n /**\n * Transformation-specific configuration\n * \n * @example For map: { oldField: 'newField' }\n * @example For filter: { condition: 'status == \"active\"' }\n * @example For script: { language: 'javascript', code: '...' }\n */\n config: z.record(z.string(), z.any()).describe('Transformation config'),\n\n /**\n * Whether to continue on error\n */\n continueOnError: z.boolean().default(false).describe('Continue on error'),\n});\n\nexport type ETLTransformation = z.infer<typeof ETLTransformationSchema>;\n\n/**\n * ETL Sync Mode\n */\nexport const ETLSyncModeSchema = z.enum([\n 'full', // Full refresh - extract all data every time\n 'incremental', // Only extract changed data\n 'cdc', // Change Data Capture - real-time streaming\n]);\n\nexport type ETLSyncMode = z.infer<typeof ETLSyncModeSchema>;\n\n/**\n * ETL Pipeline Schema\n * \n * Complete definition of a data pipeline from source to destination with transformations.\n */\nexport const ETLPipelineSchema = z.object({\n /**\n * Pipeline identifier (snake_case)\n */\n name: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Pipeline identifier (snake_case)'),\n\n /**\n * Human-readable pipeline name\n */\n label: z.string().optional().describe('Pipeline display name'),\n\n /**\n * Pipeline description\n */\n description: z.string().optional().describe('Pipeline description'),\n\n /**\n * Data source configuration\n */\n source: ETLSourceSchema.describe('Data source'),\n\n /**\n * Data destination configuration\n */\n destination: ETLDestinationSchema.describe('Data destination'),\n\n /**\n * Transformation steps\n * Applied in order from source to destination\n */\n transformations: z.array(ETLTransformationSchema)\n .optional()\n .describe('Transformation pipeline'),\n\n /**\n * Sync mode\n */\n syncMode: ETLSyncModeSchema.default('full').describe('Sync mode'),\n\n /**\n * Execution schedule (cron expression)\n * \n * @example \"0 2 * * *\" - Daily at 2 AM\n * @example \"0 *\\/4 * * *\" - Every 4 hours\n * @example \"0 0 * * 0\" - Weekly on Sunday\n */\n schedule: z.string().optional().describe('Cron schedule expression'),\n\n /**\n * Whether pipeline is enabled\n */\n enabled: z.boolean().default(true).describe('Pipeline enabled status'),\n\n /**\n * Retry configuration for failed runs\n */\n retry: z.object({\n maxAttempts: z.number().int().min(0).default(3).describe('Max retry attempts'),\n backoffMs: z.number().int().min(0).default(60000).describe('Backoff in milliseconds'),\n }).optional().describe('Retry configuration'),\n\n /**\n * Notification configuration\n */\n notifications: z.object({\n onSuccess: z.array(z.string()).optional().describe('Email addresses for success notifications'),\n onFailure: z.array(z.string()).optional().describe('Email addresses for failure notifications'),\n }).optional().describe('Notification settings'),\n\n /**\n * Pipeline tags for organization\n */\n tags: z.array(z.string()).optional().describe('Pipeline tags'),\n\n /**\n * Custom metadata\n */\n metadata: z.record(z.string(), z.any()).optional().describe('Custom metadata'),\n});\n\nexport type ETLPipeline = z.infer<typeof ETLPipelineSchema>;\n\n/**\n * ETL Run Status\n */\nexport const ETLRunStatusSchema = z.enum([\n 'pending', // Queued for execution\n 'running', // Currently executing\n 'succeeded', // Completed successfully\n 'failed', // Failed with errors\n 'cancelled', // Manually cancelled\n 'timeout', // Timed out\n]);\n\nexport type ETLRunStatus = z.infer<typeof ETLRunStatusSchema>;\n\n/**\n * ETL Pipeline Run Result\n * \n * Result of a pipeline execution\n */\nexport const ETLPipelineRunSchema = z.object({\n /**\n * Run ID\n */\n id: z.string().describe('Run identifier'),\n\n /**\n * Pipeline name\n */\n pipelineName: z.string().describe('Pipeline name'),\n\n /**\n * Run status\n */\n status: ETLRunStatusSchema.describe('Run status'),\n\n /**\n * Start timestamp\n */\n startedAt: z.string().datetime().describe('Start time'),\n\n /**\n * End timestamp\n */\n completedAt: z.string().datetime().optional().describe('Completion time'),\n\n /**\n * Duration in milliseconds\n */\n durationMs: z.number().optional().describe('Duration in ms'),\n\n /**\n * Statistics\n */\n stats: z.object({\n recordsRead: z.number().int().default(0).describe('Records extracted'),\n recordsWritten: z.number().int().default(0).describe('Records loaded'),\n recordsErrored: z.number().int().default(0).describe('Records with errors'),\n bytesProcessed: z.number().int().default(0).describe('Bytes processed'),\n }).optional().describe('Run statistics'),\n\n /**\n * Error information\n */\n error: z.object({\n message: z.string().describe('Error message'),\n code: z.string().optional().describe('Error code'),\n details: z.any().optional().describe('Error details'),\n }).optional().describe('Error information'),\n\n /**\n * Execution logs\n */\n logs: z.array(z.string()).optional().describe('Execution logs'),\n});\n\nexport type ETLPipelineRun = z.infer<typeof ETLPipelineRunSchema>;\n\n/**\n * Helper factory for creating ETL pipelines\n */\nexport const ETL = {\n /**\n * Create a simple database-to-database pipeline\n */\n databaseSync: (params: {\n name: string;\n sourceTable: string;\n destTable: string;\n schedule?: string;\n }): ETLPipeline => ({\n name: params.name,\n source: {\n type: 'database',\n config: { table: params.sourceTable },\n },\n destination: {\n type: 'database',\n config: { table: params.destTable },\n writeMode: 'upsert',\n },\n syncMode: 'incremental',\n schedule: params.schedule,\n enabled: true,\n }),\n\n /**\n * Create an API to database pipeline\n */\n apiToDatabase: (params: {\n name: string;\n apiConnector: string;\n destTable: string;\n schedule?: string;\n }): ETLPipeline => ({\n name: params.name,\n source: {\n type: 'api',\n connector: params.apiConnector,\n config: {},\n },\n destination: {\n type: 'database',\n config: { table: params.destTable },\n writeMode: 'append',\n },\n syncMode: 'full',\n schedule: params.schedule,\n enabled: true,\n }),\n} as const;\n","import { z } from 'zod';\n\n/**\n * Trigger Registry Protocol\n * \n * Lightweight automation triggers for simple integrations.\n * Inspired by Zapier, n8n, and Workato connector architectures.\n * \n * ## When to use Trigger Registry vs. Integration Connector?\n * \n * **Use `automation/trigger-registry.zod.ts` when:**\n * - Building simple automation triggers (e.g., \"when Slack message received, create task\")\n * - No complex authentication needed (simple API keys, basic auth)\n * - Lightweight, single-purpose integrations\n * - Quick setup with minimal configuration\n * - Webhook-based or polling triggers for automation workflows\n * \n * **Use `integration/connector.zod.ts` when:**\n * - Building enterprise-grade connectors (e.g., Salesforce, SAP, Oracle)\n * - Complex OAuth2/SAML authentication required\n * - Bidirectional sync with field mapping and transformations\n * - Webhook management and rate limiting required\n * - Full CRUD operations and data synchronization\n * \n * ## Use Cases\n * \n * 1. **Simple Automation Triggers**\n * - Slack notifications on record updates\n * - Twilio SMS on workflow events\n * - SendGrid email templates\n * \n * 2. **Lightweight Operations**\n * - Single-action integrations (send, notify, log)\n * - No bidirectional sync required\n * - Webhook receivers for incoming events\n * \n * 3. **Quick Integrations**\n * - Payment webhooks (Stripe, PayPal)\n * - Communication triggers (Twilio, SendGrid, Slack)\n * - Simple API calls to third-party services\n * \n * @see https://zapier.com/developer/documentation/v2/\n * @see https://docs.n8n.io/integrations/creating-nodes/\n * @see ../../integration/connector.zod.ts for enterprise connectors\n * \n * @example\n * ```typescript\n * const slackNotifier: Connector = {\n * id: 'slack_notify',\n * name: 'Slack Notification',\n * category: 'communication',\n * authentication: {\n * type: 'apiKey',\n * fields: [{ name: 'webhook_url', label: 'Webhook URL', type: 'url' }]\n * },\n * operations: [\n * { id: 'send_message', name: 'Send Message', type: 'action' }\n * ]\n * }\n * ```\n */\n\n/**\n * Connector Category\n */\nexport const ConnectorCategorySchema = z.enum([\n 'crm', // Customer Relationship Management\n 'payment', // Payment processors\n 'communication', // Email, SMS, Chat\n 'storage', // File storage\n 'analytics', // Analytics platforms\n 'database', // Databases\n 'marketing', // Marketing automation\n 'accounting', // Accounting software\n 'hr', // Human resources\n 'productivity', // Productivity tools\n 'ecommerce', // E-commerce platforms\n 'support', // Customer support\n 'devtools', // Developer tools\n 'social', // Social media\n 'other', // Other category\n]);\n\nexport type ConnectorCategory = z.infer<typeof ConnectorCategorySchema>;\n\n/**\n * Authentication Type\n */\nexport const AuthenticationTypeSchema = z.enum([\n 'none', // No authentication\n 'apiKey', // API key\n 'basic', // Basic auth (username/password)\n 'bearer', // Bearer token\n 'oauth1', // OAuth 1.0\n 'oauth2', // OAuth 2.0\n 'custom', // Custom authentication\n]);\n\nexport type AuthenticationType = z.infer<typeof AuthenticationTypeSchema>;\n\n/**\n * Authentication Field Schema\n */\nexport const AuthFieldSchema = z.object({\n /**\n * Field name (machine name)\n */\n name: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Field name (snake_case)'),\n\n /**\n * Field label\n */\n label: z.string().describe('Field label'),\n\n /**\n * Field type\n */\n type: z.enum(['text', 'password', 'url', 'select'])\n .default('text')\n .describe('Field type'),\n\n /**\n * Field description\n */\n description: z.string().optional().describe('Field description'),\n\n /**\n * Whether field is required\n */\n required: z.boolean().default(true).describe('Required field'),\n\n /**\n * Default value\n */\n default: z.string().optional().describe('Default value'),\n\n /**\n * Options for select fields\n */\n options: z.array(z.object({\n label: z.string(),\n value: z.string(),\n })).optional().describe('Select field options'),\n\n /**\n * Placeholder text\n */\n placeholder: z.string().optional().describe('Placeholder text'),\n});\n\nexport type AuthField = z.infer<typeof AuthFieldSchema>;\n\n/**\n * OAuth 2.0 Configuration\n */\nexport const OAuth2ConfigSchema = z.object({\n /**\n * Authorization URL\n */\n authorizationUrl: z.string().url().describe('Authorization endpoint URL'),\n\n /**\n * Token URL\n */\n tokenUrl: z.string().url().describe('Token endpoint URL'),\n\n /**\n * Scopes to request\n */\n scopes: z.array(z.string()).optional().describe('OAuth scopes'),\n\n /**\n * Client ID field name\n */\n clientIdField: z.string().default('client_id').describe('Client ID field name'),\n\n /**\n * Client secret field name\n */\n clientSecretField: z.string().default('client_secret').describe('Client secret field name'),\n});\n\nexport type OAuth2Config = z.infer<typeof OAuth2ConfigSchema>;\n\n/**\n * Authentication Configuration\n */\nexport const AuthenticationSchema = z.object({\n /**\n * Authentication type\n */\n type: AuthenticationTypeSchema.describe('Authentication type'),\n\n /**\n * Authentication fields\n * Configuration fields needed for this auth type\n */\n fields: z.array(AuthFieldSchema).optional().describe('Authentication fields'),\n\n /**\n * OAuth 2.0 configuration (when type is oauth2)\n */\n oauth2: OAuth2ConfigSchema.optional().describe('OAuth 2.0 configuration'),\n\n /**\n * Test authentication instructions\n */\n test: z.object({\n url: z.string().optional().describe('Test endpoint URL'),\n method: z.enum(['GET', 'POST', 'PUT', 'DELETE']).default('GET').describe('HTTP method'),\n }).optional().describe('Authentication test configuration'),\n});\n\nexport type Authentication = z.infer<typeof AuthenticationSchema>;\n\n/**\n * Connector Operation Type\n */\nexport const OperationTypeSchema = z.enum([\n 'read', // Read/query data\n 'write', // Create/update data\n 'delete', // Delete data\n 'search', // Search operation\n 'trigger', // Webhook/polling trigger\n 'action', // Custom action\n]);\n\nexport type OperationType = z.infer<typeof OperationTypeSchema>;\n\n/**\n * Operation Parameter Schema\n */\nexport const OperationParameterSchema = z.object({\n /**\n * Parameter name\n */\n name: z.string().describe('Parameter name'),\n\n /**\n * Parameter label\n */\n label: z.string().describe('Parameter label'),\n\n /**\n * Parameter description\n */\n description: z.string().optional().describe('Parameter description'),\n\n /**\n * Parameter type\n */\n type: z.enum(['string', 'number', 'boolean', 'array', 'object', 'date', 'file'])\n .describe('Parameter type'),\n\n /**\n * Whether parameter is required\n */\n required: z.boolean().default(false).describe('Required parameter'),\n\n /**\n * Default value\n */\n default: z.any().optional().describe('Default value'),\n\n /**\n * Validation schema\n */\n validation: z.record(z.string(), z.any()).optional().describe('Validation rules'),\n\n /**\n * Dynamic options function\n */\n dynamicOptions: z.string().optional().describe('Function to load dynamic options'),\n});\n\nexport type OperationParameter = z.infer<typeof OperationParameterSchema>;\n\n/**\n * Connector Operation Schema\n */\nexport const ConnectorOperationSchema = z.object({\n /**\n * Operation identifier\n */\n id: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Operation ID (snake_case)'),\n\n /**\n * Operation name\n */\n name: z.string().describe('Operation name'),\n\n /**\n * Operation description\n */\n description: z.string().optional().describe('Operation description'),\n\n /**\n * Operation type\n */\n type: OperationTypeSchema.describe('Operation type'),\n\n /**\n * Input parameters\n */\n inputSchema: z.array(OperationParameterSchema)\n .optional()\n .describe('Input parameters'),\n\n /**\n * Output schema\n */\n outputSchema: z.record(z.string(), z.any())\n .optional()\n .describe('Output schema'),\n\n /**\n * Sample output for documentation\n */\n sampleOutput: z.any().optional().describe('Sample output'),\n\n /**\n * Whether operation supports pagination\n */\n supportsPagination: z.boolean().default(false).describe('Supports pagination'),\n\n /**\n * Whether operation supports filtering\n */\n supportsFiltering: z.boolean().default(false).describe('Supports filtering'),\n});\n\nexport type ConnectorOperation = z.infer<typeof ConnectorOperationSchema>;\n\n/**\n * Connector Trigger Schema\n * \n * Triggers are special operations that watch for events and initiate workflows.\n */\nexport const ConnectorTriggerSchema = z.object({\n /**\n * Trigger identifier\n */\n id: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Trigger ID (snake_case)'),\n\n /**\n * Trigger name\n */\n name: z.string().describe('Trigger name'),\n\n /**\n * Trigger description\n */\n description: z.string().optional().describe('Trigger description'),\n\n /**\n * Trigger type\n */\n type: z.enum(['webhook', 'polling', 'stream'])\n .describe('Trigger mechanism'),\n\n /**\n * Trigger configuration\n */\n config: z.record(z.string(), z.any())\n .optional()\n .describe('Trigger configuration'),\n\n /**\n * Output schema\n */\n outputSchema: z.record(z.string(), z.any())\n .optional()\n .describe('Event payload schema'),\n\n /**\n * Polling interval (for polling triggers)\n * In milliseconds\n */\n pollingIntervalMs: z.number().int().min(1000)\n .optional()\n .describe('Polling interval in ms'),\n});\n\nexport type ConnectorTrigger = z.infer<typeof ConnectorTriggerSchema>;\n\n/**\n * Connector Schema\n * \n * Complete definition of a connector to an external system.\n */\nexport const ConnectorSchema = z.object({\n /**\n * Connector identifier\n * Must be globally unique\n */\n id: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Connector ID (snake_case)'),\n\n /**\n * Connector name\n */\n name: z.string().describe('Connector name'),\n\n /**\n * Connector description\n */\n description: z.string().optional().describe('Connector description'),\n\n /**\n * Connector version (semver)\n */\n version: z.string().optional().describe('Connector version'),\n\n /**\n * Connector icon URL or name\n */\n icon: z.string().optional().describe('Connector icon'),\n\n /**\n * Connector category\n */\n category: ConnectorCategorySchema.describe('Connector category'),\n\n /**\n * Base URL for API calls\n */\n baseUrl: z.string().url().optional().describe('API base URL'),\n\n /**\n * Authentication configuration\n */\n authentication: AuthenticationSchema.describe('Authentication config'),\n\n /**\n * Available operations\n */\n operations: z.array(ConnectorOperationSchema)\n .optional()\n .describe('Connector operations'),\n\n /**\n * Available triggers\n */\n triggers: z.array(ConnectorTriggerSchema)\n .optional()\n .describe('Connector triggers'),\n\n /**\n * Rate limiting information\n */\n rateLimit: z.object({\n requestsPerSecond: z.number().optional().describe('Max requests per second'),\n requestsPerMinute: z.number().optional().describe('Max requests per minute'),\n requestsPerHour: z.number().optional().describe('Max requests per hour'),\n }).optional().describe('Rate limiting'),\n\n /**\n * Connector author\n */\n author: z.string().optional().describe('Connector author'),\n\n /**\n * Documentation URL\n */\n documentation: z.string().url().optional().describe('Documentation URL'),\n\n /**\n * Homepage URL\n */\n homepage: z.string().url().optional().describe('Homepage URL'),\n\n /**\n * License\n */\n license: z.string().optional().describe('License (SPDX identifier)'),\n\n /**\n * Tags for discovery\n */\n tags: z.array(z.string()).optional().describe('Connector tags'),\n\n /**\n * Whether connector is verified/certified\n */\n verified: z.boolean().default(false).describe('Verified connector'),\n\n /**\n * Custom metadata\n */\n metadata: z.record(z.string(), z.any()).optional().describe('Custom metadata'),\n});\n\nexport type Connector = z.infer<typeof ConnectorSchema>;\n\n/**\n * Connector Instance Schema\n * \n * A configured instance of a connector with credentials.\n */\nexport const ConnectorInstanceSchema = z.object({\n /**\n * Instance ID\n */\n id: z.string().describe('Instance ID'),\n\n /**\n * Connector ID this instance uses\n */\n connectorId: z.string().describe('Connector ID'),\n\n /**\n * Instance name\n */\n name: z.string().describe('Instance name'),\n\n /**\n * Instance description\n */\n description: z.string().optional().describe('Instance description'),\n\n /**\n * Authentication credentials (encrypted)\n */\n credentials: z.record(z.string(), z.any()).describe('Encrypted credentials'),\n\n /**\n * Additional configuration\n */\n config: z.record(z.string(), z.any()).optional().describe('Additional config'),\n\n /**\n * Whether instance is active\n */\n active: z.boolean().default(true).describe('Instance active status'),\n\n /**\n * Created timestamp\n */\n createdAt: z.string().datetime().optional().describe('Creation time'),\n\n /**\n * Last tested timestamp\n */\n lastTestedAt: z.string().datetime().optional().describe('Last test time'),\n\n /**\n * Test status\n */\n testStatus: z.enum(['unknown', 'success', 'failed'])\n .default('unknown')\n .describe('Connection test status'),\n});\n\nexport type ConnectorInstance = z.infer<typeof ConnectorInstanceSchema>;\n\n/**\n * Helper factory for creating connectors\n */\nexport const Connector = {\n /**\n * Create a basic API key connector\n */\n apiKey: (params: {\n id: string;\n name: string;\n category: ConnectorCategory;\n baseUrl: string;\n }): Connector => ({\n id: params.id,\n name: params.name,\n category: params.category,\n baseUrl: params.baseUrl,\n authentication: {\n type: 'apiKey',\n fields: [\n {\n name: 'api_key',\n label: 'API Key',\n type: 'password',\n required: true,\n },\n ],\n },\n verified: false,\n }),\n\n /**\n * Create an OAuth 2.0 connector\n */\n oauth2: (params: {\n id: string;\n name: string;\n category: ConnectorCategory;\n baseUrl: string;\n authUrl: string;\n tokenUrl: string;\n scopes?: string[];\n }): Connector => ({\n id: params.id,\n name: params.name,\n category: params.category,\n baseUrl: params.baseUrl,\n authentication: {\n type: 'oauth2',\n oauth2: {\n authorizationUrl: params.authUrl,\n tokenUrl: params.tokenUrl,\n clientIdField: 'client_id',\n clientSecretField: 'client_secret',\n scopes: params.scopes,\n },\n },\n verified: false,\n }),\n} as const;\n","import { z } from 'zod';\nimport { FieldMappingSchema } from '../shared/mapping.zod';\n\n/**\n * Data Sync Protocol - LEVEL 1: Simple Synchronization\n * \n * Inspired by Salesforce Connect, Segment Sync, and Census Reverse ETL.\n * \n * **Positioning in 3-Layer Architecture:**\n * - **L1: Simple Sync** (THIS FILE) - Business users - Sync Salesforce to Sheets\n * - **L2: ETL Pipeline** (automation/etl.zod.ts) - Data engineers - Aggregate 10 sources to warehouse\n * - **L3: Enterprise Connector** (integration/connector.zod.ts) - System integrators - Full SAP integration\n * \n * Data sync provides bidirectional or unidirectional data synchronization\n * between ObjectStack and external systems, maintaining data consistency\n * across platforms.\n * \n * **SCOPE: Simple field mappings only. NO complex transformations.**\n * For complex transformations (joins, aggregates, custom SQL), use ETL Pipeline (Level 2).\n * \n * ## When to Use This Layer\n * \n * **Use Simple Sync when:**\n * - Syncing 1:1 fields between two systems\n * - Simple field transformations (uppercase, cast, etc.)\n * - No complex logic required\n * - Business users need to configure integrations\n * \n * **Examples:**\n * - Salesforce Contact ↔ Google Sheets\n * - HubSpot Company ↔ CRM Account\n * - Shopify Orders → Accounting System\n * \n * **When to upgrade:**\n * - Need multi-source joins → Use {@link file://./etl.zod.ts | ETL Pipeline}\n * - Need complex authentication/webhooks → Use {@link file://../integration/connector.zod.ts | Enterprise Connector}\n * - Need aggregations or data warehousing → Use {@link file://./etl.zod.ts | ETL Pipeline}\n * \n * @see {@link file://./etl.zod.ts} for Level 2 (data engineering)\n * @see {@link file://../integration/connector.zod.ts} for Level 3 (enterprise integration)\n * \n * ## Use Cases\n * \n * 1. **CRM Integration**\n * - Sync contacts between ObjectStack and Salesforce\n * - Keep opportunity data synchronized\n * - Bidirectional updates\n * \n * 2. **Customer Data Platform (CDP)**\n * - Sync user profiles to Segment\n * - Enrichment data from Clearbit\n * - Marketing automation sync\n * \n * 3. **Operational Analytics**\n * - Sync production data to analytics warehouse\n * - Real-time dashboards\n * - Business intelligence\n * \n * @see https://help.salesforce.com/s/articleView?id=sf.platform_connect_about.htm\n * @see https://segment.com/docs/connections/sync/\n * @see https://www.getcensus.com/\n * \n * @example\n * ```typescript\n * const contactSync: DataSyncConfig = {\n * name: 'salesforce_contact_sync',\n * label: 'Salesforce Contact Sync',\n * source: {\n * object: 'contact',\n * filters: { status: 'active' }\n * },\n * destination: {\n * connector: 'salesforce',\n * operation: 'upsert_contact',\n * mapping: {\n * first_name: 'FirstName',\n * last_name: 'LastName',\n * email: 'Email'\n * }\n * },\n * syncMode: 'incremental',\n * schedule: '0 * * * *' // Hourly\n * }\n * ```\n */\n\n/**\n * Sync Direction\n */\nexport const SyncDirectionSchema = z.enum([\n 'push', // ObjectStack -> External (one-way)\n 'pull', // External -> ObjectStack (one-way)\n 'bidirectional', // Both directions\n]);\n\nexport type SyncDirection = z.infer<typeof SyncDirectionSchema>;\n\n/**\n * Sync Mode\n */\nexport const SyncModeSchema = z.enum([\n 'full', // Full refresh every time\n 'incremental', // Only sync changed records\n 'realtime', // Real-time streaming sync\n]);\n\nexport type SyncMode = z.infer<typeof SyncModeSchema>;\n\n/**\n * Conflict Resolution Strategy\n */\nexport const ConflictResolutionSchema = z.enum([\n 'source_wins', // Source system always wins\n 'destination_wins', // Destination system always wins\n 'latest_wins', // Most recently modified wins\n 'manual', // Flag for manual resolution\n 'merge', // Smart merge (custom logic)\n]);\n\nexport type ConflictResolution = z.infer<typeof ConflictResolutionSchema>;\n\n/**\n * Field Mapping for Data Sync\n * \n * Uses the canonical field mapping protocol from shared/mapping.zod.ts\n * for simple 1:1 field transformations.\n * \n * @see {@link FieldMappingSchema} for the base field mapping schema\n */\n\n/**\n * Data Source Configuration\n */\nexport const DataSourceConfigSchema = z.object({\n /**\n * Source object name\n * For ObjectStack objects\n */\n object: z.string().optional().describe('ObjectStack object name'),\n\n /**\n * Filter conditions\n * Only sync records matching these filters\n */\n filters: z.any().optional().describe('Filter conditions'),\n\n /**\n * Fields to include\n * If not specified, all fields are synced\n */\n fields: z.array(z.string()).optional().describe('Fields to sync'),\n\n /**\n * External connector instance ID\n * For external data sources\n */\n connectorInstanceId: z.string().optional().describe('Connector instance ID'),\n\n /**\n * External resource identifier\n * e.g., Salesforce object name, database table, API endpoint\n */\n externalResource: z.string().optional().describe('External resource ID'),\n});\n\nexport type DataSourceConfig = z.infer<typeof DataSourceConfigSchema>;\n\n/**\n * Data Destination Configuration\n */\nexport const DataDestinationConfigSchema = z.object({\n /**\n * Destination object name\n * For ObjectStack objects\n */\n object: z.string().optional().describe('ObjectStack object name'),\n\n /**\n * Connector instance ID\n * For external destinations\n */\n connectorInstanceId: z.string().optional().describe('Connector instance ID'),\n\n /**\n * Operation to perform\n */\n operation: z.enum([\n 'insert', // Create new records only\n 'update', // Update existing records only\n 'upsert', // Insert or update based on key\n 'delete', // Delete records\n 'sync', // Full synchronization\n ]).describe('Sync operation'),\n\n /**\n * Field mappings\n * Maps source fields to destination fields\n */\n mapping: z.union([\n z.record(z.string(), z.string()), // Simple mapping: { sourceField: 'destField' }\n z.array(FieldMappingSchema), // Advanced mapping with transformations\n ]).optional().describe('Field mappings'),\n\n /**\n * External resource identifier\n */\n externalResource: z.string().optional().describe('External resource ID'),\n\n /**\n * Match key for upsert operations\n * Fields to use for matching existing records\n */\n matchKey: z.array(z.string()).optional().describe('Match key fields'),\n});\n\nexport type DataDestinationConfig = z.infer<typeof DataDestinationConfigSchema>;\n\n/**\n * Data Sync Configuration Schema\n * \n * Complete definition of a data synchronization between systems.\n */\nexport const DataSyncConfigSchema = z.object({\n /**\n * Sync configuration name (snake_case)\n */\n name: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Sync configuration name (snake_case)'),\n\n /**\n * Human-readable label\n */\n label: z.string().optional().describe('Sync display name'),\n\n /**\n * Description\n */\n description: z.string().optional().describe('Sync description'),\n\n /**\n * Source configuration\n */\n source: DataSourceConfigSchema.describe('Data source'),\n\n /**\n * Destination configuration\n */\n destination: DataDestinationConfigSchema.describe('Data destination'),\n\n /**\n * Sync direction\n */\n direction: SyncDirectionSchema.default('push').describe('Sync direction'),\n\n /**\n * Sync mode\n */\n syncMode: SyncModeSchema.default('incremental').describe('Sync mode'),\n\n /**\n * Conflict resolution strategy\n */\n conflictResolution: ConflictResolutionSchema\n .default('latest_wins')\n .describe('Conflict resolution'),\n\n /**\n * Execution schedule (cron expression)\n * For scheduled syncs\n * \n * @example \"0 * * * *\" - Hourly\n * @example \"*\\/15 * * * *\" - Every 15 minutes\n */\n schedule: z.string().optional().describe('Cron schedule'),\n\n /**\n * Whether sync is enabled\n */\n enabled: z.boolean().default(true).describe('Sync enabled'),\n\n /**\n * Change tracking field\n * Field to track when records were last modified\n * Used for incremental sync\n * \n * @example \"updated_at\", \"modified_date\"\n */\n changeTrackingField: z.string()\n .optional()\n .describe('Field for change tracking'),\n\n /**\n * Batch size\n * Number of records to process per batch\n */\n batchSize: z.number().int().min(1).max(10000)\n .default(100)\n .describe('Batch size for processing'),\n\n /**\n * Retry configuration\n */\n retry: z.object({\n maxAttempts: z.number().int().min(0).default(3).describe('Max retries'),\n backoffMs: z.number().int().min(0).default(30000).describe('Backoff duration'),\n }).optional().describe('Retry configuration'),\n\n /**\n * Pre-sync validation rules\n */\n validation: z.object({\n required: z.array(z.string()).optional().describe('Required fields'),\n unique: z.array(z.string()).optional().describe('Unique constraint fields'),\n custom: z.array(z.object({\n name: z.string(),\n condition: z.string().describe('Validation condition'),\n message: z.string().describe('Error message'),\n })).optional().describe('Custom validation rules'),\n }).optional().describe('Validation rules'),\n\n /**\n * Error handling configuration\n */\n errorHandling: z.object({\n onValidationError: z.enum(['skip', 'fail', 'log']).default('skip'),\n onSyncError: z.enum(['skip', 'fail', 'retry']).default('retry'),\n notifyOnError: z.array(z.string()).optional().describe('Email notifications'),\n }).optional().describe('Error handling'),\n\n /**\n * Performance optimization\n */\n optimization: z.object({\n parallelBatches: z.boolean().default(false).describe('Process batches in parallel'),\n cacheEnabled: z.boolean().default(true).describe('Enable caching'),\n compressionEnabled: z.boolean().default(false).describe('Enable compression'),\n }).optional().describe('Performance optimization'),\n\n /**\n * Audit and logging\n */\n audit: z.object({\n logLevel: z.enum(['none', 'error', 'warn', 'info', 'debug']).default('info'),\n retainLogsForDays: z.number().int().min(1).default(30),\n trackChanges: z.boolean().default(true).describe('Track all changes'),\n }).optional().describe('Audit configuration'),\n\n /**\n * Tags for organization\n */\n tags: z.array(z.string()).optional().describe('Sync tags'),\n\n /**\n * Custom metadata\n */\n metadata: z.record(z.string(), z.any()).optional().describe('Custom metadata'),\n});\n\nexport type DataSyncConfig = z.infer<typeof DataSyncConfigSchema>;\n\n/**\n * Sync Execution Status\n */\nexport const SyncExecutionStatusSchema = z.enum([\n 'pending', // Queued\n 'running', // Currently executing\n 'completed', // Successfully completed\n 'partial', // Completed with some errors\n 'failed', // Failed\n 'cancelled', // Manually cancelled\n]);\n\nexport type SyncExecutionStatus = z.infer<typeof SyncExecutionStatusSchema>;\n\n/**\n * Sync Execution Result Schema\n * \n * Result of a sync execution.\n */\nexport const SyncExecutionResultSchema = z.object({\n /**\n * Execution ID\n */\n id: z.string().describe('Execution ID'),\n\n /**\n * Sync configuration name\n */\n syncName: z.string().describe('Sync name'),\n\n /**\n * Execution status\n */\n status: SyncExecutionStatusSchema.describe('Execution status'),\n\n /**\n * Start timestamp\n */\n startedAt: z.string().datetime().describe('Start time'),\n\n /**\n * End timestamp\n */\n completedAt: z.string().datetime().optional().describe('Completion time'),\n\n /**\n * Duration in milliseconds\n */\n durationMs: z.number().optional().describe('Duration in ms'),\n\n /**\n * Statistics\n */\n stats: z.object({\n recordsProcessed: z.number().int().default(0).describe('Total records processed'),\n recordsInserted: z.number().int().default(0).describe('Records inserted'),\n recordsUpdated: z.number().int().default(0).describe('Records updated'),\n recordsDeleted: z.number().int().default(0).describe('Records deleted'),\n recordsSkipped: z.number().int().default(0).describe('Records skipped'),\n recordsErrored: z.number().int().default(0).describe('Records with errors'),\n conflictsDetected: z.number().int().default(0).describe('Conflicts detected'),\n conflictsResolved: z.number().int().default(0).describe('Conflicts resolved'),\n }).optional().describe('Execution statistics'),\n\n /**\n * Errors encountered\n */\n errors: z.array(z.object({\n recordId: z.string().optional().describe('Record ID'),\n field: z.string().optional().describe('Field name'),\n message: z.string().describe('Error message'),\n code: z.string().optional().describe('Error code'),\n })).optional().describe('Errors'),\n\n /**\n * Execution logs\n */\n logs: z.array(z.string()).optional().describe('Execution logs'),\n});\n\nexport type SyncExecutionResult = z.infer<typeof SyncExecutionResultSchema>;\n\n/**\n * Helper factory for creating sync configurations\n */\nexport const Sync = {\n /**\n * Create a simple object-to-object sync\n */\n objectSync: (params: {\n name: string;\n sourceObject: string;\n destObject: string;\n mapping: Record<string, string>;\n schedule?: string;\n }): DataSyncConfig => ({\n name: params.name,\n source: {\n object: params.sourceObject,\n },\n destination: {\n object: params.destObject,\n operation: 'upsert',\n mapping: params.mapping,\n },\n direction: 'push',\n syncMode: 'incremental',\n conflictResolution: 'latest_wins',\n batchSize: 100,\n schedule: params.schedule,\n enabled: true,\n }),\n\n /**\n * Create a connector sync\n */\n connectorSync: (params: {\n name: string;\n sourceObject: string;\n connectorInstanceId: string;\n externalResource: string;\n mapping: Record<string, string>;\n schedule?: string;\n }): DataSyncConfig => ({\n name: params.name,\n source: {\n object: params.sourceObject,\n },\n destination: {\n connectorInstanceId: params.connectorInstanceId,\n externalResource: params.externalResource,\n operation: 'upsert',\n mapping: params.mapping,\n },\n direction: 'push',\n syncMode: 'incremental',\n conflictResolution: 'latest_wins',\n batchSize: 100,\n schedule: params.schedule,\n enabled: true,\n }),\n\n /**\n * Create a bidirectional sync\n */\n bidirectionalSync: (params: {\n name: string;\n object: string;\n connectorInstanceId: string;\n externalResource: string;\n mapping: Record<string, string>;\n schedule?: string;\n }): DataSyncConfig => ({\n name: params.name,\n source: {\n object: params.object,\n },\n destination: {\n connectorInstanceId: params.connectorInstanceId,\n externalResource: params.externalResource,\n operation: 'sync',\n mapping: params.mapping,\n },\n direction: 'bidirectional',\n syncMode: 'incremental',\n conflictResolution: 'latest_wins',\n batchSize: 100,\n schedule: params.schedule,\n enabled: true,\n }),\n} as const;\n","import { z } from 'zod';\n\n/**\n * Base Field Mapping Protocol\n * \n * Shared by: ETL, Sync, Connector, External Lookup\n * \n * This module provides the canonical field mapping schema used across\n * ObjectStack for data transformation and synchronization.\n * \n * **Use Cases:**\n * - ETL pipelines (data/mapping.zod.ts)\n * - Data synchronization (automation/sync.zod.ts)\n * - Integration connectors (integration/connector.zod.ts)\n * - External lookups (data/external-lookup.zod.ts)\n * \n * @example Basic field mapping\n * ```typescript\n * const mapping: FieldMapping = {\n * source: 'external_user_id',\n * target: 'user_id',\n * };\n * ```\n * \n * @example With transformation\n * ```typescript\n * const mapping: FieldMapping = {\n * source: 'user_name',\n * target: 'name',\n * transform: { type: 'cast', targetType: 'string' },\n * defaultValue: 'Unknown'\n * };\n * ```\n */\n\n/**\n * Transform Type Schema\n * \n * Defines the type of transformation to apply to a field value.\n * Implementations can extend this for domain-specific transforms.\n */\nexport const TransformTypeSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('constant'),\n value: z.any().describe('Constant value to use'),\n }).describe('Set a constant value'),\n \n z.object({\n type: z.literal('cast'),\n targetType: z.enum(['string', 'number', 'boolean', 'date']).describe('Target data type'),\n }).describe('Cast to a specific data type'),\n \n z.object({\n type: z.literal('lookup'),\n table: z.string().describe('Lookup table name'),\n keyField: z.string().describe('Field to match on'),\n valueField: z.string().describe('Field to retrieve'),\n }).describe('Lookup value from another table'),\n \n z.object({\n type: z.literal('javascript'),\n expression: z.string().describe('JavaScript expression (e.g., \"value.toUpperCase()\")'),\n }).describe('Custom JavaScript transformation'),\n \n z.object({\n type: z.literal('map'),\n mappings: z.record(z.string(), z.any()).describe('Value mappings (e.g., {\"Active\": \"active\"})'),\n }).describe('Map values using a dictionary'),\n]);\n\nexport type TransformType = z.infer<typeof TransformTypeSchema>;\n\n/**\n * Field Mapping Schema\n * \n * Base schema for mapping fields between source and target systems.\n * \n * **NAMING CONVENTION:**\n * - source: Field name in the source system\n * - target: Field name in the target system (should be snake_case for ObjectStack)\n * \n * @example\n * ```typescript\n * {\n * source: 'FirstName',\n * target: 'first_name',\n * transform: { type: 'cast', targetType: 'string' },\n * defaultValue: ''\n * }\n * ```\n */\nexport const FieldMappingSchema = z.object({\n /**\n * Source field name\n */\n source: z.string().describe('Source field name'),\n \n /**\n * Target field name (should be snake_case for ObjectStack)\n */\n target: z.string().describe('Target field name'),\n \n /**\n * Transformation to apply\n */\n transform: TransformTypeSchema.optional().describe('Transformation to apply'),\n \n /**\n * Default value if source is null/undefined\n */\n defaultValue: z.any().optional().describe('Default if source is null/undefined'),\n});\n\nexport type FieldMapping = z.infer<typeof FieldMappingSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA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QAAQ;AAAA,MACN,QAAQ,OAAO;AAAA,IACjB;AAAA,IACA,aAAa;AAAA,MACX,qBAAqB,OAAO;AAAA,MAC5B,kBAAkB,OAAO;AAAA,MACzB,WAAW;AAAA,MACX,SAAS,OAAO;AAAA,IAClB;AAAA,IACA,WAAW;AAAA,IACX,UAAU;AAAA,IACV,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,UAAU,OAAO;AAAA,IACjB,SAAS;AAAA,EACX;AACF;","names":["import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod"]}
|
|
1
|
+
{"version":3,"sources":["../../src/automation/index.ts","../../src/automation/workflow.zod.ts","../../src/shared/identifiers.zod.ts","../../src/automation/flow.zod.ts","../../src/automation/webhook.zod.ts","../../src/automation/approval.zod.ts","../../src/automation/etl.zod.ts","../../src/automation/trigger-registry.zod.ts","../../src/automation/sync.zod.ts","../../src/shared/mapping.zod.ts","../../src/automation/state-machine.zod.ts"],"sourcesContent":["\nexport * from './workflow.zod';\nexport * from './flow.zod';\nexport * from './webhook.zod';\nexport * from './approval.zod';\nexport * from './etl.zod';\nexport * from './trigger-registry.zod';\nexport * from './sync.zod';\nexport * from './state-machine.zod';\n","import { z } from 'zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\n\n/**\n * Trigger events for workflow automation\n */\nexport const WorkflowTriggerType = z.enum([\n 'on_create', // When record is created\n 'on_update', // When record is updated\n 'on_create_or_update', // Both\n 'on_delete', // When record is deleted\n 'schedule' // Time-based (cron)\n]);\n\n/**\n * Schema for Workflow Field Update Action\n * @example\n * {\n * name: \"update_status\",\n * type: \"field_update\",\n * field: \"status\",\n * value: \"approved\"\n * }\n */\nexport const FieldUpdateActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('field_update'),\n field: z.string().describe('Field to update'),\n value: z.any().describe('Value or Formula to set'),\n});\n\n/**\n * Schema for Workflow Email Alert Action\n * @example\n * {\n * name: \"send_approval_email\",\n * type: \"email_alert\",\n * template: \"approval_request_email\",\n * recipients: [\"user_id_123\", \"manager_field\"]\n * }\n */\nexport const EmailAlertActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('email_alert'),\n template: z.string().describe('Email template ID/DevName'),\n recipients: z.array(z.string()).describe('List of recipient emails or user IDs'),\n});\n\n/**\n * Schema for Connector Action Reference\n * Executes a capability defined in an integration connector.\n * Replaces hardcoded vendor actions (Slack, Twilio, etc).\n * \n * @example Send Slack Message\n * {\n * name: \"notify_slack\",\n * type: \"connector_action\",\n * connectorId: \"slack\",\n * actionId: \"post_message\",\n * input: {\n * channel: \"#general\",\n * text: \"New deal closed: {name}\"\n * }\n * }\n */\nexport const ConnectorActionRefSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('connector_action'),\n connectorId: z.string().describe('Target Connector ID (e.g. slack, twilio)'),\n actionId: z.string().describe('Target Action ID (e.g. send_message)'),\n input: z.record(z.string(), z.any()).describe('Input parameters matching the action schema'),\n});\n\n/**\n * Schema for HTTP Callout Action\n * Makes a REST API call to an external service.\n * @example\n * {\n * name: \"sync_to_erp\",\n * type: \"http_call\",\n * url: \"https://erp.api/orders\",\n * method: \"POST\",\n * headers: { \"Authorization\": \"Bearer {token}\" },\n * body: \"{ ... }\"\n * }\n */\nexport const HttpCallActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('http_call'),\n url: z.string().describe('Target URL'),\n method: z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH']).default('POST').describe('HTTP Method'),\n headers: z.record(z.string(), z.string()).optional().describe('HTTP Headers'),\n body: z.string().optional().describe('Request body (JSON or text)'),\n});\n\n/**\n * Schema for Workflow Task Creation Action\n * @example\n * {\n * name: \"create_followup_task\",\n * type: \"task_creation\",\n * taskObject: \"tasks\",\n * subject: \"Follow up with client\",\n * dueDate: \"TODAY() + 3\"\n * }\n */\nexport const TaskCreationActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('task_creation'),\n taskObject: z.string().describe('Task object name (e.g., \"task\", \"project_task\")'),\n subject: z.string().describe('Task subject/title'),\n description: z.string().optional().describe('Task description'),\n assignedTo: z.string().optional().describe('User ID or field reference for assignee'),\n dueDate: z.string().optional().describe('Due date (ISO string or formula)'),\n priority: z.string().optional().describe('Task priority'),\n relatedTo: z.string().optional().describe('Related record ID or field reference'),\n additionalFields: z.record(z.string(), z.any()).optional().describe('Additional custom fields'),\n});\n\n/**\n * Schema for Workflow Push Notification Action\n */\nexport const PushNotificationActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('push_notification'),\n title: z.string().describe('Notification title'),\n body: z.string().describe('Notification body text'),\n recipients: z.array(z.string()).describe('User IDs or device tokens'),\n data: z.record(z.string(), z.any()).optional().describe('Additional data payload'),\n badge: z.number().optional().describe('Badge count (iOS)'),\n sound: z.string().optional().describe('Notification sound'),\n clickAction: z.string().optional().describe('Action/URL when notification is clicked'),\n});\n\n/**\n * Schema for Workflow Custom Script Action\n */\nexport const CustomScriptActionSchema = z.object({\n name: z.string().describe('Action name'),\n type: z.literal('custom_script'),\n language: z.enum(['javascript', 'typescript', 'python']).default('javascript').describe('Script language'),\n code: z.string().describe('Script code to execute'),\n timeout: z.number().default(30000).describe('Execution timeout in milliseconds'),\n context: z.record(z.string(), z.any()).optional().describe('Additional context variables'),\n});\n\n/**\n * Universal Workflow Action Schema\n * Union of all supported action types.\n */\nexport const WorkflowActionSchema = z.discriminatedUnion('type', [\n FieldUpdateActionSchema,\n EmailAlertActionSchema,\n HttpCallActionSchema,\n ConnectorActionRefSchema,\n TaskCreationActionSchema,\n PushNotificationActionSchema,\n CustomScriptActionSchema,\n]);\n\nexport type WorkflowAction = z.infer<typeof WorkflowActionSchema>;\n\n/**\n * Time Trigger Definition\n * Schedules actions to run relative to a specific time or date field.\n */\nexport const TimeTriggerSchema = z.object({\n id: z.string().optional().describe('Unique identifier'),\n \n /** Timing Logic */\n timeLength: z.number().int().describe('Duration amount (e.g. 1, 30)'),\n timeUnit: z.enum(['minutes', 'hours', 'days']).describe('Unit of time'),\n \n /** Reference Point */\n offsetDirection: z.enum(['before', 'after']).describe('Before or After the reference date'),\n offsetFrom: z.enum(['trigger_date', 'date_field']).describe('Basis for calculation'),\n dateField: z.string().optional().describe('Date field to calculate from (required if offsetFrom is date_field)'),\n \n /** Actions */\n actions: z.array(WorkflowActionSchema).describe('Actions to execute at the scheduled time'),\n});\n\n/**\n * Schema for Workflow Rules (Automation)\n * \n * **NAMING CONVENTION:**\n * Workflow names are machine identifiers and must be lowercase snake_case.\n * \n * @example Good workflow names\n * - 'send_welcome_email'\n * - 'update_lead_status'\n * - 'notify_manager_on_close'\n * - 'calculate_discount'\n * \n * @example Bad workflow names (will be rejected)\n * - 'SendWelcomeEmail' (PascalCase)\n * - 'updateLeadStatus' (camelCase)\n * - 'Send Welcome Email' (spaces)\n * \n * @example Complete Workflow\n * {\n * name: \"new_lead_process\",\n * objectName: \"lead\",\n * triggerType: \"on_create\",\n * criteria: \"amount > 1000\",\n * active: true,\n * actions: [\n * {\n * name: \"set_status\",\n * type: \"field_update\",\n * field: \"status\",\n * value: \"new\"\n * },\n * {\n * name: \"notify_team\",\n * type: \"connector_action\",\n * connectorId: \"slack\",\n * actionId: \"post_message\",\n * input: { channel: \"#sales\", text: \"New high value lead!\" }\n * }\n * ],\n * timeTriggers: [\n * {\n * timeLength: 2,\n * timeUnit: \"days\",\n * offsetDirection: \"after\",\n * offsetFrom: \"trigger_date\",\n * actions: [\n * {\n * name: \"followup_check\",\n * type: \"task_creation\",\n * taskObject: \"task\",\n * subject: \"Follow up lead\",\n * dueDate: \"TODAY()\"\n * }\n * ]\n * }\n * ]\n * }\n */\nexport const WorkflowRuleSchema = z.object({\n /** Machine name */\n name: SnakeCaseIdentifierSchema.describe('Unique workflow name (lowercase snake_case)'),\n \n /** Target Object */\n objectName: z.string().describe('Target Object'),\n \n /** When to evaluate the rule */\n triggerType: WorkflowTriggerType.describe('When to evaluate'),\n \n /** \n * Condition to start the workflow.\n * If empty, runs on every trigger event.\n */\n criteria: z.string().optional().describe('Formula condition. If TRUE, actions execute.'),\n \n /** Actions to execute immediately */\n actions: z.array(WorkflowActionSchema).optional().describe('Immediate actions'),\n \n /** \n * Time-Dependent Actions \n * Actions scheduled to run in the future.\n */\n timeTriggers: z.array(TimeTriggerSchema).optional().describe('Scheduled actions relative to trigger or date field'),\n \n /** Active status */\n active: z.boolean().default(true).describe('Whether this workflow is active'),\n \n /** Recursion Control */\n reevaluateOnChange: z.boolean().default(false).describe('Re-evaluate rule if field updates change the record validity'),\n});\n\nexport type WorkflowRule = z.infer<typeof WorkflowRuleSchema>;\nexport type TimeTrigger = z.infer<typeof TimeTriggerSchema>;\n","import { z } from 'zod';\n\n/**\n * System Identifier Schema\n * \n * Universal naming convention for all machine identifiers (API Names) in ObjectStack.\n * Enforces lowercase with underscores or dots to ensure:\n * - Cross-platform compatibility (case-insensitive filesystems)\n * - URL-friendliness (no encoding needed)\n * - Database consistency (no collation issues)\n * - Security (no case-sensitivity bugs in permission checks)\n * \n * **Applies to all metadata that acts as a machine identifier:**\n * - Object names (tables/collections)\n * - Field names\n * - Role names\n * - Permission set names\n * - Action/trigger names\n * - Event keys\n * - App IDs\n * - Menu/page IDs\n * - Select option values\n * - Workflow names\n * - Webhook names\n * \n * **Naming Convention Summary:**\n * | Type | Pattern | Example |\n * |------|---------|---------|\n * | Machine ID | snake_case | `crm_account`, `btn_submit`, `role_admin` |\n * | Event keys | dot.notation | `user.login`, `order.created` |\n * | Labels | Any case | `Client Account`, `Submit Form` |\n * \n * @example Valid identifiers\n * - 'account'\n * - 'crm_account'\n * - 'user_profile'\n * - 'order.created' (for events)\n * - 'api_v2_endpoint'\n * \n * @example Invalid identifiers (will be rejected)\n * - 'Account' (uppercase)\n * - 'CrmAccount' (camelCase)\n * - 'crm-account' (kebab-case - use underscore instead)\n * - 'user profile' (spaces)\n */\nexport const SystemIdentifierSchema = z\n .string()\n .min(2, { message: 'System identifier must be at least 2 characters' })\n .regex(/^[a-z][a-z0-9_.]*$/, {\n message:\n 'System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., \"user_profile\" or \"order.created\")',\n })\n .describe('System identifier (lowercase with underscores or dots)');\n\n/**\n * Strict Snake Case Identifier\n * \n * More restrictive than SystemIdentifierSchema - only allows underscores (no dots).\n * Use this for identifiers that should NOT contain dots (e.g., database table/column names).\n * \n * @example Valid\n * - 'account'\n * - 'crm_account'\n * - 'user_profile'\n * \n * @example Invalid\n * - 'user.profile' (dots not allowed)\n * - 'UserProfile' (uppercase)\n */\nexport const SnakeCaseIdentifierSchema = z\n .string()\n .min(2, { message: 'Identifier must be at least 2 characters' })\n .regex(/^[a-z][a-z0-9_]*$/, {\n message:\n 'Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., \"user_profile\")',\n })\n .describe('Snake case identifier (lowercase with underscores only)');\n\n/**\n * Event Name Identifier\n * \n * Specialized identifier for event names that encourages dot notation.\n * Used in event-driven systems, message queues, and webhooks.\n * \n * Pattern: `namespace.action` or `entity.event_type`\n * \n * @example Valid\n * - 'user.created'\n * - 'order.paid'\n * - 'user.login_success'\n * - 'alarm.high_cpu'\n * \n * @example Invalid\n * - 'UserCreated' (camelCase)\n * - 'user_created' (should use dots for namespacing)\n */\nexport const EventNameSchema = z\n .string()\n .min(3, { message: 'Event name must be at least 3 characters' })\n .regex(/^[a-z][a-z0-9_.]*$/, {\n message:\n 'Event name must be lowercase with dots for namespacing (e.g., \"user.created\", \"order.paid\")',\n })\n .describe('Event name (lowercase with dot notation for namespacing)');\n\n/**\n * Type Exports\n */\nexport type SystemIdentifier = z.infer<typeof SystemIdentifierSchema>;\nexport type SnakeCaseIdentifier = z.infer<typeof SnakeCaseIdentifierSchema>;\nexport type EventName = z.infer<typeof EventNameSchema>;\n","import { z } from 'zod';\n\n/**\n * Flow Node Types\n */\nexport const FlowNodeAction = z.enum([\n 'start', // Trigger\n 'end', // Return/Stop\n 'decision', // If/Else logic\n 'assignment', // Set Variable\n 'loop', // For Each\n 'create_record', // CRUD: Create\n 'update_record', // CRUD: Update\n 'delete_record', // CRUD: Delete\n 'get_record', // CRUD: Get/Query\n 'http_request', // Webhook/API Call\n 'script', // Custom Script (JS/TS)\n 'screen', // Screen / User-Input Element\n 'wait', // Delay/Sleep\n 'subflow', // Call another flow\n 'connector_action', // Zapier-style integration action\n]);\n\n/**\n * Flow Variable Schema\n * Variables available within the flow execution context.\n */\nexport const FlowVariableSchema = z.object({\n name: z.string().describe('Variable name'),\n type: z.string().describe('Data type (text, number, boolean, object, list)'),\n isInput: z.boolean().default(false).describe('Is input parameter'),\n isOutput: z.boolean().default(false).describe('Is output parameter'),\n});\n\n/**\n * Flow Node Schema\n * A single step in the visual logic graph.\n * \n * @example Decision Node\n * {\n * id: \"dec_1\",\n * type: \"decision\",\n * label: \"Is High Value?\",\n * config: {\n * conditions: [\n * { label: \"Yes\", expression: \"{amount} > 10000\" },\n * { label: \"No\", expression: \"true\" } // default\n * ]\n * },\n * position: { x: 300, y: 200 }\n * }\n */\nexport const FlowNodeSchema = z.object({\n id: z.string().describe('Node unique ID'),\n type: FlowNodeAction.describe('Action type'),\n label: z.string().describe('Node label'),\n \n /** Node Configuration Options (Specific to type) */\n config: z.record(z.string(), z.any()).optional().describe('Node configuration'),\n \n /** \n * Connector Action Configuration\n * Used when type is 'connector_action'\n */\n connectorConfig: z.object({\n connectorId: z.string(),\n actionId: z.string(),\n input: z.record(z.string(), z.any()).describe('Mapped inputs for the action'),\n }).optional(),\n\n /** UI Position (for the canvas) */\n position: z.object({ x: z.number(), y: z.number() }).optional(),\n});\n\n/**\n * Flow Edge Schema\n * Connections between nodes.\n */\nexport const FlowEdgeSchema = z.object({\n id: z.string().describe('Edge unique ID'),\n source: z.string().describe('Source Node ID'),\n target: z.string().describe('Target Node ID'),\n \n /** Condition for this path (only for decision/branch nodes) */\n condition: z.string().optional().describe('Expression returning boolean used for branching'),\n \n type: z.enum(['default', 'fault']).default('default').describe('Connection type: Standard (Success) or Fault (Error) path'),\n label: z.string().optional().describe('Label on the connector'),\n});\n\n/**\n * Flow Schema\n * Visual Business Logic Orchestration.\n * \n * @example Simple Approval Logic\n * {\n * name: \"approve_order_flow\",\n * label: \"Approve Large Orders\",\n * type: \"record_change\",\n * status: \"active\",\n * nodes: [\n * { id: \"start\", type: \"start\", label: \"Start\", position: {x: 0, y: 0} },\n * { id: \"check_amount\", type: \"decision\", label: \"Check Amount\", position: {x: 0, y: 100} },\n * { id: \"auto_approve\", type: \"update_record\", label: \"Auto Approve\", position: {x: -100, y: 200} },\n * { id: \"submit_for_approval\", type: \"connector_action\", label: \"Submit\", position: {x: 100, y: 200} }\n * ],\n * edges: [\n * { id: \"e1\", source: \"start\", target: \"check_amount\" },\n * { id: \"e2\", source: \"check_amount\", target: \"auto_approve\", condition: \"{amount} < 500\" },\n * { id: \"e3\", source: \"check_amount\", target: \"submit_for_approval\", condition: \"{amount} >= 500\" }\n * ]\n * }\n */\nexport const FlowSchema = z.object({\n /** Identity */\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Machine name'),\n label: z.string().describe('Flow label'),\n description: z.string().optional(),\n \n /** Metadata & Versioning */\n version: z.number().int().default(1).describe('Version number'),\n status: z.enum(['draft', 'active', 'obsolete', 'invalid']).default('draft').describe('Deployment status'),\n template: z.boolean().default(false).describe('Is logic template (Subflow)'),\n\n /** Trigger Type */\n type: z.enum(['autolaunched', 'record_change', 'schedule', 'screen', 'api']).describe('Flow type'),\n \n /** Configuration Variables */\n variables: z.array(FlowVariableSchema).optional().describe('Flow variables'),\n \n /** Graph Definition */\n nodes: z.array(FlowNodeSchema).describe('Flow nodes'),\n edges: z.array(FlowEdgeSchema).describe('Flow connections'),\n \n /** Execution Config */\n active: z.boolean().default(false).describe('Is active (Deprecated: use status)'),\n runAs: z.enum(['system', 'user']).default('user').describe('Execution context'),\n});\n\nexport type Flow = z.input<typeof FlowSchema>;\nexport type FlowParsed = z.infer<typeof FlowSchema>;\nexport type FlowNode = z.input<typeof FlowNodeSchema>;\nexport type FlowNodeParsed = z.infer<typeof FlowNodeSchema>;\nexport type FlowEdge = z.input<typeof FlowEdgeSchema>;\nexport type FlowEdgeParsed = z.infer<typeof FlowEdgeSchema>;\n","import { z } from 'zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\n\n/**\n * Webhook Trigger Event\n * When should this webhook fire?\n */\nexport const WebhookTriggerType = z.enum([\n 'create', \n 'update', \n 'delete', \n 'undelete',\n 'api' // Manually triggered\n]);\n\n/**\n * CANONICAL WEBHOOK DEFINITION\n * \n * This is the single source of truth for webhook configuration across ObjectStack.\n * All other protocols (workflow, connector, etc.) should import and reference this schema.\n * \n * Webhook Protocol - Outbound HTTP Integration\n * Push data to external URLs when events occur in the system.\n * \n * **NAMING CONVENTION:**\n * Webhook names are machine identifiers and must be lowercase snake_case.\n * \n * @example Good webhook names\n * - 'stripe_payment_sync'\n * - 'slack_notification'\n * - 'crm_lead_export'\n * \n * @example Bad webhook names (will be rejected)\n * - 'StripePaymentSync' (PascalCase)\n * - 'slackNotification' (camelCase)\n * \n * @example Basic webhook configuration\n * ```typescript\n * const webhook: Webhook = {\n * name: 'slack_notification',\n * label: 'Slack Order Notification',\n * object: 'order',\n * triggers: ['create', 'update'],\n * url: 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXX',\n * method: 'POST',\n * headers: { 'Content-Type': 'application/json' },\n * authentication: {\n * type: 'bearer',\n * credentials: { token: process.env.SLACK_TOKEN }\n * },\n * retryPolicy: {\n * maxRetries: 3,\n * backoffStrategy: 'exponential'\n * }\n * }\n * ```\n */\nexport const WebhookSchema = z.object({\n name: SnakeCaseIdentifierSchema.describe('Webhook unique name (lowercase snake_case)'),\n label: z.string().optional().describe('Human-readable webhook label'),\n \n /** Scope */\n object: z.string().optional().describe('Object to listen to (optional for manual webhooks)'),\n triggers: z.array(WebhookTriggerType).optional().describe('Events that trigger execution'),\n \n /** Target */\n url: z.string().url().describe('External webhook endpoint URL'),\n method: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']).default('POST').describe('HTTP method'),\n \n /** Headers */\n headers: z.record(z.string(), z.string()).optional().describe('Custom HTTP headers'),\n \n /** Body/Payload */\n body: z.any().optional().describe('Request body payload (if not using default record data)'),\n \n /** Payload Configuration */\n payloadFields: z.array(z.string()).optional().describe('Fields to include. Empty = All'),\n includeSession: z.boolean().default(false).describe('Include user session info'),\n \n /** Authentication */\n authentication: z.object({\n type: z.enum(['none', 'bearer', 'basic', 'api-key']).describe('Authentication type'),\n credentials: z.record(z.string(), z.string()).optional().describe('Authentication credentials'),\n }).optional().describe('Authentication configuration'),\n \n /** Retry Policy */\n retryPolicy: z.object({\n maxRetries: z.number().int().min(0).max(10).default(3).describe('Maximum retry attempts'),\n backoffStrategy: z.enum(['exponential', 'linear', 'fixed']).default('exponential').describe('Backoff strategy'),\n initialDelayMs: z.number().int().min(100).default(1000).describe('Initial retry delay in milliseconds'),\n maxDelayMs: z.number().int().min(1000).default(60000).describe('Maximum retry delay in milliseconds'),\n }).optional().describe('Retry policy configuration'),\n \n /** Timeout */\n timeoutMs: z.number().int().min(1000).max(300000).default(30000).describe('Request timeout in milliseconds'),\n \n /** Security */\n secret: z.string().optional().describe('Signing secret for HMAC signature verification'),\n \n /** Status */\n isActive: z.boolean().default(true).describe('Whether webhook is active'),\n \n /** Metadata */\n description: z.string().optional().describe('Webhook description'),\n tags: z.array(z.string()).optional().describe('Tags for organization'),\n});\n\n/**\n * Webhook Receiver Schema (Inbound)\n * Handling incoming HTTP hooks from Stripe, Slack, etc.\n * \n * **NAMING CONVENTION:**\n * Webhook receiver names are machine identifiers and must be lowercase snake_case.\n * \n * @example Good names\n * - 'stripe_webhook_handler'\n * - 'github_events'\n * - 'twilio_status_callback'\n * \n * @example Bad names (will be rejected)\n * - 'StripeWebhookHandler' (PascalCase)\n */\nexport const WebhookReceiverSchema = z.object({\n name: SnakeCaseIdentifierSchema.describe('Webhook receiver unique name (lowercase snake_case)'),\n path: z.string().describe('URL Path (e.g. /webhooks/stripe)'),\n \n /** Verification */\n verificationType: z.enum(['none', 'header_token', 'hmac', 'ip_whitelist']).default('none'),\n verificationParams: z.object({\n header: z.string().optional(),\n secret: z.string().optional(),\n ips: z.array(z.string()).optional()\n }).optional(),\n \n /** Action */\n action: z.enum(['trigger_flow', 'script', 'upsert_record']).default('trigger_flow'),\n target: z.string().describe('Flow ID or Script name'),\n});\n\nexport type Webhook = z.infer<typeof WebhookSchema>;\nexport type WebhookReceiver = z.infer<typeof WebhookReceiverSchema>;\n","import { z } from 'zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\n\n/**\n * Approval Step Approver Type\n */\nexport const ApproverType = z.enum([\n 'user', // Specific user(s)\n 'role', // Users with specific role\n 'manager', // Submitter's manager\n 'field', // User ID defined in a record field\n 'queue' // Data ownership queue\n]);\n\n/**\n * Approval Action Type\n * Actions to execute on transition\n */\nexport const ApprovalActionType = z.enum([\n 'field_update',\n 'email_alert',\n 'webhook',\n 'script',\n 'connector_action' // Added for Zapier-style integrations\n]);\n\n/**\n * definition of an action to perform\n */\nexport const ApprovalActionSchema = z.object({\n type: ApprovalActionType,\n name: z.string().describe('Action name'),\n config: z.record(z.string(), z.any()).describe('Action configuration'),\n \n /** For connector actions */\n connectorId: z.string().optional(),\n actionId: z.string().optional(),\n});\n\n/**\n * Approval Process Step\n */\nexport const ApprovalStepSchema = z.object({\n name: SnakeCaseIdentifierSchema.describe('Step machine name'),\n label: z.string().describe('Step display label'),\n description: z.string().optional(),\n \n /** Entry criteria for this step */\n entryCriteria: z.string().optional().describe('Formula expression to enter this step'),\n \n /** Who can approve */\n approvers: z.array(z.object({\n type: ApproverType,\n value: z.string().describe('User ID, Role Name, or Field Name')\n })).min(1).describe('List of allowed approvers'),\n \n /** Approval Logic */\n behavior: z.enum(['first_response', 'unanimous']).default('first_response')\n .describe('How to handle multiple approvers'),\n \n /** Rejection behavior */\n rejectionBehavior: z.enum(['reject_process', 'back_to_previous'])\n .default('reject_process').describe('What happens if rejected'),\n\n /** Actions */\n onApprove: z.array(ApprovalActionSchema).optional().describe('Actions on step approval'),\n onReject: z.array(ApprovalActionSchema).optional().describe('Actions on step rejection'),\n});\n\n/**\n * Approval Process Protocol\n * \n * Defines a complex review and approval cycle for a record.\n * Manages state locking, notifications, and transition logic.\n */\nexport const ApprovalProcessSchema = z.object({\n name: SnakeCaseIdentifierSchema.describe('Unique process name'),\n label: z.string().describe('Human readable label'),\n object: z.string().describe('Target Object Name'),\n \n active: z.boolean().default(false),\n description: z.string().optional(),\n \n /** Entry Criteria for the entire process */\n entryCriteria: z.string().optional().describe('Formula to allow submission'),\n \n /** Record Locking */\n lockRecord: z.boolean().default(true).describe('Lock record from editing during approval'),\n \n /** Steps */\n steps: z.array(ApprovalStepSchema).min(1).describe('Sequence of approval steps'),\n \n /** Global Actions */\n onSubmit: z.array(ApprovalActionSchema).optional().describe('Actions on initial submission'),\n onFinalApprove: z.array(ApprovalActionSchema).optional().describe('Actions on final approval'),\n onFinalReject: z.array(ApprovalActionSchema).optional().describe('Actions on final rejection'),\n onRecall: z.array(ApprovalActionSchema).optional().describe('Actions on recall'),\n});\n\nexport const ApprovalProcess = Object.assign(ApprovalProcessSchema, {\n create: <T extends z.input<typeof ApprovalProcessSchema>>(config: T) => config,\n});\n\nexport type ApprovalProcess = z.infer<typeof ApprovalProcessSchema>;\nexport type ApprovalStep = z.infer<typeof ApprovalStepSchema>;\n","import { z } from 'zod';\n\n/**\n * ETL (Extract, Transform, Load) Pipeline Protocol - LEVEL 2: Data Engineering\n * \n * Inspired by modern data integration platforms like Airbyte, Fivetran, and Apache NiFi.\n * \n * **Positioning in 3-Layer Architecture:**\n * - **L1: Simple Sync** (automation/sync.zod.ts) - Business users - Sync Salesforce to Sheets\n * - **L2: ETL Pipeline** (THIS FILE) - Data engineers - Aggregate 10 sources to warehouse\n * - **L3: Enterprise Connector** (integration/connector.zod.ts) - System integrators - Full SAP integration\n * \n * ETL pipelines enable automated data synchronization between systems, transforming\n * data as it moves from source to destination.\n * \n * **SCOPE: Advanced multi-source, multi-stage transformations.**\n * Supports complex operations: joins, aggregations, filtering, custom SQL.\n * \n * ## When to Use This Layer\n * \n * **Use ETL Pipeline when:**\n * - Combining data from multiple sources\n * - Need aggregations, joins, transformations\n * - Building data warehouses or analytics platforms\n * - Complex data transformations required\n * \n * **Examples:**\n * - Sales data from Salesforce + Marketing from HubSpot → Data Warehouse\n * - Multi-region databases → Consolidated reporting\n * - Legacy system migration with transformation\n * \n * **When to downgrade:**\n * - Simple 1:1 sync → Use {@link file://./sync.zod.ts | Simple Sync}\n * \n * **When to upgrade:**\n * - Need full connector lifecycle (auth, webhooks, rate limits) → Use {@link file://../integration/connector.zod.ts | Enterprise Connector}\n * \n * @see {@link file://./sync.zod.ts} for Level 1 (simple sync)\n * @see {@link file://../integration/connector.zod.ts} for Level 3 (enterprise integration)\n * \n * ## Use Cases\n * \n * 1. **Data Warehouse Population**\n * - Extract from multiple operational systems\n * - Transform to analytical schema\n * - Load into data warehouse\n * \n * 2. **System Integration**\n * - Sync data between CRM and Marketing Automation\n * - Keep product catalog synchronized across e-commerce platforms\n * - Replicate data for backup/disaster recovery\n * \n * 3. **Data Migration**\n * - Move data from legacy systems to modern platforms\n * - Consolidate data from multiple sources\n * - Split monolithic databases into microservices\n * \n * @see https://airbyte.com/\n * @see https://docs.fivetran.com/\n * @see https://nifi.apache.org/\n * \n * @example\n * ```typescript\n * const salesforceToDB: ETLPipeline = {\n * name: 'salesforce_to_postgres',\n * label: 'Salesforce Accounts to PostgreSQL',\n * source: {\n * type: 'api',\n * connector: 'salesforce',\n * config: { object: 'Account' }\n * },\n * destination: {\n * type: 'database',\n * connector: 'postgres',\n * config: { table: 'accounts' }\n * },\n * transformations: [\n * { type: 'map', config: { 'Name': 'account_name' } }\n * ],\n * schedule: '0 2 * * *' // Daily at 2 AM\n * }\n * ```\n */\n\n/**\n * ETL Source/Destination Type\n */\nexport const ETLEndpointTypeSchema = z.enum([\n 'database', // SQL/NoSQL databases\n 'api', // REST/GraphQL APIs\n 'file', // CSV, JSON, XML, Excel files\n 'stream', // Kafka, RabbitMQ, Kinesis\n 'object', // ObjectStack object\n 'warehouse', // Data warehouse (Snowflake, BigQuery, Redshift)\n 'storage', // S3, Azure Blob, Google Cloud Storage\n 'spreadsheet', // Google Sheets, Excel Online\n]);\n\nexport type ETLEndpointType = z.infer<typeof ETLEndpointTypeSchema>;\n\n/**\n * ETL Source Configuration\n */\nexport const ETLSourceSchema = z.object({\n /**\n * Source type\n */\n type: ETLEndpointTypeSchema.describe('Source type'),\n\n /**\n * Connector identifier\n * References a registered connector\n * \n * @example \"salesforce\", \"postgres\", \"mysql\", \"s3\"\n */\n connector: z.string().optional().describe('Connector ID'),\n\n /**\n * Source-specific configuration\n * Structure varies by source type\n * \n * @example For database: { table: 'customers', schema: 'public' }\n * @example For API: { endpoint: '/api/users', method: 'GET' }\n * @example For file: { path: 's3://bucket/data.csv', format: 'csv' }\n */\n config: z.record(z.string(), z.any()).describe('Source configuration'),\n\n /**\n * Incremental sync configuration\n * Allows extracting only changed data\n */\n incremental: z.object({\n enabled: z.boolean().default(false),\n cursorField: z.string().describe('Field to track progress (e.g., updated_at)'),\n cursorValue: z.any().optional().describe('Last processed value'),\n }).optional().describe('Incremental extraction config'),\n});\n\nexport type ETLSource = z.infer<typeof ETLSourceSchema>;\n\n/**\n * ETL Destination Configuration\n */\nexport const ETLDestinationSchema = z.object({\n /**\n * Destination type\n */\n type: ETLEndpointTypeSchema.describe('Destination type'),\n\n /**\n * Connector identifier\n */\n connector: z.string().optional().describe('Connector ID'),\n\n /**\n * Destination-specific configuration\n */\n config: z.record(z.string(), z.any()).describe('Destination configuration'),\n\n /**\n * Write mode\n */\n writeMode: z.enum([\n 'append', // Add new records\n 'overwrite', // Replace all data\n 'upsert', // Insert or update based on key\n 'merge', // Smart merge based on business rules\n ]).default('append').describe('How to write data'),\n\n /**\n * Primary key fields for upsert/merge\n */\n primaryKey: z.array(z.string()).optional().describe('Primary key fields'),\n});\n\nexport type ETLDestination = z.infer<typeof ETLDestinationSchema>;\n\n/**\n * ETL Transformation Type\n */\nexport const ETLTransformationTypeSchema = z.enum([\n 'map', // Field mapping/renaming\n 'filter', // Row filtering\n 'aggregate', // Aggregation/grouping\n 'join', // Joining with other data\n 'script', // Custom JavaScript/Python script\n 'lookup', // Enrich with lookup data\n 'split', // Split one record into multiple\n 'merge', // Merge multiple records into one\n 'normalize', // Data normalization\n 'deduplicate', // Remove duplicates\n]);\n\nexport type ETLTransformationType = z.infer<typeof ETLTransformationTypeSchema>;\n\n/**\n * ETL Transformation Configuration\n */\nexport const ETLTransformationSchema = z.object({\n /**\n * Transformation name\n */\n name: z.string().optional().describe('Transformation name'),\n\n /**\n * Transformation type\n */\n type: ETLTransformationTypeSchema.describe('Transformation type'),\n\n /**\n * Transformation-specific configuration\n * \n * @example For map: { oldField: 'newField' }\n * @example For filter: { condition: 'status == \"active\"' }\n * @example For script: { language: 'javascript', code: '...' }\n */\n config: z.record(z.string(), z.any()).describe('Transformation config'),\n\n /**\n * Whether to continue on error\n */\n continueOnError: z.boolean().default(false).describe('Continue on error'),\n});\n\nexport type ETLTransformation = z.infer<typeof ETLTransformationSchema>;\n\n/**\n * ETL Sync Mode\n */\nexport const ETLSyncModeSchema = z.enum([\n 'full', // Full refresh - extract all data every time\n 'incremental', // Only extract changed data\n 'cdc', // Change Data Capture - real-time streaming\n]);\n\nexport type ETLSyncMode = z.infer<typeof ETLSyncModeSchema>;\n\n/**\n * ETL Pipeline Schema\n * \n * Complete definition of a data pipeline from source to destination with transformations.\n */\nexport const ETLPipelineSchema = z.object({\n /**\n * Pipeline identifier (snake_case)\n */\n name: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Pipeline identifier (snake_case)'),\n\n /**\n * Human-readable pipeline name\n */\n label: z.string().optional().describe('Pipeline display name'),\n\n /**\n * Pipeline description\n */\n description: z.string().optional().describe('Pipeline description'),\n\n /**\n * Data source configuration\n */\n source: ETLSourceSchema.describe('Data source'),\n\n /**\n * Data destination configuration\n */\n destination: ETLDestinationSchema.describe('Data destination'),\n\n /**\n * Transformation steps\n * Applied in order from source to destination\n */\n transformations: z.array(ETLTransformationSchema)\n .optional()\n .describe('Transformation pipeline'),\n\n /**\n * Sync mode\n */\n syncMode: ETLSyncModeSchema.default('full').describe('Sync mode'),\n\n /**\n * Execution schedule (cron expression)\n * \n * @example \"0 2 * * *\" - Daily at 2 AM\n * @example \"0 *\\/4 * * *\" - Every 4 hours\n * @example \"0 0 * * 0\" - Weekly on Sunday\n */\n schedule: z.string().optional().describe('Cron schedule expression'),\n\n /**\n * Whether pipeline is enabled\n */\n enabled: z.boolean().default(true).describe('Pipeline enabled status'),\n\n /**\n * Retry configuration for failed runs\n */\n retry: z.object({\n maxAttempts: z.number().int().min(0).default(3).describe('Max retry attempts'),\n backoffMs: z.number().int().min(0).default(60000).describe('Backoff in milliseconds'),\n }).optional().describe('Retry configuration'),\n\n /**\n * Notification configuration\n */\n notifications: z.object({\n onSuccess: z.array(z.string()).optional().describe('Email addresses for success notifications'),\n onFailure: z.array(z.string()).optional().describe('Email addresses for failure notifications'),\n }).optional().describe('Notification settings'),\n\n /**\n * Pipeline tags for organization\n */\n tags: z.array(z.string()).optional().describe('Pipeline tags'),\n\n /**\n * Custom metadata\n */\n metadata: z.record(z.string(), z.any()).optional().describe('Custom metadata'),\n});\n\nexport type ETLPipeline = z.infer<typeof ETLPipelineSchema>;\n\n/**\n * ETL Run Status\n */\nexport const ETLRunStatusSchema = z.enum([\n 'pending', // Queued for execution\n 'running', // Currently executing\n 'succeeded', // Completed successfully\n 'failed', // Failed with errors\n 'cancelled', // Manually cancelled\n 'timeout', // Timed out\n]);\n\nexport type ETLRunStatus = z.infer<typeof ETLRunStatusSchema>;\n\n/**\n * ETL Pipeline Run Result\n * \n * Result of a pipeline execution\n */\nexport const ETLPipelineRunSchema = z.object({\n /**\n * Run ID\n */\n id: z.string().describe('Run identifier'),\n\n /**\n * Pipeline name\n */\n pipelineName: z.string().describe('Pipeline name'),\n\n /**\n * Run status\n */\n status: ETLRunStatusSchema.describe('Run status'),\n\n /**\n * Start timestamp\n */\n startedAt: z.string().datetime().describe('Start time'),\n\n /**\n * End timestamp\n */\n completedAt: z.string().datetime().optional().describe('Completion time'),\n\n /**\n * Duration in milliseconds\n */\n durationMs: z.number().optional().describe('Duration in ms'),\n\n /**\n * Statistics\n */\n stats: z.object({\n recordsRead: z.number().int().default(0).describe('Records extracted'),\n recordsWritten: z.number().int().default(0).describe('Records loaded'),\n recordsErrored: z.number().int().default(0).describe('Records with errors'),\n bytesProcessed: z.number().int().default(0).describe('Bytes processed'),\n }).optional().describe('Run statistics'),\n\n /**\n * Error information\n */\n error: z.object({\n message: z.string().describe('Error message'),\n code: z.string().optional().describe('Error code'),\n details: z.any().optional().describe('Error details'),\n }).optional().describe('Error information'),\n\n /**\n * Execution logs\n */\n logs: z.array(z.string()).optional().describe('Execution logs'),\n});\n\nexport type ETLPipelineRun = z.infer<typeof ETLPipelineRunSchema>;\n\n/**\n * Helper factory for creating ETL pipelines\n */\nexport const ETL = {\n /**\n * Create a simple database-to-database pipeline\n */\n databaseSync: (params: {\n name: string;\n sourceTable: string;\n destTable: string;\n schedule?: string;\n }): ETLPipeline => ({\n name: params.name,\n source: {\n type: 'database',\n config: { table: params.sourceTable },\n },\n destination: {\n type: 'database',\n config: { table: params.destTable },\n writeMode: 'upsert',\n },\n syncMode: 'incremental',\n schedule: params.schedule,\n enabled: true,\n }),\n\n /**\n * Create an API to database pipeline\n */\n apiToDatabase: (params: {\n name: string;\n apiConnector: string;\n destTable: string;\n schedule?: string;\n }): ETLPipeline => ({\n name: params.name,\n source: {\n type: 'api',\n connector: params.apiConnector,\n config: {},\n },\n destination: {\n type: 'database',\n config: { table: params.destTable },\n writeMode: 'append',\n },\n syncMode: 'full',\n schedule: params.schedule,\n enabled: true,\n }),\n} as const;\n","import { z } from 'zod';\n\n/**\n * Trigger Registry Protocol\n * \n * Lightweight automation triggers for simple integrations.\n * Inspired by Zapier, n8n, and Workato connector architectures.\n * \n * ## When to use Trigger Registry vs. Integration Connector?\n * \n * **Use `automation/trigger-registry.zod.ts` when:**\n * - Building simple automation triggers (e.g., \"when Slack message received, create task\")\n * - No complex authentication needed (simple API keys, basic auth)\n * - Lightweight, single-purpose integrations\n * - Quick setup with minimal configuration\n * - Webhook-based or polling triggers for automation workflows\n * \n * **Use `integration/connector.zod.ts` when:**\n * - Building enterprise-grade connectors (e.g., Salesforce, SAP, Oracle)\n * - Complex OAuth2/SAML authentication required\n * - Bidirectional sync with field mapping and transformations\n * - Webhook management and rate limiting required\n * - Full CRUD operations and data synchronization\n * \n * ## Use Cases\n * \n * 1. **Simple Automation Triggers**\n * - Slack notifications on record updates\n * - Twilio SMS on workflow events\n * - SendGrid email templates\n * \n * 2. **Lightweight Operations**\n * - Single-action integrations (send, notify, log)\n * - No bidirectional sync required\n * - Webhook receivers for incoming events\n * \n * 3. **Quick Integrations**\n * - Payment webhooks (Stripe, PayPal)\n * - Communication triggers (Twilio, SendGrid, Slack)\n * - Simple API calls to third-party services\n * \n * @see https://zapier.com/developer/documentation/v2/\n * @see https://docs.n8n.io/integrations/creating-nodes/\n * @see ../../integration/connector.zod.ts for enterprise connectors\n * \n * @example\n * ```typescript\n * const slackNotifier: Connector = {\n * id: 'slack_notify',\n * name: 'Slack Notification',\n * category: 'communication',\n * authentication: {\n * type: 'apiKey',\n * fields: [{ name: 'webhook_url', label: 'Webhook URL', type: 'url' }]\n * },\n * operations: [\n * { id: 'send_message', name: 'Send Message', type: 'action' }\n * ]\n * }\n * ```\n */\n\n/**\n * Connector Category\n */\nexport const ConnectorCategorySchema = z.enum([\n 'crm', // Customer Relationship Management\n 'payment', // Payment processors\n 'communication', // Email, SMS, Chat\n 'storage', // File storage\n 'analytics', // Analytics platforms\n 'database', // Databases\n 'marketing', // Marketing automation\n 'accounting', // Accounting software\n 'hr', // Human resources\n 'productivity', // Productivity tools\n 'ecommerce', // E-commerce platforms\n 'support', // Customer support\n 'devtools', // Developer tools\n 'social', // Social media\n 'other', // Other category\n]);\n\nexport type ConnectorCategory = z.infer<typeof ConnectorCategorySchema>;\n\n/**\n * Authentication Type\n */\nexport const AuthenticationTypeSchema = z.enum([\n 'none', // No authentication\n 'apiKey', // API key\n 'basic', // Basic auth (username/password)\n 'bearer', // Bearer token\n 'oauth1', // OAuth 1.0\n 'oauth2', // OAuth 2.0\n 'custom', // Custom authentication\n]);\n\nexport type AuthenticationType = z.infer<typeof AuthenticationTypeSchema>;\n\n/**\n * Authentication Field Schema\n */\nexport const AuthFieldSchema = z.object({\n /**\n * Field name (machine name)\n */\n name: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Field name (snake_case)'),\n\n /**\n * Field label\n */\n label: z.string().describe('Field label'),\n\n /**\n * Field type\n */\n type: z.enum(['text', 'password', 'url', 'select'])\n .default('text')\n .describe('Field type'),\n\n /**\n * Field description\n */\n description: z.string().optional().describe('Field description'),\n\n /**\n * Whether field is required\n */\n required: z.boolean().default(true).describe('Required field'),\n\n /**\n * Default value\n */\n default: z.string().optional().describe('Default value'),\n\n /**\n * Options for select fields\n */\n options: z.array(z.object({\n label: z.string(),\n value: z.string(),\n })).optional().describe('Select field options'),\n\n /**\n * Placeholder text\n */\n placeholder: z.string().optional().describe('Placeholder text'),\n});\n\nexport type AuthField = z.infer<typeof AuthFieldSchema>;\n\n/**\n * OAuth 2.0 Configuration\n */\nexport const OAuth2ConfigSchema = z.object({\n /**\n * Authorization URL\n */\n authorizationUrl: z.string().url().describe('Authorization endpoint URL'),\n\n /**\n * Token URL\n */\n tokenUrl: z.string().url().describe('Token endpoint URL'),\n\n /**\n * Scopes to request\n */\n scopes: z.array(z.string()).optional().describe('OAuth scopes'),\n\n /**\n * Client ID field name\n */\n clientIdField: z.string().default('client_id').describe('Client ID field name'),\n\n /**\n * Client secret field name\n */\n clientSecretField: z.string().default('client_secret').describe('Client secret field name'),\n});\n\nexport type OAuth2Config = z.infer<typeof OAuth2ConfigSchema>;\n\n/**\n * Authentication Configuration\n */\nexport const AuthenticationSchema = z.object({\n /**\n * Authentication type\n */\n type: AuthenticationTypeSchema.describe('Authentication type'),\n\n /**\n * Authentication fields\n * Configuration fields needed for this auth type\n */\n fields: z.array(AuthFieldSchema).optional().describe('Authentication fields'),\n\n /**\n * OAuth 2.0 configuration (when type is oauth2)\n */\n oauth2: OAuth2ConfigSchema.optional().describe('OAuth 2.0 configuration'),\n\n /**\n * Test authentication instructions\n */\n test: z.object({\n url: z.string().optional().describe('Test endpoint URL'),\n method: z.enum(['GET', 'POST', 'PUT', 'DELETE']).default('GET').describe('HTTP method'),\n }).optional().describe('Authentication test configuration'),\n});\n\nexport type Authentication = z.infer<typeof AuthenticationSchema>;\n\n/**\n * Connector Operation Type\n */\nexport const OperationTypeSchema = z.enum([\n 'read', // Read/query data\n 'write', // Create/update data\n 'delete', // Delete data\n 'search', // Search operation\n 'trigger', // Webhook/polling trigger\n 'action', // Custom action\n]);\n\nexport type OperationType = z.infer<typeof OperationTypeSchema>;\n\n/**\n * Operation Parameter Schema\n */\nexport const OperationParameterSchema = z.object({\n /**\n * Parameter name\n */\n name: z.string().describe('Parameter name'),\n\n /**\n * Parameter label\n */\n label: z.string().describe('Parameter label'),\n\n /**\n * Parameter description\n */\n description: z.string().optional().describe('Parameter description'),\n\n /**\n * Parameter type\n */\n type: z.enum(['string', 'number', 'boolean', 'array', 'object', 'date', 'file'])\n .describe('Parameter type'),\n\n /**\n * Whether parameter is required\n */\n required: z.boolean().default(false).describe('Required parameter'),\n\n /**\n * Default value\n */\n default: z.any().optional().describe('Default value'),\n\n /**\n * Validation schema\n */\n validation: z.record(z.string(), z.any()).optional().describe('Validation rules'),\n\n /**\n * Dynamic options function\n */\n dynamicOptions: z.string().optional().describe('Function to load dynamic options'),\n});\n\nexport type OperationParameter = z.infer<typeof OperationParameterSchema>;\n\n/**\n * Connector Operation Schema\n */\nexport const ConnectorOperationSchema = z.object({\n /**\n * Operation identifier\n */\n id: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Operation ID (snake_case)'),\n\n /**\n * Operation name\n */\n name: z.string().describe('Operation name'),\n\n /**\n * Operation description\n */\n description: z.string().optional().describe('Operation description'),\n\n /**\n * Operation type\n */\n type: OperationTypeSchema.describe('Operation type'),\n\n /**\n * Input parameters\n */\n inputSchema: z.array(OperationParameterSchema)\n .optional()\n .describe('Input parameters'),\n\n /**\n * Output schema\n */\n outputSchema: z.record(z.string(), z.any())\n .optional()\n .describe('Output schema'),\n\n /**\n * Sample output for documentation\n */\n sampleOutput: z.any().optional().describe('Sample output'),\n\n /**\n * Whether operation supports pagination\n */\n supportsPagination: z.boolean().default(false).describe('Supports pagination'),\n\n /**\n * Whether operation supports filtering\n */\n supportsFiltering: z.boolean().default(false).describe('Supports filtering'),\n});\n\nexport type ConnectorOperation = z.infer<typeof ConnectorOperationSchema>;\n\n/**\n * Connector Trigger Schema\n * \n * Triggers are special operations that watch for events and initiate workflows.\n */\nexport const ConnectorTriggerSchema = z.object({\n /**\n * Trigger identifier\n */\n id: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Trigger ID (snake_case)'),\n\n /**\n * Trigger name\n */\n name: z.string().describe('Trigger name'),\n\n /**\n * Trigger description\n */\n description: z.string().optional().describe('Trigger description'),\n\n /**\n * Trigger type\n */\n type: z.enum(['webhook', 'polling', 'stream'])\n .describe('Trigger mechanism'),\n\n /**\n * Trigger configuration\n */\n config: z.record(z.string(), z.any())\n .optional()\n .describe('Trigger configuration'),\n\n /**\n * Output schema\n */\n outputSchema: z.record(z.string(), z.any())\n .optional()\n .describe('Event payload schema'),\n\n /**\n * Polling interval (for polling triggers)\n * In milliseconds\n */\n pollingIntervalMs: z.number().int().min(1000)\n .optional()\n .describe('Polling interval in ms'),\n});\n\nexport type ConnectorTrigger = z.infer<typeof ConnectorTriggerSchema>;\n\n/**\n * Connector Schema\n * \n * Complete definition of a connector to an external system.\n */\nexport const ConnectorSchema = z.object({\n /**\n * Connector identifier\n * Must be globally unique\n */\n id: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Connector ID (snake_case)'),\n\n /**\n * Connector name\n */\n name: z.string().describe('Connector name'),\n\n /**\n * Connector description\n */\n description: z.string().optional().describe('Connector description'),\n\n /**\n * Connector version (semver)\n */\n version: z.string().optional().describe('Connector version'),\n\n /**\n * Connector icon URL or name\n */\n icon: z.string().optional().describe('Connector icon'),\n\n /**\n * Connector category\n */\n category: ConnectorCategorySchema.describe('Connector category'),\n\n /**\n * Base URL for API calls\n */\n baseUrl: z.string().url().optional().describe('API base URL'),\n\n /**\n * Authentication configuration\n */\n authentication: AuthenticationSchema.describe('Authentication config'),\n\n /**\n * Available operations\n */\n operations: z.array(ConnectorOperationSchema)\n .optional()\n .describe('Connector operations'),\n\n /**\n * Available triggers\n */\n triggers: z.array(ConnectorTriggerSchema)\n .optional()\n .describe('Connector triggers'),\n\n /**\n * Rate limiting information\n */\n rateLimit: z.object({\n requestsPerSecond: z.number().optional().describe('Max requests per second'),\n requestsPerMinute: z.number().optional().describe('Max requests per minute'),\n requestsPerHour: z.number().optional().describe('Max requests per hour'),\n }).optional().describe('Rate limiting'),\n\n /**\n * Connector author\n */\n author: z.string().optional().describe('Connector author'),\n\n /**\n * Documentation URL\n */\n documentation: z.string().url().optional().describe('Documentation URL'),\n\n /**\n * Homepage URL\n */\n homepage: z.string().url().optional().describe('Homepage URL'),\n\n /**\n * License\n */\n license: z.string().optional().describe('License (SPDX identifier)'),\n\n /**\n * Tags for discovery\n */\n tags: z.array(z.string()).optional().describe('Connector tags'),\n\n /**\n * Whether connector is verified/certified\n */\n verified: z.boolean().default(false).describe('Verified connector'),\n\n /**\n * Custom metadata\n */\n metadata: z.record(z.string(), z.any()).optional().describe('Custom metadata'),\n});\n\nexport type Connector = z.infer<typeof ConnectorSchema>;\n\n/**\n * Connector Instance Schema\n * \n * A configured instance of a connector with credentials.\n */\nexport const ConnectorInstanceSchema = z.object({\n /**\n * Instance ID\n */\n id: z.string().describe('Instance ID'),\n\n /**\n * Connector ID this instance uses\n */\n connectorId: z.string().describe('Connector ID'),\n\n /**\n * Instance name\n */\n name: z.string().describe('Instance name'),\n\n /**\n * Instance description\n */\n description: z.string().optional().describe('Instance description'),\n\n /**\n * Authentication credentials (encrypted)\n */\n credentials: z.record(z.string(), z.any()).describe('Encrypted credentials'),\n\n /**\n * Additional configuration\n */\n config: z.record(z.string(), z.any()).optional().describe('Additional config'),\n\n /**\n * Whether instance is active\n */\n active: z.boolean().default(true).describe('Instance active status'),\n\n /**\n * Created timestamp\n */\n createdAt: z.string().datetime().optional().describe('Creation time'),\n\n /**\n * Last tested timestamp\n */\n lastTestedAt: z.string().datetime().optional().describe('Last test time'),\n\n /**\n * Test status\n */\n testStatus: z.enum(['unknown', 'success', 'failed'])\n .default('unknown')\n .describe('Connection test status'),\n});\n\nexport type ConnectorInstance = z.infer<typeof ConnectorInstanceSchema>;\n\n/**\n * Helper factory for creating connectors\n */\nexport const Connector = {\n /**\n * Create a basic API key connector\n */\n apiKey: (params: {\n id: string;\n name: string;\n category: ConnectorCategory;\n baseUrl: string;\n }): Connector => ({\n id: params.id,\n name: params.name,\n category: params.category,\n baseUrl: params.baseUrl,\n authentication: {\n type: 'apiKey',\n fields: [\n {\n name: 'api_key',\n label: 'API Key',\n type: 'password',\n required: true,\n },\n ],\n },\n verified: false,\n }),\n\n /**\n * Create an OAuth 2.0 connector\n */\n oauth2: (params: {\n id: string;\n name: string;\n category: ConnectorCategory;\n baseUrl: string;\n authUrl: string;\n tokenUrl: string;\n scopes?: string[];\n }): Connector => ({\n id: params.id,\n name: params.name,\n category: params.category,\n baseUrl: params.baseUrl,\n authentication: {\n type: 'oauth2',\n oauth2: {\n authorizationUrl: params.authUrl,\n tokenUrl: params.tokenUrl,\n clientIdField: 'client_id',\n clientSecretField: 'client_secret',\n scopes: params.scopes,\n },\n },\n verified: false,\n }),\n} as const;\n","import { z } from 'zod';\nimport { FieldMappingSchema } from '../shared/mapping.zod';\n\n/**\n * Data Sync Protocol - LEVEL 1: Simple Synchronization\n * \n * Inspired by Salesforce Connect, Segment Sync, and Census Reverse ETL.\n * \n * **Positioning in 3-Layer Architecture:**\n * - **L1: Simple Sync** (THIS FILE) - Business users - Sync Salesforce to Sheets\n * - **L2: ETL Pipeline** (automation/etl.zod.ts) - Data engineers - Aggregate 10 sources to warehouse\n * - **L3: Enterprise Connector** (integration/connector.zod.ts) - System integrators - Full SAP integration\n * \n * Data sync provides bidirectional or unidirectional data synchronization\n * between ObjectStack and external systems, maintaining data consistency\n * across platforms.\n * \n * **SCOPE: Simple field mappings only. NO complex transformations.**\n * For complex transformations (joins, aggregates, custom SQL), use ETL Pipeline (Level 2).\n * \n * ## When to Use This Layer\n * \n * **Use Simple Sync when:**\n * - Syncing 1:1 fields between two systems\n * - Simple field transformations (uppercase, cast, etc.)\n * - No complex logic required\n * - Business users need to configure integrations\n * \n * **Examples:**\n * - Salesforce Contact ↔ Google Sheets\n * - HubSpot Company ↔ CRM Account\n * - Shopify Orders → Accounting System\n * \n * **When to upgrade:**\n * - Need multi-source joins → Use {@link file://./etl.zod.ts | ETL Pipeline}\n * - Need complex authentication/webhooks → Use {@link file://../integration/connector.zod.ts | Enterprise Connector}\n * - Need aggregations or data warehousing → Use {@link file://./etl.zod.ts | ETL Pipeline}\n * \n * @see {@link file://./etl.zod.ts} for Level 2 (data engineering)\n * @see {@link file://../integration/connector.zod.ts} for Level 3 (enterprise integration)\n * \n * ## Use Cases\n * \n * 1. **CRM Integration**\n * - Sync contacts between ObjectStack and Salesforce\n * - Keep opportunity data synchronized\n * - Bidirectional updates\n * \n * 2. **Customer Data Platform (CDP)**\n * - Sync user profiles to Segment\n * - Enrichment data from Clearbit\n * - Marketing automation sync\n * \n * 3. **Operational Analytics**\n * - Sync production data to analytics warehouse\n * - Real-time dashboards\n * - Business intelligence\n * \n * @see https://help.salesforce.com/s/articleView?id=sf.platform_connect_about.htm\n * @see https://segment.com/docs/connections/sync/\n * @see https://www.getcensus.com/\n * \n * @example\n * ```typescript\n * const contactSync: DataSyncConfig = {\n * name: 'salesforce_contact_sync',\n * label: 'Salesforce Contact Sync',\n * source: {\n * object: 'contact',\n * filters: { status: 'active' }\n * },\n * destination: {\n * connector: 'salesforce',\n * operation: 'upsert_contact',\n * mapping: {\n * first_name: 'FirstName',\n * last_name: 'LastName',\n * email: 'Email'\n * }\n * },\n * syncMode: 'incremental',\n * schedule: '0 * * * *' // Hourly\n * }\n * ```\n */\n\n/**\n * Sync Direction\n */\nexport const SyncDirectionSchema = z.enum([\n 'push', // ObjectStack -> External (one-way)\n 'pull', // External -> ObjectStack (one-way)\n 'bidirectional', // Both directions\n]);\n\nexport type SyncDirection = z.infer<typeof SyncDirectionSchema>;\n\n/**\n * Sync Mode\n */\nexport const SyncModeSchema = z.enum([\n 'full', // Full refresh every time\n 'incremental', // Only sync changed records\n 'realtime', // Real-time streaming sync\n]);\n\nexport type SyncMode = z.infer<typeof SyncModeSchema>;\n\n/**\n * Conflict Resolution Strategy\n */\nexport const ConflictResolutionSchema = z.enum([\n 'source_wins', // Source system always wins\n 'destination_wins', // Destination system always wins\n 'latest_wins', // Most recently modified wins\n 'manual', // Flag for manual resolution\n 'merge', // Smart merge (custom logic)\n]);\n\nexport type ConflictResolution = z.infer<typeof ConflictResolutionSchema>;\n\n/**\n * Field Mapping for Data Sync\n * \n * Uses the canonical field mapping protocol from shared/mapping.zod.ts\n * for simple 1:1 field transformations.\n * \n * @see {@link FieldMappingSchema} for the base field mapping schema\n */\n\n/**\n * Data Source Configuration\n */\nexport const DataSourceConfigSchema = z.object({\n /**\n * Source object name\n * For ObjectStack objects\n */\n object: z.string().optional().describe('ObjectStack object name'),\n\n /**\n * Filter conditions\n * Only sync records matching these filters\n */\n filters: z.any().optional().describe('Filter conditions'),\n\n /**\n * Fields to include\n * If not specified, all fields are synced\n */\n fields: z.array(z.string()).optional().describe('Fields to sync'),\n\n /**\n * External connector instance ID\n * For external data sources\n */\n connectorInstanceId: z.string().optional().describe('Connector instance ID'),\n\n /**\n * External resource identifier\n * e.g., Salesforce object name, database table, API endpoint\n */\n externalResource: z.string().optional().describe('External resource ID'),\n});\n\nexport type DataSourceConfig = z.infer<typeof DataSourceConfigSchema>;\n\n/**\n * Data Destination Configuration\n */\nexport const DataDestinationConfigSchema = z.object({\n /**\n * Destination object name\n * For ObjectStack objects\n */\n object: z.string().optional().describe('ObjectStack object name'),\n\n /**\n * Connector instance ID\n * For external destinations\n */\n connectorInstanceId: z.string().optional().describe('Connector instance ID'),\n\n /**\n * Operation to perform\n */\n operation: z.enum([\n 'insert', // Create new records only\n 'update', // Update existing records only\n 'upsert', // Insert or update based on key\n 'delete', // Delete records\n 'sync', // Full synchronization\n ]).describe('Sync operation'),\n\n /**\n * Field mappings\n * Maps source fields to destination fields\n */\n mapping: z.union([\n z.record(z.string(), z.string()), // Simple mapping: { sourceField: 'destField' }\n z.array(FieldMappingSchema), // Advanced mapping with transformations\n ]).optional().describe('Field mappings'),\n\n /**\n * External resource identifier\n */\n externalResource: z.string().optional().describe('External resource ID'),\n\n /**\n * Match key for upsert operations\n * Fields to use for matching existing records\n */\n matchKey: z.array(z.string()).optional().describe('Match key fields'),\n});\n\nexport type DataDestinationConfig = z.infer<typeof DataDestinationConfigSchema>;\n\n/**\n * Data Sync Configuration Schema\n * \n * Complete definition of a data synchronization between systems.\n */\nexport const DataSyncConfigSchema = z.object({\n /**\n * Sync configuration name (snake_case)\n */\n name: z.string()\n .regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Sync configuration name (snake_case)'),\n\n /**\n * Human-readable label\n */\n label: z.string().optional().describe('Sync display name'),\n\n /**\n * Description\n */\n description: z.string().optional().describe('Sync description'),\n\n /**\n * Source configuration\n */\n source: DataSourceConfigSchema.describe('Data source'),\n\n /**\n * Destination configuration\n */\n destination: DataDestinationConfigSchema.describe('Data destination'),\n\n /**\n * Sync direction\n */\n direction: SyncDirectionSchema.default('push').describe('Sync direction'),\n\n /**\n * Sync mode\n */\n syncMode: SyncModeSchema.default('incremental').describe('Sync mode'),\n\n /**\n * Conflict resolution strategy\n */\n conflictResolution: ConflictResolutionSchema\n .default('latest_wins')\n .describe('Conflict resolution'),\n\n /**\n * Execution schedule (cron expression)\n * For scheduled syncs\n * \n * @example \"0 * * * *\" - Hourly\n * @example \"*\\/15 * * * *\" - Every 15 minutes\n */\n schedule: z.string().optional().describe('Cron schedule'),\n\n /**\n * Whether sync is enabled\n */\n enabled: z.boolean().default(true).describe('Sync enabled'),\n\n /**\n * Change tracking field\n * Field to track when records were last modified\n * Used for incremental sync\n * \n * @example \"updated_at\", \"modified_date\"\n */\n changeTrackingField: z.string()\n .optional()\n .describe('Field for change tracking'),\n\n /**\n * Batch size\n * Number of records to process per batch\n */\n batchSize: z.number().int().min(1).max(10000)\n .default(100)\n .describe('Batch size for processing'),\n\n /**\n * Retry configuration\n */\n retry: z.object({\n maxAttempts: z.number().int().min(0).default(3).describe('Max retries'),\n backoffMs: z.number().int().min(0).default(30000).describe('Backoff duration'),\n }).optional().describe('Retry configuration'),\n\n /**\n * Pre-sync validation rules\n */\n validation: z.object({\n required: z.array(z.string()).optional().describe('Required fields'),\n unique: z.array(z.string()).optional().describe('Unique constraint fields'),\n custom: z.array(z.object({\n name: z.string(),\n condition: z.string().describe('Validation condition'),\n message: z.string().describe('Error message'),\n })).optional().describe('Custom validation rules'),\n }).optional().describe('Validation rules'),\n\n /**\n * Error handling configuration\n */\n errorHandling: z.object({\n onValidationError: z.enum(['skip', 'fail', 'log']).default('skip'),\n onSyncError: z.enum(['skip', 'fail', 'retry']).default('retry'),\n notifyOnError: z.array(z.string()).optional().describe('Email notifications'),\n }).optional().describe('Error handling'),\n\n /**\n * Performance optimization\n */\n optimization: z.object({\n parallelBatches: z.boolean().default(false).describe('Process batches in parallel'),\n cacheEnabled: z.boolean().default(true).describe('Enable caching'),\n compressionEnabled: z.boolean().default(false).describe('Enable compression'),\n }).optional().describe('Performance optimization'),\n\n /**\n * Audit and logging\n */\n audit: z.object({\n logLevel: z.enum(['none', 'error', 'warn', 'info', 'debug']).default('info'),\n retainLogsForDays: z.number().int().min(1).default(30),\n trackChanges: z.boolean().default(true).describe('Track all changes'),\n }).optional().describe('Audit configuration'),\n\n /**\n * Tags for organization\n */\n tags: z.array(z.string()).optional().describe('Sync tags'),\n\n /**\n * Custom metadata\n */\n metadata: z.record(z.string(), z.any()).optional().describe('Custom metadata'),\n});\n\nexport type DataSyncConfig = z.infer<typeof DataSyncConfigSchema>;\n\n/**\n * Sync Execution Status\n */\nexport const SyncExecutionStatusSchema = z.enum([\n 'pending', // Queued\n 'running', // Currently executing\n 'completed', // Successfully completed\n 'partial', // Completed with some errors\n 'failed', // Failed\n 'cancelled', // Manually cancelled\n]);\n\nexport type SyncExecutionStatus = z.infer<typeof SyncExecutionStatusSchema>;\n\n/**\n * Sync Execution Result Schema\n * \n * Result of a sync execution.\n */\nexport const SyncExecutionResultSchema = z.object({\n /**\n * Execution ID\n */\n id: z.string().describe('Execution ID'),\n\n /**\n * Sync configuration name\n */\n syncName: z.string().describe('Sync name'),\n\n /**\n * Execution status\n */\n status: SyncExecutionStatusSchema.describe('Execution status'),\n\n /**\n * Start timestamp\n */\n startedAt: z.string().datetime().describe('Start time'),\n\n /**\n * End timestamp\n */\n completedAt: z.string().datetime().optional().describe('Completion time'),\n\n /**\n * Duration in milliseconds\n */\n durationMs: z.number().optional().describe('Duration in ms'),\n\n /**\n * Statistics\n */\n stats: z.object({\n recordsProcessed: z.number().int().default(0).describe('Total records processed'),\n recordsInserted: z.number().int().default(0).describe('Records inserted'),\n recordsUpdated: z.number().int().default(0).describe('Records updated'),\n recordsDeleted: z.number().int().default(0).describe('Records deleted'),\n recordsSkipped: z.number().int().default(0).describe('Records skipped'),\n recordsErrored: z.number().int().default(0).describe('Records with errors'),\n conflictsDetected: z.number().int().default(0).describe('Conflicts detected'),\n conflictsResolved: z.number().int().default(0).describe('Conflicts resolved'),\n }).optional().describe('Execution statistics'),\n\n /**\n * Errors encountered\n */\n errors: z.array(z.object({\n recordId: z.string().optional().describe('Record ID'),\n field: z.string().optional().describe('Field name'),\n message: z.string().describe('Error message'),\n code: z.string().optional().describe('Error code'),\n })).optional().describe('Errors'),\n\n /**\n * Execution logs\n */\n logs: z.array(z.string()).optional().describe('Execution logs'),\n});\n\nexport type SyncExecutionResult = z.infer<typeof SyncExecutionResultSchema>;\n\n/**\n * Helper factory for creating sync configurations\n */\nexport const Sync = {\n /**\n * Create a simple object-to-object sync\n */\n objectSync: (params: {\n name: string;\n sourceObject: string;\n destObject: string;\n mapping: Record<string, string>;\n schedule?: string;\n }): DataSyncConfig => ({\n name: params.name,\n source: {\n object: params.sourceObject,\n },\n destination: {\n object: params.destObject,\n operation: 'upsert',\n mapping: params.mapping,\n },\n direction: 'push',\n syncMode: 'incremental',\n conflictResolution: 'latest_wins',\n batchSize: 100,\n schedule: params.schedule,\n enabled: true,\n }),\n\n /**\n * Create a connector sync\n */\n connectorSync: (params: {\n name: string;\n sourceObject: string;\n connectorInstanceId: string;\n externalResource: string;\n mapping: Record<string, string>;\n schedule?: string;\n }): DataSyncConfig => ({\n name: params.name,\n source: {\n object: params.sourceObject,\n },\n destination: {\n connectorInstanceId: params.connectorInstanceId,\n externalResource: params.externalResource,\n operation: 'upsert',\n mapping: params.mapping,\n },\n direction: 'push',\n syncMode: 'incremental',\n conflictResolution: 'latest_wins',\n batchSize: 100,\n schedule: params.schedule,\n enabled: true,\n }),\n\n /**\n * Create a bidirectional sync\n */\n bidirectionalSync: (params: {\n name: string;\n object: string;\n connectorInstanceId: string;\n externalResource: string;\n mapping: Record<string, string>;\n schedule?: string;\n }): DataSyncConfig => ({\n name: params.name,\n source: {\n object: params.object,\n },\n destination: {\n connectorInstanceId: params.connectorInstanceId,\n externalResource: params.externalResource,\n operation: 'sync',\n mapping: params.mapping,\n },\n direction: 'bidirectional',\n syncMode: 'incremental',\n conflictResolution: 'latest_wins',\n batchSize: 100,\n schedule: params.schedule,\n enabled: true,\n }),\n} as const;\n","import { z } from 'zod';\n\n/**\n * Base Field Mapping Protocol\n * \n * Shared by: ETL, Sync, Connector, External Lookup\n * \n * This module provides the canonical field mapping schema used across\n * ObjectStack for data transformation and synchronization.\n * \n * **Use Cases:**\n * - ETL pipelines (data/mapping.zod.ts)\n * - Data synchronization (automation/sync.zod.ts)\n * - Integration connectors (integration/connector.zod.ts)\n * - External lookups (data/external-lookup.zod.ts)\n * \n * @example Basic field mapping\n * ```typescript\n * const mapping: FieldMapping = {\n * source: 'external_user_id',\n * target: 'user_id',\n * };\n * ```\n * \n * @example With transformation\n * ```typescript\n * const mapping: FieldMapping = {\n * source: 'user_name',\n * target: 'name',\n * transform: { type: 'cast', targetType: 'string' },\n * defaultValue: 'Unknown'\n * };\n * ```\n */\n\n/**\n * Transform Type Schema\n * \n * Defines the type of transformation to apply to a field value.\n * Implementations can extend this for domain-specific transforms.\n */\nexport const TransformTypeSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('constant'),\n value: z.any().describe('Constant value to use'),\n }).describe('Set a constant value'),\n \n z.object({\n type: z.literal('cast'),\n targetType: z.enum(['string', 'number', 'boolean', 'date']).describe('Target data type'),\n }).describe('Cast to a specific data type'),\n \n z.object({\n type: z.literal('lookup'),\n table: z.string().describe('Lookup table name'),\n keyField: z.string().describe('Field to match on'),\n valueField: z.string().describe('Field to retrieve'),\n }).describe('Lookup value from another table'),\n \n z.object({\n type: z.literal('javascript'),\n expression: z.string().describe('JavaScript expression (e.g., \"value.toUpperCase()\")'),\n }).describe('Custom JavaScript transformation'),\n \n z.object({\n type: z.literal('map'),\n mappings: z.record(z.string(), z.any()).describe('Value mappings (e.g., {\"Active\": \"active\"})'),\n }).describe('Map values using a dictionary'),\n]);\n\nexport type TransformType = z.infer<typeof TransformTypeSchema>;\n\n/**\n * Field Mapping Schema\n * \n * Base schema for mapping fields between source and target systems.\n * \n * **NAMING CONVENTION:**\n * - source: Field name in the source system\n * - target: Field name in the target system (should be snake_case for ObjectStack)\n * \n * @example\n * ```typescript\n * {\n * source: 'FirstName',\n * target: 'first_name',\n * transform: { type: 'cast', targetType: 'string' },\n * defaultValue: ''\n * }\n * ```\n */\nexport const FieldMappingSchema = z.object({\n /**\n * Source field name\n */\n source: z.string().describe('Source field name'),\n \n /**\n * Target field name (should be snake_case for ObjectStack)\n */\n target: z.string().describe('Target field name'),\n \n /**\n * Transformation to apply\n */\n transform: TransformTypeSchema.optional().describe('Transformation to apply'),\n \n /**\n * Default value if source is null/undefined\n */\n defaultValue: z.any().optional().describe('Default if source is null/undefined'),\n});\n\nexport type FieldMapping = z.infer<typeof FieldMappingSchema>;\n","import { z } from 'zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\n\n/**\n * XState-inspired State Machine Protocol\n * Used to define strict business logic constraints and lifecycle management.\n * Prevent AI \"hallucinations\" by enforcing valid valid transitions.\n */\n\n// --- Primitives ---\n\n/**\n * References a named action (side effect)\n * Can be a script, a webhook, or a field update.\n */\nexport const ActionRefSchema = z.union([\n z.string().describe('Action Name'),\n z.object({\n type: z.string(), // e.g., 'xstate.assign', 'log', 'email'\n params: z.record(z.string(), z.any()).optional()\n })\n]);\n\n/**\n * References a named condition (guard)\n * Must evaluate to true for the transition to occur.\n */\nexport const GuardRefSchema = z.union([\n z.string().describe('Guard Name (e.g., \"isManager\", \"amountGT1000\")'),\n z.object({\n type: z.string(),\n params: z.record(z.string(), z.any()).optional()\n })\n]);\n\n// --- Core Structure ---\n\n/**\n * State Transition Definition\n * \"When EVENT happens, if GUARD is true, go to TARGET and run ACTIONS\"\n */\nexport const TransitionSchema = z.object({\n target: z.string().optional().describe('Target State ID'),\n cond: GuardRefSchema.optional().describe('Condition (Guard) required to take this path'),\n actions: z.array(ActionRefSchema).optional().describe('Actions to execute during transition'),\n description: z.string().optional().describe('Human readable description of this rule'),\n});\n\n/**\n * Event Definition (Signals)\n */\nexport const EventSchema = z.object({\n type: z.string().describe('Event Type (e.g. \"APPROVE\", \"REJECT\", \"Submit\")'),\n // Payload validation schema could go here if we want deep validation\n schema: z.record(z.string(), z.any()).optional().describe('Expected event payload structure'),\n});\n\nexport type ActionRef = z.infer<typeof ActionRefSchema>;\nexport type Transition = z.infer<typeof TransitionSchema>;\n\nexport type StateNodeConfig = {\n type?: 'atomic' | 'compound' | 'parallel' | 'final' | 'history';\n entry?: ActionRef[];\n exit?: ActionRef[];\n on?: Record<string, string | Transition | Transition[]>;\n always?: Transition[];\n initial?: string;\n states?: Record<string, StateNodeConfig>;\n meta?: {\n label?: string;\n description?: string;\n color?: string;\n aiInstructions?: string;\n };\n};\n\n/**\n * State Node Definition\n */\nexport const StateNodeSchema: z.ZodType<StateNodeConfig> = z.lazy(() => z.object({\n /** Type of state */\n type: z.enum(['atomic', 'compound', 'parallel', 'final', 'history']).default('atomic'),\n \n /** Entry/Exit Actions */\n entry: z.array(ActionRefSchema).optional().describe('Actions to run when entering this state'),\n exit: z.array(ActionRefSchema).optional().describe('Actions to run when leaving this state'),\n \n /** Transitions (Events) */\n on: z.record(z.string(), z.union([\n z.string(), // Shorthand target\n TransitionSchema, \n z.array(TransitionSchema)\n ])).optional().describe('Map of Event Type -> Transition Definition'),\n \n /** Always Transitions (Eventless) */\n always: z.array(TransitionSchema).optional(),\n\n /** Nesting (Hierarchical States) */\n initial: z.string().optional().describe('Initial child state (if compound)'),\n states: z.record(z.string(), StateNodeSchema).optional(),\n \n /** Metadata for UI/AI */\n meta: z.object({\n label: z.string().optional(),\n description: z.string().optional(),\n color: z.string().optional(), // For UI diagrams\n // Instructions for AI Agent when in this state\n aiInstructions: z.string().optional().describe('Specific instructions for AI when in this state'),\n }).optional(),\n}));\n\n/**\n * Top-Level State Machine Definition\n */\nexport const StateMachineSchema = z.object({\n id: SnakeCaseIdentifierSchema.describe('Unique Machine ID'),\n description: z.string().optional(),\n \n /** Context (Memory) Schema */\n contextSchema: z.record(z.string(), z.any()).optional().describe('Zod Schema for the machine context/memory'),\n \n /** Initial State */\n initial: z.string().describe('Initial State ID'),\n \n /** State Definitions */\n states: z.record(z.string(), StateNodeSchema).describe('State Nodes'),\n \n /** Global Listeners */\n on: z.record(z.string(), z.union([z.string(), TransitionSchema, z.array(TransitionSchema)])).optional(),\n});\n\nexport type StateMachineConfig = z.infer<typeof StateMachineSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,cAAkB;;;ACAlB,iBAAkB;AA6CX,IAAM,yBAAyB,aACnC,OAAO,EACP,IAAI,GAAG,EAAE,SAAS,kDAAkD,CAAC,EACrE,MAAM,sBAAsB;AAAA,EAC3B,SACE;AACJ,CAAC,EACA,SAAS,wDAAwD;AAiB7D,IAAM,4BAA4B,aACtC,OAAO,EACP,IAAI,GAAG,EAAE,SAAS,2CAA2C,CAAC,EAC9D,MAAM,qBAAqB;AAAA,EAC1B,SACE;AACJ,CAAC,EACA,SAAS,yDAAyD;AAoB9D,IAAM,kBAAkB,aAC5B,OAAO,EACP,IAAI,GAAG,EAAE,SAAS,2CAA2C,CAAC,EAC9D,MAAM,sBAAsB;AAAA,EAC3B,SACE;AACJ,CAAC,EACA,SAAS,0DAA0D;;;ADjG/D,IAAM,sBAAsB,cAAE,KA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