@voltro/devtools 0.90.0 → 0.91.0
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/CHANGELOG.md +121 -0
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/Devtools.js +170 -169
- package/dist/components/dockMenu.js +46 -46
- package/dist/console/Capsule.js +137 -68
- package/dist/console/Console.js +22 -22
- package/dist/console/InspectRefusals.js +12 -12
- package/dist/console/sources.js +13 -13
- package/dist/index.js +3 -3
- package/dist/inspectFetch.js +19 -19
- package/dist/inspectStream.js +9 -9
- package/dist/panels/desktop.js +18 -18
- package/dist/panels/indexes.js +71 -71
- package/dist/panels/pwa.js +22 -22
- package/dist/panels/routes.js +13 -13
- package/dist/panels/runtimes.js +15 -15
- package/dist/panels/stores.js +35 -35
- package/dist/panels/traces.js +42 -42
- package/dist/panels/webhooks.js +89 -89
- package/dist/panels/workflows.js +146 -146
- package/dist/styles.css +11 -3
- package/dist/useCapsuleClearance.js +6 -6
- package/package.json +4 -4
package/dist/panels/stores.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Badge as e, Button as t, Card as n, Empty as r, KeyValue as i, SectionTitle as a } from "../components/primitives.js";
|
|
2
|
+
import { ArrowUpDown as o, Database as s, Trash as c } from "../components/icons.js";
|
|
3
3
|
import { useState as l, useSyncExternalStore as u } from "react";
|
|
4
4
|
import { clearStoreHistory as d, definedStores as f, storeHistory as p, subscribeStoreHistory as m, travelToStoreState as h } from "@voltro/client";
|
|
5
5
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
@@ -12,22 +12,22 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
|
|
|
12
12
|
n = String(e);
|
|
13
13
|
}
|
|
14
14
|
return n.length > t ? `${n.slice(0, t)}…` : n;
|
|
15
|
-
}, x = (e, t) => typeof e != "object" || typeof t != "object" || e === null || t === null ? [] : [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !Object.is(e[n], t[n])), S = ({ label:
|
|
16
|
-
let [
|
|
15
|
+
}, x = (e, t) => typeof e != "object" || typeof t != "object" || e === null || t === null ? [] : [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !Object.is(e[n], t[n])), S = ({ label: t, state: n }) => {
|
|
16
|
+
let [r, a] = l(!1);
|
|
17
17
|
return /* @__PURE__ */ v("div", {
|
|
18
18
|
className: "vdt:border-t vdt:border-border",
|
|
19
19
|
children: [/* @__PURE__ */ v("button", {
|
|
20
20
|
type: "button",
|
|
21
21
|
className: "vdt:flex vdt:w-full vdt:items-center vdt:gap-2 vdt:px-3 vdt:py-2 vdt:text-left vdt:hover:bg-muted",
|
|
22
|
-
onClick: () =>
|
|
23
|
-
children: [/* @__PURE__ */ _(
|
|
22
|
+
onClick: () => a((e) => !e),
|
|
23
|
+
children: [/* @__PURE__ */ _(e, {
|
|
24
24
|
tone: "neutral",
|
|
25
|
-
children:
|
|
25
|
+
children: t
|
|
26
26
|
}), /* @__PURE__ */ _("span", {
|
|
27
27
|
className: "vdt:truncate vdt:font-mono vdt:text-[11px] vdt:text-foreground-muted",
|
|
28
|
-
children: b(
|
|
28
|
+
children: b(n)
|
|
29
29
|
})]
|
|
30
|
-
}),
|
|
30
|
+
}), r ? /* @__PURE__ */ _(i, { entries: Object.entries(n).map(([e, t]) => ({
|
|
31
31
|
key: e,
|
|
32
32
|
value: b(t, 200)
|
|
33
33
|
})) }) : null]
|
|
@@ -35,13 +35,13 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
|
|
|
35
35
|
}, C = () => {
|
|
36
36
|
let u = y(), [p, m] = l(null), C = f(), w = p ?? u.length;
|
|
37
37
|
return /* @__PURE__ */ v(g, { children: [
|
|
38
|
-
/* @__PURE__ */ v(
|
|
39
|
-
Icon:
|
|
40
|
-
right: /* @__PURE__ */ v(
|
|
38
|
+
/* @__PURE__ */ v(a, {
|
|
39
|
+
Icon: s,
|
|
40
|
+
right: /* @__PURE__ */ v(t, {
|
|
41
41
|
onClick: () => {
|
|
42
42
|
d(), m(null);
|
|
43
43
|
},
|
|
44
|
-
children: [/* @__PURE__ */ _(
|
|
44
|
+
children: [/* @__PURE__ */ _(c, {}), "Clear"]
|
|
45
45
|
}),
|
|
46
46
|
children: [
|
|
47
47
|
"Stores (",
|
|
@@ -49,8 +49,8 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
|
|
|
49
49
|
")"
|
|
50
50
|
]
|
|
51
51
|
}),
|
|
52
|
-
C.length === 0 ? /* @__PURE__ */ _(
|
|
53
|
-
/* @__PURE__ */ _(
|
|
52
|
+
C.length === 0 ? /* @__PURE__ */ _(r, { children: "No stores defined. `defineStore(name, () => state)` in a *.store.ts file." }) : C.map((e) => /* @__PURE__ */ v(n, { children: [
|
|
53
|
+
/* @__PURE__ */ _(a, { children: e.name }),
|
|
54
54
|
/* @__PURE__ */ _(S, {
|
|
55
55
|
label: "global",
|
|
56
56
|
state: e.get()
|
|
@@ -60,15 +60,15 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
|
|
|
60
60
|
state: e.get(t)
|
|
61
61
|
}, t))
|
|
62
62
|
] }, e.name)),
|
|
63
|
-
/* @__PURE__ */ v(
|
|
64
|
-
Icon:
|
|
65
|
-
right: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
63
|
+
/* @__PURE__ */ v(a, {
|
|
64
|
+
Icon: o,
|
|
65
|
+
right: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(t, {
|
|
66
66
|
onClick: () => {
|
|
67
67
|
w <= 0 || h(w - 1, "before") && m(w - 1);
|
|
68
68
|
},
|
|
69
69
|
disabled: w <= 0,
|
|
70
70
|
children: "◀ Back"
|
|
71
|
-
}), /* @__PURE__ */ _(
|
|
71
|
+
}), /* @__PURE__ */ _(t, {
|
|
72
72
|
onClick: () => {
|
|
73
73
|
p === null || w >= u.length || h(w, "after") && m(w + 1);
|
|
74
74
|
},
|
|
@@ -82,42 +82,42 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
|
|
|
82
82
|
p === null ? "" : ` — travelled to ${w}/${u.length}`
|
|
83
83
|
]
|
|
84
84
|
}),
|
|
85
|
-
u.length === 0 ? /* @__PURE__ */ _(
|
|
86
|
-
let
|
|
87
|
-
return /* @__PURE__ */ v(
|
|
85
|
+
u.length === 0 ? /* @__PURE__ */ _(r, { children: "No writes yet. Every `set()` lands here, labelled if you pass one." }) : [...u].reverse().map((t, r) => {
|
|
86
|
+
let a = u.length - 1 - r, o = x(t.prev, t.next);
|
|
87
|
+
return /* @__PURE__ */ v(n, { children: [/* @__PURE__ */ v("div", {
|
|
88
88
|
className: "vdt:flex vdt:items-center vdt:gap-2 vdt:px-3 vdt:py-2",
|
|
89
89
|
children: [
|
|
90
|
-
/* @__PURE__ */ _(
|
|
91
|
-
tone:
|
|
92
|
-
children:
|
|
90
|
+
/* @__PURE__ */ _(e, {
|
|
91
|
+
tone: t.isUndo === !0 ? "warning" : "neutral",
|
|
92
|
+
children: t.store
|
|
93
93
|
}),
|
|
94
|
-
|
|
94
|
+
t.key === void 0 ? null : /* @__PURE__ */ _(e, {
|
|
95
95
|
tone: "neutral",
|
|
96
|
-
children:
|
|
96
|
+
children: t.key
|
|
97
97
|
}),
|
|
98
|
-
|
|
98
|
+
t.label === void 0 ? null : /* @__PURE__ */ _("span", {
|
|
99
99
|
className: "vdt:truncate vdt:font-mono vdt:text-[11px] vdt:text-foreground-muted",
|
|
100
|
-
children:
|
|
100
|
+
children: t.label
|
|
101
101
|
}),
|
|
102
|
-
p !== null &&
|
|
102
|
+
p !== null && a === w ? /* @__PURE__ */ _(e, {
|
|
103
103
|
tone: "info",
|
|
104
104
|
children: "here"
|
|
105
105
|
}) : null
|
|
106
106
|
]
|
|
107
|
-
}), /* @__PURE__ */ _(
|
|
107
|
+
}), /* @__PURE__ */ _(i, { entries: [
|
|
108
108
|
{
|
|
109
109
|
key: "changed",
|
|
110
|
-
value:
|
|
110
|
+
value: o.length > 0 ? o.join(", ") : "(no field diff)"
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
key: "before",
|
|
114
|
-
value: b(
|
|
114
|
+
value: b(t.prev)
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
key: "after",
|
|
118
|
-
value: b(
|
|
118
|
+
value: b(t.next)
|
|
119
119
|
}
|
|
120
|
-
] })] }, `${
|
|
120
|
+
] })] }, `${t.at}-${a}`);
|
|
121
121
|
})
|
|
122
122
|
] });
|
|
123
123
|
};
|
package/dist/panels/traces.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useDocumentVisible as e } from "../useDocumentVisible.js";
|
|
2
|
+
import { ChevronDown as t } from "../components/icons.js";
|
|
3
3
|
import { useInspectToken as n } from "../inspectAuth.js";
|
|
4
4
|
import { fetchInspect as r } from "../inspectFetch.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useDevtoolsStrings as i } from "../strings.js";
|
|
6
6
|
import { useEffect as a, useState as o } from "react";
|
|
7
7
|
import { useFrameworkRuntimes as s } from "@voltro/client";
|
|
8
8
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
@@ -11,8 +11,8 @@ var d = 4e3, f = async (e, t, n = !1) => {
|
|
|
11
11
|
if (e === "") return null;
|
|
12
12
|
let i = await r(`${e}/_voltro/inspect/traces${n ? "?includeBackground=1" : ""}`, t);
|
|
13
13
|
return i !== null && Array.isArray(i.traces) ? i : null;
|
|
14
|
-
}, p = [], m = (
|
|
15
|
-
let
|
|
14
|
+
}, p = [], m = (t, r = !1) => {
|
|
15
|
+
let i = s(), c = e(), l = n(), u = i.names.join(","), [m, h] = o(p), g = t && c;
|
|
16
16
|
return a(() => {
|
|
17
17
|
if (!g) {
|
|
18
18
|
h(p);
|
|
@@ -20,34 +20,34 @@ var d = 4e3, f = async (e, t, n = !1) => {
|
|
|
20
20
|
}
|
|
21
21
|
let e = u === "" ? [] : u.split(",").map((e) => ({
|
|
22
22
|
name: e,
|
|
23
|
-
baseUrl:
|
|
23
|
+
baseUrl: i.get(e).inspectBaseUrl
|
|
24
24
|
})).filter((e) => e.baseUrl !== "");
|
|
25
25
|
if (e.length === 0) {
|
|
26
26
|
h(p);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
let
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
29
|
+
let t = !1, n = async () => {
|
|
30
|
+
let n = await Promise.all(e.map((e) => f(e.baseUrl, l, r)));
|
|
31
|
+
if (t) return;
|
|
32
32
|
let i = [];
|
|
33
|
-
|
|
33
|
+
n.forEach((t, n) => {
|
|
34
34
|
if (t !== null) for (let r of t.traces) i.push({
|
|
35
35
|
apiName: e[n].name,
|
|
36
36
|
trace: r
|
|
37
37
|
});
|
|
38
38
|
}), h(i);
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
let a = setInterval(
|
|
40
|
+
n();
|
|
41
|
+
let a = setInterval(n, d);
|
|
42
42
|
return () => {
|
|
43
|
-
|
|
43
|
+
t = !0, clearInterval(a);
|
|
44
44
|
};
|
|
45
45
|
}, [
|
|
46
|
-
|
|
46
|
+
i,
|
|
47
47
|
u,
|
|
48
48
|
g,
|
|
49
49
|
l,
|
|
50
|
-
|
|
50
|
+
r
|
|
51
51
|
]), m;
|
|
52
52
|
}, h = (e) => e < 1 ? "<1ms" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(2)}s`, g = (e) => {
|
|
53
53
|
let t = new Map(e.map((e) => [e.spanId, e])), n = /* @__PURE__ */ new Map(), r = (e, i) => {
|
|
@@ -65,55 +65,55 @@ var d = 4e3, f = async (e, t, n = !1) => {
|
|
|
65
65
|
} catch {
|
|
66
66
|
return String(e);
|
|
67
67
|
}
|
|
68
|
-
}, v = (e) => typeof e.attributes["db.query.text"] == "string" || e.name.startsWith("sql."), y = ({ trace:
|
|
69
|
-
let
|
|
68
|
+
}, v = (e) => typeof e.attributes["db.query.text"] == "string" || e.name.startsWith("sql."), y = ({ trace: e }) => {
|
|
69
|
+
let n = i().traces, r = g(e.spans), a = new Set(e.spans.map((e) => e.spanId)), o = e.spans.some((e) => e.parentSpanId !== null && !a.has(e.parentSpanId)), s = e.spans.length > 0 && e.spans.every(v), d = e.durationMs > 0 ? e.durationMs : 1;
|
|
70
70
|
return /* @__PURE__ */ u("div", {
|
|
71
71
|
className: "vdt-trace-detail",
|
|
72
72
|
children: [
|
|
73
73
|
/* @__PURE__ */ u("div", {
|
|
74
74
|
className: "vdt-trace-summary",
|
|
75
|
-
children: [/* @__PURE__ */ l("span", { children:
|
|
76
|
-
|
|
75
|
+
children: [/* @__PURE__ */ l("span", { children: n.spans(e.spanCount) }), e.kind === "subscription" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("span", { children: [
|
|
76
|
+
e.deliveryCount ?? 0,
|
|
77
77
|
" ",
|
|
78
|
-
|
|
79
|
-
] }),
|
|
80
|
-
|
|
78
|
+
n.delivery(e.deliveryCount ?? 0)
|
|
79
|
+
] }), e.lastDeliveryMs === void 0 ? null : /* @__PURE__ */ u("span", { children: [
|
|
80
|
+
n.lastDelivery,
|
|
81
81
|
": ",
|
|
82
|
-
/* @__PURE__ */ l("strong", { children: h(
|
|
82
|
+
/* @__PURE__ */ l("strong", { children: h(e.lastDeliveryMs) })
|
|
83
83
|
] })] }) : /* @__PURE__ */ u("span", { children: [
|
|
84
|
-
|
|
84
|
+
n.duration,
|
|
85
85
|
": ",
|
|
86
|
-
/* @__PURE__ */ l("strong", { children: h(
|
|
86
|
+
/* @__PURE__ */ l("strong", { children: h(e.durationMs) })
|
|
87
87
|
] })]
|
|
88
88
|
}),
|
|
89
89
|
/* @__PURE__ */ u("code", {
|
|
90
90
|
className: "vdt-trace-id",
|
|
91
|
-
children: ["trace ",
|
|
91
|
+
children: ["trace ", e.traceId]
|
|
92
92
|
}),
|
|
93
93
|
o || s ? /* @__PURE__ */ l("p", {
|
|
94
94
|
className: "vdt-trace-context",
|
|
95
|
-
children: o ?
|
|
95
|
+
children: o ? n.missingParents : n.sqlWithoutCaller
|
|
96
96
|
}) : null,
|
|
97
|
-
|
|
98
|
-
let a = Math.min(
|
|
97
|
+
e.spans.map((i) => {
|
|
98
|
+
let a = Math.min(r.get(i.spanId) ?? 0, 8), o = Math.max(0, Math.min(100, (i.startMs - e.startMs) / d * 100)), s = Math.max(0, Math.min(100 - o, Math.max(1.5, i.durationMs / d * 100))), f = Object.entries(i.attributes);
|
|
99
99
|
return /* @__PURE__ */ u("details", {
|
|
100
100
|
className: "vdt-trace-span",
|
|
101
|
-
open:
|
|
102
|
-
"data-status":
|
|
101
|
+
open: i.status === "error",
|
|
102
|
+
"data-status": i.status,
|
|
103
103
|
children: [/* @__PURE__ */ u("summary", {
|
|
104
104
|
className: "vdt-trace-span-head",
|
|
105
105
|
style: { paddingLeft: 8 + a * 8 },
|
|
106
106
|
children: [
|
|
107
107
|
/* @__PURE__ */ u("span", {
|
|
108
108
|
className: "vdt-trace-span-label",
|
|
109
|
-
children: [/* @__PURE__ */ l(
|
|
109
|
+
children: [/* @__PURE__ */ l(t, { className: "vdt-trace-chevron" }), /* @__PURE__ */ l("code", {
|
|
110
110
|
className: "vdt-trace-span-name",
|
|
111
|
-
children:
|
|
111
|
+
children: i.name
|
|
112
112
|
})]
|
|
113
113
|
}),
|
|
114
114
|
/* @__PURE__ */ l("span", {
|
|
115
115
|
className: "vdt-trace-span-duration",
|
|
116
|
-
children: h(
|
|
116
|
+
children: h(i.durationMs)
|
|
117
117
|
}),
|
|
118
118
|
/* @__PURE__ */ l("span", {
|
|
119
119
|
className: "vdt-trace-span-bar",
|
|
@@ -130,28 +130,28 @@ var d = 4e3, f = async (e, t, n = !1) => {
|
|
|
130
130
|
/* @__PURE__ */ u("div", {
|
|
131
131
|
className: "vdt-trace-span-meta",
|
|
132
132
|
children: [
|
|
133
|
-
/* @__PURE__ */ l("span", { children:
|
|
134
|
-
/* @__PURE__ */ l("span", { children:
|
|
135
|
-
/* @__PURE__ */ l("code", { children:
|
|
133
|
+
/* @__PURE__ */ l("span", { children: i.kind }),
|
|
134
|
+
/* @__PURE__ */ l("span", { children: i.status }),
|
|
135
|
+
/* @__PURE__ */ l("code", { children: i.spanId })
|
|
136
136
|
]
|
|
137
137
|
}),
|
|
138
|
-
|
|
138
|
+
i.statusMessage ? /* @__PURE__ */ l("p", {
|
|
139
139
|
className: "vdt-trace-span-message",
|
|
140
|
-
children:
|
|
140
|
+
children: i.statusMessage
|
|
141
141
|
}) : null,
|
|
142
142
|
f.length > 0 ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
|
|
143
143
|
className: "vdt-trace-attributes-label",
|
|
144
|
-
children:
|
|
144
|
+
children: n.attributes
|
|
145
145
|
}), /* @__PURE__ */ l("dl", {
|
|
146
146
|
className: "vdt-trace-attributes",
|
|
147
147
|
children: f.map(([e, t]) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("dt", { children: e }), /* @__PURE__ */ l("dd", { children: /* @__PURE__ */ l("pre", { children: _(t) }) })] }, e))
|
|
148
148
|
})] }) : /* @__PURE__ */ l("p", {
|
|
149
149
|
className: "vdt-trace-no-attributes",
|
|
150
|
-
children:
|
|
150
|
+
children: n.noAttributes
|
|
151
151
|
})
|
|
152
152
|
]
|
|
153
153
|
})]
|
|
154
|
-
},
|
|
154
|
+
}, i.spanId);
|
|
155
155
|
})
|
|
156
156
|
]
|
|
157
157
|
});
|
package/dist/panels/webhooks.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useDocumentVisible as e } from "../useDocumentVisible.js";
|
|
2
|
+
import { Badge as t, Button as n, Card as r, CardBody as i, Empty as a, SectionTitle as o } from "../components/primitives.js";
|
|
3
|
+
import { Webhook as s } from "../components/icons.js";
|
|
4
4
|
import { useInspectToken as c } from "../inspectAuth.js";
|
|
5
5
|
import { fetchInspect as l } from "../inspectFetch.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useDevtoolsStrings as u } from "../strings.js";
|
|
7
7
|
import { useEffect as d, useState as f } from "react";
|
|
8
8
|
import { DEFAULT_WEBHOOK_INSPECT_LIST as p, MAX_WEBHOOK_INSPECT_OFFSET as m, isWebhookEventActivity as h, isWebhookInspectActivityStatus as g, isWebhookInspectPagination as _, useFrameworkRuntimes as v, webhookInspectListRequest as y } from "@voltro/client";
|
|
9
9
|
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
@@ -34,45 +34,45 @@ var C = {
|
|
|
34
34
|
} catch {
|
|
35
35
|
return null;
|
|
36
36
|
}
|
|
37
|
-
}, E = (
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
}, E = (t, n, r = !0) => {
|
|
38
|
+
let i = e(), a = c(), o = r && i && t !== "", [s, l] = f(0), u = JSON.stringify([
|
|
39
|
+
t,
|
|
40
|
+
a,
|
|
41
|
+
n.targetOffset,
|
|
42
|
+
n.deliveryOffset,
|
|
43
|
+
n.limit,
|
|
44
|
+
s
|
|
45
45
|
]), [p, m] = f();
|
|
46
46
|
d(() => {
|
|
47
|
-
if (!
|
|
48
|
-
let
|
|
49
|
-
let
|
|
47
|
+
if (!o) return;
|
|
48
|
+
let e = !1, r, i = async () => {
|
|
49
|
+
let o;
|
|
50
50
|
try {
|
|
51
|
-
|
|
51
|
+
o = await T(t, a, n);
|
|
52
52
|
} catch {
|
|
53
|
-
|
|
53
|
+
o = null;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
key:
|
|
57
|
-
data:
|
|
58
|
-
}), r = setTimeout(() => void
|
|
55
|
+
e || (m({
|
|
56
|
+
key: u,
|
|
57
|
+
data: o
|
|
58
|
+
}), r = setTimeout(() => void i(), w));
|
|
59
59
|
};
|
|
60
|
-
return
|
|
61
|
-
|
|
60
|
+
return i(), () => {
|
|
61
|
+
e = !0, clearTimeout(r);
|
|
62
62
|
};
|
|
63
63
|
}, [
|
|
64
|
-
|
|
64
|
+
t,
|
|
65
|
+
o,
|
|
65
66
|
a,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
t
|
|
67
|
+
u,
|
|
68
|
+
n
|
|
69
69
|
]);
|
|
70
|
-
let h = p?.key ===
|
|
70
|
+
let h = p?.key === u ? p : void 0;
|
|
71
71
|
return {
|
|
72
|
-
data:
|
|
73
|
-
pending:
|
|
74
|
-
failed:
|
|
75
|
-
refresh: () =>
|
|
72
|
+
data: o && h?.data ? h.data : C,
|
|
73
|
+
pending: o && h === void 0,
|
|
74
|
+
failed: o && h?.data === null,
|
|
75
|
+
refresh: () => l((e) => e + 1)
|
|
76
76
|
};
|
|
77
77
|
}, D = {
|
|
78
78
|
pending: "neutral",
|
|
@@ -83,58 +83,58 @@ var C = {
|
|
|
83
83
|
}, O = (e) => {
|
|
84
84
|
let t = new Date(e), n = (e) => e < 10 ? `0${e}` : String(e);
|
|
85
85
|
return `${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;
|
|
86
|
-
}, k = (
|
|
87
|
-
let
|
|
86
|
+
}, k = (t) => {
|
|
87
|
+
let n = v(), r = e(), i = c(), a = JSON.stringify(n.names.map((e) => n.get(e).inspectBaseUrl)), o = t && r, s = JSON.stringify([
|
|
88
|
+
a,
|
|
88
89
|
i,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
]), [s, l] = f();
|
|
90
|
+
o
|
|
91
|
+
]), [l, u] = f();
|
|
92
92
|
return d(() => {
|
|
93
|
-
if (!
|
|
94
|
-
let e = JSON.parse(
|
|
93
|
+
if (!o) return;
|
|
94
|
+
let e = JSON.parse(a);
|
|
95
95
|
if (e.length === 0) {
|
|
96
|
-
|
|
97
|
-
key:
|
|
96
|
+
u({
|
|
97
|
+
key: s,
|
|
98
98
|
count: 0
|
|
99
99
|
});
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
if (e.some((e) => e === "")) {
|
|
103
|
-
|
|
104
|
-
key:
|
|
103
|
+
u({
|
|
104
|
+
key: s,
|
|
105
105
|
count: null
|
|
106
106
|
});
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
let t = !1, n,
|
|
110
|
-
let
|
|
109
|
+
let t = !1, n, r = async () => {
|
|
110
|
+
let a = await Promise.all(e.map((e) => T(e, i)));
|
|
111
111
|
if (t) return;
|
|
112
|
-
let
|
|
113
|
-
|
|
114
|
-
key:
|
|
115
|
-
count:
|
|
116
|
-
}), n = setTimeout(() => void
|
|
112
|
+
let o = a.some((e) => e === null) ? void 0 : a.reduce((e, t) => e + t.outgoing.length + t.incoming.length + t.eventActivity.reduce((e, t) => e + t.targets, 0), 0);
|
|
113
|
+
u({
|
|
114
|
+
key: s,
|
|
115
|
+
count: o !== void 0 && Number.isSafeInteger(o) ? o : null
|
|
116
|
+
}), n = setTimeout(() => void r(), w);
|
|
117
117
|
};
|
|
118
|
-
return
|
|
118
|
+
return r(), () => {
|
|
119
119
|
t = !0, clearTimeout(n);
|
|
120
120
|
};
|
|
121
121
|
}, [
|
|
122
|
-
|
|
123
|
-
r,
|
|
122
|
+
o,
|
|
124
123
|
i,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
a,
|
|
125
|
+
s
|
|
126
|
+
]), o && l?.key === s ? l.count : null;
|
|
127
|
+
}, A = ({ apiName: e, baseUrl: a }) => {
|
|
128
|
+
let [c, l] = f({
|
|
129
129
|
...p,
|
|
130
130
|
includeActivity: !1
|
|
131
|
-
}), d = E(
|
|
132
|
-
return !(h.outgoing.length + h.incoming.length + h.targets.length + h.deliveries.length > 0) && !d.pending && !d.failed &&
|
|
131
|
+
}), d = E(a, c), h = d.data, g = u().webhooks;
|
|
132
|
+
return !(h.outgoing.length + h.incoming.length + h.targets.length + h.deliveries.length > 0) && !d.pending && !d.failed && c.targetOffset === 0 && c.deliveryOffset === 0 ? null : /* @__PURE__ */ x("div", {
|
|
133
133
|
className: "vdt:space-y-4",
|
|
134
|
-
children: /* @__PURE__ */ S(
|
|
135
|
-
Icon:
|
|
136
|
-
children:
|
|
137
|
-
}), /* @__PURE__ */ S(
|
|
134
|
+
children: /* @__PURE__ */ S(r, { children: [/* @__PURE__ */ x(o, {
|
|
135
|
+
Icon: s,
|
|
136
|
+
children: e
|
|
137
|
+
}), /* @__PURE__ */ S(i, { children: [
|
|
138
138
|
h.outgoing.length > 0 ? /* @__PURE__ */ S("div", {
|
|
139
139
|
className: "vdt:mb-4",
|
|
140
140
|
children: [/* @__PURE__ */ x("div", {
|
|
@@ -149,7 +149,7 @@ var C = {
|
|
|
149
149
|
className: "vdt:text-foreground vdt:font-mono",
|
|
150
150
|
children: e.id
|
|
151
151
|
}),
|
|
152
|
-
/* @__PURE__ */ S(
|
|
152
|
+
/* @__PURE__ */ S(t, {
|
|
153
153
|
tone: "neutral",
|
|
154
154
|
children: ["v", e.version]
|
|
155
155
|
}),
|
|
@@ -175,14 +175,14 @@ var C = {
|
|
|
175
175
|
className: "vdt:text-foreground vdt:font-mono",
|
|
176
176
|
children: e.path
|
|
177
177
|
}),
|
|
178
|
-
e.provider ? /* @__PURE__ */ x(
|
|
178
|
+
e.provider ? /* @__PURE__ */ x(t, {
|
|
179
179
|
tone: "info",
|
|
180
180
|
children: e.provider
|
|
181
181
|
}) : null,
|
|
182
|
-
e.signatureConfigured ? /* @__PURE__ */ x(
|
|
182
|
+
e.signatureConfigured ? /* @__PURE__ */ x(t, {
|
|
183
183
|
tone: "success",
|
|
184
184
|
children: g.signed
|
|
185
|
-
}) : /* @__PURE__ */ x(
|
|
185
|
+
}) : /* @__PURE__ */ x(t, {
|
|
186
186
|
tone: "warning",
|
|
187
187
|
children: g.unsigned
|
|
188
188
|
})
|
|
@@ -198,7 +198,7 @@ var C = {
|
|
|
198
198
|
}), /* @__PURE__ */ x("div", {
|
|
199
199
|
className: "vdt:space-y-1",
|
|
200
200
|
children: h.targets.map((e) => {
|
|
201
|
-
let
|
|
201
|
+
let n = h.outgoing.find((t) => t.id === e.event)?.version ?? e.payloadVersion, r = e.payloadVersion === n ? "current" : e.payloadVersion < n ? "behind" : "ahead";
|
|
202
202
|
return /* @__PURE__ */ S("div", {
|
|
203
203
|
className: "vdt-record-row vdt:text-sm",
|
|
204
204
|
children: [
|
|
@@ -214,31 +214,31 @@ var C = {
|
|
|
214
214
|
className: "vdt:text-foreground vdt:text-xs vdt:truncate vdt:max-w-72",
|
|
215
215
|
children: e.url
|
|
216
216
|
}),
|
|
217
|
-
e.active ? /* @__PURE__ */ x(
|
|
217
|
+
e.active ? /* @__PURE__ */ x(t, {
|
|
218
218
|
tone: "success",
|
|
219
219
|
children: g.active
|
|
220
|
-
}) : /* @__PURE__ */ x(
|
|
220
|
+
}) : /* @__PURE__ */ x(t, {
|
|
221
221
|
tone: "warning",
|
|
222
222
|
children: g.paused
|
|
223
223
|
}),
|
|
224
|
-
r === "current" ? /* @__PURE__ */ S(
|
|
224
|
+
r === "current" ? /* @__PURE__ */ S(t, {
|
|
225
225
|
tone: "neutral",
|
|
226
226
|
children: ["v", e.payloadVersion]
|
|
227
|
-
}) : r === "behind" ? /* @__PURE__ */ S(
|
|
227
|
+
}) : r === "behind" ? /* @__PURE__ */ S(t, {
|
|
228
228
|
tone: "warning",
|
|
229
229
|
children: [
|
|
230
230
|
"v",
|
|
231
231
|
e.payloadVersion,
|
|
232
232
|
" ← current v",
|
|
233
|
-
|
|
233
|
+
n
|
|
234
234
|
]
|
|
235
|
-
}) : /* @__PURE__ */ S(
|
|
235
|
+
}) : /* @__PURE__ */ S(t, {
|
|
236
236
|
tone: "danger",
|
|
237
237
|
children: [
|
|
238
238
|
"v",
|
|
239
239
|
e.payloadVersion,
|
|
240
240
|
" → ahead of v",
|
|
241
|
-
|
|
241
|
+
n
|
|
242
242
|
]
|
|
243
243
|
})
|
|
244
244
|
]
|
|
@@ -262,7 +262,7 @@ var C = {
|
|
|
262
262
|
className: "vdt:text-foreground vdt:min-w-32 vdt:truncate",
|
|
263
263
|
children: e.event
|
|
264
264
|
}),
|
|
265
|
-
/* @__PURE__ */ x(
|
|
265
|
+
/* @__PURE__ */ x(t, {
|
|
266
266
|
tone: D[e.status],
|
|
267
267
|
children: e.status
|
|
268
268
|
}),
|
|
@@ -294,7 +294,7 @@ var C = {
|
|
|
294
294
|
children: g.pageError
|
|
295
295
|
}),
|
|
296
296
|
["targets", "deliveries"].map((e) => {
|
|
297
|
-
let t = e === "targets" ?
|
|
297
|
+
let t = e === "targets" ? c.targetOffset : c.deliveryOffset, r = h.pagination[e], i = h[e].length;
|
|
298
298
|
return /* @__PURE__ */ S("nav", {
|
|
299
299
|
"aria-label": e === "targets" ? g.targetPages : g.deliveryPages,
|
|
300
300
|
"aria-busy": d.pending,
|
|
@@ -306,33 +306,33 @@ var C = {
|
|
|
306
306
|
className: "vdt:min-w-0 vdt:flex-1 vdt:text-sm vdt:text-foreground-muted vdt:tabular-nums",
|
|
307
307
|
children: [d.pending ? g.pageLoading : e === "targets" ? g.targetPages : g.deliveryPages, !d.pending && !d.failed && /* @__PURE__ */ S(b, { children: [" · ", g.pageRange(i === 0 ? 0 : t + 1, i === 0 ? 0 : t + i)] })]
|
|
308
308
|
}),
|
|
309
|
-
/* @__PURE__ */ x(
|
|
309
|
+
/* @__PURE__ */ x(n, {
|
|
310
310
|
className: "vdt:min-h-11",
|
|
311
311
|
variant: "outline",
|
|
312
312
|
disabled: d.pending || t === 0,
|
|
313
|
-
onClick: () =>
|
|
313
|
+
onClick: () => l((t) => ({
|
|
314
314
|
...t,
|
|
315
315
|
[e === "targets" ? "targetOffset" : "deliveryOffset"]: 0
|
|
316
316
|
})),
|
|
317
317
|
children: g.pageFirst
|
|
318
318
|
}),
|
|
319
|
-
/* @__PURE__ */ x(
|
|
319
|
+
/* @__PURE__ */ x(n, {
|
|
320
320
|
className: "vdt:min-h-11",
|
|
321
321
|
variant: "outline",
|
|
322
322
|
disabled: d.pending || t === 0,
|
|
323
|
-
onClick: () =>
|
|
323
|
+
onClick: () => l((n) => ({
|
|
324
324
|
...n,
|
|
325
|
-
[e === "targets" ? "targetOffset" : "deliveryOffset"]: Math.max(0, t -
|
|
325
|
+
[e === "targets" ? "targetOffset" : "deliveryOffset"]: Math.max(0, t - c.limit)
|
|
326
326
|
})),
|
|
327
327
|
children: g.pagePrevious
|
|
328
328
|
}),
|
|
329
|
-
/* @__PURE__ */ x(
|
|
329
|
+
/* @__PURE__ */ x(n, {
|
|
330
330
|
className: "vdt:min-h-11",
|
|
331
331
|
variant: "outline",
|
|
332
|
-
disabled: d.pending || d.failed || !
|
|
333
|
-
onClick: () =>
|
|
332
|
+
disabled: d.pending || d.failed || !r.hasMore || t > m - c.limit,
|
|
333
|
+
onClick: () => l((n) => ({
|
|
334
334
|
...n,
|
|
335
|
-
[e === "targets" ? "targetOffset" : "deliveryOffset"]: t +
|
|
335
|
+
[e === "targets" ? "targetOffset" : "deliveryOffset"]: t + c.limit
|
|
336
336
|
})),
|
|
337
337
|
children: g.pageNext
|
|
338
338
|
})
|
|
@@ -344,7 +344,7 @@ var C = {
|
|
|
344
344
|
children: [/* @__PURE__ */ x("p", {
|
|
345
345
|
className: "vdt:min-w-0 vdt:flex-1 vdt:text-xs vdt:text-foreground-muted",
|
|
346
346
|
children: g.pageLiveHint
|
|
347
|
-
}), /* @__PURE__ */ x(
|
|
347
|
+
}), /* @__PURE__ */ x(n, {
|
|
348
348
|
className: "vdt:min-h-11",
|
|
349
349
|
variant: "ghost",
|
|
350
350
|
disabled: d.pending,
|
|
@@ -357,8 +357,8 @@ var C = {
|
|
|
357
357
|
] })] })
|
|
358
358
|
});
|
|
359
359
|
}, j = () => {
|
|
360
|
-
let e = v(),
|
|
361
|
-
return e.names.length === 0 ? /* @__PURE__ */ x(
|
|
360
|
+
let e = v(), t = u().webhooks;
|
|
361
|
+
return e.names.length === 0 ? /* @__PURE__ */ x(a, { children: t.empty }) : /* @__PURE__ */ x("div", {
|
|
362
362
|
className: "vdt:space-y-4 vdt:p-3",
|
|
363
363
|
children: e.names.map((t) => {
|
|
364
364
|
let n = e.get(t);
|