@burdenoff/microfe-headshotmarketing 2026.928.2 → 2026.1029.1
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 +464 -248
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +320 -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/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/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { HeadshotmarketingAutomationWorkflowRunsDocument as e, HeadshotmarketingAutomationWorkflowsDocument as t } from "../../../generated/wspace-operations.js";
|
|
2
|
+
import { startOfMonth as n, summarizeRuns as r } from "../../utils/automationMapper.js";
|
|
3
|
+
import { useCallback as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
4
|
+
import { useApolloClient as l } from "@apollo/client/react";
|
|
5
|
+
//#region src/headshotmarketing/pages/automation/useAutomationData.ts
|
|
6
|
+
var u = 100, d = 10;
|
|
7
|
+
function f() {
|
|
8
|
+
let f = l(), [p, m] = c([]), [h, g] = c([]), [_, v] = c(!1), [y, b] = c(!0), [x, S] = c(null), C = s(0), w = i(async () => {
|
|
9
|
+
let r = ++C.current;
|
|
10
|
+
b(!0), S(null);
|
|
11
|
+
try {
|
|
12
|
+
let i = [];
|
|
13
|
+
for (let e = 0; e < d; e += 1) {
|
|
14
|
+
let n = (await f.query({
|
|
15
|
+
query: t,
|
|
16
|
+
variables: { pagination: {
|
|
17
|
+
limit: u,
|
|
18
|
+
offset: e * u
|
|
19
|
+
} },
|
|
20
|
+
fetchPolicy: "network-only"
|
|
21
|
+
})).data?.headshotmarketingAutomationWorkflows;
|
|
22
|
+
if (!n || (i.push(...n.items), !n.hasMore)) break;
|
|
23
|
+
}
|
|
24
|
+
let a = n(/* @__PURE__ */ new Date()).toISOString(), o = [], s = !1;
|
|
25
|
+
for (let t = 0; t < 10; t += 1) {
|
|
26
|
+
let n = (await f.query({
|
|
27
|
+
query: e,
|
|
28
|
+
variables: { pagination: {
|
|
29
|
+
limit: u,
|
|
30
|
+
offset: t * u
|
|
31
|
+
} },
|
|
32
|
+
fetchPolicy: "network-only"
|
|
33
|
+
})).data?.headshotmarketingAutomationWorkflowRuns;
|
|
34
|
+
if (!n) break;
|
|
35
|
+
o.push(...n.items);
|
|
36
|
+
let r = n.items[n.items.length - 1];
|
|
37
|
+
if (!n.hasMore || !r || r.startedAt < a) break;
|
|
38
|
+
t === 9 && (s = !0);
|
|
39
|
+
}
|
|
40
|
+
if (r !== C.current) return;
|
|
41
|
+
m(i), g(o), v(s);
|
|
42
|
+
} catch (e) {
|
|
43
|
+
if (r !== C.current) return;
|
|
44
|
+
S(e instanceof Error ? e : Error(String(e)));
|
|
45
|
+
} finally {
|
|
46
|
+
r === C.current && b(!1);
|
|
47
|
+
}
|
|
48
|
+
}, [f]);
|
|
49
|
+
a(() => {
|
|
50
|
+
w();
|
|
51
|
+
}, [w]);
|
|
52
|
+
let T = i((e) => {
|
|
53
|
+
m((t) => {
|
|
54
|
+
let n = t.findIndex((t) => t.id === e.id);
|
|
55
|
+
if (n === -1) return [e, ...t];
|
|
56
|
+
let r = [...t];
|
|
57
|
+
return r[n] = e, r;
|
|
58
|
+
});
|
|
59
|
+
}, []), E = i((e) => {
|
|
60
|
+
m((t) => t.filter((t) => t.id !== e));
|
|
61
|
+
}, []);
|
|
62
|
+
return {
|
|
63
|
+
workflows: p,
|
|
64
|
+
runs: h,
|
|
65
|
+
stats: o(() => r(p, h), [p, h]),
|
|
66
|
+
runsCapped: _,
|
|
67
|
+
loading: y,
|
|
68
|
+
error: x,
|
|
69
|
+
refetch: w,
|
|
70
|
+
upsertWorkflow: T,
|
|
71
|
+
removeWorkflow: E
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { f as useAutomationData };
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=useAutomationData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAutomationData.js","names":[],"sources":["../../../../src/headshotmarketing/pages/automation/useAutomationData.ts"],"sourcesContent":["/**\n * Data for the automation pages, straight from the product step engine\n * (wspace-headshotmarketing-svc, BOFF-10192).\n *\n * Workflows load in pages of 100 (the service's page cap). Runs load newest\n * first until the current month is fully covered, so \"this month\" figures are\n * exact up to RUN_PAGE_CAP pages; beyond that the page reports the figure as\n * a lower bound (`runsCapped`).\n *\n * @module headshotmarketing/pages/automation\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useApolloClient } from \"@apollo/client/react\";\nimport {\n HeadshotmarketingAutomationWorkflowRunsDocument,\n HeadshotmarketingAutomationWorkflowsDocument,\n type HeadshotmarketingAutomationRunFieldsFragment,\n type HeadshotmarketingAutomationWorkflowFieldsFragment,\n type HeadshotmarketingAutomationWorkflowRunsQuery,\n type HeadshotmarketingAutomationWorkflowRunsQueryVariables,\n type HeadshotmarketingAutomationWorkflowsQuery,\n type HeadshotmarketingAutomationWorkflowsQueryVariables,\n} from \"../../../generated/wspace-operations\";\nimport {\n startOfMonth,\n summarizeRuns,\n type RunStats,\n} from \"../../utils/automationMapper\";\n\nexport type AutomationWorkflow =\n HeadshotmarketingAutomationWorkflowFieldsFragment;\nexport type AutomationRun = HeadshotmarketingAutomationRunFieldsFragment;\n\nconst PAGE_SIZE = 100;\nconst WORKFLOW_PAGE_CAP = 10;\nexport const RUN_PAGE_CAP = 10;\n\nexport interface AutomationData {\n workflows: AutomationWorkflow[];\n runs: AutomationRun[];\n stats: { total: RunStats; byWorkflow: Map<string, RunStats> };\n /** True when more runs exist this month than were loaded. */\n runsCapped: boolean;\n loading: boolean;\n error: Error | null;\n refetch: () => Promise<void>;\n /** Replace one workflow in place after a mutation returns it. */\n upsertWorkflow: (workflow: AutomationWorkflow) => void;\n removeWorkflow: (id: string) => void;\n}\n\nexport function useAutomationData(): AutomationData {\n const client = useApolloClient();\n const [workflows, setWorkflows] = useState<AutomationWorkflow[]>([]);\n const [runs, setRuns] = useState<AutomationRun[]>([]);\n const [runsCapped, setRunsCapped] = useState(false);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n const generation = useRef(0);\n\n const load = useCallback(async (): Promise<void> => {\n const current = ++generation.current;\n setLoading(true);\n setError(null);\n try {\n const nextWorkflows: AutomationWorkflow[] = [];\n for (let page = 0; page < WORKFLOW_PAGE_CAP; page += 1) {\n const res = await client.query<\n HeadshotmarketingAutomationWorkflowsQuery,\n HeadshotmarketingAutomationWorkflowsQueryVariables\n >({\n query: HeadshotmarketingAutomationWorkflowsDocument,\n variables: {\n pagination: { limit: PAGE_SIZE, offset: page * PAGE_SIZE },\n },\n fetchPolicy: \"network-only\",\n });\n const list = res.data?.headshotmarketingAutomationWorkflows;\n if (!list) break;\n nextWorkflows.push(...list.items);\n if (!list.hasMore) break;\n }\n\n const monthStart = startOfMonth(new Date()).toISOString();\n const nextRuns: AutomationRun[] = [];\n let capped = false;\n for (let page = 0; page < RUN_PAGE_CAP; page += 1) {\n const res = await client.query<\n HeadshotmarketingAutomationWorkflowRunsQuery,\n HeadshotmarketingAutomationWorkflowRunsQueryVariables\n >({\n query: HeadshotmarketingAutomationWorkflowRunsDocument,\n variables: {\n pagination: { limit: PAGE_SIZE, offset: page * PAGE_SIZE },\n },\n fetchPolicy: \"network-only\",\n });\n const list = res.data?.headshotmarketingAutomationWorkflowRuns;\n if (!list) break;\n nextRuns.push(...list.items);\n const oldest = list.items[list.items.length - 1];\n if (!list.hasMore || !oldest || oldest.startedAt < monthStart) break;\n if (page === RUN_PAGE_CAP - 1) capped = true;\n }\n\n if (current !== generation.current) return;\n setWorkflows(nextWorkflows);\n setRuns(nextRuns);\n setRunsCapped(capped);\n } catch (err) {\n if (current !== generation.current) return;\n setError(err instanceof Error ? err : new Error(String(err)));\n } finally {\n if (current === generation.current) setLoading(false);\n }\n }, [client]);\n\n useEffect(() => {\n void load();\n }, [load]);\n\n const upsertWorkflow = useCallback((workflow: AutomationWorkflow): void => {\n setWorkflows((prev) => {\n const index = prev.findIndex((w) => w.id === workflow.id);\n if (index === -1) return [workflow, ...prev];\n const next = [...prev];\n next[index] = workflow;\n return next;\n });\n }, []);\n\n const removeWorkflow = useCallback((id: string): void => {\n setWorkflows((prev) => prev.filter((w) => w.id !== id));\n }, []);\n\n const stats = useMemo(\n () => summarizeRuns(workflows, runs),\n [workflows, runs],\n );\n\n return {\n workflows,\n runs,\n stats,\n runsCapped,\n loading,\n error,\n refetch: load,\n upsertWorkflow,\n removeWorkflow,\n };\n}\n"],"mappings":";;;;;AAiCA,IAAM,IAAY,KACZ,IAAoB;AAiB1B,SAAgB,IAAoC;CAClD,IAAM,IAAS,GAAiB,EAC1B,CAAC,GAAW,KAAgB,EAA+B,EAAE,CAAC,EAC9D,CAAC,GAAM,KAAW,EAA0B,EAAE,CAAC,EAC/C,CAAC,GAAY,KAAiB,EAAS,GAAM,EAC7C,CAAC,GAAS,KAAc,EAAS,GAAK,EACtC,CAAC,GAAO,KAAY,EAAuB,KAAK,EAChD,IAAa,EAAO,EAAE,EAEtB,IAAO,EAAY,YAA2B;EAClD,IAAM,IAAU,EAAE,EAAW;AAE7B,EADA,EAAW,GAAK,EAChB,EAAS,KAAK;AACd,MAAI;GACF,IAAM,IAAsC,EAAE;AAC9C,QAAK,IAAI,IAAO,GAAG,IAAO,GAAmB,KAAQ,GAAG;IAWtD,IAAM,KAVM,MAAM,EAAO,MAGvB;KACA,OAAO;KACP,WAAW,EACT,YAAY;MAAE,OAAO;MAAW,QAAQ,IAAO;MAAW,EAC3D;KACD,aAAa;KACd,CAAC,EACe,MAAM;AAGvB,QAFI,CAAC,MACL,EAAc,KAAK,GAAG,EAAK,MAAM,EAC7B,CAAC,EAAK,SAAS;;GAGrB,IAAM,IAAa,kBAAa,IAAI,MAAM,CAAC,CAAC,aAAa,EACnD,IAA4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|
|
@@ -4,23 +4,48 @@ import { LucideIcon } from 'lucide-react';
|
|
|
4
4
|
export declare const NODE_W = 240;
|
|
5
5
|
export declare const NODE_H = 78;
|
|
6
6
|
export type NodeKind = "trigger" | "action";
|
|
7
|
+
/** Engine step types (engine/workflow-steps.ts in the service). */
|
|
8
|
+
export type EngineStepType = "SEND_EMAIL" | "SEND_NOTIFICATION" | "WAIT" | "CONDITION" | "WEBHOOK" | "UPDATE_CONTACT_FIELD" | "ADD_TAG" | "GOAL";
|
|
9
|
+
/** Engine trigger types the builder offers (the ones real events fire). */
|
|
10
|
+
export type BuilderTriggerType = "LEAD_CREATED" | "CONTACT_CREATED" | "SCORE_THRESHOLD" | "MANUAL";
|
|
11
|
+
export type WaitUnit = "minutes" | "hours" | "days";
|
|
12
|
+
export type ConditionOperator = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "contains";
|
|
13
|
+
export type UpdatableField = "score" | "status" | "assignedTo";
|
|
14
|
+
export type WebhookMethod = "POST" | "PUT" | "PATCH";
|
|
7
15
|
/** Per-node configuration captured by the right-hand config panel. */
|
|
8
16
|
export interface NodeConfig {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
/** SEND_EMAIL subject. */
|
|
18
|
+
subject?: string;
|
|
19
|
+
/** SEND_EMAIL / SEND_NOTIFICATION body. */
|
|
20
|
+
body?: string;
|
|
21
|
+
/** SEND_NOTIFICATION title. */
|
|
22
|
+
title?: string;
|
|
23
|
+
/** WAIT duration in `waitUnit`. */
|
|
12
24
|
waitDuration?: number;
|
|
13
|
-
waitUnit?:
|
|
14
|
-
|
|
25
|
+
waitUnit?: WaitUnit;
|
|
26
|
+
/** CONDITION field / operator / value (value kept as typed text). */
|
|
27
|
+
field?: string;
|
|
28
|
+
operator?: ConditionOperator;
|
|
29
|
+
value?: string;
|
|
30
|
+
/** WEBHOOK destination. */
|
|
15
31
|
webhookUrl?: string;
|
|
32
|
+
method?: WebhookMethod;
|
|
33
|
+
/** UPDATE_CONTACT_FIELD target field (value uses `value`). */
|
|
34
|
+
updateField?: UpdatableField;
|
|
35
|
+
/** ADD_TAG tag. */
|
|
16
36
|
tag?: string;
|
|
17
|
-
|
|
18
|
-
|
|
37
|
+
/** GOAL description. */
|
|
38
|
+
description?: string;
|
|
39
|
+
/** Optional automatic retry policy (side-effecting steps only). */
|
|
40
|
+
retryMaxAttempts?: number;
|
|
41
|
+
retryBackoffMinutes?: number;
|
|
42
|
+
/** SCORE_THRESHOLD trigger threshold. */
|
|
43
|
+
scoreThreshold?: number;
|
|
19
44
|
}
|
|
20
45
|
export interface CanvasNode {
|
|
21
46
|
id: string;
|
|
22
47
|
kind: NodeKind;
|
|
23
|
-
/** trigger
|
|
48
|
+
/** Trigger nodes: engine trigger type. Action nodes: palette action id. */
|
|
24
49
|
actionType: string;
|
|
25
50
|
label: string;
|
|
26
51
|
x: number;
|
|
@@ -38,25 +63,62 @@ export interface CanvasEdge {
|
|
|
38
63
|
export type ChipTone = "info" | "success" | "warning" | "error" | "accent";
|
|
39
64
|
export declare const CHIP_TONE: Record<ChipTone, string>;
|
|
40
65
|
export interface ActionMeta {
|
|
66
|
+
/** Palette id stored on the canvas node. */
|
|
41
67
|
type: string;
|
|
68
|
+
/** Engine step type this action compiles to. */
|
|
69
|
+
engineType: EngineStepType;
|
|
42
70
|
label: string;
|
|
71
|
+
/** Short label for the compact palette tile. */
|
|
72
|
+
shortLabel: string;
|
|
43
73
|
icon: LucideIcon;
|
|
44
74
|
tone: ChipTone;
|
|
45
75
|
/** True for branching nodes that expose Yes/No output ports. */
|
|
46
76
|
isCondition?: boolean;
|
|
77
|
+
/** True when the engine accepts a retry policy for this step type. */
|
|
78
|
+
retryable: boolean;
|
|
47
79
|
}
|
|
48
80
|
export declare const ACTION_TYPES: ActionMeta[];
|
|
49
|
-
export
|
|
50
|
-
type:
|
|
81
|
+
export interface TriggerMeta {
|
|
82
|
+
type: BuilderTriggerType;
|
|
83
|
+
label: string;
|
|
84
|
+
description: string;
|
|
85
|
+
}
|
|
86
|
+
export declare const TRIGGER_TYPES: TriggerMeta[];
|
|
87
|
+
export declare const CONDITION_OPERATORS: {
|
|
88
|
+
value: ConditionOperator;
|
|
89
|
+
label: string;
|
|
90
|
+
}[];
|
|
91
|
+
/**
|
|
92
|
+
* Fields a condition can read. The run context carries the trigger's event
|
|
93
|
+
* data (email, score, source, …) and the engine falls back to the lead or
|
|
94
|
+
* contact row for anything else.
|
|
95
|
+
*/
|
|
96
|
+
export declare const CONDITION_FIELDS: {
|
|
97
|
+
value: string;
|
|
98
|
+
label: string;
|
|
99
|
+
}[];
|
|
100
|
+
export declare const UPDATABLE_FIELDS: {
|
|
101
|
+
value: UpdatableField;
|
|
51
102
|
label: string;
|
|
52
|
-
icon: string;
|
|
53
103
|
}[];
|
|
54
104
|
export declare function actionMeta(type: string): ActionMeta | undefined;
|
|
105
|
+
export declare function actionMetaForEngineType(engineType: string): ActionMeta | undefined;
|
|
55
106
|
export declare function triggerLabel(type: string): string;
|
|
107
|
+
export declare function isBuilderTriggerType(type: string): type is BuilderTriggerType;
|
|
56
108
|
/** Chip tone for a node (trigger nodes read as success/green, like the mock). */
|
|
57
109
|
export declare function nodeTone(node: CanvasNode): ChipTone;
|
|
58
110
|
export declare function nodeIcon(node: CanvasNode): LucideIcon;
|
|
59
111
|
export declare function isConditionNode(node: CanvasNode): boolean;
|
|
112
|
+
/** Default config for a freshly added action. */
|
|
113
|
+
export declare function defaultConfig(actionType: string): NodeConfig;
|
|
114
|
+
export declare function waitToMinutes(duration: number, unit: WaitUnit): number;
|
|
115
|
+
/** Largest unit that expresses `minutes` exactly (2880 → 2 days). */
|
|
116
|
+
export declare function minutesToWait(minutes: number): {
|
|
117
|
+
waitDuration: number;
|
|
118
|
+
waitUnit: WaitUnit;
|
|
119
|
+
};
|
|
120
|
+
/** One-line summary rendered under a node's title on the canvas. */
|
|
121
|
+
export declare function nodeSubtitle(node: CanvasNode): string;
|
|
60
122
|
/** Output port (bottom) for an edge leaving `node` on the given branch. */
|
|
61
123
|
export declare function outPort(node: CanvasNode, branch: BranchKind): {
|
|
62
124
|
x: number;
|
|
@@ -67,9 +129,4 @@ export declare function inPort(node: CanvasNode): {
|
|
|
67
129
|
x: number;
|
|
68
130
|
y: number;
|
|
69
131
|
};
|
|
70
|
-
/**
|
|
71
|
-
* Serialize the graph into the `steps` JSON shape persisted by
|
|
72
|
-
* createHeadshotmarketingWorkflow. Positions + config + edges all round-trip.
|
|
73
|
-
*/
|
|
74
|
-
export declare function serializeGraph(nodes: CanvasNode[], edges: CanvasEdge[]): Record<string, unknown>;
|
|
75
132
|
//# sourceMappingURL=workflowBuilderModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflowBuilderModel.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/automation/workflowBuilderModel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"workflowBuilderModel.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/automation/workflowBuilderModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAUL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAEtB,wEAAwE;AACxE,eAAO,MAAM,MAAM,MAAM,CAAC;AAC1B,eAAO,MAAM,MAAM,KAAK,CAAC;AAEzB,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE5C,mEAAmE;AACnE,MAAM,MAAM,cAAc,GACtB,YAAY,GACZ,mBAAmB,GACnB,MAAM,GACN,WAAW,GACX,SAAS,GACT,sBAAsB,GACtB,SAAS,GACT,MAAM,CAAC;AAEX,2EAA2E;AAC3E,MAAM,MAAM,kBAAkB,GAC1B,cAAc,GACd,iBAAiB,GACjB,iBAAiB,GACjB,QAAQ,CAAC;AAEb,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GACz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AC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAEjE"}
|
|
@@ -1,108 +1,271 @@
|
|
|
1
|
-
import { Bell as e, Clock as t,
|
|
2
|
-
var
|
|
1
|
+
import { Bell as e, Clock as t, Flag as n, GitBranch as r, Mail as i, PencilLine as a, Tag as o, Webhook as s, Zap as c } from "lucide-react";
|
|
2
|
+
var l = {
|
|
3
3
|
info: "bg-status-info-bg text-status-info-text ring-status-info-border",
|
|
4
4
|
success: "bg-status-success-bg text-status-success-text ring-status-success-border",
|
|
5
5
|
warning: "bg-status-warning-bg text-status-warning-text ring-status-warning-border",
|
|
6
6
|
error: "bg-status-error-bg text-status-error-text ring-status-error-border",
|
|
7
7
|
accent: "bg-[var(--color-accent-soft)] text-action-primary-bg ring-border-seam"
|
|
8
|
-
},
|
|
8
|
+
}, u = [
|
|
9
9
|
{
|
|
10
10
|
type: "send_email",
|
|
11
|
+
engineType: "SEND_EMAIL",
|
|
11
12
|
label: "Send Email",
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
shortLabel: "Email",
|
|
14
|
+
icon: i,
|
|
15
|
+
tone: "info",
|
|
16
|
+
retryable: !0
|
|
14
17
|
},
|
|
15
18
|
{
|
|
16
|
-
type: "
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
type: "notify",
|
|
20
|
+
engineType: "SEND_NOTIFICATION",
|
|
21
|
+
label: "Notify",
|
|
22
|
+
shortLabel: "Notify",
|
|
23
|
+
icon: e,
|
|
24
|
+
tone: "success",
|
|
25
|
+
retryable: !0
|
|
20
26
|
},
|
|
21
27
|
{
|
|
22
28
|
type: "wait",
|
|
23
|
-
|
|
29
|
+
engineType: "WAIT",
|
|
30
|
+
label: "Wait",
|
|
31
|
+
shortLabel: "Wait",
|
|
24
32
|
icon: t,
|
|
25
|
-
tone: "warning"
|
|
33
|
+
tone: "warning",
|
|
34
|
+
retryable: !1
|
|
26
35
|
},
|
|
27
36
|
{
|
|
28
37
|
type: "condition",
|
|
38
|
+
engineType: "CONDITION",
|
|
29
39
|
label: "Condition",
|
|
30
|
-
|
|
40
|
+
shortLabel: "Condition",
|
|
41
|
+
icon: r,
|
|
31
42
|
tone: "accent",
|
|
32
|
-
isCondition: !0
|
|
43
|
+
isCondition: !0,
|
|
44
|
+
retryable: !1
|
|
33
45
|
},
|
|
34
46
|
{
|
|
35
|
-
type: "
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
type: "add_tag",
|
|
48
|
+
engineType: "ADD_TAG",
|
|
49
|
+
label: "Add Tag",
|
|
50
|
+
shortLabel: "Tag",
|
|
51
|
+
icon: o,
|
|
52
|
+
tone: "warning",
|
|
53
|
+
retryable: !0
|
|
39
54
|
},
|
|
40
55
|
{
|
|
41
56
|
type: "webhook",
|
|
57
|
+
engineType: "WEBHOOK",
|
|
42
58
|
label: "Webhook",
|
|
43
|
-
|
|
44
|
-
|
|
59
|
+
shortLabel: "Webhook",
|
|
60
|
+
icon: s,
|
|
61
|
+
tone: "info",
|
|
62
|
+
retryable: !0
|
|
45
63
|
},
|
|
46
64
|
{
|
|
47
|
-
type: "
|
|
48
|
-
|
|
65
|
+
type: "update_field",
|
|
66
|
+
engineType: "UPDATE_CONTACT_FIELD",
|
|
67
|
+
label: "Update Field",
|
|
68
|
+
shortLabel: "Update field",
|
|
49
69
|
icon: a,
|
|
50
|
-
tone: "
|
|
70
|
+
tone: "error",
|
|
71
|
+
retryable: !0
|
|
51
72
|
},
|
|
52
73
|
{
|
|
53
|
-
type: "
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
74
|
+
type: "goal",
|
|
75
|
+
engineType: "GOAL",
|
|
76
|
+
label: "Goal",
|
|
77
|
+
shortLabel: "Goal",
|
|
78
|
+
icon: n,
|
|
79
|
+
tone: "success",
|
|
80
|
+
retryable: !1
|
|
57
81
|
}
|
|
58
|
-
],
|
|
82
|
+
], d = [
|
|
59
83
|
{
|
|
60
|
-
type: "
|
|
61
|
-
label: "
|
|
62
|
-
|
|
84
|
+
type: "LEAD_CREATED",
|
|
85
|
+
label: "New lead",
|
|
86
|
+
description: "Runs for every lead created in this workspace."
|
|
63
87
|
},
|
|
64
88
|
{
|
|
65
|
-
type: "
|
|
66
|
-
label: "
|
|
67
|
-
|
|
89
|
+
type: "CONTACT_CREATED",
|
|
90
|
+
label: "New contact",
|
|
91
|
+
description: "Runs for every contact created in this workspace."
|
|
68
92
|
},
|
|
69
93
|
{
|
|
70
|
-
type: "
|
|
71
|
-
label: "
|
|
72
|
-
|
|
94
|
+
type: "SCORE_THRESHOLD",
|
|
95
|
+
label: "Lead score reached",
|
|
96
|
+
description: "Runs when a lead's score rises to the threshold or above."
|
|
73
97
|
},
|
|
74
98
|
{
|
|
75
|
-
type: "
|
|
76
|
-
label: "
|
|
77
|
-
|
|
99
|
+
type: "MANUAL",
|
|
100
|
+
label: "Manual",
|
|
101
|
+
description: "Runs only when you start it for a lead."
|
|
102
|
+
}
|
|
103
|
+
], f = {
|
|
104
|
+
CAMPAIGN_EVENT: "Campaign event",
|
|
105
|
+
DATE_BASED: "Date based"
|
|
106
|
+
}, p = [
|
|
107
|
+
{
|
|
108
|
+
value: "eq",
|
|
109
|
+
label: "equals"
|
|
78
110
|
},
|
|
79
111
|
{
|
|
80
|
-
|
|
81
|
-
label: "
|
|
82
|
-
|
|
112
|
+
value: "neq",
|
|
113
|
+
label: "does not equal"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
value: "gt",
|
|
117
|
+
label: "is greater than"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
value: "gte",
|
|
121
|
+
label: "is at least"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
value: "lt",
|
|
125
|
+
label: "is less than"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
value: "lte",
|
|
129
|
+
label: "is at most"
|
|
83
130
|
},
|
|
84
131
|
{
|
|
85
|
-
|
|
86
|
-
label: "
|
|
87
|
-
|
|
132
|
+
value: "contains",
|
|
133
|
+
label: "contains"
|
|
134
|
+
}
|
|
135
|
+
], m = [
|
|
136
|
+
{
|
|
137
|
+
value: "score",
|
|
138
|
+
label: "Score"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
value: "status",
|
|
142
|
+
label: "Status"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
value: "source",
|
|
146
|
+
label: "Source"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
value: "email",
|
|
150
|
+
label: "Email"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
value: "company",
|
|
154
|
+
label: "Company"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
value: "assignedTo",
|
|
158
|
+
label: "Assigned to"
|
|
159
|
+
}
|
|
160
|
+
], h = [
|
|
161
|
+
{
|
|
162
|
+
value: "score",
|
|
163
|
+
label: "Score"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
value: "status",
|
|
167
|
+
label: "Status"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
value: "assignedTo",
|
|
171
|
+
label: "Assigned to"
|
|
88
172
|
}
|
|
89
173
|
];
|
|
90
|
-
function
|
|
91
|
-
return
|
|
174
|
+
function g(e) {
|
|
175
|
+
return u.find((t) => t.type === e);
|
|
176
|
+
}
|
|
177
|
+
function _(e) {
|
|
178
|
+
return u.find((t) => t.engineType === e);
|
|
179
|
+
}
|
|
180
|
+
function v(e) {
|
|
181
|
+
return d.find((t) => t.type === e)?.label ?? f[e] ?? "Trigger";
|
|
92
182
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
183
|
+
function y(e) {
|
|
184
|
+
return d.some((t) => t.type === e);
|
|
95
185
|
}
|
|
96
|
-
function
|
|
97
|
-
return e.kind === "trigger" ? "success" :
|
|
186
|
+
function b(e) {
|
|
187
|
+
return e.kind === "trigger" ? "success" : g(e.actionType)?.tone ?? "accent";
|
|
98
188
|
}
|
|
99
|
-
function
|
|
100
|
-
return e.kind === "trigger" ?
|
|
189
|
+
function x(e) {
|
|
190
|
+
return e.kind === "trigger" ? c : g(e.actionType)?.icon ?? c;
|
|
101
191
|
}
|
|
102
|
-
function
|
|
192
|
+
function S(e) {
|
|
103
193
|
return e.kind === "action" && e.actionType === "condition";
|
|
104
194
|
}
|
|
105
|
-
function
|
|
195
|
+
function C(e) {
|
|
196
|
+
switch (e) {
|
|
197
|
+
case "send_email": return {
|
|
198
|
+
subject: "",
|
|
199
|
+
body: ""
|
|
200
|
+
};
|
|
201
|
+
case "notify": return {
|
|
202
|
+
title: "",
|
|
203
|
+
body: ""
|
|
204
|
+
};
|
|
205
|
+
case "wait": return {
|
|
206
|
+
waitDuration: 2,
|
|
207
|
+
waitUnit: "days"
|
|
208
|
+
};
|
|
209
|
+
case "condition": return {
|
|
210
|
+
field: "score",
|
|
211
|
+
operator: "gte",
|
|
212
|
+
value: "50"
|
|
213
|
+
};
|
|
214
|
+
case "webhook": return {
|
|
215
|
+
webhookUrl: "",
|
|
216
|
+
method: "POST"
|
|
217
|
+
};
|
|
218
|
+
case "update_field": return {
|
|
219
|
+
updateField: "score",
|
|
220
|
+
value: ""
|
|
221
|
+
};
|
|
222
|
+
case "add_tag": return { tag: "" };
|
|
223
|
+
case "goal": return { description: "" };
|
|
224
|
+
default: return {};
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
var w = {
|
|
228
|
+
minutes: 1,
|
|
229
|
+
hours: 60,
|
|
230
|
+
days: 1440
|
|
231
|
+
};
|
|
232
|
+
function T(e, t) {
|
|
233
|
+
return e * w[t];
|
|
234
|
+
}
|
|
235
|
+
function E(e) {
|
|
236
|
+
return e >= 1440 && e % 1440 == 0 ? {
|
|
237
|
+
waitDuration: e / 1440,
|
|
238
|
+
waitUnit: "days"
|
|
239
|
+
} : e >= 60 && e % 60 == 0 ? {
|
|
240
|
+
waitDuration: e / 60,
|
|
241
|
+
waitUnit: "hours"
|
|
242
|
+
} : {
|
|
243
|
+
waitDuration: e,
|
|
244
|
+
waitUnit: "minutes"
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function D(e) {
|
|
248
|
+
return p.find((t) => t.value === e)?.label ?? "?";
|
|
249
|
+
}
|
|
250
|
+
function O(e) {
|
|
251
|
+
return e ? m.find((t) => t.value === e)?.label ?? e : "field";
|
|
252
|
+
}
|
|
253
|
+
function k(e) {
|
|
254
|
+
let t = e.config;
|
|
255
|
+
if (e.kind === "trigger") return e.actionType === "SCORE_THRESHOLD" && t.scoreThreshold != null ? `Score reaches ${t.scoreThreshold}` : v(e.actionType);
|
|
256
|
+
switch (e.actionType) {
|
|
257
|
+
case "send_email": return t.subject ? t.subject : "Set a subject";
|
|
258
|
+
case "notify": return t.title ? t.title : "Notify your team";
|
|
259
|
+
case "wait": return t.waitDuration ? `Wait ${t.waitDuration} ${t.waitUnit ?? "days"}` : "Set a delay";
|
|
260
|
+
case "condition": return t.field ? `${O(t.field)} ${D(t.operator)} ${t.value ?? ""}?` : "Set a condition";
|
|
261
|
+
case "webhook": return t.webhookUrl ? t.webhookUrl : "Call a webhook";
|
|
262
|
+
case "update_field": return t.updateField ? `Set ${O(t.updateField)} to ${t.value ?? ""}` : "Update a field";
|
|
263
|
+
case "add_tag": return t.tag ? `Tag: ${t.tag}` : "Add a tag";
|
|
264
|
+
case "goal": return t.description ? t.description : "Mark a goal";
|
|
265
|
+
default: return g(e.actionType)?.label ?? "";
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function A(e, t) {
|
|
106
269
|
let n = e.y + 78;
|
|
107
270
|
return t === "yes" ? {
|
|
108
271
|
x: e.x + 240 * .28,
|
|
@@ -115,36 +278,13 @@ function g(e, t) {
|
|
|
115
278
|
y: n
|
|
116
279
|
};
|
|
117
280
|
}
|
|
118
|
-
function
|
|
281
|
+
function j(e) {
|
|
119
282
|
return {
|
|
120
283
|
x: e.x + 240 / 2,
|
|
121
284
|
y: e.y
|
|
122
285
|
};
|
|
123
286
|
}
|
|
124
|
-
function v(e, t) {
|
|
125
|
-
return {
|
|
126
|
-
version: 2,
|
|
127
|
-
nodes: e.map((e, t) => ({
|
|
128
|
-
id: e.id,
|
|
129
|
-
kind: e.kind,
|
|
130
|
-
actionType: e.actionType,
|
|
131
|
-
label: e.label,
|
|
132
|
-
order: t,
|
|
133
|
-
position: {
|
|
134
|
-
x: Math.round(e.x),
|
|
135
|
-
y: Math.round(e.y)
|
|
136
|
-
},
|
|
137
|
-
config: e.config
|
|
138
|
-
})),
|
|
139
|
-
edges: t.map((e) => ({
|
|
140
|
-
id: e.id,
|
|
141
|
-
source: e.source,
|
|
142
|
-
target: e.target,
|
|
143
|
-
branch: e.branch
|
|
144
|
-
}))
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
287
|
//#endregion
|
|
148
|
-
export {
|
|
288
|
+
export { u as ACTION_TYPES, l as CHIP_TONE, m as CONDITION_FIELDS, p as CONDITION_OPERATORS, d as TRIGGER_TYPES, h as UPDATABLE_FIELDS, g as actionMeta, _ as actionMetaForEngineType, C as defaultConfig, j as inPort, y as isBuilderTriggerType, S as isConditionNode, E as minutesToWait, x as nodeIcon, k as nodeSubtitle, b as nodeTone, A as outPort, v as triggerLabel, T as waitToMinutes };
|
|
149
289
|
|
|
150
290
|
//# sourceMappingURL=workflowBuilderModel.js.map
|