@burdenoff/microfe-subscriberbot 2026.827.1 → 2026.1014.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/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.js +80 -83
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/hooks/index.d.ts +1 -0
- package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/index.js +1 -0
- package/dist/subscriberbot/hooks/useTr.d.ts +17 -0
- package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useTr.js +14 -0
- package/dist/subscriberbot/hooks/useTr.js.map +1 -0
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.js +111 -109
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +113 -105
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +404 -369
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +94 -93
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +360 -366
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +209 -193
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +268 -236
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +96 -76
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +145 -161
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +514 -441
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +167 -129
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +171 -218
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +340 -279
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +185 -166
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +153 -182
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,56 +7,62 @@ import { Modal as a } from "../components/Modal.js";
|
|
|
7
7
|
import { ErrorView as o, LoadingView as s } from "../components/StateViews.js";
|
|
8
8
|
import "../components/index.js";
|
|
9
9
|
import { useActivateWorkflow as c, useCreateWorkflow as l, useWorkflows as u } from "../hooks/useSubscriberBotApi.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { useTr as d } from "../hooks/useTr.js";
|
|
11
|
+
import { useState as f } from "react";
|
|
12
|
+
import { ArrowRight as p, CheckCircle2 as m, Clock as h, Play as g, Plus as _, Sparkles as v, Workflow as y, X as b, Zap as x } from "lucide-react";
|
|
13
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
14
|
+
import { GlassCard as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
|
|
14
15
|
//#region src/subscriberbot/pages/WorkflowsPage.tsx
|
|
15
|
-
var
|
|
16
|
+
var D = [
|
|
16
17
|
{
|
|
17
18
|
value: "",
|
|
18
|
-
|
|
19
|
+
labelKey: "workflows.filters.allStatuses",
|
|
20
|
+
fallback: "All statuses"
|
|
19
21
|
},
|
|
20
22
|
{
|
|
21
23
|
value: "ACTIVE",
|
|
22
|
-
|
|
24
|
+
labelKey: "workflows.filters.active",
|
|
25
|
+
fallback: "Active"
|
|
23
26
|
},
|
|
24
27
|
{
|
|
25
28
|
value: "DRAFT",
|
|
26
|
-
|
|
29
|
+
labelKey: "workflows.filters.draft",
|
|
30
|
+
fallback: "Draft"
|
|
27
31
|
},
|
|
28
32
|
{
|
|
29
33
|
value: "PAUSED",
|
|
30
|
-
|
|
34
|
+
labelKey: "workflows.filters.paused",
|
|
35
|
+
fallback: "Paused"
|
|
31
36
|
},
|
|
32
37
|
{
|
|
33
38
|
value: "ARCHIVED",
|
|
34
|
-
|
|
39
|
+
labelKey: "workflows.filters.archived",
|
|
40
|
+
fallback: "Archived"
|
|
35
41
|
}
|
|
36
|
-
],
|
|
37
|
-
function
|
|
38
|
-
return /* @__PURE__ */
|
|
42
|
+
], O = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", k = "mb-1 block text-xs font-medium text-text-secondary";
|
|
43
|
+
function A({ icon: e, kicker: t, title: n, sub: r, accent: i }) {
|
|
44
|
+
return /* @__PURE__ */ w("div", {
|
|
39
45
|
className: "w-48 shrink-0 overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-sm",
|
|
40
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ C("div", {
|
|
41
47
|
className: `h-1 w-full ${i === "done" ? "bg-status-success-text" : i === "run" ? "bg-status-warning-text" : "bg-[var(--color-accent-indigo)]"}`,
|
|
42
48
|
"aria-hidden": !0
|
|
43
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ w("div", {
|
|
44
50
|
className: "p-3",
|
|
45
51
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ C("span", {
|
|
47
53
|
className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
|
|
48
54
|
children: e
|
|
49
55
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ C("p", {
|
|
51
57
|
className: "mt-2 text-[10px] font-medium uppercase tracking-wide text-text-secondary",
|
|
52
58
|
children: t
|
|
53
59
|
}),
|
|
54
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ C("p", {
|
|
55
61
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
56
62
|
title: n,
|
|
57
63
|
children: n
|
|
58
64
|
}),
|
|
59
|
-
r && /* @__PURE__ */
|
|
65
|
+
r && /* @__PURE__ */ C("p", {
|
|
60
66
|
className: "mt-0.5 truncate text-xs text-text-secondary",
|
|
61
67
|
children: r
|
|
62
68
|
})
|
|
@@ -64,339 +70,349 @@ function k({ icon: e, kicker: t, title: n, sub: r, accent: i }) {
|
|
|
64
70
|
})]
|
|
65
71
|
});
|
|
66
72
|
}
|
|
67
|
-
function
|
|
68
|
-
let o = /* @__PURE__ */
|
|
73
|
+
function j({ workflow: e, onClose: t, onActivate: i, activating: a }) {
|
|
74
|
+
let o = d(), s = /* @__PURE__ */ w("div", {
|
|
69
75
|
className: "flex shrink-0 items-center px-1 text-text-secondary",
|
|
70
76
|
"aria-hidden": !0,
|
|
71
|
-
children: [/* @__PURE__ */
|
|
72
|
-
});
|
|
73
|
-
return /* @__PURE__ */
|
|
77
|
+
children: [/* @__PURE__ */ C("span", { className: "h-px w-4 bg-border-seam sm:w-6" }), /* @__PURE__ */ C(p, { className: "h-4 w-4" })]
|
|
78
|
+
}), c = e.status.charAt(0) + e.status.slice(1).toLowerCase();
|
|
79
|
+
return /* @__PURE__ */ w(T, {
|
|
74
80
|
treatment: "glass",
|
|
75
81
|
glow: !0,
|
|
76
82
|
className: "mt-6 p-5",
|
|
77
83
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ w("div", {
|
|
79
85
|
className: "flex flex-wrap items-start justify-between gap-3",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
86
|
+
children: [/* @__PURE__ */ w("div", {
|
|
81
87
|
className: "min-w-0",
|
|
82
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ w("div", {
|
|
83
89
|
className: "flex flex-wrap items-center gap-2",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
90
|
+
children: [/* @__PURE__ */ C("p", {
|
|
85
91
|
className: "text-base font-semibold text-text-primary",
|
|
86
92
|
children: e.name
|
|
87
|
-
}), /* @__PURE__ */
|
|
88
|
-
}), /* @__PURE__ */
|
|
93
|
+
}), /* @__PURE__ */ C(r, { status: e.status })]
|
|
94
|
+
}), /* @__PURE__ */ w("p", {
|
|
89
95
|
className: "mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-secondary",
|
|
90
96
|
children: [/* @__PURE__ */ C("span", {
|
|
91
97
|
className: "tabular-nums",
|
|
92
|
-
children:
|
|
93
|
-
|
|
94
|
-
e.runCount,
|
|
95
|
-
"×"
|
|
96
|
-
]
|
|
97
|
-
}), e.lastRunAt && /* @__PURE__ */ C("span", {
|
|
98
|
+
children: o("workflows.flow.ran", "Ran {{count}}×", { count: e.runCount })
|
|
99
|
+
}), e.lastRunAt && /* @__PURE__ */ w("span", {
|
|
98
100
|
className: "inline-flex items-center gap-1",
|
|
99
101
|
children: [
|
|
100
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ C(h, {
|
|
101
103
|
className: "h-3 w-3",
|
|
102
104
|
"aria-hidden": !0
|
|
103
105
|
}),
|
|
104
|
-
" last",
|
|
105
106
|
" ",
|
|
106
|
-
n(e.lastRunAt)
|
|
107
|
+
o("workflows.flow.lastRun", "last {{when}}", { when: n(e.lastRunAt) })
|
|
107
108
|
]
|
|
108
109
|
})]
|
|
109
110
|
})]
|
|
110
|
-
}), /* @__PURE__ */
|
|
111
|
+
}), /* @__PURE__ */ C("button", {
|
|
111
112
|
type: "button",
|
|
112
113
|
onClick: t,
|
|
113
|
-
"aria-label": "Close flow",
|
|
114
|
+
"aria-label": o("workflows.flow.closeAriaLabel", "Close flow"),
|
|
114
115
|
className: "rounded-lg border border-border-subtle p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
|
|
115
|
-
children: /* @__PURE__ */
|
|
116
|
+
children: /* @__PURE__ */ C(b, { className: "h-4 w-4" })
|
|
116
117
|
})]
|
|
117
118
|
}),
|
|
118
|
-
e.description && /* @__PURE__ */
|
|
119
|
+
e.description && /* @__PURE__ */ C("p", {
|
|
119
120
|
className: "mt-2 max-w-3xl text-sm text-text-secondary",
|
|
120
121
|
children: e.description
|
|
121
122
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ C("div", {
|
|
123
124
|
className: "mt-4 overflow-x-auto pb-2",
|
|
124
|
-
children: /* @__PURE__ */
|
|
125
|
+
children: /* @__PURE__ */ w("div", {
|
|
125
126
|
className: "flex min-w-max items-stretch",
|
|
126
127
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ C(A, {
|
|
128
129
|
accent: "trigger",
|
|
129
|
-
kicker: "When",
|
|
130
|
-
icon: /* @__PURE__ */
|
|
130
|
+
kicker: o("workflows.flow.trigger", "When"),
|
|
131
|
+
icon: /* @__PURE__ */ C(x, { className: "h-4 w-4" }),
|
|
131
132
|
title: e.triggerEvent,
|
|
132
|
-
sub: "Trigger event"
|
|
133
|
+
sub: o("workflows.flow.triggerEvent", "Trigger event")
|
|
133
134
|
}),
|
|
134
|
-
|
|
135
|
-
/* @__PURE__ */
|
|
135
|
+
s,
|
|
136
|
+
/* @__PURE__ */ C(A, {
|
|
136
137
|
accent: "run",
|
|
137
|
-
kicker: "Run",
|
|
138
|
-
icon: /* @__PURE__ */
|
|
138
|
+
kicker: o("workflows.flow.run", "Run"),
|
|
139
|
+
icon: /* @__PURE__ */ C(v, { className: "h-4 w-4" }),
|
|
139
140
|
title: e.name,
|
|
140
|
-
sub: "Automation"
|
|
141
|
+
sub: o("workflows.flow.automation", "Automation")
|
|
141
142
|
}),
|
|
142
|
-
|
|
143
|
-
/* @__PURE__ */
|
|
143
|
+
s,
|
|
144
|
+
/* @__PURE__ */ C(A, {
|
|
144
145
|
accent: "done",
|
|
145
|
-
kicker: "Then",
|
|
146
|
-
icon: /* @__PURE__ */
|
|
147
|
-
title: e.status === "ACTIVE" ? "Live" : "Awaiting activation",
|
|
148
|
-
sub:
|
|
146
|
+
kicker: o("workflows.flow.then", "Then"),
|
|
147
|
+
icon: /* @__PURE__ */ C(m, { className: "h-4 w-4" }),
|
|
148
|
+
title: e.status === "ACTIVE" ? o("workflows.flow.live", "Live") : o("workflows.flow.awaitingActivation", "Awaiting activation"),
|
|
149
|
+
sub: o("workflows.flow.status", "Status: {{status}}", { status: c })
|
|
149
150
|
})
|
|
150
151
|
]
|
|
151
152
|
})
|
|
152
153
|
}),
|
|
153
|
-
e.status !== "ACTIVE" && /* @__PURE__ */
|
|
154
|
+
e.status !== "ACTIVE" && /* @__PURE__ */ C("div", {
|
|
154
155
|
className: "mt-3 flex justify-end",
|
|
155
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ w("button", {
|
|
156
157
|
type: "button",
|
|
157
158
|
disabled: a,
|
|
158
159
|
onClick: i,
|
|
159
160
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
160
161
|
children: [
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ C(g, { className: "h-4 w-4" }),
|
|
162
163
|
" ",
|
|
163
|
-
a ? "Activating…" : "Activate workflow"
|
|
164
|
+
a ? o("common.activating", "Activating…") : o("workflows.flow.activate", "Activate workflow")
|
|
164
165
|
]
|
|
165
166
|
})
|
|
166
167
|
})
|
|
167
168
|
]
|
|
168
169
|
});
|
|
169
170
|
}
|
|
170
|
-
function
|
|
171
|
-
let [
|
|
172
|
-
|
|
173
|
-
},
|
|
174
|
-
|
|
171
|
+
function M() {
|
|
172
|
+
let [p, m] = f(""), [h, v] = f(!1), [b, A] = f(null), M = d(), { data: N, isLoading: P, isError: F, refetch: I } = u(p || void 0), L = l(), R = c(), [z, B] = f(""), [V, H] = f(""), [U, W] = f(""), [G, K] = f(null), q = N ?? [], J = q.find((e) => e.id === b) ?? null, Y = q.filter((e) => e.status === "ACTIVE").length, X = q.reduce((e, t) => e + (t.runCount || 0), 0), Z = () => {
|
|
173
|
+
B(""), H(""), W(""), K(null);
|
|
174
|
+
}, Q = () => {
|
|
175
|
+
v(!1), Z();
|
|
175
176
|
};
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
-
title: "Workflows",
|
|
178
|
-
description: "Event-driven automation across your portfolio",
|
|
179
|
-
actions: /* @__PURE__ */
|
|
177
|
+
return /* @__PURE__ */ w(e, {
|
|
178
|
+
title: M("workflows.title", "Workflows"),
|
|
179
|
+
description: M("workflows.description", "Event-driven automation across your portfolio"),
|
|
180
|
+
actions: /* @__PURE__ */ w("button", {
|
|
180
181
|
type: "button",
|
|
181
|
-
onClick: () =>
|
|
182
|
+
onClick: () => v(!0),
|
|
182
183
|
className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
183
|
-
children: [
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ C(_, { className: "h-4 w-4" }),
|
|
186
|
+
" ",
|
|
187
|
+
M("workflows.newWorkflow", "New workflow")
|
|
188
|
+
]
|
|
184
189
|
}),
|
|
185
190
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ C(E, {
|
|
187
192
|
className: "mb-4",
|
|
188
|
-
children: "Workflows react to domain events — a new invoice, a detected renewal, a cancelled relationship — and run multi-step automations. Draft a workflow, then activate it when you're ready."
|
|
193
|
+
children: M("workflows.purpose", "Workflows react to domain events — a new invoice, a detected renewal, a cancelled relationship — and run multi-step automations. Draft a workflow, then activate it when you're ready.")
|
|
189
194
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ C("div", {
|
|
191
196
|
className: "flex flex-wrap items-center gap-3",
|
|
192
|
-
children: /* @__PURE__ */
|
|
193
|
-
"aria-label": "
|
|
194
|
-
value:
|
|
195
|
-
onChange: (e) =>
|
|
197
|
+
children: /* @__PURE__ */ C("select", {
|
|
198
|
+
"aria-label": M("common.filter", "Filter"),
|
|
199
|
+
value: p,
|
|
200
|
+
onChange: (e) => m(e.target.value),
|
|
196
201
|
className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-xs text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
197
|
-
children:
|
|
202
|
+
children: D.map((e) => /* @__PURE__ */ C("option", {
|
|
198
203
|
value: e.value,
|
|
199
|
-
children: e.
|
|
204
|
+
children: M(e.labelKey, e.fallback)
|
|
200
205
|
}, e.value))
|
|
201
206
|
})
|
|
202
207
|
}),
|
|
203
|
-
|
|
204
|
-
message: "Could not load workflows.",
|
|
205
|
-
onRetry: () => void
|
|
206
|
-
}) :
|
|
208
|
+
P ? /* @__PURE__ */ C(s, { label: M("workflows.loading", "Loading workflows…") }) : F ? /* @__PURE__ */ C(o, {
|
|
209
|
+
message: M("workflows.error", "Could not load workflows."),
|
|
210
|
+
onRetry: () => void I()
|
|
211
|
+
}) : q.length === 0 ? /* @__PURE__ */ C("div", {
|
|
207
212
|
className: "mt-6",
|
|
208
|
-
children: /* @__PURE__ */
|
|
213
|
+
children: /* @__PURE__ */ C(i, {
|
|
209
214
|
illustration: "empty-data",
|
|
210
|
-
icon: /* @__PURE__ */
|
|
211
|
-
title: "No workflows yet",
|
|
212
|
-
description: "Create your first event-driven workflow to automate your recurring portfolio.",
|
|
213
|
-
action: /* @__PURE__ */
|
|
215
|
+
icon: /* @__PURE__ */ C(y, { className: "h-12 w-12" }),
|
|
216
|
+
title: M("workflows.empty.title", "No workflows yet"),
|
|
217
|
+
description: M("workflows.empty.description", "Create your first event-driven workflow to automate your recurring portfolio."),
|
|
218
|
+
action: /* @__PURE__ */ C("button", {
|
|
214
219
|
type: "button",
|
|
215
|
-
onClick: () =>
|
|
220
|
+
onClick: () => v(!0),
|
|
216
221
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
217
|
-
children: "New workflow"
|
|
222
|
+
children: M("workflows.newWorkflow", "New workflow")
|
|
218
223
|
})
|
|
219
224
|
})
|
|
220
|
-
}) : /* @__PURE__ */
|
|
221
|
-
/* @__PURE__ */
|
|
225
|
+
}) : /* @__PURE__ */ w(S, { children: [
|
|
226
|
+
/* @__PURE__ */ w("div", {
|
|
222
227
|
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
223
228
|
children: [
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
icon: /* @__PURE__ */
|
|
226
|
-
value:
|
|
227
|
-
label: "Workflows"
|
|
229
|
+
/* @__PURE__ */ C(t, {
|
|
230
|
+
icon: /* @__PURE__ */ C(y, { className: "h-5 w-5" }),
|
|
231
|
+
value: q.length,
|
|
232
|
+
label: M("workflows.metrics.workflows", "Workflows")
|
|
228
233
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
icon: /* @__PURE__ */
|
|
231
|
-
value:
|
|
232
|
-
label: "Active"
|
|
234
|
+
/* @__PURE__ */ C(t, {
|
|
235
|
+
icon: /* @__PURE__ */ C(x, { className: "h-5 w-5" }),
|
|
236
|
+
value: Y,
|
|
237
|
+
label: M("workflows.metrics.active", "Active")
|
|
233
238
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
icon: /* @__PURE__ */
|
|
236
|
-
value:
|
|
237
|
-
label: "Total runs"
|
|
239
|
+
/* @__PURE__ */ C(t, {
|
|
240
|
+
icon: /* @__PURE__ */ C(g, { className: "h-5 w-5" }),
|
|
241
|
+
value: X,
|
|
242
|
+
label: M("workflows.metrics.totalRuns", "Total runs")
|
|
238
243
|
})
|
|
239
244
|
]
|
|
240
245
|
}),
|
|
241
|
-
|
|
242
|
-
workflow:
|
|
243
|
-
onClose: () =>
|
|
244
|
-
onActivate: () =>
|
|
245
|
-
activating:
|
|
246
|
+
J && /* @__PURE__ */ C(j, {
|
|
247
|
+
workflow: J,
|
|
248
|
+
onClose: () => A(null),
|
|
249
|
+
onActivate: () => R.mutate(J.id),
|
|
250
|
+
activating: R.isPending
|
|
246
251
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ C("div", {
|
|
248
253
|
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
249
|
-
children:
|
|
250
|
-
let t = e.id ===
|
|
251
|
-
return /* @__PURE__ */
|
|
254
|
+
children: q.map((e) => {
|
|
255
|
+
let t = e.id === b;
|
|
256
|
+
return /* @__PURE__ */ w(T, {
|
|
252
257
|
treatment: "metric",
|
|
253
258
|
glow: t || e.status === "ACTIVE",
|
|
254
259
|
role: "button",
|
|
255
260
|
tabIndex: 0,
|
|
256
261
|
"aria-pressed": t,
|
|
257
|
-
"aria-label":
|
|
258
|
-
onClick: () =>
|
|
262
|
+
"aria-label": M("workflows.card.viewAriaLabel", "View flow for {{name}}", { name: e.name }),
|
|
263
|
+
onClick: () => A(t ? null : e.id),
|
|
259
264
|
onKeyDown: (n) => {
|
|
260
|
-
(n.key === "Enter" || n.key === " ") && (n.preventDefault(),
|
|
265
|
+
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), A(t ? null : e.id));
|
|
261
266
|
},
|
|
262
267
|
className: "flex cursor-pointer flex-col p-5 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
263
268
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ w("div", {
|
|
265
270
|
className: "flex items-start justify-between gap-2",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
271
|
+
children: [/* @__PURE__ */ C("span", {
|
|
267
272
|
className: "flex size-10 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary",
|
|
268
|
-
children: /* @__PURE__ */
|
|
269
|
-
}), /* @__PURE__ */
|
|
273
|
+
children: /* @__PURE__ */ C(y, { className: "h-5 w-5" })
|
|
274
|
+
}), /* @__PURE__ */ C(r, { status: e.status })]
|
|
270
275
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ C("p", {
|
|
272
277
|
className: "mt-3 truncate text-sm font-semibold text-text-primary",
|
|
273
278
|
children: e.name
|
|
274
279
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ w("p", {
|
|
276
281
|
className: "flex items-center gap-1 truncate text-xs text-text-secondary",
|
|
277
282
|
children: [
|
|
278
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ C(x, {
|
|
279
284
|
className: "h-3 w-3 shrink-0",
|
|
280
285
|
"aria-hidden": !0
|
|
281
286
|
}),
|
|
282
|
-
"
|
|
283
|
-
e.triggerEvent
|
|
287
|
+
" ",
|
|
288
|
+
M("workflows.card.onTrigger", "on {{trigger}}", { trigger: e.triggerEvent })
|
|
284
289
|
]
|
|
285
290
|
}),
|
|
286
|
-
e.description && /* @__PURE__ */
|
|
291
|
+
e.description && /* @__PURE__ */ C("p", {
|
|
287
292
|
className: "mt-2 line-clamp-2 min-h-[2rem] text-xs text-text-secondary",
|
|
288
293
|
children: e.description
|
|
289
294
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ w("p", {
|
|
291
296
|
className: "mt-3 flex items-center gap-1.5 text-xs text-text-secondary tabular-nums",
|
|
292
297
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ C(g, {
|
|
294
299
|
className: "h-3.5 w-3.5",
|
|
295
300
|
"aria-hidden": !0
|
|
296
301
|
}),
|
|
297
|
-
"
|
|
298
|
-
e.runCount,
|
|
299
|
-
"
|
|
300
|
-
e.lastRunAt ? ` · last ${n(e.lastRunAt)}` : ""
|
|
302
|
+
" ",
|
|
303
|
+
M("workflows.flow.ran", "Ran {{count}}×", { count: e.runCount }),
|
|
304
|
+
e.lastRunAt ? ` · ${M("workflows.flow.lastRun", "last {{when}}", { when: n(e.lastRunAt) })}` : ""
|
|
301
305
|
]
|
|
302
306
|
}),
|
|
303
|
-
e.status !== "ACTIVE" && /* @__PURE__ */
|
|
307
|
+
e.status !== "ACTIVE" && /* @__PURE__ */ w("button", {
|
|
304
308
|
type: "button",
|
|
305
|
-
disabled:
|
|
309
|
+
disabled: R.isPending,
|
|
306
310
|
onClick: (t) => {
|
|
307
|
-
t.stopPropagation(),
|
|
311
|
+
t.stopPropagation(), R.mutate(e.id);
|
|
308
312
|
},
|
|
309
313
|
className: "mt-4 inline-flex items-center justify-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
|
|
310
|
-
children: [
|
|
314
|
+
children: [
|
|
315
|
+
/* @__PURE__ */ C(g, { className: "h-3.5 w-3.5" }),
|
|
316
|
+
" ",
|
|
317
|
+
M("common.activate", "Activate")
|
|
318
|
+
]
|
|
311
319
|
})
|
|
312
320
|
]
|
|
313
321
|
}, e.id);
|
|
314
322
|
})
|
|
315
323
|
})
|
|
316
324
|
] }),
|
|
317
|
-
|
|
318
|
-
title: "New workflow",
|
|
319
|
-
onClose:
|
|
320
|
-
children: /* @__PURE__ */
|
|
325
|
+
h && /* @__PURE__ */ C(a, {
|
|
326
|
+
title: M("workflows.newWorkflow", "New workflow"),
|
|
327
|
+
onClose: Q,
|
|
328
|
+
children: /* @__PURE__ */ w("form", {
|
|
321
329
|
onSubmit: (e) => {
|
|
322
|
-
if (e.preventDefault(),
|
|
323
|
-
|
|
330
|
+
if (e.preventDefault(), K(null), !z.trim() || !V.trim()) {
|
|
331
|
+
K(M("workflows.form.nameRequired", "Name and trigger event are required."));
|
|
324
332
|
return;
|
|
325
333
|
}
|
|
326
334
|
let t = {
|
|
327
|
-
name:
|
|
328
|
-
triggerEvent:
|
|
329
|
-
...
|
|
335
|
+
name: z.trim(),
|
|
336
|
+
triggerEvent: V.trim(),
|
|
337
|
+
...U.trim() ? { description: U.trim() } : {}
|
|
330
338
|
};
|
|
331
|
-
|
|
339
|
+
L.mutate(t, {
|
|
332
340
|
onSuccess: () => {
|
|
333
|
-
|
|
341
|
+
Z(), v(!1);
|
|
334
342
|
},
|
|
335
|
-
onError: (e) =>
|
|
343
|
+
onError: (e) => K(e instanceof Error ? e.message : M("common.error", "An error occurred"))
|
|
336
344
|
});
|
|
337
345
|
},
|
|
338
346
|
className: "space-y-4",
|
|
339
347
|
children: [
|
|
340
|
-
|
|
348
|
+
G && /* @__PURE__ */ C("div", {
|
|
341
349
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
342
|
-
children:
|
|
350
|
+
children: G
|
|
343
351
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
|
|
345
353
|
htmlFor: "wf-name",
|
|
346
|
-
className:
|
|
347
|
-
children: [
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
354
|
+
className: k,
|
|
355
|
+
children: [
|
|
356
|
+
M("workflows.form.nameLabel", "Name"),
|
|
357
|
+
" ",
|
|
358
|
+
/* @__PURE__ */ C("span", {
|
|
359
|
+
className: "text-status-error-text",
|
|
360
|
+
children: "*"
|
|
361
|
+
})
|
|
362
|
+
]
|
|
363
|
+
}), /* @__PURE__ */ C("input", {
|
|
352
364
|
id: "wf-name",
|
|
353
365
|
type: "text",
|
|
354
|
-
value:
|
|
355
|
-
onChange: (e) =>
|
|
356
|
-
placeholder: "e.g. Invoice → notify finance",
|
|
357
|
-
className:
|
|
366
|
+
value: z,
|
|
367
|
+
onChange: (e) => B(e.target.value),
|
|
368
|
+
placeholder: M("workflows.form.namePlaceholder", "e.g. Invoice → notify finance"),
|
|
369
|
+
className: O,
|
|
358
370
|
required: !0
|
|
359
371
|
})] }),
|
|
360
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
|
|
361
373
|
htmlFor: "wf-trigger",
|
|
362
|
-
className:
|
|
363
|
-
children: [
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
374
|
+
className: k,
|
|
375
|
+
children: [
|
|
376
|
+
M("workflows.form.triggerLabel", "Trigger event"),
|
|
377
|
+
" ",
|
|
378
|
+
/* @__PURE__ */ C("span", {
|
|
379
|
+
className: "text-status-error-text",
|
|
380
|
+
children: "*"
|
|
381
|
+
})
|
|
382
|
+
]
|
|
383
|
+
}), /* @__PURE__ */ C("input", {
|
|
368
384
|
id: "wf-trigger",
|
|
369
385
|
type: "text",
|
|
370
|
-
value:
|
|
371
|
-
onChange: (e) =>
|
|
372
|
-
placeholder: "e.g. InvoiceReceived, RenewalDetected",
|
|
373
|
-
className:
|
|
386
|
+
value: V,
|
|
387
|
+
onChange: (e) => H(e.target.value),
|
|
388
|
+
placeholder: M("workflows.form.triggerPlaceholder", "e.g. InvoiceReceived, RenewalDetected"),
|
|
389
|
+
className: O,
|
|
374
390
|
required: !0
|
|
375
391
|
})] }),
|
|
376
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
|
|
377
393
|
htmlFor: "wf-desc",
|
|
378
|
-
className:
|
|
379
|
-
children: "Description"
|
|
380
|
-
}), /* @__PURE__ */
|
|
394
|
+
className: k,
|
|
395
|
+
children: M("workflows.form.descriptionLabel", "Description")
|
|
396
|
+
}), /* @__PURE__ */ C("textarea", {
|
|
381
397
|
id: "wf-desc",
|
|
382
|
-
value:
|
|
383
|
-
onChange: (e) =>
|
|
398
|
+
value: U,
|
|
399
|
+
onChange: (e) => W(e.target.value),
|
|
384
400
|
rows: 3,
|
|
385
|
-
placeholder: "What should this workflow do when the event fires?",
|
|
386
|
-
className:
|
|
401
|
+
placeholder: M("workflows.form.descriptionPlaceholder", "What should this workflow do when the event fires?"),
|
|
402
|
+
className: O
|
|
387
403
|
})] }),
|
|
388
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ w("div", {
|
|
389
405
|
className: "flex justify-end gap-3",
|
|
390
|
-
children: [/* @__PURE__ */
|
|
406
|
+
children: [/* @__PURE__ */ C("button", {
|
|
391
407
|
type: "button",
|
|
392
|
-
onClick:
|
|
408
|
+
onClick: Q,
|
|
393
409
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
394
|
-
children: "Cancel"
|
|
395
|
-
}), /* @__PURE__ */
|
|
410
|
+
children: M("common.cancel", "Cancel")
|
|
411
|
+
}), /* @__PURE__ */ C("button", {
|
|
396
412
|
type: "submit",
|
|
397
|
-
disabled:
|
|
413
|
+
disabled: L.isPending,
|
|
398
414
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
399
|
-
children:
|
|
415
|
+
children: L.isPending ? M("workflows.creating", "Creating…") : M("workflows.createWorkflow", "Create workflow")
|
|
400
416
|
})]
|
|
401
417
|
})
|
|
402
418
|
]
|
|
@@ -406,6 +422,6 @@ function j() {
|
|
|
406
422
|
});
|
|
407
423
|
}
|
|
408
424
|
//#endregion
|
|
409
|
-
export {
|
|
425
|
+
export { M as WorkflowsPage };
|
|
410
426
|
|
|
411
427
|
//# sourceMappingURL=WorkflowsPage.js.map
|