@shaferllc/keel 0.66.0 → 0.74.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/AGENTS.md +169 -0
- package/README.md +44 -6
- package/bin/keel-mcp.mjs +9 -0
- package/dist/api/api.config.stub +9 -0
- package/dist/api/config.d.ts +13 -0
- package/dist/api/config.js +14 -0
- package/dist/api/index.d.ts +16 -0
- package/dist/api/index.js +13 -0
- package/dist/api/provider.d.ts +10 -0
- package/dist/api/provider.js +17 -0
- package/dist/api/query.d.ts +35 -0
- package/dist/api/query.js +42 -0
- package/dist/api/resource.d.ts +91 -0
- package/dist/api/resource.js +188 -0
- package/dist/core/application.d.ts +5 -5
- package/dist/core/application.js +8 -2
- package/dist/core/cache.d.ts +81 -5
- package/dist/core/cache.js +188 -23
- package/dist/core/cli/stubs.d.ts +26 -0
- package/dist/core/cli/stubs.js +225 -0
- package/dist/core/console-prompt.d.ts +79 -0
- package/dist/core/console-prompt.js +239 -0
- package/dist/core/console-ui.d.ts +96 -0
- package/dist/core/console-ui.js +187 -0
- package/dist/core/console.d.ts +188 -0
- package/dist/core/console.js +395 -0
- package/dist/core/database.d.ts +70 -1
- package/dist/core/database.js +174 -15
- package/dist/core/env.d.ts +96 -0
- package/dist/core/env.js +140 -0
- package/dist/core/events.d.ts +129 -5
- package/dist/core/events.js +165 -7
- package/dist/core/health.d.ts +141 -0
- package/dist/core/health.js +226 -0
- package/dist/core/helpers.d.ts +9 -3
- package/dist/core/helpers.js +11 -3
- package/dist/core/http/kernel.d.ts +2 -0
- package/dist/core/http/kernel.js +48 -0
- package/dist/core/http/router.d.ts +5 -5
- package/dist/core/http/router.js +5 -5
- package/dist/core/i18n.d.ts +162 -0
- package/dist/core/i18n.js +472 -0
- package/dist/core/index.d.ts +39 -13
- package/dist/core/index.js +19 -6
- package/dist/core/instrumentation.d.ts +113 -0
- package/dist/core/instrumentation.js +52 -0
- package/dist/core/lock.d.ts +139 -0
- package/dist/core/lock.js +215 -0
- package/dist/core/logger.d.ts +89 -4
- package/dist/core/logger.js +167 -22
- package/dist/core/mail.d.ts +128 -7
- package/dist/core/mail.js +264 -16
- package/dist/core/notification.js +10 -1
- package/dist/core/package.d.ts +120 -0
- package/dist/core/package.js +169 -0
- package/dist/core/pages.d.ts +108 -0
- package/dist/core/pages.js +199 -0
- package/dist/core/queue.d.ts +134 -9
- package/dist/core/queue.js +325 -14
- package/dist/core/repl.d.ts +33 -0
- package/dist/core/repl.js +88 -0
- package/dist/core/scheduler.js +6 -0
- package/dist/core/social.d.ts +4 -4
- package/dist/core/social.js +4 -4
- package/dist/core/storage.d.ts +159 -6
- package/dist/core/storage.js +299 -7
- package/dist/core/telemetry.d.ts +208 -0
- package/dist/core/telemetry.js +383 -0
- package/dist/core/template.d.ts +2 -3
- package/dist/core/template.js +2 -3
- package/dist/core/testing.d.ts +170 -1
- package/dist/core/testing.js +504 -2
- package/dist/db/d1.js +13 -0
- package/dist/db/pg.d.ts +13 -0
- package/dist/db/pg.js +46 -4
- package/dist/mcp/server.d.ts +19 -0
- package/dist/mcp/server.js +355 -0
- package/dist/openapi/config.d.ts +28 -0
- package/dist/openapi/config.js +25 -0
- package/dist/openapi/doc.d.ts +40 -0
- package/dist/openapi/doc.js +20 -0
- package/dist/openapi/export.d.ts +8 -0
- package/dist/openapi/export.js +19 -0
- package/dist/openapi/gate.d.ts +15 -0
- package/dist/openapi/gate.js +27 -0
- package/dist/openapi/index.d.ts +19 -0
- package/dist/openapi/index.js +15 -0
- package/dist/openapi/openapi.config.stub +29 -0
- package/dist/openapi/provider.d.ts +18 -0
- package/dist/openapi/provider.js +35 -0
- package/dist/openapi/routes.d.ts +9 -0
- package/dist/openapi/routes.js +23 -0
- package/dist/openapi/spec.d.ts +23 -0
- package/dist/openapi/spec.js +132 -0
- package/dist/openapi/ui.d.ts +8 -0
- package/dist/openapi/ui.js +31 -0
- package/dist/openapi/zod.d.ts +12 -0
- package/dist/openapi/zod.js +46 -0
- package/dist/watch/config.d.ts +33 -0
- package/dist/watch/config.js +38 -0
- package/dist/watch/entry.d.ts +53 -0
- package/dist/watch/entry.js +105 -0
- package/dist/watch/gate.d.ts +20 -0
- package/dist/watch/gate.js +32 -0
- package/dist/watch/index.d.ts +21 -0
- package/dist/watch/index.js +17 -0
- package/dist/watch/migration.d.ts +7 -0
- package/dist/watch/migration.js +20 -0
- package/dist/watch/provider.d.ts +22 -0
- package/dist/watch/provider.js +58 -0
- package/dist/watch/prune.d.ts +11 -0
- package/dist/watch/prune.js +20 -0
- package/dist/watch/recorder.d.ts +24 -0
- package/dist/watch/recorder.js +39 -0
- package/dist/watch/routes.d.ts +13 -0
- package/dist/watch/routes.js +55 -0
- package/dist/watch/store.d.ts +54 -0
- package/dist/watch/store.js +158 -0
- package/dist/watch/ui/dist/watch.css +1 -0
- package/dist/watch/ui/dist/watch.js +555 -0
- package/dist/watch/ui-shell.d.ts +12 -0
- package/dist/watch/ui-shell.js +24 -0
- package/dist/watch/watch.config.stub +47 -0
- package/dist/watch/watchers.d.ts +12 -0
- package/dist/watch/watchers.js +156 -0
- package/docs/ai-manifest.json +3206 -0
- package/docs/ai.md +128 -0
- package/docs/api-resources.md +118 -0
- package/docs/architecture.md +331 -0
- package/docs/authentication.md +453 -0
- package/docs/authorization.md +167 -0
- package/docs/broadcasting.md +137 -0
- package/docs/broker.md +500 -0
- package/docs/cache.md +558 -0
- package/docs/configuration.md +385 -0
- package/docs/console.md +536 -0
- package/docs/container.md +467 -0
- package/docs/controllers.md +265 -0
- package/docs/cors.md +51 -0
- package/docs/database.md +631 -0
- package/docs/debugging.md +129 -0
- package/docs/decorators.md +127 -0
- package/docs/errors.md +395 -0
- package/docs/events.md +496 -0
- package/docs/examples/architecture-app.ts +27 -0
- package/docs/examples/authentication.ts +61 -0
- package/docs/examples/authorization.ts +79 -0
- package/docs/examples/broadcasting.ts +60 -0
- package/docs/examples/broker-cache-validate.ts +34 -0
- package/docs/examples/broker-fault-tolerance.ts +29 -0
- package/docs/examples/broker-middleware.ts +27 -0
- package/docs/examples/broker.ts +203 -0
- package/docs/examples/cache.ts +222 -0
- package/docs/examples/configuration.ts +121 -0
- package/docs/examples/console.ts +134 -0
- package/docs/examples/container.ts +134 -0
- package/docs/examples/controllers.ts +86 -0
- package/docs/examples/database.ts +208 -0
- package/docs/examples/debugging.ts +41 -0
- package/docs/examples/decorators.ts +40 -0
- package/docs/examples/errors.ts +121 -0
- package/docs/examples/events.ts +204 -0
- package/docs/examples/factories.ts +84 -0
- package/docs/examples/hashing.ts +71 -0
- package/docs/examples/health.ts +94 -0
- package/docs/examples/helpers.ts +171 -0
- package/docs/examples/hooks.ts +54 -0
- package/docs/examples/i18n.ts +117 -0
- package/docs/examples/inertia.ts +81 -0
- package/docs/examples/locks.ts +120 -0
- package/docs/examples/logger.ts +166 -0
- package/docs/examples/mail.ts +263 -0
- package/docs/examples/middleware.ts +119 -0
- package/docs/examples/migrations.ts +126 -0
- package/docs/examples/models.ts +239 -0
- package/docs/examples/notification.ts +124 -0
- package/docs/examples/pages.ts +82 -0
- package/docs/examples/providers.ts +123 -0
- package/docs/examples/queues.ts +254 -0
- package/docs/examples/rate-limiting.ts +42 -0
- package/docs/examples/redis.ts +99 -0
- package/docs/examples/request-response.ts +197 -0
- package/docs/examples/routing.ts +186 -0
- package/docs/examples/scheduling.ts +62 -0
- package/docs/examples/sessions.ts +102 -0
- package/docs/examples/static-files.ts +63 -0
- package/docs/examples/storage.ts +132 -0
- package/docs/examples/telemetry.ts +127 -0
- package/docs/examples/templates.ts +58 -0
- package/docs/examples/testing.ts +215 -0
- package/docs/examples/transformer.ts +141 -0
- package/docs/examples/transformers.ts +49 -0
- package/docs/examples/url-builder.ts +86 -0
- package/docs/examples/validation.ts +102 -0
- package/docs/examples/views.tsx +62 -0
- package/docs/examples/vite.ts +106 -0
- package/docs/factories.md +166 -0
- package/docs/getting-started.md +290 -0
- package/docs/hashing.md +259 -0
- package/docs/health.md +225 -0
- package/docs/helpers.md +347 -0
- package/docs/hono.md +186 -0
- package/docs/hooks.md +118 -0
- package/docs/i18n.md +302 -0
- package/docs/inertia.md +241 -0
- package/docs/locks.md +323 -0
- package/docs/logger.md +436 -0
- package/docs/mail.md +751 -0
- package/docs/middleware.md +425 -0
- package/docs/migrations.md +476 -0
- package/docs/models.md +810 -0
- package/docs/notifications.md +474 -0
- package/docs/openapi.md +111 -0
- package/docs/packages.md +118 -0
- package/docs/pages.md +217 -0
- package/docs/providers.md +363 -0
- package/docs/queues.md +679 -0
- package/docs/rate-limiting.md +155 -0
- package/docs/redis.md +178 -0
- package/docs/request-response.md +953 -0
- package/docs/routing.md +804 -0
- package/docs/scheduling.md +110 -0
- package/docs/security.md +85 -0
- package/docs/sessions.md +354 -0
- package/docs/social-auth.md +174 -0
- package/docs/static-files.md +211 -0
- package/docs/storage.md +452 -0
- package/docs/telemetry.md +263 -0
- package/docs/templates.md +314 -0
- package/docs/testing.md +376 -0
- package/docs/transformers.md +381 -0
- package/docs/url-builder.md +295 -0
- package/docs/validation.md +288 -0
- package/docs/views.md +267 -0
- package/docs/vite.md +434 -0
- package/docs/watch.md +118 -0
- package/llms-full.txt +19816 -0
- package/llms.txt +127 -0
- package/package.json +42 -7
|
@@ -0,0 +1,555 @@
|
|
|
1
|
+
var Q, d, Se, H, pe, He, Pe, ee, j, M, Ee, ie, ne, _e, O = {}, z = [], Be = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, G = Array.isArray;
|
|
2
|
+
function S(t, e) {
|
|
3
|
+
for (var n in e) t[n] = e[n];
|
|
4
|
+
return t;
|
|
5
|
+
}
|
|
6
|
+
function se(t) {
|
|
7
|
+
t && t.parentNode && t.parentNode.removeChild(t);
|
|
8
|
+
}
|
|
9
|
+
function Oe(t, e, n) {
|
|
10
|
+
var o, i, _, s = {};
|
|
11
|
+
for (_ in e) _ == "key" ? o = e[_] : _ == "ref" ? i = e[_] : s[_] = e[_];
|
|
12
|
+
if (arguments.length > 2 && (s.children = arguments.length > 3 ? Q.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (_ in t.defaultProps) s[_] === void 0 && (s[_] = t.defaultProps[_]);
|
|
13
|
+
return q(t, s, o, i, null);
|
|
14
|
+
}
|
|
15
|
+
function q(t, e, n, o, i) {
|
|
16
|
+
var _ = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++Se, __i: -1, __u: 0 };
|
|
17
|
+
return i == null && d.vnode != null && d.vnode(_), _;
|
|
18
|
+
}
|
|
19
|
+
function T(t) {
|
|
20
|
+
return t.children;
|
|
21
|
+
}
|
|
22
|
+
function W(t, e) {
|
|
23
|
+
this.props = t, this.context = e;
|
|
24
|
+
}
|
|
25
|
+
function N(t, e) {
|
|
26
|
+
if (e == null) return t.__ ? N(t.__, t.__i + 1) : null;
|
|
27
|
+
for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
|
|
28
|
+
return typeof t.type == "function" ? N(t) : null;
|
|
29
|
+
}
|
|
30
|
+
function ze(t) {
|
|
31
|
+
if (t.__P && t.__d) {
|
|
32
|
+
var e = t.__v, n = e.__e, o = [], i = [], _ = S({}, e);
|
|
33
|
+
_.__v = e.__v + 1, d.vnode && d.vnode(_), ce(t.__P, _, e, t.__n, t.__P.namespaceURI, 32 & e.__u ? [n] : null, o, n ?? N(e), !!(32 & e.__u), i), _.__v = e.__v, _.__.__k[_.__i] = _, De(o, _, i), e.__e = e.__ = null, _.__e != n && Le(_);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function Le(t) {
|
|
37
|
+
if ((t = t.__) != null && t.__c != null) return t.__e = t.__c.base = null, t.__k.some(function(e) {
|
|
38
|
+
if (e != null && e.__e != null) return t.__e = t.__c.base = e.__e;
|
|
39
|
+
}), Le(t);
|
|
40
|
+
}
|
|
41
|
+
function fe(t) {
|
|
42
|
+
(!t.__d && (t.__d = !0) && H.push(t) && !J.__r++ || pe != d.debounceRendering) && ((pe = d.debounceRendering) || He)(J);
|
|
43
|
+
}
|
|
44
|
+
function J() {
|
|
45
|
+
try {
|
|
46
|
+
for (var t, e = 1; H.length; ) H.length > e && H.sort(Pe), t = H.shift(), e = H.length, ze(t);
|
|
47
|
+
} finally {
|
|
48
|
+
H.length = J.__r = 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function Ne(t, e, n, o, i, _, s, l, u, c, p) {
|
|
52
|
+
var m, r, h, v, C, k, b, f = o && o.__k || z, w = e.length;
|
|
53
|
+
for (u = Je(n, e, f, u, w), m = 0; m < w; m++) (h = n.__k[m]) != null && (r = h.__i != -1 && f[h.__i] || O, h.__i = m, k = ce(t, h, r, i, _, s, l, u, c, p), v = h.__e, h.ref && r.ref != h.ref && (r.ref && ae(r.ref, null, h), p.push(h.ref, h.__c || v, h)), C == null && v != null && (C = v), (b = !!(4 & h.__u)) || r.__k === h.__k ? (u = Te(h, u, t, b), b && r.__e && (r.__e = null)) : typeof h.type == "function" && k !== void 0 ? u = k : v && (u = v.nextSibling), h.__u &= -7);
|
|
54
|
+
return n.__e = C, u;
|
|
55
|
+
}
|
|
56
|
+
function Je(t, e, n, o, i) {
|
|
57
|
+
var _, s, l, u, c, p = n.length, m = p, r = 0;
|
|
58
|
+
for (t.__k = new Array(i), _ = 0; _ < i; _++) (s = e[_]) != null && typeof s != "boolean" && typeof s != "function" ? (typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ? s = t.__k[_] = q(null, s, null, null, null) : G(s) ? s = t.__k[_] = q(T, { children: s }, null, null, null) : s.constructor === void 0 && s.__b > 0 ? s = t.__k[_] = q(s.type, s.props, s.key, s.ref ? s.ref : null, s.__v) : t.__k[_] = s, u = _ + r, s.__ = t, s.__b = t.__b + 1, l = null, (c = s.__i = Ve(s, n, u, m)) != -1 && (m--, (l = n[c]) && (l.__u |= 2)), l == null || l.__v == null ? (c == -1 && (i > p ? r-- : i < p && r++), typeof s.type != "function" && (s.__u |= 4)) : c != u && (c == u - 1 ? r-- : c == u + 1 ? r++ : (c > u ? r-- : r++, s.__u |= 4))) : t.__k[_] = null;
|
|
59
|
+
if (m) for (_ = 0; _ < p; _++) (l = n[_]) != null && (2 & l.__u) == 0 && (l.__e == o && (o = N(l)), Ue(l, l));
|
|
60
|
+
return o;
|
|
61
|
+
}
|
|
62
|
+
function Te(t, e, n, o) {
|
|
63
|
+
var i, _;
|
|
64
|
+
if (typeof t.type == "function") {
|
|
65
|
+
for (i = t.__k, _ = 0; i && _ < i.length; _++) i[_] && (i[_].__ = t, e = Te(i[_], e, n, o));
|
|
66
|
+
return e;
|
|
67
|
+
}
|
|
68
|
+
t.__e != e && (o && (e && t.type && !e.parentNode && (e = N(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
|
|
69
|
+
do
|
|
70
|
+
e = e && e.nextSibling;
|
|
71
|
+
while (e != null && e.nodeType == 8);
|
|
72
|
+
return e;
|
|
73
|
+
}
|
|
74
|
+
function Ve(t, e, n, o) {
|
|
75
|
+
var i, _, s, l = t.key, u = t.type, c = e[n], p = c != null && (2 & c.__u) == 0;
|
|
76
|
+
if (c === null && l == null || p && l == c.key && u == c.type) return n;
|
|
77
|
+
if (o > (p ? 1 : 0)) {
|
|
78
|
+
for (i = n - 1, _ = n + 1; i >= 0 || _ < e.length; ) if ((c = e[s = i >= 0 ? i-- : _++]) != null && (2 & c.__u) == 0 && l == c.key && u == c.type) return s;
|
|
79
|
+
}
|
|
80
|
+
return -1;
|
|
81
|
+
}
|
|
82
|
+
function de(t, e, n) {
|
|
83
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || Be.test(e) ? n : n + "px";
|
|
84
|
+
}
|
|
85
|
+
function R(t, e, n, o, i) {
|
|
86
|
+
var _, s;
|
|
87
|
+
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
88
|
+
else {
|
|
89
|
+
if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || de(t.style, e, "");
|
|
90
|
+
if (n) for (e in n) o && n[e] == o[e] || de(t.style, e, n[e]);
|
|
91
|
+
}
|
|
92
|
+
else if (e[0] == "o" && e[1] == "n") _ = e != (e = e.replace(Ee, "$1")), s = e.toLowerCase(), e = s in t || e == "onFocusOut" || e == "onFocusIn" ? s.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + _] = n, n ? o ? n[M] = o[M] : (n[M] = ie, t.addEventListener(e, _ ? _e : ne, _)) : t.removeEventListener(e, _ ? _e : ne, _);
|
|
93
|
+
else {
|
|
94
|
+
if (i == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
95
|
+
else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
|
|
96
|
+
t[e] = n ?? "";
|
|
97
|
+
break e;
|
|
98
|
+
} catch {
|
|
99
|
+
}
|
|
100
|
+
typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function me(t) {
|
|
104
|
+
return function(e) {
|
|
105
|
+
if (this.l) {
|
|
106
|
+
var n = this.l[e.type + t];
|
|
107
|
+
if (e[j] == null) e[j] = ie++;
|
|
108
|
+
else if (e[j] < n[M]) return;
|
|
109
|
+
return n(d.event ? d.event(e) : e);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function ce(t, e, n, o, i, _, s, l, u, c) {
|
|
114
|
+
var p, m, r, h, v, C, k, b, f, w, A, P, D, he, F, Z, x = e.type;
|
|
115
|
+
if (e.constructor !== void 0) return null;
|
|
116
|
+
128 & n.__u && (u = !!(32 & n.__u), _ = [l = e.__e = n.__e]), (p = d.__b) && p(e);
|
|
117
|
+
e: if (typeof x == "function") {
|
|
118
|
+
m = s.length;
|
|
119
|
+
try {
|
|
120
|
+
if (f = e.props, w = x.prototype && x.prototype.render, A = (p = x.contextType) && o[p.__c], P = p ? A ? A.props.value : p.__ : o, n.__c ? b = (r = e.__c = n.__c).__ = r.__E : (w ? e.__c = r = new x(f, P) : (e.__c = r = new W(f, P), r.constructor = x, r.render = Qe), A && A.sub(r), r.state || (r.state = {}), r.__n = o, h = r.__d = !0, r.__h = [], r._sb = []), w && r.__s == null && (r.__s = r.state), w && x.getDerivedStateFromProps != null && (r.__s == r.state && (r.__s = S({}, r.__s)), S(r.__s, x.getDerivedStateFromProps(f, r.__s))), v = r.props, C = r.state, r.__v = e, h) w && x.getDerivedStateFromProps == null && r.componentWillMount != null && r.componentWillMount(), w && r.componentDidMount != null && r.__h.push(r.componentDidMount);
|
|
121
|
+
else {
|
|
122
|
+
if (w && x.getDerivedStateFromProps == null && f !== v && r.componentWillReceiveProps != null && r.componentWillReceiveProps(f, P), e.__v == n.__v || !r.__e && r.shouldComponentUpdate != null && r.shouldComponentUpdate(f, r.__s, P) === !1) {
|
|
123
|
+
e.__v != n.__v && (r.props = f, r.state = r.__s, r.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(L) {
|
|
124
|
+
L && (L.__ = e);
|
|
125
|
+
}), z.push.apply(r.__h, r._sb), r._sb = [], r.__h.length && s.push(r);
|
|
126
|
+
break e;
|
|
127
|
+
}
|
|
128
|
+
r.componentWillUpdate != null && r.componentWillUpdate(f, r.__s, P), w && r.componentDidUpdate != null && r.__h.push(function() {
|
|
129
|
+
r.componentDidUpdate(v, C, k);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
if (r.context = P, r.props = f, r.__P = t, r.__e = !1, D = d.__r, he = 0, w) r.state = r.__s, r.__d = !1, D && D(e), p = r.render(r.props, r.state, r.context), z.push.apply(r.__h, r._sb), r._sb = [];
|
|
133
|
+
else do
|
|
134
|
+
r.__d = !1, D && D(e), p = r.render(r.props, r.state, r.context), r.state = r.__s;
|
|
135
|
+
while (r.__d && ++he < 25);
|
|
136
|
+
r.state = r.__s, r.getChildContext != null && (o = S(S({}, o), r.getChildContext())), w && !h && r.getSnapshotBeforeUpdate != null && (k = r.getSnapshotBeforeUpdate(v, C)), F = p != null && p.type === T && p.key == null ? Me(p.props.children) : p, l = Ne(t, G(F) ? F : [F], e, n, o, i, _, s, l, u, c), r.base = e.__e, e.__u &= -161, r.__h.length && s.push(r), b && (r.__E = r.__ = null);
|
|
137
|
+
} catch (L) {
|
|
138
|
+
if (s.length = m, e.__v = null, u || _ != null) {
|
|
139
|
+
if (L.then) {
|
|
140
|
+
for (e.__u |= u ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
141
|
+
_ != null && (_[_.indexOf(l)] = null), e.__e = l;
|
|
142
|
+
} else if (_ != null) for (Z = _.length; Z--; ) se(_[Z]);
|
|
143
|
+
} else e.__e = n.__e;
|
|
144
|
+
e.__k == null && (e.__k = n.__k || []), L.then || Ae(e), d.__e(L, e, n);
|
|
145
|
+
}
|
|
146
|
+
} else _ == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = Ke(n.__e, e, n, o, i, _, s, u, c);
|
|
147
|
+
return (p = d.diffed) && p(e), 128 & e.__u ? void 0 : l;
|
|
148
|
+
}
|
|
149
|
+
function Ae(t) {
|
|
150
|
+
t && (t.__c && (t.__c.__e = !0), t.__k && t.__k.some(Ae));
|
|
151
|
+
}
|
|
152
|
+
function De(t, e, n) {
|
|
153
|
+
for (var o = 0; o < n.length; o++) ae(n[o], n[++o], n[++o]);
|
|
154
|
+
d.__c && d.__c(e, t), t.some(function(i) {
|
|
155
|
+
try {
|
|
156
|
+
t = i.__h, i.__h = [], t.some(function(_) {
|
|
157
|
+
_.call(i);
|
|
158
|
+
});
|
|
159
|
+
} catch (_) {
|
|
160
|
+
d.__e(_, i.__v);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function Me(t) {
|
|
165
|
+
return typeof t != "object" || t == null || t.__b > 0 ? t : G(t) ? t.map(Me) : t.constructor !== void 0 ? null : S({}, t);
|
|
166
|
+
}
|
|
167
|
+
function Ke(t, e, n, o, i, _, s, l, u) {
|
|
168
|
+
var c, p, m, r, h, v, C, k = n.props || O, b = e.props, f = e.type;
|
|
169
|
+
if (f == "svg" ? i = "http://www.w3.org/2000/svg" : f == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), _ != null) {
|
|
170
|
+
for (c = 0; c < _.length; c++) if ((h = _[c]) && "setAttribute" in h == !!f && (f ? h.localName == f : h.nodeType == 3)) {
|
|
171
|
+
t = h, _[c] = null;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (t == null) {
|
|
176
|
+
if (f == null) return document.createTextNode(b);
|
|
177
|
+
t = document.createElementNS(i, f, b.is && b), l && (d.__m && d.__m(e, _), l = !1), _ = null;
|
|
178
|
+
}
|
|
179
|
+
if (f == null) k === b || l && t.data == b || (t.data = b);
|
|
180
|
+
else {
|
|
181
|
+
if (_ = f == "textarea" && b.defaultValue != null ? null : _ && Q.call(t.childNodes), !l && _ != null) for (k = {}, c = 0; c < t.attributes.length; c++) k[(h = t.attributes[c]).name] = h.value;
|
|
182
|
+
for (c in k) h = k[c], c == "dangerouslySetInnerHTML" ? m = h : c == "children" || c in b || c == "value" && "defaultValue" in b || c == "checked" && "defaultChecked" in b || R(t, c, null, h, i);
|
|
183
|
+
for (c in b) h = b[c], c == "children" ? r = h : c == "dangerouslySetInnerHTML" ? p = h : c == "value" ? v = h : c == "checked" ? C = h : l && typeof h != "function" || k[c] === h || R(t, c, h, k[c], i);
|
|
184
|
+
if (p) l || m && (p.__html == m.__html || p.__html == t.innerHTML) || (t.innerHTML = p.__html), e.__k = [];
|
|
185
|
+
else if (m && (t.innerHTML = ""), Ne(e.type == "template" ? t.content : t, G(r) ? r : [r], e, n, o, f == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, _, s, _ ? _[0] : n.__k && N(n, 0), l, u), _ != null) for (c = _.length; c--; ) se(_[c]);
|
|
186
|
+
l && f != "textarea" || (c = "value", f == "progress" && v == null ? t.removeAttribute("value") : v != null && (v !== t[c] || f == "progress" && !v || f == "option" && v != k[c]) && R(t, c, v, k[c], i), c = "checked", C != null && C != t[c] && R(t, c, C, k[c], i));
|
|
187
|
+
}
|
|
188
|
+
return t;
|
|
189
|
+
}
|
|
190
|
+
function ae(t, e, n) {
|
|
191
|
+
try {
|
|
192
|
+
if (typeof t == "function") {
|
|
193
|
+
var o = typeof t.__u == "function";
|
|
194
|
+
o && t.__u(), o && e == null || (t.__u = t(e));
|
|
195
|
+
} else t.current = e;
|
|
196
|
+
} catch (i) {
|
|
197
|
+
d.__e(i, n);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function Ue(t, e, n) {
|
|
201
|
+
var o, i;
|
|
202
|
+
if (d.unmount && d.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || ae(o, null, e)), (o = t.__c) != null) {
|
|
203
|
+
if (o.componentWillUnmount) try {
|
|
204
|
+
o.componentWillUnmount();
|
|
205
|
+
} catch (_) {
|
|
206
|
+
d.__e(_, e);
|
|
207
|
+
}
|
|
208
|
+
o.base = o.__P = o.__n = null;
|
|
209
|
+
}
|
|
210
|
+
if (o = t.__k) for (i = 0; i < o.length; i++) o[i] && Ue(o[i], e, n || typeof t.type != "function");
|
|
211
|
+
n || se(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
212
|
+
}
|
|
213
|
+
function Qe(t, e, n) {
|
|
214
|
+
return this.constructor(t, n);
|
|
215
|
+
}
|
|
216
|
+
function Ge(t, e, n) {
|
|
217
|
+
var o, i, _, s;
|
|
218
|
+
e == document && (e = document.documentElement), d.__ && d.__(t, e), i = (o = !1) ? null : e.__k, _ = [], s = [], ce(e, t = e.__k = Oe(T, null, [t]), i || O, O, e.namespaceURI, i ? null : e.firstChild ? Q.call(e.childNodes) : null, _, i ? i.__e : e.firstChild, o, s), De(_, t, s), t.props.children = null;
|
|
219
|
+
}
|
|
220
|
+
Q = z.slice, d = { __e: function(t, e, n, o) {
|
|
221
|
+
for (var i, _, s; e = e.__; ) if ((i = e.__c) && !i.__) try {
|
|
222
|
+
if ((_ = i.constructor) && _.getDerivedStateFromError != null && (i.setState(_.getDerivedStateFromError(t)), s = i.__d), i.componentDidCatch != null && (i.componentDidCatch(t, o || {}), s = i.__d), s) return i.__E = i;
|
|
223
|
+
} catch (l) {
|
|
224
|
+
t = l;
|
|
225
|
+
}
|
|
226
|
+
throw t;
|
|
227
|
+
} }, Se = 0, W.prototype.setState = function(t, e) {
|
|
228
|
+
var n;
|
|
229
|
+
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = S({}, this.state), typeof t == "function" && (t = t(S({}, n), this.props)), t && S(n, t), t != null && this.__v && (e && this._sb.push(e), fe(this));
|
|
230
|
+
}, W.prototype.forceUpdate = function(t) {
|
|
231
|
+
this.__v && (this.__e = !0, t && this.__h.push(t), fe(this));
|
|
232
|
+
}, W.prototype.render = T, H = [], He = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Pe = function(t, e) {
|
|
233
|
+
return t.__v.__b - e.__v.__b;
|
|
234
|
+
}, J.__r = 0, ee = Math.random().toString(8), j = "__d" + ee, M = "__a" + ee, Ee = /(PointerCapture)$|Capture$/i, ie = 0, ne = me(!1), _e = me(!0);
|
|
235
|
+
var Xe = 0;
|
|
236
|
+
function a(t, e, n, o, i, _) {
|
|
237
|
+
e || (e = {});
|
|
238
|
+
var s, l, u = e;
|
|
239
|
+
if ("ref" in u) for (l in u = {}, e) l == "ref" ? s = e[l] : u[l] = e[l];
|
|
240
|
+
var c = { type: t, props: u, key: n, ref: s, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Xe, __i: -1, __u: 0, __source: i, __self: _ };
|
|
241
|
+
if (typeof t == "function" && (s = t.defaultProps)) for (l in s) u[l] === void 0 && (u[l] = s[l]);
|
|
242
|
+
return d.vnode && d.vnode(c), c;
|
|
243
|
+
}
|
|
244
|
+
var U, y, te, ve, re = 0, Ie = [], g = d, ye = g.__b, ge = g.__r, be = g.diffed, ke = g.__c, $e = g.unmount, we = g.__;
|
|
245
|
+
function ue(t, e) {
|
|
246
|
+
g.__h && g.__h(y, t, re || e), re = 0;
|
|
247
|
+
var n = y.__H || (y.__H = { __: [], __h: [] });
|
|
248
|
+
return t >= n.__.length && n.__.push({}), n.__[t];
|
|
249
|
+
}
|
|
250
|
+
function E(t) {
|
|
251
|
+
return re = 1, Ye(Re, t);
|
|
252
|
+
}
|
|
253
|
+
function Ye(t, e, n) {
|
|
254
|
+
var o = ue(U++, 2);
|
|
255
|
+
if (o.t = t, !o.__c && (o.__ = [Re(void 0, e), function(l) {
|
|
256
|
+
var u = o.__N ? o.__N[0] : o.__[0], c = o.t(u, l);
|
|
257
|
+
u !== c && (o.__N = [c, o.__[1]], o.__c.setState({}));
|
|
258
|
+
}], o.__c = y, !y.__f)) {
|
|
259
|
+
var i = function(l, u, c) {
|
|
260
|
+
if (!o.__c.__H) return !0;
|
|
261
|
+
var p = !1, m = o.__c.props !== l;
|
|
262
|
+
if (o.__c.__H.__.some(function(h) {
|
|
263
|
+
if (h.__N) {
|
|
264
|
+
p = !0;
|
|
265
|
+
var v = h.__[0];
|
|
266
|
+
h.__ = h.__N, h.__N = void 0, v !== h.__[0] && (m = !0);
|
|
267
|
+
}
|
|
268
|
+
}), _) {
|
|
269
|
+
var r = _.call(this, l, u, c);
|
|
270
|
+
return p ? r || m : r;
|
|
271
|
+
}
|
|
272
|
+
return !p || m;
|
|
273
|
+
};
|
|
274
|
+
y.__f = !0;
|
|
275
|
+
var _ = y.shouldComponentUpdate, s = y.componentWillUpdate;
|
|
276
|
+
y.componentWillUpdate = function(l, u, c) {
|
|
277
|
+
if (this.__e) {
|
|
278
|
+
var p = _;
|
|
279
|
+
_ = void 0, i(l, u, c), _ = p;
|
|
280
|
+
}
|
|
281
|
+
s && s.call(this, l, u, c);
|
|
282
|
+
}, y.shouldComponentUpdate = i;
|
|
283
|
+
}
|
|
284
|
+
return o.__N || o.__;
|
|
285
|
+
}
|
|
286
|
+
function X(t, e) {
|
|
287
|
+
var n = ue(U++, 3);
|
|
288
|
+
!g.__s && Fe(n.__H, e) && (n.__ = t, n.u = e, y.__H.__h.push(n));
|
|
289
|
+
}
|
|
290
|
+
function Ze(t, e) {
|
|
291
|
+
var n = ue(U++, 7);
|
|
292
|
+
return Fe(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
|
|
293
|
+
}
|
|
294
|
+
function et() {
|
|
295
|
+
for (var t; t = Ie.shift(); ) {
|
|
296
|
+
var e = t.__H;
|
|
297
|
+
if (t.__P && e) try {
|
|
298
|
+
e.__h.some(B), e.__h.some(oe), e.__h = [];
|
|
299
|
+
} catch (n) {
|
|
300
|
+
e.__h = [], g.__e(n, t.__v);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
g.__b = function(t) {
|
|
305
|
+
y = null, ye && ye(t);
|
|
306
|
+
}, g.__ = function(t, e) {
|
|
307
|
+
t && e.__k && e.__k.__m && (t.__m = e.__k.__m), we && we(t, e);
|
|
308
|
+
}, g.__r = function(t) {
|
|
309
|
+
ge && ge(t), U = 0;
|
|
310
|
+
var e = (y = t.__c).__H;
|
|
311
|
+
e && (te === y ? (e.__h = [], y.__h = [], e.__.some(function(n) {
|
|
312
|
+
n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
|
|
313
|
+
})) : (e.__h.some(B), e.__h.some(oe), e.__h = [], U = 0)), te = y;
|
|
314
|
+
}, g.diffed = function(t) {
|
|
315
|
+
be && be(t);
|
|
316
|
+
var e = t.__c;
|
|
317
|
+
e && e.__H && (e.__H.__h.length && (Ie.push(e) !== 1 && ve === g.requestAnimationFrame || ((ve = g.requestAnimationFrame) || tt)(et)), e.__H.__.some(function(n) {
|
|
318
|
+
n.u && (n.__H = n.u, n.u = void 0);
|
|
319
|
+
})), te = y = null;
|
|
320
|
+
}, g.__c = function(t, e) {
|
|
321
|
+
e.some(function(n) {
|
|
322
|
+
try {
|
|
323
|
+
n.__h.some(B), n.__h = n.__h.filter(function(o) {
|
|
324
|
+
return !o.__ || oe(o);
|
|
325
|
+
});
|
|
326
|
+
} catch (o) {
|
|
327
|
+
e.some(function(i) {
|
|
328
|
+
i.__h && (i.__h = []);
|
|
329
|
+
}), e = [], g.__e(o, n.__v);
|
|
330
|
+
}
|
|
331
|
+
}), ke && ke(t, e);
|
|
332
|
+
}, g.unmount = function(t) {
|
|
333
|
+
$e && $e(t);
|
|
334
|
+
var e, n = t.__c;
|
|
335
|
+
n && n.__H && (n.__H.__.some(function(o) {
|
|
336
|
+
try {
|
|
337
|
+
B(o);
|
|
338
|
+
} catch (i) {
|
|
339
|
+
e = i;
|
|
340
|
+
}
|
|
341
|
+
}), n.__H = void 0, e && g.__e(e, n.__v));
|
|
342
|
+
};
|
|
343
|
+
var Ce = typeof requestAnimationFrame == "function";
|
|
344
|
+
function tt(t) {
|
|
345
|
+
var e, n = function() {
|
|
346
|
+
clearTimeout(o), Ce && cancelAnimationFrame(e), setTimeout(t);
|
|
347
|
+
}, o = setTimeout(n, 35);
|
|
348
|
+
Ce && (e = requestAnimationFrame(n));
|
|
349
|
+
}
|
|
350
|
+
function B(t) {
|
|
351
|
+
var e = y, n = t.__c;
|
|
352
|
+
typeof n == "function" && (t.__c = void 0, n()), y = e;
|
|
353
|
+
}
|
|
354
|
+
function oe(t) {
|
|
355
|
+
var e = y;
|
|
356
|
+
t.__c = t.__(), y = e;
|
|
357
|
+
}
|
|
358
|
+
function Fe(t, e) {
|
|
359
|
+
return !t || t.length !== e.length || e.some(function(n, o) {
|
|
360
|
+
return n !== t[o];
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
function Re(t, e) {
|
|
364
|
+
return typeof e == "function" ? e(t) : e;
|
|
365
|
+
}
|
|
366
|
+
const Y = window.__WATCH__, V = {
|
|
367
|
+
request: "Requests",
|
|
368
|
+
query: "Queries",
|
|
369
|
+
exception: "Exceptions",
|
|
370
|
+
log: "Logs",
|
|
371
|
+
mail: "Mail",
|
|
372
|
+
job: "Jobs",
|
|
373
|
+
notification: "Notifications",
|
|
374
|
+
cache: "Cache",
|
|
375
|
+
event: "Events",
|
|
376
|
+
schedule: "Schedule"
|
|
377
|
+
};
|
|
378
|
+
async function K(t, e) {
|
|
379
|
+
const n = await fetch(`${Y.api}${t}`, e);
|
|
380
|
+
if (!n.ok) throw new Error(`${n.status}`);
|
|
381
|
+
return n.json();
|
|
382
|
+
}
|
|
383
|
+
function xe() {
|
|
384
|
+
const t = location.hash.replace(/^#\/?/, ""), [e, n] = t.split("/");
|
|
385
|
+
if (e === "entry" && n) return { type: nt(), uuid: n };
|
|
386
|
+
const [o, i] = t.split("?"), _ = new URLSearchParams(i ?? "").get("tag") ?? void 0;
|
|
387
|
+
return { type: o || Y.types[0], ..._ ? { tag: _ } : {} };
|
|
388
|
+
}
|
|
389
|
+
let je = Y.types[0];
|
|
390
|
+
function nt() {
|
|
391
|
+
return je;
|
|
392
|
+
}
|
|
393
|
+
function _t() {
|
|
394
|
+
const [t, e] = E(xe());
|
|
395
|
+
return X(() => {
|
|
396
|
+
const n = () => e(xe());
|
|
397
|
+
return addEventListener("hashchange", n), () => removeEventListener("hashchange", n);
|
|
398
|
+
}, []), t.type && (je = t.type), t;
|
|
399
|
+
}
|
|
400
|
+
function I(t, e) {
|
|
401
|
+
location.hash = `#/${t}${e ? `?tag=${encodeURIComponent(e)}` : ""}`;
|
|
402
|
+
}
|
|
403
|
+
function qe(t) {
|
|
404
|
+
location.hash = `#/entry/${t}`;
|
|
405
|
+
}
|
|
406
|
+
function $(t) {
|
|
407
|
+
return t == null ? "" : String(t);
|
|
408
|
+
}
|
|
409
|
+
function le(t) {
|
|
410
|
+
var n;
|
|
411
|
+
const e = t.content;
|
|
412
|
+
switch (t.type) {
|
|
413
|
+
case "request":
|
|
414
|
+
return `${$(e.method)} ${$(e.path)} → ${$(e.status)}`;
|
|
415
|
+
case "query":
|
|
416
|
+
return $(e.sql);
|
|
417
|
+
case "exception":
|
|
418
|
+
return `${$(e.class)}: ${$(e.message)}`;
|
|
419
|
+
case "log":
|
|
420
|
+
return `[${$(e.level)}] ${$(e.message)}`;
|
|
421
|
+
case "mail":
|
|
422
|
+
return `${$(e.subject)} → ${$(e.to)}`;
|
|
423
|
+
case "job":
|
|
424
|
+
return `${$(e.job)} · ${$(e.status)}`;
|
|
425
|
+
case "notification":
|
|
426
|
+
return `${$(e.notification)} → ${((n = e.channels) == null ? void 0 : n.join(", ")) ?? ""}`;
|
|
427
|
+
case "cache":
|
|
428
|
+
return `${e.hit ? "hit" : "miss"} ${$(e.key)}`;
|
|
429
|
+
case "event":
|
|
430
|
+
return $(e.name);
|
|
431
|
+
case "schedule":
|
|
432
|
+
return $(e.task);
|
|
433
|
+
default:
|
|
434
|
+
return t.type;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
function We(t) {
|
|
438
|
+
const e = t.content;
|
|
439
|
+
return e.durationMs != null ? `${e.durationMs} ms` : "";
|
|
440
|
+
}
|
|
441
|
+
function rt(t) {
|
|
442
|
+
const e = Math.round((Date.now() - t) / 1e3);
|
|
443
|
+
return e < 60 ? `${e}s ago` : e < 3600 ? `${Math.round(e / 60)}m ago` : `${Math.round(e / 3600)}h ago`;
|
|
444
|
+
}
|
|
445
|
+
function ot() {
|
|
446
|
+
const t = _t(), [e, n] = E({}), [o, i] = E(!0), _ = () => K("/counts").then((l) => n(l.counts)).catch(() => {
|
|
447
|
+
});
|
|
448
|
+
X(() => {
|
|
449
|
+
if (_(), !o) return;
|
|
450
|
+
const l = setInterval(_, 3e3);
|
|
451
|
+
return () => clearInterval(l);
|
|
452
|
+
}, [o]);
|
|
453
|
+
const s = async () => {
|
|
454
|
+
confirm("Delete all recorded entries?") && (await K("/entries", { method: "DELETE" }).catch(() => {
|
|
455
|
+
}), _(), location.hash = `#/${t.type}?_=${Date.now()}`);
|
|
456
|
+
};
|
|
457
|
+
return /* @__PURE__ */ a("div", { class: "app", children: [
|
|
458
|
+
/* @__PURE__ */ a("aside", { class: "sidebar", children: [
|
|
459
|
+
/* @__PURE__ */ a("div", { class: "brand", children: [
|
|
460
|
+
/* @__PURE__ */ a("span", { class: "anchor", children: "⚓" }),
|
|
461
|
+
" Keel Watch"
|
|
462
|
+
] }),
|
|
463
|
+
/* @__PURE__ */ a("nav", { children: Y.types.map((l) => /* @__PURE__ */ a(
|
|
464
|
+
"button",
|
|
465
|
+
{
|
|
466
|
+
class: `tab ${t.type === l && !t.uuid ? "active" : ""}`,
|
|
467
|
+
onClick: () => I(l),
|
|
468
|
+
children: [
|
|
469
|
+
/* @__PURE__ */ a("span", { children: V[l] ?? l }),
|
|
470
|
+
/* @__PURE__ */ a("span", { class: "count", children: e[l] ?? 0 })
|
|
471
|
+
]
|
|
472
|
+
},
|
|
473
|
+
l
|
|
474
|
+
)) }),
|
|
475
|
+
/* @__PURE__ */ a("div", { class: "controls", children: [
|
|
476
|
+
/* @__PURE__ */ a("label", { class: "live", children: [
|
|
477
|
+
/* @__PURE__ */ a("input", { type: "checkbox", checked: o, onChange: (l) => i(l.target.checked) }),
|
|
478
|
+
"Live"
|
|
479
|
+
] }),
|
|
480
|
+
/* @__PURE__ */ a("button", { class: "clear", onClick: s, children: "Clear" })
|
|
481
|
+
] })
|
|
482
|
+
] }),
|
|
483
|
+
/* @__PURE__ */ a("main", { class: "content", children: t.uuid ? /* @__PURE__ */ a(it, { uuid: t.uuid }) : /* @__PURE__ */ a(lt, { route: t, live: o }) })
|
|
484
|
+
] });
|
|
485
|
+
}
|
|
486
|
+
function lt({ route: t, live: e }) {
|
|
487
|
+
const [n, o] = E([]), [i, _] = E(!0), s = Ze(() => {
|
|
488
|
+
const l = new URLSearchParams({ type: t.type, limit: "100" });
|
|
489
|
+
return t.tag && l.set("tag", t.tag), l.toString();
|
|
490
|
+
}, [t.type, t.tag]);
|
|
491
|
+
return X(() => {
|
|
492
|
+
let l = !0;
|
|
493
|
+
const u = () => K(`/entries?${s}`).then((p) => l && o(p.entries)).catch(() => {
|
|
494
|
+
}).finally(() => l && _(!1));
|
|
495
|
+
if (_(!0), u(), !e) return () => l = !1;
|
|
496
|
+
const c = setInterval(u, 2e3);
|
|
497
|
+
return () => {
|
|
498
|
+
l = !1, clearInterval(c);
|
|
499
|
+
};
|
|
500
|
+
}, [s, e]), /* @__PURE__ */ a(T, { children: [
|
|
501
|
+
/* @__PURE__ */ a("header", { class: "head", children: [
|
|
502
|
+
/* @__PURE__ */ a("h1", { children: V[t.type] ?? t.type }),
|
|
503
|
+
t.tag && /* @__PURE__ */ a("button", { class: "chip removable", onClick: () => I(t.type), children: [
|
|
504
|
+
t.tag,
|
|
505
|
+
" ✕"
|
|
506
|
+
] })
|
|
507
|
+
] }),
|
|
508
|
+
i && !n.length ? /* @__PURE__ */ a("p", { class: "empty", children: "Loading…" }) : n.length ? /* @__PURE__ */ a("table", { class: "list", children: /* @__PURE__ */ a("tbody", { children: n.map((l) => /* @__PURE__ */ a("tr", { onClick: () => qe(l.uuid), children: [
|
|
509
|
+
/* @__PURE__ */ a("td", { class: "summary", children: [
|
|
510
|
+
/* @__PURE__ */ a("span", { class: "text", children: le(l) }),
|
|
511
|
+
/* @__PURE__ */ a("span", { class: "tags", children: l.tags.slice(0, 4).map((u) => /* @__PURE__ */ a(
|
|
512
|
+
"span",
|
|
513
|
+
{
|
|
514
|
+
class: "chip",
|
|
515
|
+
onClick: (c) => {
|
|
516
|
+
c.stopPropagation(), I(t.type, u);
|
|
517
|
+
},
|
|
518
|
+
children: u
|
|
519
|
+
},
|
|
520
|
+
u
|
|
521
|
+
)) })
|
|
522
|
+
] }),
|
|
523
|
+
/* @__PURE__ */ a("td", { class: "metacol", children: We(l) }),
|
|
524
|
+
/* @__PURE__ */ a("td", { class: "timecol", children: rt(l.createdAt) })
|
|
525
|
+
] }, l.uuid)) }) }) : /* @__PURE__ */ a("p", { class: "empty", children: "No entries yet. Exercise your app and they'll appear here." })
|
|
526
|
+
] });
|
|
527
|
+
}
|
|
528
|
+
function it({ uuid: t }) {
|
|
529
|
+
const [e, n] = E(null), [o, i] = E(!1);
|
|
530
|
+
if (X(() => {
|
|
531
|
+
n(null), i(!1), K(`/entries/${t}`).then(n).catch(() => i(!0));
|
|
532
|
+
}, [t]), o) return /* @__PURE__ */ a("p", { class: "empty", children: "Entry not found." });
|
|
533
|
+
if (!e) return /* @__PURE__ */ a("p", { class: "empty", children: "Loading…" });
|
|
534
|
+
const { entry: _, related: s } = e;
|
|
535
|
+
return /* @__PURE__ */ a(T, { children: [
|
|
536
|
+
/* @__PURE__ */ a("header", { class: "head", children: [
|
|
537
|
+
/* @__PURE__ */ a("button", { class: "back", onClick: () => I(_.type), children: [
|
|
538
|
+
"← ",
|
|
539
|
+
V[_.type] ?? _.type
|
|
540
|
+
] }),
|
|
541
|
+
/* @__PURE__ */ a("h1", { children: le(_) })
|
|
542
|
+
] }),
|
|
543
|
+
/* @__PURE__ */ a("div", { class: "tags detailtags", children: _.tags.map((l) => /* @__PURE__ */ a("span", { class: "chip", onClick: () => I(_.type, l), children: l }, l)) }),
|
|
544
|
+
/* @__PURE__ */ a("pre", { class: "json", children: JSON.stringify(_.content, null, 2) }),
|
|
545
|
+
s.length > 0 && /* @__PURE__ */ a("section", { class: "related", children: [
|
|
546
|
+
/* @__PURE__ */ a("h2", { children: "In the same batch" }),
|
|
547
|
+
/* @__PURE__ */ a("table", { class: "list", children: /* @__PURE__ */ a("tbody", { children: s.map((l) => /* @__PURE__ */ a("tr", { onClick: () => qe(l.uuid), children: [
|
|
548
|
+
/* @__PURE__ */ a("td", { class: "badge", children: V[l.type] ?? l.type }),
|
|
549
|
+
/* @__PURE__ */ a("td", { class: "summary", children: /* @__PURE__ */ a("span", { class: "text", children: le(l) }) }),
|
|
550
|
+
/* @__PURE__ */ a("td", { class: "timecol", children: We(l) })
|
|
551
|
+
] }, l.uuid)) }) })
|
|
552
|
+
] })
|
|
553
|
+
] });
|
|
554
|
+
}
|
|
555
|
+
Ge(/* @__PURE__ */ a(ot, {}), document.getElementById("app"));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The server-rendered shell for the single-page dashboard. It carries no data —
|
|
3
|
+
* just a mount point, a bit of boot config, and the bundled JS/CSS built by Vite
|
|
4
|
+
* (`npm run build:watch`). Everything else is the SPA talking to the JSON API.
|
|
5
|
+
*/
|
|
6
|
+
export interface ShellOptions {
|
|
7
|
+
/** The dashboard's base path, e.g. "/watch". */
|
|
8
|
+
base: string;
|
|
9
|
+
/** Where the built assets are served, e.g. "/watch/assets". */
|
|
10
|
+
assetsUrl: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function dashboardHtml({ base, assetsUrl }: ShellOptions): string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The server-rendered shell for the single-page dashboard. It carries no data —
|
|
3
|
+
* just a mount point, a bit of boot config, and the bundled JS/CSS built by Vite
|
|
4
|
+
* (`npm run build:watch`). Everything else is the SPA talking to the JSON API.
|
|
5
|
+
*/
|
|
6
|
+
import { ENTRY_TYPES } from "./entry.js";
|
|
7
|
+
export function dashboardHtml({ base, assetsUrl }) {
|
|
8
|
+
const boot = JSON.stringify({ base, api: `${base}/api`, types: ENTRY_TYPES });
|
|
9
|
+
return `<!doctype html>
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="utf-8" />
|
|
13
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
14
|
+
<meta name="robots" content="noindex, nofollow" />
|
|
15
|
+
<title>Keel Watch</title>
|
|
16
|
+
<link rel="stylesheet" href="${assetsUrl}/watch.css" />
|
|
17
|
+
</head>
|
|
18
|
+
<body>
|
|
19
|
+
<div id="app"></div>
|
|
20
|
+
<script>window.__WATCH__ = ${boot};</script>
|
|
21
|
+
<script type="module" src="${assetsUrl}/watch.js"></script>
|
|
22
|
+
</body>
|
|
23
|
+
</html>`;
|
|
24
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { env } from "@shaferllc/keel/core";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Keel Watch — debug dashboard configuration.
|
|
5
|
+
* Published with `keel vendor:publish --tag watch-config`.
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
// Master switch. Keep it off in production unless the gate is locked down.
|
|
9
|
+
enabled: env("WATCH_ENABLED", true),
|
|
10
|
+
|
|
11
|
+
// Where the dashboard mounts: http://localhost:3000/watch
|
|
12
|
+
path: "watch",
|
|
13
|
+
|
|
14
|
+
// "database" persists entries (run `keel migrate`); "memory" is a per-process ring.
|
|
15
|
+
storage: env("WATCH_STORAGE", "database"),
|
|
16
|
+
connection: undefined, // default connection
|
|
17
|
+
table: "watch_entries",
|
|
18
|
+
|
|
19
|
+
// Default API page size, and the memory ring is 10× this.
|
|
20
|
+
limit: 100,
|
|
21
|
+
|
|
22
|
+
// Record this fraction of eligible entries (0–1). Lower it on a busy app.
|
|
23
|
+
sampling: 1,
|
|
24
|
+
|
|
25
|
+
// Queries at or above this many ms are tagged "slow".
|
|
26
|
+
slowQueryMs: 100,
|
|
27
|
+
|
|
28
|
+
// Request paths to never record (the dashboard's own are always skipped).
|
|
29
|
+
ignorePaths: [],
|
|
30
|
+
|
|
31
|
+
// `keel watch:prune` deletes entries older than this.
|
|
32
|
+
retentionHours: 24,
|
|
33
|
+
|
|
34
|
+
// Per-type switches. The noisy ones (cache, event) are off by default.
|
|
35
|
+
watchers: {
|
|
36
|
+
request: true,
|
|
37
|
+
query: true,
|
|
38
|
+
exception: true,
|
|
39
|
+
log: true,
|
|
40
|
+
mail: true,
|
|
41
|
+
job: true,
|
|
42
|
+
notification: true,
|
|
43
|
+
cache: false,
|
|
44
|
+
event: false,
|
|
45
|
+
schedule: true,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The watchers. Each subscribes to one instrumentation seam and turns it into a
|
|
3
|
+
* recorded entry — the whole reason the framework emits those events. None of
|
|
4
|
+
* them patch anything: they're just listeners, so installing Watch changes no
|
|
5
|
+
* behaviour, only observation.
|
|
6
|
+
*
|
|
7
|
+
* `installWatchers` wires up every enabled watcher and hands back a single
|
|
8
|
+
* teardown function (used on shutdown and in tests).
|
|
9
|
+
*/
|
|
10
|
+
import type { Recorder } from "./recorder.js";
|
|
11
|
+
import type { WatchConfig } from "./config.js";
|
|
12
|
+
export declare function installWatchers(recorder: Recorder, config: WatchConfig): () => void;
|