@burdenoff/microfe-headshotmarketing 2026.1013.1 → 2026.1029.2
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/dist/generated/global-types.d.ts +5145 -1627
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/wspace-operations.d.ts +512 -248
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +349 -292
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +21251 -468
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +20 -20
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/components/PageLayout.d.ts +5 -0
- package/dist/headshotmarketing/components/PageLayout.d.ts.map +1 -1
- package/dist/headshotmarketing/components/PageLayout.js +12 -6
- package/dist/headshotmarketing/components/PageLayout.js.map +1 -1
- package/dist/headshotmarketing/components/StatusBadge.d.ts.map +1 -1
- package/dist/headshotmarketing/components/StatusBadge.js +3 -0
- package/dist/headshotmarketing/components/StatusBadge.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/AutomationPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/AutomationPage.js +172 -167
- package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/TriggersPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/TriggersPage.js +127 -143
- package/dist/headshotmarketing/pages/automation/TriggersPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowActions.d.ts +16 -16
- package/dist/headshotmarketing/pages/automation/WorkflowActions.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowActions.js +104 -221
- package/dist/headshotmarketing/pages/automation/WorkflowActions.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.d.ts +16 -0
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +470 -549
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.d.ts +2 -0
- package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.js +19 -19
- package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.js +341 -164
- package/dist/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.d.ts +13 -0
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js +294 -0
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js.map +1 -0
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.d.ts +2 -0
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js +198 -220
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/useAutomationData.d.ts +24 -0
- package/dist/headshotmarketing/pages/automation/useAutomationData.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/automation/useAutomationData.js +77 -0
- package/dist/headshotmarketing/pages/automation/useAutomationData.js.map +1 -0
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.d.ts +73 -16
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js +220 -80
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/workflowCompiler.d.ts +51 -0
- package/dist/headshotmarketing/pages/automation/workflowCompiler.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/automation/workflowCompiler.js +453 -0
- package/dist/headshotmarketing/pages/automation/workflowCompiler.js.map +1 -0
- package/dist/headshotmarketing/pages/social-media/PostsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/social-media/PostsPage.js +267 -194
- package/dist/headshotmarketing/pages/social-media/PostsPage.js.map +1 -1
- package/dist/headshotmarketing/types/index.d.ts +6 -0
- package/dist/headshotmarketing/types/index.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/automationMapper.d.ts +50 -29
- package/dist/headshotmarketing/utils/automationMapper.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/automationMapper.js +55 -99
- package/dist/headshotmarketing/utils/automationMapper.js.map +1 -1
- package/dist/headshotmarketing/utils/socialMapper.d.ts +8 -0
- package/dist/headshotmarketing/utils/socialMapper.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/socialMapper.js +27 -15
- package/dist/headshotmarketing/utils/socialMapper.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflowBuilderModel.js","names":[],"sources":["../../../../src/headshotmarketing/pages/automation/workflowBuilderModel.ts"],"sourcesContent":["/**\n * Shared model + metadata for the visual Workflow Builder canvas.\n * @module headshotmarketing/pages/automation\n *\n * The canvas persists a node-graph ({ nodes[], edges[] }) into the workflow's\n * `steps` JSON so the graph round-trips through createHeadshotmarketingWorkflow.\n */\nimport {\n Mail,\n MessageSquare,\n Clock,\n GitBranch,\n Bell,\n Tag,\n Zap,\n Webhook,\n type LucideIcon,\n} from \"lucide-react\";\n\n/** Fixed node footprint (world units) — used for edge port geometry. */\nexport const NODE_W = 240;\nexport const NODE_H = 78;\n\nexport type NodeKind = \"trigger\" | \"action\";\n\n/** Per-node configuration captured by the right-hand config panel. */\nexport interface NodeConfig {\n description?: string;\n emailTemplate?: string;\n message?: string;\n waitDuration?: number;\n waitUnit?: string;\n conditionRule?: string;\n webhookUrl?: string;\n tag?: string;\n points?: number;\n source?: string;\n}\n\nexport interface CanvasNode {\n id: string;\n kind: NodeKind;\n /** trigger id (form_submit…) or action id (send_email…). */\n actionType: string;\n label: string;\n x: number;\n y: number;\n config: NodeConfig;\n}\n\nexport type BranchKind = \"yes\" | \"no\" | null;\n\nexport interface CanvasEdge {\n id: string;\n source: string;\n target: string;\n branch: BranchKind;\n}\n\n/** Semantic-token tones for the node icon chips (never raw colors). */\nexport type ChipTone = \"info\" | \"success\" | \"warning\" | \"error\" | \"accent\";\n\nexport const CHIP_TONE: Record<ChipTone, string> = {\n info: \"bg-status-info-bg text-status-info-text ring-status-info-border\",\n success:\n \"bg-status-success-bg text-status-success-text ring-status-success-border\",\n warning:\n \"bg-status-warning-bg text-status-warning-text ring-status-warning-border\",\n error: \"bg-status-error-bg text-status-error-text ring-status-error-border\",\n accent:\n \"bg-[var(--color-accent-soft)] text-action-primary-bg ring-border-seam\",\n};\n\nexport interface ActionMeta {\n type: string;\n label: string;\n icon: LucideIcon;\n tone: ChipTone;\n /** True for branching nodes that expose Yes/No output ports. */\n isCondition?: boolean;\n}\n\nexport const ACTION_TYPES: ActionMeta[] = [\n { type: \"send_email\", label: \"Send Email\", icon: Mail, tone: \"info\" },\n { type: \"send_sms\", label: \"Send SMS\", icon: MessageSquare, tone: \"accent\" },\n { type: \"wait\", label: \"Wait / Delay\", icon: Clock, tone: \"warning\" },\n {\n type: \"condition\",\n label: \"Condition\",\n icon: GitBranch,\n tone: \"accent\",\n isCondition: true,\n },\n { type: \"notify\", label: \"Send Notification\", icon: Bell, tone: \"success\" },\n { type: \"webhook\", label: \"Webhook\", icon: Webhook, tone: \"info\" },\n { type: \"add_tag\", label: \"Add Tag\", icon: Tag, tone: \"warning\" },\n { type: \"update_score\", label: \"Update Score\", icon: Zap, tone: \"error\" },\n];\n\nexport const TRIGGER_TYPES: { type: string; label: string; icon: string }[] = [\n { type: \"form_submit\", label: \"Form Submission\", icon: \"📝\" },\n { type: \"event\", label: \"Event Triggered\", icon: \"⚡\" },\n { type: \"schedule\", label: \"Schedule\", icon: \"📅\" },\n { type: \"tag_added\", label: \"Tag Added\", icon: \"🏷️\" },\n { type: \"webhook\", label: \"Webhook\", icon: \"🔗\" },\n { type: \"score_change\", label: \"Score Change\", icon: \"📊\" },\n];\n\nexport function actionMeta(type: string): ActionMeta | undefined {\n return ACTION_TYPES.find((a) => a.type === type);\n}\n\nexport function triggerLabel(type: string): string {\n return TRIGGER_TYPES.find((t) => t.type === type)?.label ?? \"Trigger\";\n}\n\n/** Chip tone for a node (trigger nodes read as success/green, like the mock). */\nexport function nodeTone(node: CanvasNode): ChipTone {\n if (node.kind === \"trigger\") return \"success\";\n return actionMeta(node.actionType)?.tone ?? \"accent\";\n}\n\nexport function nodeIcon(node: CanvasNode): LucideIcon {\n if (node.kind === \"trigger\") return Zap;\n return actionMeta(node.actionType)?.icon ?? Zap;\n}\n\nexport function isConditionNode(node: CanvasNode): boolean {\n return node.kind === \"action\" && node.actionType === \"condition\";\n}\n\n/** Output port (bottom) for an edge leaving `node` on the given branch. */\nexport function outPort(\n node: CanvasNode,\n branch: BranchKind,\n): {\n x: number;\n y: number;\n} {\n const y = node.y + NODE_H;\n if (branch === \"yes\") return { x: node.x + NODE_W * 0.28, y };\n if (branch === \"no\") return { x: node.x + NODE_W * 0.72, y };\n return { x: node.x + NODE_W / 2, y };\n}\n\n/** Input port (top-center) for edges arriving at `node`. */\nexport function inPort(node: CanvasNode): { x: number; y: number } {\n return { x: node.x + NODE_W / 2, y: node.y };\n}\n\n/**\n * Serialize the graph into the `steps` JSON shape persisted by\n * createHeadshotmarketingWorkflow. Positions + config + edges all round-trip.\n */\nexport function serializeGraph(\n nodes: CanvasNode[],\n edges: CanvasEdge[],\n): Record<string, unknown> {\n return {\n version: 2,\n nodes: nodes.map((n, index) => ({\n id: n.id,\n kind: n.kind,\n actionType: n.actionType,\n label: n.label,\n order: index,\n position: { x: Math.round(n.x), y: Math.round(n.y) },\n config: n.config,\n })),\n edges: edges.map((e) => ({\n id: e.id,\n source: e.source,\n target: e.target,\n branch: e.branch,\n })),\n };\n}\n"],"mappings":";AA8DA,IAAa,IAAsC;CACjD,MAAM;CACN,SACE;CACF,SACE;CACF,OAAO;CACP,QACE;CACH,EAWY,IAA6B;CACxC;EAAE,MAAM;EAAc,OAAO;EAAc,MAAM;EAAM,MAAM;EAAQ;CACrE;EAAE,MAAM;EAAY,OAAO;EAAY,MAAM;EAAe,MAAM;EAAU;CAC5E;EAAE,MAAM;EAAQ,OAAO;EAAgB,MAAM;EAAO,MAAM;EAAW;CACrE;EACE,MAAM;EACN,OAAO;EACP,MAAM;EACN,MAAM;EACN,aAAa;EACd;CACD;EAAE,MAAM;EAAU,OAAO;EAAqB,MAAM;EAAM,MAAM;EAAW;CAC3E;EAAE,MAAM;EAAW,OAAO;EAAW,MAAM;EAAS,MAAM;EAAQ;CAClE;EAAE,MAAM;EAAW,OAAO;EAAW,MAAM;EAAK,MAAM;EAAW;CACjE;EAAE,MAAM;EAAgB,OAAO;EAAgB,MAAM;EAAK,MAAM;EAAS;CAC1E,EAEY,IAAiE;CAC5E;EAAE,MAAM;EAAe,OAAO;EAAmB,MAAM;EAAM;CAC7D;EAAE,MAAM;EAAS,OAAO;EAAmB,MAAM;EAAK;CACtD;EAAE,MAAM;EAAY,OAAO;EAAY,MAAM;EAAM;CACnD;EAAE,MAAM;EAAa,OAAO;EAAa,MAAM;EAAO;CACtD;EAAE,MAAM;EAAW,OAAO;EAAW,MAAM;EAAM;CACjD;EAAE,MAAM;EAAgB,OAAO;EAAgB,MAAM;EAAM;CAC5D;AAED,SAAgB,EAAW,GAAsC;AAC/D,QAAO,EAAa,MAAM,MAAM,EAAE,SAAS,EAAK;;AAGlD,SAAgB,EAAa,GAAsB;AACjD,QAAO,EAAc,MAAM,MAAM,EAAE,SAAS,EAAK,EAAE,SAAS;;AAI9D,SAAgB,EAAS,GAA4B;AAEnD,QADI,EAAK,SAAS,YAAkB,YAC7B,EAAW,EAAK,WAAW,EAAE,QAAQ;;AAG9C,SAAgB,EAAS,GAA8B;AAErD,QADI,EAAK,SAAS,YAAkB,IAC7B,EAAW,EAAK,WAAW,EAAE,QAAQ;;AAG9C,SAAgB,EAAgB,GAA2B;AACzD,QAAO,EAAK,SAAS,YAAY,EAAK,eAAe;;AAIvD,SAAgB,EACd,GACA,GAIA;CACA,IAAM,IAAI,EAAK,IAAA;AAGf,QAFI,MAAW,QAAc;EAAE,GAAG,EAAK,IAAA,MAAa;EAAM;EAAG,GACzD,MAAW,OAAa;EAAE,GAAG,EAAK,IAAA,MAAa;EAAM;EAAG,GACrD;EAAE,GAAG,EAAK,IAAA,MAAa;EAAG;EAAG;;AAItC,SAAgB,EAAO,GAA4C;AACjE,QAAO;EAAE,GAAG,EAAK,IAAA,MAAa;EAAG,GAAG,EAAK;EAAG;;AAO9C,SAAgB,EACd,GACA,GACyB;AACzB,QAAO;EACL,SAAS;EACT,OAAO,EAAM,KAAK,GAAG,OAAW;GAC9B,IAAI,EAAE;GACN,MAAM,EAAE;GACR,YAAY,EAAE;GACd,OAAO,EAAE;GACT,OAAO;GACP,UAAU;IAAE,GAAG,KAAK,MAAM,EAAE,EAAE;IAAE,GAAG,KAAK,MAAM,EAAE,EAAE;IAAE;GACpD,QAAQ,EAAE;GACX,EAAE;EACH,OAAO,EAAM,KAAK,OAAO;GACvB,IAAI,EAAE;GACN,QAAQ,EAAE;GACV,QAAQ,EAAE;GACV,QAAQ,EAAE;GACX,EAAE;EACJ"}
|
|
1
|
+
{"version":3,"file":"workflowBuilderModel.js","names":[],"sources":["../../../../src/headshotmarketing/pages/automation/workflowBuilderModel.ts"],"sourcesContent":["/**\n * Shared model + metadata for the visual Workflow Builder canvas.\n * @module headshotmarketing/pages/automation\n *\n * The canvas is an editing view over the HeadshotMarketing step engine\n * (wspace-headshotmarketing-svc, BOFF-3457 / BOFF-10192). It is compiled to\n * the engine's ordered `steps` list by `workflowCompiler.ts` and rebuilt from\n * that list when a saved workflow is opened, so every palette entry here maps\n * to exactly one engine step type.\n */\nimport {\n Mail,\n Clock,\n GitBranch,\n Bell,\n Tag,\n Zap,\n Webhook,\n PencilLine,\n Flag,\n type LucideIcon,\n} from \"lucide-react\";\n\n/** Fixed node footprint (world units) — used for edge port geometry. */\nexport const NODE_W = 240;\nexport const NODE_H = 78;\n\nexport type NodeKind = \"trigger\" | \"action\";\n\n/** Engine step types (engine/workflow-steps.ts in the service). */\nexport type EngineStepType =\n | \"SEND_EMAIL\"\n | \"SEND_NOTIFICATION\"\n | \"WAIT\"\n | \"CONDITION\"\n | \"WEBHOOK\"\n | \"UPDATE_CONTACT_FIELD\"\n | \"ADD_TAG\"\n | \"GOAL\";\n\n/** Engine trigger types the builder offers (the ones real events fire). */\nexport type BuilderTriggerType =\n | \"LEAD_CREATED\"\n | \"CONTACT_CREATED\"\n | \"SCORE_THRESHOLD\"\n | \"MANUAL\";\n\nexport type WaitUnit = \"minutes\" | \"hours\" | \"days\";\n\nexport type ConditionOperator =\n | \"eq\"\n | \"neq\"\n | \"gt\"\n | \"gte\"\n | \"lt\"\n | \"lte\"\n | \"contains\";\n\nexport type UpdatableField = \"score\" | \"status\" | \"assignedTo\";\n\nexport type WebhookMethod = \"POST\" | \"PUT\" | \"PATCH\";\n\n/** Per-node configuration captured by the right-hand config panel. */\nexport interface NodeConfig {\n /** SEND_EMAIL subject. */\n subject?: string;\n /** SEND_EMAIL / SEND_NOTIFICATION body. */\n body?: string;\n /** SEND_NOTIFICATION title. */\n title?: string;\n /** WAIT duration in `waitUnit`. */\n waitDuration?: number;\n waitUnit?: WaitUnit;\n /** CONDITION field / operator / value (value kept as typed text). */\n field?: string;\n operator?: ConditionOperator;\n value?: string;\n /** WEBHOOK destination. */\n webhookUrl?: string;\n method?: WebhookMethod;\n /** UPDATE_CONTACT_FIELD target field (value uses `value`). */\n updateField?: UpdatableField;\n /** ADD_TAG tag. */\n tag?: string;\n /** GOAL description. */\n description?: string;\n /** Optional automatic retry policy (side-effecting steps only). */\n retryMaxAttempts?: number;\n retryBackoffMinutes?: number;\n /** SCORE_THRESHOLD trigger threshold. */\n scoreThreshold?: number;\n}\n\nexport interface CanvasNode {\n id: string;\n kind: NodeKind;\n /** Trigger nodes: engine trigger type. Action nodes: palette action id. */\n actionType: string;\n label: string;\n x: number;\n y: number;\n config: NodeConfig;\n}\n\nexport type BranchKind = \"yes\" | \"no\" | null;\n\nexport interface CanvasEdge {\n id: string;\n source: string;\n target: string;\n branch: BranchKind;\n}\n\n/** Semantic-token tones for the node icon chips (never raw colors). */\nexport type ChipTone = \"info\" | \"success\" | \"warning\" | \"error\" | \"accent\";\n\nexport const CHIP_TONE: Record<ChipTone, string> = {\n info: \"bg-status-info-bg text-status-info-text ring-status-info-border\",\n success:\n \"bg-status-success-bg text-status-success-text ring-status-success-border\",\n warning:\n \"bg-status-warning-bg text-status-warning-text ring-status-warning-border\",\n error: \"bg-status-error-bg text-status-error-text ring-status-error-border\",\n accent:\n \"bg-[var(--color-accent-soft)] text-action-primary-bg ring-border-seam\",\n};\n\nexport interface ActionMeta {\n /** Palette id stored on the canvas node. */\n type: string;\n /** Engine step type this action compiles to. */\n engineType: EngineStepType;\n label: string;\n /** Short label for the compact palette tile. */\n shortLabel: string;\n icon: LucideIcon;\n tone: ChipTone;\n /** True for branching nodes that expose Yes/No output ports. */\n isCondition?: boolean;\n /** True when the engine accepts a retry policy for this step type. */\n retryable: boolean;\n}\n\nexport const ACTION_TYPES: ActionMeta[] = [\n {\n type: \"send_email\",\n engineType: \"SEND_EMAIL\",\n label: \"Send Email\",\n shortLabel: \"Email\",\n icon: Mail,\n tone: \"info\",\n retryable: true,\n },\n {\n type: \"notify\",\n engineType: \"SEND_NOTIFICATION\",\n label: \"Notify\",\n shortLabel: \"Notify\",\n icon: Bell,\n tone: \"success\",\n retryable: true,\n },\n {\n type: \"wait\",\n engineType: \"WAIT\",\n label: \"Wait\",\n shortLabel: \"Wait\",\n icon: Clock,\n tone: \"warning\",\n retryable: false,\n },\n {\n type: \"condition\",\n engineType: \"CONDITION\",\n label: \"Condition\",\n shortLabel: \"Condition\",\n icon: GitBranch,\n tone: \"accent\",\n isCondition: true,\n retryable: false,\n },\n {\n type: \"add_tag\",\n engineType: \"ADD_TAG\",\n label: \"Add Tag\",\n shortLabel: \"Tag\",\n icon: Tag,\n tone: \"warning\",\n retryable: true,\n },\n {\n type: \"webhook\",\n engineType: \"WEBHOOK\",\n label: \"Webhook\",\n shortLabel: \"Webhook\",\n icon: Webhook,\n tone: \"info\",\n retryable: true,\n },\n {\n type: \"update_field\",\n engineType: \"UPDATE_CONTACT_FIELD\",\n label: \"Update Field\",\n shortLabel: \"Update field\",\n icon: PencilLine,\n tone: \"error\",\n retryable: true,\n },\n {\n type: \"goal\",\n engineType: \"GOAL\",\n label: \"Goal\",\n shortLabel: \"Goal\",\n icon: Flag,\n tone: \"success\",\n retryable: false,\n },\n];\n\nexport interface TriggerMeta {\n type: BuilderTriggerType;\n label: string;\n description: string;\n}\n\nexport const TRIGGER_TYPES: TriggerMeta[] = [\n {\n type: \"LEAD_CREATED\",\n label: \"New lead\",\n description: \"Runs for every lead created in this workspace.\",\n },\n {\n type: \"CONTACT_CREATED\",\n label: \"New contact\",\n description: \"Runs for every contact created in this workspace.\",\n },\n {\n type: \"SCORE_THRESHOLD\",\n label: \"Lead score reached\",\n description: \"Runs when a lead's score rises to the threshold or above.\",\n },\n {\n type: \"MANUAL\",\n label: \"Manual\",\n description: \"Runs only when you start it for a lead.\",\n },\n];\n\n/** Labels for trigger types the engine knows but the builder does not offer. */\nconst OTHER_TRIGGER_LABELS: Record<string, string> = {\n CAMPAIGN_EVENT: \"Campaign event\",\n DATE_BASED: \"Date based\",\n};\n\nexport const CONDITION_OPERATORS: {\n value: ConditionOperator;\n label: string;\n}[] = [\n { value: \"eq\", label: \"equals\" },\n { value: \"neq\", label: \"does not equal\" },\n { value: \"gt\", label: \"is greater than\" },\n { value: \"gte\", label: \"is at least\" },\n { value: \"lt\", label: \"is less than\" },\n { value: \"lte\", label: \"is at most\" },\n { value: \"contains\", label: \"contains\" },\n];\n\n/**\n * Fields a condition can read. The run context carries the trigger's event\n * data (email, score, source, …) and the engine falls back to the lead or\n * contact row for anything else.\n */\nexport const CONDITION_FIELDS: { value: string; label: string }[] = [\n { value: \"score\", label: \"Score\" },\n { value: \"status\", label: \"Status\" },\n { value: \"source\", label: \"Source\" },\n { value: \"email\", label: \"Email\" },\n { value: \"company\", label: \"Company\" },\n { value: \"assignedTo\", label: \"Assigned to\" },\n];\n\nexport const UPDATABLE_FIELDS: { value: UpdatableField; label: string }[] = [\n { value: \"score\", label: \"Score\" },\n { value: \"status\", label: \"Status\" },\n { value: \"assignedTo\", label: \"Assigned to\" },\n];\n\nexport function actionMeta(type: string): ActionMeta | undefined {\n return ACTION_TYPES.find((a) => a.type === type);\n}\n\nexport function actionMetaForEngineType(\n engineType: string,\n): ActionMeta | undefined {\n return ACTION_TYPES.find((a) => a.engineType === engineType);\n}\n\nexport function triggerLabel(type: string): string {\n return (\n TRIGGER_TYPES.find((t) => t.type === type)?.label ??\n OTHER_TRIGGER_LABELS[type] ??\n \"Trigger\"\n );\n}\n\nexport function isBuilderTriggerType(type: string): type is BuilderTriggerType {\n return TRIGGER_TYPES.some((t) => t.type === type);\n}\n\n/** Chip tone for a node (trigger nodes read as success/green, like the mock). */\nexport function nodeTone(node: CanvasNode): ChipTone {\n if (node.kind === \"trigger\") return \"success\";\n return actionMeta(node.actionType)?.tone ?? \"accent\";\n}\n\nexport function nodeIcon(node: CanvasNode): LucideIcon {\n if (node.kind === \"trigger\") return Zap;\n return actionMeta(node.actionType)?.icon ?? Zap;\n}\n\nexport function isConditionNode(node: CanvasNode): boolean {\n return node.kind === \"action\" && node.actionType === \"condition\";\n}\n\n/** Default config for a freshly added action. */\nexport function defaultConfig(actionType: string): NodeConfig {\n switch (actionType) {\n case \"send_email\":\n return { subject: \"\", body: \"\" };\n case \"notify\":\n return { title: \"\", body: \"\" };\n case \"wait\":\n return { waitDuration: 2, waitUnit: \"days\" };\n case \"condition\":\n return { field: \"score\", operator: \"gte\", value: \"50\" };\n case \"webhook\":\n return { webhookUrl: \"\", method: \"POST\" };\n case \"update_field\":\n return { updateField: \"score\", value: \"\" };\n case \"add_tag\":\n return { tag: \"\" };\n case \"goal\":\n return { description: \"\" };\n default:\n return {};\n }\n}\n\nconst WAIT_UNIT_MINUTES: Record<WaitUnit, number> = {\n minutes: 1,\n hours: 60,\n days: 1440,\n};\n\nexport function waitToMinutes(duration: number, unit: WaitUnit): number {\n return duration * WAIT_UNIT_MINUTES[unit];\n}\n\n/** Largest unit that expresses `minutes` exactly (2880 → 2 days). */\nexport function minutesToWait(minutes: number): {\n waitDuration: number;\n waitUnit: WaitUnit;\n} {\n if (minutes >= 1440 && minutes % 1440 === 0)\n return { waitDuration: minutes / 1440, waitUnit: \"days\" };\n if (minutes >= 60 && minutes % 60 === 0)\n return { waitDuration: minutes / 60, waitUnit: \"hours\" };\n return { waitDuration: minutes, waitUnit: \"minutes\" };\n}\n\nfunction operatorLabel(op: ConditionOperator | undefined): string {\n return CONDITION_OPERATORS.find((o) => o.value === op)?.label ?? \"?\";\n}\n\nfunction fieldLabel(field: string | undefined): string {\n if (!field) return \"field\";\n return CONDITION_FIELDS.find((f) => f.value === field)?.label ?? field;\n}\n\n/** One-line summary rendered under a node's title on the canvas. */\nexport function nodeSubtitle(node: CanvasNode): string {\n const c = node.config;\n if (node.kind === \"trigger\") {\n if (node.actionType === \"SCORE_THRESHOLD\" && c.scoreThreshold != null)\n return `Score reaches ${c.scoreThreshold}`;\n return triggerLabel(node.actionType);\n }\n switch (node.actionType) {\n case \"send_email\":\n return c.subject ? c.subject : \"Set a subject\";\n case \"notify\":\n return c.title ? c.title : \"Notify your team\";\n case \"wait\":\n return c.waitDuration\n ? `Wait ${c.waitDuration} ${c.waitUnit ?? \"days\"}`\n : \"Set a delay\";\n case \"condition\":\n return c.field\n ? `${fieldLabel(c.field)} ${operatorLabel(c.operator)} ${c.value ?? \"\"}?`\n : \"Set a condition\";\n case \"webhook\":\n return c.webhookUrl ? c.webhookUrl : \"Call a webhook\";\n case \"update_field\":\n return c.updateField\n ? `Set ${fieldLabel(c.updateField)} to ${c.value ?? \"\"}`\n : \"Update a field\";\n case \"add_tag\":\n return c.tag ? `Tag: ${c.tag}` : \"Add a tag\";\n case \"goal\":\n return c.description ? c.description : \"Mark a goal\";\n default:\n return actionMeta(node.actionType)?.label ?? \"\";\n }\n}\n\n/** Output port (bottom) for an edge leaving `node` on the given branch. */\nexport function outPort(\n node: CanvasNode,\n branch: BranchKind,\n): {\n x: number;\n y: number;\n} {\n const y = node.y + NODE_H;\n if (branch === \"yes\") return { x: node.x + NODE_W * 0.28, y };\n if (branch === \"no\") return { x: node.x + NODE_W * 0.72, y };\n return { x: node.x + NODE_W / 2, y };\n}\n\n/** Input port (top-center) for edges arriving at `node`. */\nexport function inPort(node: CanvasNode): { x: number; y: number } {\n return { x: node.x + NODE_W / 2, y: node.y };\n}\n"],"mappings":";AAoHA,IAAa,IAAsC;CACjD,MAAM;CACN,SACE;CACF,SACE;CACF,OAAO;CACP,QACE;CACH,EAkBY,IAA6B;CACxC;EACE,MAAM;EACN,YAAY;EACZ,OAAO;EACP,YAAY;EACZ,MAAM;EACN,MAAM;EACN,WAAW;EACZ;CACD;EACE,MAAM;EACN,YAAY;EACZ,OAAO;EACP,YAAY;EACZ,MAAM;EACN,MAAM;EACN,WAAW;EACZ;CACD;EACE,MAAM;EACN,YAAY;EACZ,OAAO;EACP,YAAY;EACZ,MAAM;EACN,MAAM;EACN,WAAW;EACZ;CACD;EACE,MAAM;EACN,YAAY;EACZ,OAAO;EACP,YAAY;EACZ,MAAM;EACN,MAAM;EACN,aAAa;EACb,WAAW;EACZ;CACD;EACE,MAAM;EACN,YAAY;EACZ,OAAO;EACP,YAAY;EACZ,MAAM;EACN,MAAM;EACN,WAAW;EACZ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K,IAAA,MAAa;EAAM;EAAG,GACrD;EAAE,GAAG,EAAK,IAAA,MAAa;EAAG;EAAG;;AAItC,SAAgB,EAAO,GAA4C;AACjE,QAAO;EAAE,GAAG,EAAK,IAAA,MAAa;EAAG,GAAG,EAAK;EAAG"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CanvasEdge, CanvasNode, EngineStepType } from './workflowBuilderModel';
|
|
2
|
+
|
|
3
|
+
export interface EngineStepRetry {
|
|
4
|
+
maxAttempts: number;
|
|
5
|
+
backoffMinutes?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface EngineStep {
|
|
8
|
+
id: string;
|
|
9
|
+
type: EngineStepType;
|
|
10
|
+
config: Record<string, unknown>;
|
|
11
|
+
retry?: EngineStepRetry;
|
|
12
|
+
}
|
|
13
|
+
export interface CompiledWorkflow {
|
|
14
|
+
triggerType: string;
|
|
15
|
+
triggerConfig: Record<string, unknown>;
|
|
16
|
+
steps: EngineStep[];
|
|
17
|
+
}
|
|
18
|
+
/** A canvas the engine cannot run, with the node to highlight. */
|
|
19
|
+
export declare class WorkflowCompileError extends Error {
|
|
20
|
+
readonly nodeId: string | null;
|
|
21
|
+
constructor(message: string, nodeId?: string | null);
|
|
22
|
+
}
|
|
23
|
+
/** Suffix of the structural GOAL that ends a Condition's Yes path. */
|
|
24
|
+
export declare const BRANCH_END_SUFFIX = "__end";
|
|
25
|
+
/** Typed condition/update value: numbers and booleans keep their type. */
|
|
26
|
+
export declare function parseTypedValue(raw: string): string | number | boolean;
|
|
27
|
+
/** Compile the canvas to the engine's trigger + ordered step list. */
|
|
28
|
+
export declare function compileGraph(nodes: CanvasNode[], edges: CanvasEdge[]): CompiledWorkflow;
|
|
29
|
+
export interface SavedWorkflowShape {
|
|
30
|
+
triggerType: string;
|
|
31
|
+
triggerConfig?: Record<string, unknown> | null;
|
|
32
|
+
steps: unknown;
|
|
33
|
+
}
|
|
34
|
+
/** Parse the persisted `steps` JSON into engine steps, dropping junk entries. */
|
|
35
|
+
export declare function parseEngineSteps(raw: unknown): EngineStep[];
|
|
36
|
+
/**
|
|
37
|
+
* Lay the graph out top-down as a tree: each node sits one row below its
|
|
38
|
+
* tree parent and is centred over its children.
|
|
39
|
+
*/
|
|
40
|
+
export declare function layoutGraph(nodes: CanvasNode[], edges: CanvasEdge[]): CanvasNode[];
|
|
41
|
+
/** Rebuild the canvas for a saved engine workflow. */
|
|
42
|
+
export declare function decompileWorkflow(workflow: SavedWorkflowShape): {
|
|
43
|
+
nodes: CanvasNode[];
|
|
44
|
+
edges: CanvasEdge[];
|
|
45
|
+
};
|
|
46
|
+
/** Starter canvas for a new workflow — mirrors the reference flow (mock 20). */
|
|
47
|
+
export declare function seedGraph(): {
|
|
48
|
+
nodes: CanvasNode[];
|
|
49
|
+
edges: CanvasEdge[];
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=workflowCompiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowCompiler.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/automation/workflowCompiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAQL,KAAK,UAAU,EACf,KAAK,UAAU,EAEf,KAAK,cAAc,EAIpB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,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ggerLabel as r, waitToMinutes as i } from "./workflowBuilderModel.js";
|
|
2
|
+
//#region src/headshotmarketing/pages/automation/workflowCompiler.ts
|
|
3
|
+
var a = class extends Error {
|
|
4
|
+
nodeId;
|
|
5
|
+
constructor(e, t = null) {
|
|
6
|
+
super(e), this.name = "WorkflowCompileError", this.nodeId = t;
|
|
7
|
+
}
|
|
8
|
+
}, o = "__end", s = "End of branch", c = 10, l = 1440;
|
|
9
|
+
function u(t) {
|
|
10
|
+
let n = t.label.trim();
|
|
11
|
+
return n ? `"${n}"` : `"${e(t.actionType)?.label ?? "Step"}"`;
|
|
12
|
+
}
|
|
13
|
+
function d(e) {
|
|
14
|
+
return typeof e == "string" && e.trim().length > 0;
|
|
15
|
+
}
|
|
16
|
+
function f(e) {
|
|
17
|
+
let t = e.trim();
|
|
18
|
+
return t === "true" ? !0 : t === "false" ? !1 : /^-?\d+(\.\d+)?$/.test(t) ? Number(t) : t;
|
|
19
|
+
}
|
|
20
|
+
function p(e) {
|
|
21
|
+
return e.type === "GOAL" && e.config.endRun === !0;
|
|
22
|
+
}
|
|
23
|
+
function m(t) {
|
|
24
|
+
let n = e(t.actionType), r = t.config.retryMaxAttempts;
|
|
25
|
+
if (!n?.retryable || r === void 0 || r <= 1) return;
|
|
26
|
+
if (!Number.isInteger(r) || r > c) throw new a(`${u(t)}: retry attempts must be a whole number between 1 and ${c}.`, t.id);
|
|
27
|
+
let i = t.config.retryBackoffMinutes;
|
|
28
|
+
if (i !== void 0 && (!Number.isFinite(i) || i < 1 || i > l)) throw new a(`${u(t)}: retry delay must be between 1 and ${l} minutes.`, t.id);
|
|
29
|
+
return i === void 0 ? { maxAttempts: r } : {
|
|
30
|
+
maxAttempts: r,
|
|
31
|
+
backoffMinutes: i
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function h(t) {
|
|
35
|
+
let n = e(t.actionType);
|
|
36
|
+
if (!n) throw new a(`${u(t)} is not a step the automation engine can run.`, t.id);
|
|
37
|
+
let r = t.config, o = (e) => {
|
|
38
|
+
throw new a(`${u(t)}: ${e}`, t.id);
|
|
39
|
+
}, s = {};
|
|
40
|
+
switch (n.engineType) {
|
|
41
|
+
case "SEND_EMAIL":
|
|
42
|
+
d(r.subject) || o("add an email subject."), d(r.body) || o("add an email body."), s.subject = r.subject?.trim(), s.body = r.body?.trim();
|
|
43
|
+
break;
|
|
44
|
+
case "SEND_NOTIFICATION":
|
|
45
|
+
d(r.title) || o("add a notification title."), d(r.body) || o("add a notification message."), s.title = r.title?.trim(), s.body = r.body?.trim();
|
|
46
|
+
break;
|
|
47
|
+
case "WAIT": {
|
|
48
|
+
let e = r.waitDuration;
|
|
49
|
+
(e === void 0 || !Number.isFinite(e) || e <= 0) && o("set a delay greater than zero."), s.durationMinutes = i(e, r.waitUnit ?? "days");
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
case "CONDITION":
|
|
53
|
+
d(r.field) || o("choose the field to check."), r.operator || o("choose a comparison."), d(r.value) || o("enter the value to compare against."), s.field = r.field?.trim(), s.operator = r.operator, s.value = f(r.value);
|
|
54
|
+
break;
|
|
55
|
+
case "WEBHOOK":
|
|
56
|
+
(!d(r.webhookUrl) || !/^https?:\/\//i.test(r.webhookUrl)) && o("enter an http(s) webhook URL."), s.url = r.webhookUrl?.trim(), s.method = r.method ?? "POST";
|
|
57
|
+
break;
|
|
58
|
+
case "UPDATE_CONTACT_FIELD": {
|
|
59
|
+
r.updateField || o("choose the field to update."), d(r.value) || o("enter the new value.");
|
|
60
|
+
let e = f(r.value);
|
|
61
|
+
r.updateField === "score" && typeof e != "number" && o("the score must be a number."), s.field = r.updateField, s.value = typeof e == "boolean" ? String(e) : e;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
case "ADD_TAG":
|
|
65
|
+
d(r.tag) || o("enter the tag to add."), s.tag = r.tag?.trim();
|
|
66
|
+
break;
|
|
67
|
+
case "GOAL":
|
|
68
|
+
d(r.description) || o("describe the goal."), s.description = r.description?.trim();
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
let c = t.label.trim();
|
|
72
|
+
return c && c !== n.label && (s.label = c), {
|
|
73
|
+
type: n.engineType,
|
|
74
|
+
config: s
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function g(e) {
|
|
78
|
+
if (e.actionType !== "SCORE_THRESHOLD") return {};
|
|
79
|
+
let t = e.config.scoreThreshold;
|
|
80
|
+
if (t === void 0 || !Number.isFinite(t)) throw new a("The lead score trigger needs a score threshold.", e.id);
|
|
81
|
+
return { scoreThreshold: t };
|
|
82
|
+
}
|
|
83
|
+
function _(e, t, n) {
|
|
84
|
+
let r = /* @__PURE__ */ new Map();
|
|
85
|
+
for (let i of e) {
|
|
86
|
+
let e = t.filter((e) => e.target === i.id);
|
|
87
|
+
if (e.length === 0) continue;
|
|
88
|
+
if (i.kind === "trigger") throw new a("Nothing can connect into the trigger.", i.id);
|
|
89
|
+
let o = e.filter((e) => e.branch !== "no");
|
|
90
|
+
if (o.length > 1) throw new a(`${u(i)} is reached from more than one step. Paths can only rejoin through a Condition's No path.`, i.id);
|
|
91
|
+
let s = o[0] ?? e[0];
|
|
92
|
+
s && n.has(s.source) && r.set(i.id, s);
|
|
93
|
+
}
|
|
94
|
+
return r;
|
|
95
|
+
}
|
|
96
|
+
function v(e, t) {
|
|
97
|
+
let n = /* @__PURE__ */ new Map();
|
|
98
|
+
for (let t of e) n.set(t.id, t);
|
|
99
|
+
let r = t.filter((e) => n.has(e.source) && n.has(e.target)), i = /* @__PURE__ */ new Map();
|
|
100
|
+
for (let e of r) {
|
|
101
|
+
if (e.source === e.target) {
|
|
102
|
+
let t = n.get(e.source);
|
|
103
|
+
throw new a(`${t ? u(t) : "A step"} connects to itself.`, e.source);
|
|
104
|
+
}
|
|
105
|
+
i.set(e.source, [...i.get(e.source) ?? [], e]);
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
byId: n,
|
|
109
|
+
out: i,
|
|
110
|
+
primary: _(e, r, n)
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function y(e, t) {
|
|
114
|
+
let n = t.out.get(e.id) ?? [];
|
|
115
|
+
if (e.kind === "action" && e.actionType === "condition") {
|
|
116
|
+
let t = n.filter((e) => e.branch === null), r = n.filter((e) => e.branch === "yes"), i = n.filter((e) => e.branch === "no");
|
|
117
|
+
if (t.length > 0 || r.length > 1 || i.length > 1) throw new a(`${u(e)} can have one Yes path and one No path.`, e.id);
|
|
118
|
+
return {
|
|
119
|
+
next: null,
|
|
120
|
+
yes: r[0] ?? null,
|
|
121
|
+
no: i[0] ?? null
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
if (n.length > 1) throw new a(`${u(e)} connects to more than one next step. Add a Condition to branch.`, e.id);
|
|
125
|
+
return {
|
|
126
|
+
next: n[0] ?? null,
|
|
127
|
+
yes: null,
|
|
128
|
+
no: null
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function b(e, t, n) {
|
|
132
|
+
let r = t, i = /* @__PURE__ */ new Set();
|
|
133
|
+
for (; r && !i.has(r);) {
|
|
134
|
+
if (r === e) return !0;
|
|
135
|
+
i.add(r), r = n.get(r)?.source;
|
|
136
|
+
}
|
|
137
|
+
return !1;
|
|
138
|
+
}
|
|
139
|
+
function x(e, t) {
|
|
140
|
+
let n = e.filter((e) => e.kind === "trigger"), r = n[0];
|
|
141
|
+
if (!r || n.length > 1) throw new a("A workflow needs exactly one trigger.");
|
|
142
|
+
let i = v(e, t), c = [], l = /* @__PURE__ */ new Set(), d = [], f = (e) => {
|
|
143
|
+
let t = e;
|
|
144
|
+
for (; t;) {
|
|
145
|
+
let e = i.byId.get(t);
|
|
146
|
+
if (!e) return;
|
|
147
|
+
if (l.has(e.id)) throw new a(`${u(e)} is part of a loop. Workflows run top to bottom.`, e.id);
|
|
148
|
+
l.add(e.id);
|
|
149
|
+
let { type: n, config: r } = h(e), p = m(e), g = p ? {
|
|
150
|
+
id: e.id,
|
|
151
|
+
type: n,
|
|
152
|
+
config: r,
|
|
153
|
+
retry: p
|
|
154
|
+
} : {
|
|
155
|
+
id: e.id,
|
|
156
|
+
type: n,
|
|
157
|
+
config: r
|
|
158
|
+
};
|
|
159
|
+
c.push(g);
|
|
160
|
+
let _ = y(e, i);
|
|
161
|
+
if (n !== "CONDITION") {
|
|
162
|
+
t = _.next?.target ?? null;
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
let v = _.yes?.target ?? null, b = _.no;
|
|
166
|
+
if (!b) {
|
|
167
|
+
r.onFalse = "STOP", t = v;
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (r.onFalse = "SKIP_TO", r.skipToStepId = b.target, i.primary.get(b.target) === b) {
|
|
171
|
+
f(v), c.push({
|
|
172
|
+
id: `${e.id}${o}`,
|
|
173
|
+
type: "GOAL",
|
|
174
|
+
config: {
|
|
175
|
+
description: s,
|
|
176
|
+
endRun: !0
|
|
177
|
+
}
|
|
178
|
+
}), f(b.target);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
d.push({
|
|
182
|
+
conditionId: e.id,
|
|
183
|
+
targetId: b.target
|
|
184
|
+
}), t = v;
|
|
185
|
+
}
|
|
186
|
+
}, p = y(r, i).next;
|
|
187
|
+
if (!p) throw new a("Connect at least one step to the trigger.", r.id);
|
|
188
|
+
f(p.target);
|
|
189
|
+
for (let t of e) if (t.kind === "action" && !l.has(t.id)) throw new a(`${u(t)} is not connected to the trigger.`, t.id);
|
|
190
|
+
for (let e of d) if (b(e.targetId, e.conditionId, i.primary)) {
|
|
191
|
+
let t = i.byId.get(e.conditionId);
|
|
192
|
+
throw new a(`${t ? u(t) : "A condition"}: its No path loops back to an earlier step.`, e.conditionId);
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
triggerType: r.actionType,
|
|
196
|
+
triggerConfig: g(r),
|
|
197
|
+
steps: c
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function S(e) {
|
|
201
|
+
return typeof e == "object" && e && !Array.isArray(e) ? e : {};
|
|
202
|
+
}
|
|
203
|
+
function C(e) {
|
|
204
|
+
if (!Array.isArray(e)) return [];
|
|
205
|
+
let n = [];
|
|
206
|
+
for (let r of e) {
|
|
207
|
+
let e = S(r), i = e.id, a = e.type;
|
|
208
|
+
if (typeof i != "string" || typeof a != "string" || !t(a)) continue;
|
|
209
|
+
let o = S(e.retry), s = o.maxAttempts, c = o.backoffMinutes;
|
|
210
|
+
n.push({
|
|
211
|
+
id: i,
|
|
212
|
+
type: a,
|
|
213
|
+
config: S(e.config),
|
|
214
|
+
...typeof s == "number" ? { retry: {
|
|
215
|
+
maxAttempts: s,
|
|
216
|
+
...typeof c == "number" ? { backoffMinutes: c } : {}
|
|
217
|
+
} } : {}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return n;
|
|
221
|
+
}
|
|
222
|
+
function w(e) {
|
|
223
|
+
if (typeof e == "string") return e;
|
|
224
|
+
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
225
|
+
}
|
|
226
|
+
function T(e) {
|
|
227
|
+
let t = e.config, r = {};
|
|
228
|
+
switch (e.type) {
|
|
229
|
+
case "SEND_EMAIL":
|
|
230
|
+
r.subject = w(t.subject) ?? "", r.body = w(t.body) ?? "";
|
|
231
|
+
break;
|
|
232
|
+
case "SEND_NOTIFICATION":
|
|
233
|
+
r.title = w(t.title) ?? "", r.body = w(t.body) ?? "";
|
|
234
|
+
break;
|
|
235
|
+
case "WAIT": {
|
|
236
|
+
let e = t.durationMinutes;
|
|
237
|
+
Object.assign(r, n(typeof e == "number" ? e : 0));
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
case "CONDITION":
|
|
241
|
+
r.field = w(t.field) ?? "", r.operator = w(t.operator) ?? "eq", r.value = w(t.value) ?? "";
|
|
242
|
+
break;
|
|
243
|
+
case "WEBHOOK":
|
|
244
|
+
r.webhookUrl = w(t.url) ?? "", r.method = w(t.method) ?? "POST";
|
|
245
|
+
break;
|
|
246
|
+
case "UPDATE_CONTACT_FIELD":
|
|
247
|
+
r.updateField = w(t.field) ?? "score", r.value = w(t.value) ?? "";
|
|
248
|
+
break;
|
|
249
|
+
case "ADD_TAG":
|
|
250
|
+
r.tag = w(t.tag) ?? "";
|
|
251
|
+
break;
|
|
252
|
+
case "GOAL":
|
|
253
|
+
r.description = w(t.description) ?? "";
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
return e.retry && (r.retryMaxAttempts = e.retry.maxAttempts, e.retry.backoffMinutes !== void 0 && (r.retryBackoffMinutes = e.retry.backoffMinutes)), r;
|
|
257
|
+
}
|
|
258
|
+
var E = "trigger", D = 72, O = 280, k = 36, A = 24;
|
|
259
|
+
function j(e, t) {
|
|
260
|
+
let n = new Map(e.map((e) => [e.id, e])), r;
|
|
261
|
+
try {
|
|
262
|
+
r = _(e, t, n);
|
|
263
|
+
} catch {
|
|
264
|
+
r = /* @__PURE__ */ new Map();
|
|
265
|
+
for (let e of t) !r.has(e.target) && n.has(e.source) && r.set(e.target, e);
|
|
266
|
+
}
|
|
267
|
+
let i = /* @__PURE__ */ new Map(), a = (e) => e.branch === "no" ? 2 : e.branch === "yes" ? 0 : 1;
|
|
268
|
+
for (let e of [...r.values()].sort((e, t) => a(e) - a(t))) i.set(e.source, [...i.get(e.source) ?? [], e.target]);
|
|
269
|
+
let o = /* @__PURE__ */ new Map(), s = 0, c = (e, t, n) => {
|
|
270
|
+
if (n.has(e)) return s;
|
|
271
|
+
n.add(e);
|
|
272
|
+
let r = i.get(e) ?? [], a;
|
|
273
|
+
if (r.length === 0) a = s, s += 1;
|
|
274
|
+
else {
|
|
275
|
+
let e = r.map((e) => c(e, t + 1, n));
|
|
276
|
+
a = (Math.min(...e) + Math.max(...e)) / 2;
|
|
277
|
+
}
|
|
278
|
+
return o.set(e, {
|
|
279
|
+
x: k + a * O,
|
|
280
|
+
y: A + t * (78 + D)
|
|
281
|
+
}), a;
|
|
282
|
+
}, l = /* @__PURE__ */ new Set(), u = e.filter((e) => !r.has(e.id));
|
|
283
|
+
for (let e of u) c(e.id, 0, l);
|
|
284
|
+
return e.map((e) => {
|
|
285
|
+
let t = o.get(e.id);
|
|
286
|
+
return t ? {
|
|
287
|
+
...e,
|
|
288
|
+
x: Math.round(t.x),
|
|
289
|
+
y: Math.round(t.y)
|
|
290
|
+
} : e;
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
function M(e) {
|
|
294
|
+
let n = C(e.steps), i = S(e.triggerConfig).scoreThreshold, a = [{
|
|
295
|
+
id: E,
|
|
296
|
+
kind: "trigger",
|
|
297
|
+
actionType: e.triggerType,
|
|
298
|
+
label: r(e.triggerType),
|
|
299
|
+
x: 0,
|
|
300
|
+
y: 0,
|
|
301
|
+
config: typeof i == "number" ? { scoreThreshold: i } : {}
|
|
302
|
+
}], o = [], s = new Map(n.map((e, t) => [e.id, t])), c = (e) => {
|
|
303
|
+
let t = n[e];
|
|
304
|
+
return t && !p(t) ? t : null;
|
|
305
|
+
}, l = (e, t, n) => {
|
|
306
|
+
o.push({
|
|
307
|
+
id: `edge-${e}-${n ?? "next"}-${t}`,
|
|
308
|
+
source: e,
|
|
309
|
+
target: t,
|
|
310
|
+
branch: n
|
|
311
|
+
});
|
|
312
|
+
}, u = c(0);
|
|
313
|
+
return u && l(E, u.id, null), n.forEach((e, n) => {
|
|
314
|
+
if (p(e)) return;
|
|
315
|
+
let r = t(e.type);
|
|
316
|
+
if (!r) return;
|
|
317
|
+
let i = w(e.config.label);
|
|
318
|
+
a.push({
|
|
319
|
+
id: e.id,
|
|
320
|
+
kind: "action",
|
|
321
|
+
actionType: r.type,
|
|
322
|
+
label: i?.trim() ? i : r.label,
|
|
323
|
+
x: 0,
|
|
324
|
+
y: 0,
|
|
325
|
+
config: T(e)
|
|
326
|
+
});
|
|
327
|
+
let o = c(n + 1);
|
|
328
|
+
if (e.type !== "CONDITION") {
|
|
329
|
+
o && l(e.id, o.id, null);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
if (o && l(e.id, o.id, "yes"), e.config.onFalse === "SKIP_TO") {
|
|
333
|
+
let t = w(e.config.skipToStepId), n = t === void 0 ? void 0 : s.get(t), r = n === void 0 ? null : c(n);
|
|
334
|
+
r && l(e.id, r.id, "no");
|
|
335
|
+
}
|
|
336
|
+
}), {
|
|
337
|
+
nodes: j(a, o),
|
|
338
|
+
edges: o
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
function N() {
|
|
342
|
+
let e = [
|
|
343
|
+
{
|
|
344
|
+
id: E,
|
|
345
|
+
kind: "trigger",
|
|
346
|
+
actionType: "LEAD_CREATED",
|
|
347
|
+
label: "New lead",
|
|
348
|
+
x: 0,
|
|
349
|
+
y: 0,
|
|
350
|
+
config: {}
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
id: "node-email-welcome",
|
|
354
|
+
kind: "action",
|
|
355
|
+
actionType: "send_email",
|
|
356
|
+
label: "Send Email",
|
|
357
|
+
x: 0,
|
|
358
|
+
y: 0,
|
|
359
|
+
config: {
|
|
360
|
+
subject: "Welcome — thanks for your interest",
|
|
361
|
+
body: "Thanks for your interest — here is how we can help."
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
id: "node-condition-score",
|
|
366
|
+
kind: "action",
|
|
367
|
+
actionType: "condition",
|
|
368
|
+
label: "Condition",
|
|
369
|
+
x: 0,
|
|
370
|
+
y: 0,
|
|
371
|
+
config: {
|
|
372
|
+
field: "score",
|
|
373
|
+
operator: "gte",
|
|
374
|
+
value: "50"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
id: "node-wait",
|
|
379
|
+
kind: "action",
|
|
380
|
+
actionType: "wait",
|
|
381
|
+
label: "Wait",
|
|
382
|
+
x: 0,
|
|
383
|
+
y: 0,
|
|
384
|
+
config: {
|
|
385
|
+
waitDuration: 2,
|
|
386
|
+
waitUnit: "days"
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
id: "node-email-case-study",
|
|
391
|
+
kind: "action",
|
|
392
|
+
actionType: "send_email",
|
|
393
|
+
label: "Send Email",
|
|
394
|
+
x: 0,
|
|
395
|
+
y: 0,
|
|
396
|
+
config: {
|
|
397
|
+
subject: "A customer story you will like",
|
|
398
|
+
body: "Here is how a team like yours got results."
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
id: "node-notify-owner",
|
|
403
|
+
kind: "action",
|
|
404
|
+
actionType: "notify",
|
|
405
|
+
label: "Notify",
|
|
406
|
+
x: 0,
|
|
407
|
+
y: 0,
|
|
408
|
+
config: {
|
|
409
|
+
title: "Follow up with a new lead",
|
|
410
|
+
body: "A new lead is below the score threshold — reach out personally."
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
], t = [
|
|
414
|
+
{
|
|
415
|
+
id: "e1",
|
|
416
|
+
source: E,
|
|
417
|
+
target: "node-email-welcome",
|
|
418
|
+
branch: null
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
id: "e2",
|
|
422
|
+
source: "node-email-welcome",
|
|
423
|
+
target: "node-condition-score",
|
|
424
|
+
branch: null
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
id: "e3",
|
|
428
|
+
source: "node-condition-score",
|
|
429
|
+
target: "node-wait",
|
|
430
|
+
branch: "yes"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
id: "e4",
|
|
434
|
+
source: "node-condition-score",
|
|
435
|
+
target: "node-notify-owner",
|
|
436
|
+
branch: "no"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
id: "e5",
|
|
440
|
+
source: "node-wait",
|
|
441
|
+
target: "node-email-case-study",
|
|
442
|
+
branch: null
|
|
443
|
+
}
|
|
444
|
+
];
|
|
445
|
+
return {
|
|
446
|
+
nodes: j(e, t),
|
|
447
|
+
edges: t
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
//#endregion
|
|
451
|
+
export { a as WorkflowCompileError, x as compileGraph, M as decompileWorkflow, j as layoutGraph, C as parseEngineSteps, N as seedGraph };
|
|
452
|
+
|
|
453
|
+
//# sourceMappingURL=workflowCompiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowCompiler.js","names":[],"sources":["../../../../src/headshotmarketing/pages/automation/workflowCompiler.ts"],"sourcesContent":["/**\n * Canvas <-> step-engine compiler for the Workflow Builder (BOFF-10192).\n * @module headshotmarketing/pages/automation\n *\n * The HeadshotMarketing step engine executes an ORDERED step list: it runs\n * each step in turn, a CONDITION either continues to the next step or (when\n * false) stops the run / jumps forward with `onFalse: \"SKIP_TO\"`, and a GOAL\n * with `endRun: true` ends the run. The canvas is a tree of nodes, so this\n * module linearises it:\n *\n * - A chain of steps compiles in order.\n * - A Condition with only a Yes path compiles to `CONDITION(onFalse STOP)`\n * followed by the Yes path.\n * - A Condition whose No path has its own steps compiles to\n * `CONDITION(SKIP_TO first-no-step), ...yes path, GOAL(endRun), ...no path`\n * so the Yes path never falls through into the No path.\n * - A Condition whose No path connects to a step that is already reached\n * another way (for example \"skip ahead to the follow-up email\") compiles\n * to a plain `SKIP_TO` that step.\n *\n * Shapes the engine cannot express are rejected with a message naming the\n * step: two plain connections leaving one step, two paths rejoining except\n * through a Condition's No path, loops, and steps not connected to the\n * trigger. `decompileWorkflow` is the inverse used to open a saved workflow.\n */\nimport {\n NODE_H,\n NODE_W,\n actionMeta,\n actionMetaForEngineType,\n minutesToWait,\n triggerLabel,\n waitToMinutes,\n type CanvasEdge,\n type CanvasNode,\n type ConditionOperator,\n type EngineStepType,\n type NodeConfig,\n type UpdatableField,\n type WebhookMethod,\n} from \"./workflowBuilderModel\";\n\nexport interface EngineStepRetry {\n maxAttempts: number;\n backoffMinutes?: number;\n}\n\nexport interface EngineStep {\n id: string;\n type: EngineStepType;\n config: Record<string, unknown>;\n retry?: EngineStepRetry;\n}\n\nexport interface CompiledWorkflow {\n triggerType: string;\n triggerConfig: Record<string, unknown>;\n steps: EngineStep[];\n}\n\n/** A canvas the engine cannot run, with the node to highlight. */\nexport class WorkflowCompileError extends Error {\n readonly nodeId: string | null;\n\n constructor(message: string, nodeId: string | null = null) {\n super(message);\n this.name = \"WorkflowCompileError\";\n this.nodeId = nodeId;\n }\n}\n\n/** Suffix of the structural GOAL that ends a Condition's Yes path. */\nexport const BRANCH_END_SUFFIX = \"__end\";\nconst BRANCH_END_DESCRIPTION = \"End of branch\";\n\nconst MAX_RETRY_ATTEMPTS = 10;\nconst MAX_RETRY_BACKOFF_MINUTES = 1440;\n\nfunction displayName(node: CanvasNode): string {\n const label = node.label.trim();\n if (label) return `\"${label}\"`;\n return `\"${actionMeta(node.actionType)?.label ?? \"Step\"}\"`;\n}\n\nfunction nonEmpty(value: string | undefined): value is string {\n return typeof value === \"string\" && value.trim().length > 0;\n}\n\n/** Typed condition/update value: numbers and booleans keep their type. */\nexport function parseTypedValue(raw: string): string | number | boolean {\n const text = raw.trim();\n if (text === \"true\") return true;\n if (text === \"false\") return false;\n if (/^-?\\d+(\\.\\d+)?$/.test(text)) return Number(text);\n return text;\n}\n\nfunction isEndGoal(step: EngineStep): boolean {\n return step.type === \"GOAL\" && step.config[\"endRun\"] === true;\n}\n\nfunction retryFor(node: CanvasNode): EngineStepRetry | undefined {\n const meta = actionMeta(node.actionType);\n const attempts = node.config.retryMaxAttempts;\n if (!meta?.retryable || attempts === undefined || attempts <= 1) {\n return undefined;\n }\n if (!Number.isInteger(attempts) || attempts > MAX_RETRY_ATTEMPTS) {\n throw new WorkflowCompileError(\n `${displayName(node)}: retry attempts must be a whole number between 1 and ${MAX_RETRY_ATTEMPTS}.`,\n node.id,\n );\n }\n const backoff = node.config.retryBackoffMinutes;\n if (\n backoff !== undefined &&\n (!Number.isFinite(backoff) ||\n backoff < 1 ||\n backoff > MAX_RETRY_BACKOFF_MINUTES)\n ) {\n throw new WorkflowCompileError(\n `${displayName(node)}: retry delay must be between 1 and ${MAX_RETRY_BACKOFF_MINUTES} minutes.`,\n node.id,\n );\n }\n return backoff === undefined\n ? { maxAttempts: attempts }\n : { maxAttempts: attempts, backoffMinutes: backoff };\n}\n\n/** Engine config for one action node, validated with a user-facing message. */\nfunction stepConfigFor(node: CanvasNode): {\n type: EngineStepType;\n config: Record<string, unknown>;\n} {\n const meta = actionMeta(node.actionType);\n if (!meta) {\n throw new WorkflowCompileError(\n `${displayName(node)} is not a step the automation engine can run.`,\n node.id,\n );\n }\n const c = node.config;\n const fail = (message: string): never => {\n throw new WorkflowCompileError(`${displayName(node)}: ${message}`, node.id);\n };\n const config: Record<string, unknown> = {};\n switch (meta.engineType) {\n case \"SEND_EMAIL\":\n if (!nonEmpty(c.subject)) fail(\"add an email subject.\");\n if (!nonEmpty(c.body)) fail(\"add an email body.\");\n config[\"subject\"] = c.subject?.trim();\n config[\"body\"] = c.body?.trim();\n break;\n case \"SEND_NOTIFICATION\":\n if (!nonEmpty(c.title)) fail(\"add a notification title.\");\n if (!nonEmpty(c.body)) fail(\"add a notification message.\");\n config[\"title\"] = c.title?.trim();\n config[\"body\"] = c.body?.trim();\n break;\n case \"WAIT\": {\n const duration = c.waitDuration;\n if (\n duration === undefined ||\n !Number.isFinite(duration) ||\n duration <= 0\n ) {\n fail(\"set a delay greater than zero.\");\n }\n config[\"durationMinutes\"] = waitToMinutes(\n duration as number,\n c.waitUnit ?? \"days\",\n );\n break;\n }\n case \"CONDITION\":\n if (!nonEmpty(c.field)) fail(\"choose the field to check.\");\n if (!c.operator) fail(\"choose a comparison.\");\n if (!nonEmpty(c.value)) fail(\"enter the value to compare against.\");\n config[\"field\"] = c.field?.trim();\n config[\"operator\"] = c.operator;\n config[\"value\"] = parseTypedValue(c.value as string);\n break;\n case \"WEBHOOK\":\n if (!nonEmpty(c.webhookUrl) || !/^https?:\\/\\//i.test(c.webhookUrl))\n fail(\"enter an http(s) webhook URL.\");\n config[\"url\"] = c.webhookUrl?.trim();\n config[\"method\"] = c.method ?? \"POST\";\n break;\n case \"UPDATE_CONTACT_FIELD\": {\n if (!c.updateField) fail(\"choose the field to update.\");\n if (!nonEmpty(c.value)) fail(\"enter the new value.\");\n const typed = parseTypedValue(c.value as string);\n if (c.updateField === \"score\" && typeof typed !== \"number\")\n fail(\"the score must be a number.\");\n config[\"field\"] = c.updateField;\n config[\"value\"] = typeof typed === \"boolean\" ? String(typed) : typed;\n break;\n }\n case \"ADD_TAG\":\n if (!nonEmpty(c.tag)) fail(\"enter the tag to add.\");\n config[\"tag\"] = c.tag?.trim();\n break;\n case \"GOAL\":\n if (!nonEmpty(c.description)) fail(\"describe the goal.\");\n config[\"description\"] = c.description?.trim();\n break;\n }\n const label = node.label.trim();\n if (label && label !== meta.label) config[\"label\"] = label;\n return { type: meta.engineType, config };\n}\n\nfunction triggerConfigFor(trigger: CanvasNode): Record<string, unknown> {\n if (trigger.actionType !== \"SCORE_THRESHOLD\") return {};\n const threshold = trigger.config.scoreThreshold;\n if (threshold === undefined || !Number.isFinite(threshold)) {\n throw new WorkflowCompileError(\n \"The lead score trigger needs a score threshold.\",\n trigger.id,\n );\n }\n return { scoreThreshold: threshold };\n}\n\ninterface GraphIndex {\n byId: Map<string, CanvasNode>;\n out: Map<string, CanvasEdge[]>;\n /** Tree parent edge per node (see `primaryParents`). */\n primary: Map<string, CanvasEdge>;\n}\n\n/**\n * Pick each node's tree parent: its single non-\"no\" incoming connection, or\n * — when it is only reached from Condition No paths — the first of those.\n */\nfunction primaryParents(\n nodes: CanvasNode[],\n edges: CanvasEdge[],\n byId: Map<string, CanvasNode>,\n): Map<string, CanvasEdge> {\n const primary = new Map<string, CanvasEdge>();\n for (const node of nodes) {\n const incoming = edges.filter((e) => e.target === node.id);\n if (incoming.length === 0) continue;\n if (node.kind === \"trigger\") {\n throw new WorkflowCompileError(\n \"Nothing can connect into the trigger.\",\n node.id,\n );\n }\n const regular = incoming.filter((e) => e.branch !== \"no\");\n if (regular.length > 1) {\n throw new WorkflowCompileError(\n `${displayName(node)} is reached from more than one step. Paths can only rejoin through a Condition's No path.`,\n node.id,\n );\n }\n const parent = regular[0] ?? incoming[0];\n if (parent && byId.has(parent.source)) primary.set(node.id, parent);\n }\n return primary;\n}\n\nfunction indexGraph(nodes: CanvasNode[], edges: CanvasEdge[]): GraphIndex {\n const byId = new Map<string, CanvasNode>();\n for (const n of nodes) byId.set(n.id, n);\n const liveEdges = edges.filter(\n (e) => byId.has(e.source) && byId.has(e.target),\n );\n const out = new Map<string, CanvasEdge[]>();\n for (const e of liveEdges) {\n if (e.source === e.target) {\n const node = byId.get(e.source);\n throw new WorkflowCompileError(\n `${node ? displayName(node) : \"A step\"} connects to itself.`,\n e.source,\n );\n }\n out.set(e.source, [...(out.get(e.source) ?? []), e]);\n }\n return { byId, out, primary: primaryParents(nodes, liveEdges, byId) };\n}\n\ninterface Outputs {\n next: CanvasEdge | null;\n yes: CanvasEdge | null;\n no: CanvasEdge | null;\n}\n\nfunction outputsOf(node: CanvasNode, g: GraphIndex): Outputs {\n const outs = g.out.get(node.id) ?? [];\n if (node.kind === \"action\" && node.actionType === \"condition\") {\n const plain = outs.filter((e) => e.branch === null);\n const yes = outs.filter((e) => e.branch === \"yes\");\n const no = outs.filter((e) => e.branch === \"no\");\n if (plain.length > 0 || yes.length > 1 || no.length > 1) {\n throw new WorkflowCompileError(\n `${displayName(node)} can have one Yes path and one No path.`,\n node.id,\n );\n }\n return { next: null, yes: yes[0] ?? null, no: no[0] ?? null };\n }\n if (outs.length > 1) {\n throw new WorkflowCompileError(\n `${displayName(node)} connects to more than one next step. Add a Condition to branch.`,\n node.id,\n );\n }\n return { next: outs[0] ?? null, yes: null, no: null };\n}\n\nfunction isAncestor(\n candidate: string,\n nodeId: string,\n primary: Map<string, CanvasEdge>,\n): boolean {\n let cursor: string | undefined = nodeId;\n const seen = new Set<string>();\n while (cursor && !seen.has(cursor)) {\n if (cursor === candidate) return true;\n seen.add(cursor);\n cursor = primary.get(cursor)?.source;\n }\n return false;\n}\n\n/** Compile the canvas to the engine's trigger + ordered step list. */\nexport function compileGraph(\n nodes: CanvasNode[],\n edges: CanvasEdge[],\n): CompiledWorkflow {\n const triggers = nodes.filter((n) => n.kind === \"trigger\");\n const trigger = triggers[0];\n if (!trigger || triggers.length > 1) {\n throw new WorkflowCompileError(\"A workflow needs exactly one trigger.\");\n }\n const g = indexGraph(nodes, edges);\n const steps: EngineStep[] = [];\n const emitted = new Set<string>();\n const jumps: { conditionId: string; targetId: string }[] = [];\n\n const emitChain = (startId: string | null): void => {\n let currentId = startId;\n while (currentId) {\n const node = g.byId.get(currentId);\n if (!node) return;\n if (emitted.has(node.id)) {\n throw new WorkflowCompileError(\n `${displayName(node)} is part of a loop. Workflows run top to bottom.`,\n node.id,\n );\n }\n emitted.add(node.id);\n const { type, config } = stepConfigFor(node);\n const retry = retryFor(node);\n const step: EngineStep = retry\n ? { id: node.id, type, config, retry }\n : { id: node.id, type, config };\n steps.push(step);\n const outputs = outputsOf(node, g);\n\n if (type !== \"CONDITION\") {\n currentId = outputs.next?.target ?? null;\n continue;\n }\n const yesId = outputs.yes?.target ?? null;\n const noEdge = outputs.no;\n if (!noEdge) {\n config[\"onFalse\"] = \"STOP\";\n currentId = yesId;\n continue;\n }\n config[\"onFalse\"] = \"SKIP_TO\";\n config[\"skipToStepId\"] = noEdge.target;\n if (g.primary.get(noEdge.target) === noEdge) {\n // Exclusive branches: yes path, an end marker, then the no path.\n emitChain(yesId);\n steps.push({\n id: `${node.id}${BRANCH_END_SUFFIX}`,\n type: \"GOAL\",\n config: { description: BRANCH_END_DESCRIPTION, endRun: true },\n });\n emitChain(noEdge.target);\n return;\n }\n // The No path skips ahead to a step reached another way.\n jumps.push({ conditionId: node.id, targetId: noEdge.target });\n currentId = yesId;\n }\n };\n\n const first = outputsOf(trigger, g).next;\n if (!first) {\n throw new WorkflowCompileError(\n \"Connect at least one step to the trigger.\",\n trigger.id,\n );\n }\n emitChain(first.target);\n\n for (const node of nodes) {\n if (node.kind === \"action\" && !emitted.has(node.id)) {\n throw new WorkflowCompileError(\n `${displayName(node)} is not connected to the trigger.`,\n node.id,\n );\n }\n }\n for (const jump of jumps) {\n if (isAncestor(jump.targetId, jump.conditionId, g.primary)) {\n const node = g.byId.get(jump.conditionId);\n throw new WorkflowCompileError(\n `${node ? displayName(node) : \"A condition\"}: its No path loops back to an earlier step.`,\n jump.conditionId,\n );\n }\n }\n\n return {\n triggerType: trigger.actionType,\n triggerConfig: triggerConfigFor(trigger),\n steps,\n };\n}\n\n// ─── Decompile ──────────────────────────────────────────────────────────────\n\nexport interface SavedWorkflowShape {\n triggerType: string;\n triggerConfig?: Record<string, unknown> | null;\n steps: unknown;\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : {};\n}\n\n/** Parse the persisted `steps` JSON into engine steps, dropping junk entries. */\nexport function parseEngineSteps(raw: unknown): EngineStep[] {\n if (!Array.isArray(raw)) return [];\n const steps: EngineStep[] = [];\n for (const entry of raw) {\n const step = asRecord(entry);\n const id = step[\"id\"];\n const type = step[\"type\"];\n if (typeof id !== \"string\" || typeof type !== \"string\") continue;\n if (!actionMetaForEngineType(type)) continue;\n const retry = asRecord(step[\"retry\"]);\n const maxAttempts = retry[\"maxAttempts\"];\n const backoff = retry[\"backoffMinutes\"];\n steps.push({\n id,\n type: type as EngineStepType,\n config: asRecord(step[\"config\"]),\n ...(typeof maxAttempts === \"number\"\n ? {\n retry: {\n maxAttempts,\n ...(typeof backoff === \"number\"\n ? { backoffMinutes: backoff }\n : {}),\n },\n }\n : {}),\n });\n }\n return steps;\n}\n\nfunction str(value: unknown): string | undefined {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\")\n return String(value);\n return undefined;\n}\n\nfunction nodeConfigFor(step: EngineStep): NodeConfig {\n const c = step.config;\n const config: NodeConfig = {};\n switch (step.type) {\n case \"SEND_EMAIL\":\n config.subject = str(c[\"subject\"]) ?? \"\";\n config.body = str(c[\"body\"]) ?? \"\";\n break;\n case \"SEND_NOTIFICATION\":\n config.title = str(c[\"title\"]) ?? \"\";\n config.body = str(c[\"body\"]) ?? \"\";\n break;\n case \"WAIT\": {\n const minutes = c[\"durationMinutes\"];\n Object.assign(\n config,\n minutesToWait(typeof minutes === \"number\" ? minutes : 0),\n );\n break;\n }\n case \"CONDITION\":\n config.field = str(c[\"field\"]) ?? \"\";\n config.operator = (str(c[\"operator\"]) ?? \"eq\") as ConditionOperator;\n config.value = str(c[\"value\"]) ?? \"\";\n break;\n case \"WEBHOOK\":\n config.webhookUrl = str(c[\"url\"]) ?? \"\";\n config.method = (str(c[\"method\"]) ?? \"POST\") as WebhookMethod;\n break;\n case \"UPDATE_CONTACT_FIELD\":\n config.updateField = (str(c[\"field\"]) ?? \"score\") as UpdatableField;\n config.value = str(c[\"value\"]) ?? \"\";\n break;\n case \"ADD_TAG\":\n config.tag = str(c[\"tag\"]) ?? \"\";\n break;\n case \"GOAL\":\n config.description = str(c[\"description\"]) ?? \"\";\n break;\n }\n if (step.retry) {\n config.retryMaxAttempts = step.retry.maxAttempts;\n if (step.retry.backoffMinutes !== undefined)\n config.retryBackoffMinutes = step.retry.backoffMinutes;\n }\n return config;\n}\n\nconst TRIGGER_NODE_ID = \"trigger\";\nconst ROW_GAP = 72;\nconst COLUMN_W = NODE_W + 40;\nconst ORIGIN_X = 36;\nconst ORIGIN_Y = 24;\n\n/**\n * Lay the graph out top-down as a tree: each node sits one row below its\n * tree parent and is centred over its children.\n */\nexport function layoutGraph(\n nodes: CanvasNode[],\n edges: CanvasEdge[],\n): CanvasNode[] {\n const byId = new Map(nodes.map((n) => [n.id, n]));\n let primary: Map<string, CanvasEdge>;\n try {\n primary = primaryParents(nodes, edges, byId);\n } catch {\n primary = new Map();\n for (const e of edges)\n if (!primary.has(e.target) && byId.has(e.source))\n primary.set(e.target, e);\n }\n const children = new Map<string, string[]>();\n const order = (e: CanvasEdge): number =>\n e.branch === \"no\" ? 2 : e.branch === \"yes\" ? 0 : 1;\n for (const e of [...primary.values()].sort((a, b) => order(a) - order(b))) {\n children.set(e.source, [...(children.get(e.source) ?? []), e.target]);\n }\n const positions = new Map<string, { x: number; y: number }>();\n let nextColumn = 0;\n const place = (id: string, depth: number, seen: Set<string>): number => {\n if (seen.has(id)) return nextColumn;\n seen.add(id);\n const kids = children.get(id) ?? [];\n let column: number;\n if (kids.length === 0) {\n column = nextColumn;\n nextColumn += 1;\n } else {\n const cols = kids.map((k) => place(k, depth + 1, seen));\n column = (Math.min(...cols) + Math.max(...cols)) / 2;\n }\n positions.set(id, {\n x: ORIGIN_X + column * COLUMN_W,\n y: ORIGIN_Y + depth * (NODE_H + ROW_GAP),\n });\n return column;\n };\n const seen = new Set<string>();\n const roots = nodes.filter((n) => !primary.has(n.id));\n for (const root of roots) place(root.id, 0, seen);\n return nodes.map((n) => {\n const p = positions.get(n.id);\n return p ? { ...n, x: Math.round(p.x), y: Math.round(p.y) } : n;\n });\n}\n\n/** Rebuild the canvas for a saved engine workflow. */\nexport function decompileWorkflow(workflow: SavedWorkflowShape): {\n nodes: CanvasNode[];\n edges: CanvasEdge[];\n} {\n const steps = parseEngineSteps(workflow.steps);\n const triggerConfig = asRecord(workflow.triggerConfig);\n const threshold = triggerConfig[\"scoreThreshold\"];\n const nodes: CanvasNode[] = [\n {\n id: TRIGGER_NODE_ID,\n kind: \"trigger\",\n actionType: workflow.triggerType,\n label: triggerLabel(workflow.triggerType),\n x: 0,\n y: 0,\n config:\n typeof threshold === \"number\" ? { scoreThreshold: threshold } : {},\n },\n ];\n const edges: CanvasEdge[] = [];\n const indexById = new Map(steps.map((s, i) => [s.id, i]));\n const visible = (i: number): EngineStep | null => {\n const step = steps[i];\n return step && !isEndGoal(step) ? step : null;\n };\n const link = (\n source: string,\n target: string,\n branch: CanvasEdge[\"branch\"],\n ): void => {\n edges.push({\n id: `edge-${source}-${branch ?? \"next\"}-${target}`,\n source,\n target,\n branch,\n });\n };\n\n const first = visible(0);\n if (first) link(TRIGGER_NODE_ID, first.id, null);\n\n steps.forEach((step, i) => {\n if (isEndGoal(step)) return;\n const meta = actionMetaForEngineType(step.type);\n if (!meta) return;\n const customLabel = str(step.config[\"label\"]);\n nodes.push({\n id: step.id,\n kind: \"action\",\n actionType: meta.type,\n label: customLabel?.trim() ? customLabel : meta.label,\n x: 0,\n y: 0,\n config: nodeConfigFor(step),\n });\n const next = visible(i + 1);\n if (step.type !== \"CONDITION\") {\n if (next) link(step.id, next.id, null);\n return;\n }\n if (next) link(step.id, next.id, \"yes\");\n if (step.config[\"onFalse\"] === \"SKIP_TO\") {\n const targetId = str(step.config[\"skipToStepId\"]);\n const targetIndex =\n targetId !== undefined ? indexById.get(targetId) : undefined;\n const target = targetIndex !== undefined ? visible(targetIndex) : null;\n if (target) link(step.id, target.id, \"no\");\n }\n });\n\n return { nodes: layoutGraph(nodes, edges), edges };\n}\n\n/** Starter canvas for a new workflow — mirrors the reference flow (mock 20). */\nexport function seedGraph(): { nodes: CanvasNode[]; edges: CanvasEdge[] } {\n const nodes: CanvasNode[] = [\n {\n id: TRIGGER_NODE_ID,\n kind: \"trigger\",\n actionType: \"LEAD_CREATED\",\n label: \"New lead\",\n x: 0,\n y: 0,\n config: {},\n },\n {\n id: \"node-email-welcome\",\n kind: \"action\",\n actionType: \"send_email\",\n label: \"Send Email\",\n x: 0,\n y: 0,\n config: {\n subject: \"Welcome — thanks for your interest\",\n body: \"Thanks for your interest — here is how we can help.\",\n },\n },\n {\n id: \"node-condition-score\",\n kind: \"action\",\n actionType: \"condition\",\n label: \"Condition\",\n x: 0,\n y: 0,\n config: { field: \"score\", operator: \"gte\", value: \"50\" },\n },\n {\n id: \"node-wait\",\n kind: \"action\",\n actionType: \"wait\",\n label: \"Wait\",\n x: 0,\n y: 0,\n config: { waitDuration: 2, waitUnit: \"days\" },\n },\n {\n id: \"node-email-case-study\",\n kind: \"action\",\n actionType: \"send_email\",\n label: \"Send Email\",\n x: 0,\n y: 0,\n config: {\n subject: \"A customer story you will like\",\n body: \"Here is how a team like yours got results.\",\n },\n },\n {\n id: \"node-notify-owner\",\n kind: \"action\",\n actionType: \"notify\",\n label: \"Notify\",\n x: 0,\n y: 0,\n config: {\n title: \"Follow up with a new lead\",\n body: \"A new lead is below the score threshold — reach out personally.\",\n },\n },\n ];\n const edges: CanvasEdge[] = [\n {\n id: \"e1\",\n source: TRIGGER_NODE_ID,\n target: \"node-email-welcome\",\n branch: null,\n },\n {\n id: \"e2\",\n source: \"node-email-welcome\",\n target: \"node-condition-score\",\n branch: null,\n },\n {\n id: \"e3\",\n source: \"node-condition-score\",\n target: \"node-wait\",\n branch: \"yes\",\n },\n {\n id: \"e4\",\n source: \"node-condition-score\",\n target: \"node-notify-owner\",\n branch: \"no\",\n },\n {\n id: \"e5\",\n source: \"node-wait\",\n target: \"node-email-case-study\",\n branch: null,\n },\n ];\n return { nodes: layoutGraph(nodes, edges), edges };\n}\n"],"mappings":";;AA6DA,IAAa,IAAb,cAA0C,MAAM;CAC9C;CAEA,YAAY,GAAiB,IAAwB,MAAM;AAGzD,EAFA,MAAM,EAAQ,EACd,KAAK,OAAO,wBACZ,KAAK,SAAS;;GAKL,IAAoB,SAC3B,IAAyB,iBAEzB,IAAqB,IACrB,IAA4B;AAElC,SAAS,EAAY,GAA0B;CAC7C,IAAM,IAAQ,EAAK,MAAM,MAAM;AAE/B,QADI,IAAc,IAAI,EAAM,KACrB,IAAI,EAAW,EAAK,WAAW,EAAE,SAAS,OAAO;;AAG1D,SAAS,EAAS,GAA4C;AAC5D,QAAO,OAAO,KAAU,YAAY,EAAM,MAAM,CAAC,SAAS;;AAI5D,SAAgB,EAAgB,GAAwC;CACtE,IAAM,IAAO,EAAI,MAAM;AAIvB,QAHI,MAAS,SAAe,KACxB,MAAS,UAAgB,KACzB,kBAAkB,KAAK,EAAK,GAAS,OAAO,EAAK,GAC9C;;AAGT,SAAS,EAAU,GAA2B;AA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B;EAC1B;GACE,IAAI;GACJ,QAAQ;GACR,QAAQ;GACR,QAAQ;GACT;EACD;GACE,IAAI;GACJ,QAAQ;GACR,QAAQ;GACR,QAAQ;GACT;EACD;GACE,IAAI;GACJ,QAAQ;GACR,QAAQ;GACR,QAAQ;GACT;EACD;GACE,IAAI;GACJ,QAAQ;GACR,QAAQ;GACR,QAAQ;GACT;EACD;GACE,IAAI;GACJ,QAAQ;GACR,QAAQ;GACR,QAAQ;GACT;EACF;AACD,QAAO;EAAE,OAAO,EAAY,GAAO,EAAM;EAAE;EAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostsPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/social-media/PostsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PostsPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/social-media/PostsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAoF9D,eAAO,MAAM,SAAS,EAAE,EA0uBvB,CAAC"}
|