@x12i/memorix-service 3.12.0 → 3.12.3
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/activity-ring.d.ts +22 -1
- package/dist/activity-ring.d.ts.map +1 -1
- package/dist/activity-ring.js +44 -0
- package/dist/activity-ring.js.map +1 -1
- package/dist/activity-routes.d.ts.map +1 -1
- package/dist/activity-routes.js +3 -2
- package/dist/activity-routes.js.map +1 -1
- package/dist/activity-ui.d.ts.map +1 -1
- package/dist/activity-ui.js +200 -11
- package/dist/activity-ui.js.map +1 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +5 -1
- package/dist/app.js.map +1 -1
- package/dist/catalog-live-routes.d.ts +4 -0
- package/dist/catalog-live-routes.d.ts.map +1 -0
- package/dist/catalog-live-routes.js +12 -0
- package/dist/catalog-live-routes.js.map +1 -0
- package/dist/catalog-live-ui.d.ts +3 -0
- package/dist/catalog-live-ui.d.ts.map +1 -0
- package/dist/catalog-live-ui.js +230 -0
- package/dist/catalog-live-ui.js.map +1 -0
- package/dist/catalog-live.d.ts +31 -0
- package/dist/catalog-live.d.ts.map +1 -0
- package/dist/catalog-live.js +67 -0
- package/dist/catalog-live.js.map +1 -0
- package/dist/data-changes-routes.js +1 -1
- package/dist/data-changes-routes.js.map +1 -1
- package/dist/data-changes-ui.js +1 -1
- package/dist/hooks/backfill.d.ts +31 -0
- package/dist/hooks/backfill.d.ts.map +1 -0
- package/dist/hooks/backfill.js +78 -0
- package/dist/hooks/backfill.js.map +1 -0
- package/dist/hooks/enqueue.d.ts +6 -1
- package/dist/hooks/enqueue.d.ts.map +1 -1
- package/dist/hooks/enqueue.js +15 -1
- package/dist/hooks/enqueue.js.map +1 -1
- package/dist/hooks/request-trigger.d.ts +16 -0
- package/dist/hooks/request-trigger.d.ts.map +1 -0
- package/dist/hooks/request-trigger.js +31 -0
- package/dist/hooks/request-trigger.js.map +1 -0
- package/dist/hooks/store.d.ts +1 -0
- package/dist/hooks/store.d.ts.map +1 -1
- package/dist/hooks/store.js +105 -0
- package/dist/hooks/store.js.map +1 -1
- package/dist/hooks/types.d.ts +33 -0
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/hooks/types.js +12 -0
- package/dist/hooks/types.js.map +1 -1
- package/dist/hooks/worker.d.ts +0 -1
- package/dist/hooks/worker.d.ts.map +1 -1
- package/dist/hooks/worker.js +1 -8
- package/dist/hooks/worker.js.map +1 -1
- package/dist/hooks-live-routes.d.ts +4 -0
- package/dist/hooks-live-routes.d.ts.map +1 -0
- package/dist/hooks-live-routes.js +13 -0
- package/dist/hooks-live-routes.js.map +1 -0
- package/dist/hooks-live-ui.d.ts +3 -0
- package/dist/hooks-live-ui.d.ts.map +1 -0
- package/dist/hooks-live-ui.js +228 -0
- package/dist/hooks-live-ui.js.map +1 -0
- package/dist/hooks-live.d.ts +38 -0
- package/dist/hooks-live.d.ts.map +1 -0
- package/dist/hooks-live.js +51 -0
- package/dist/hooks-live.js.map +1 -0
- package/dist/live-ops-nav.d.ts.map +1 -1
- package/dist/live-ops-nav.js +8 -0
- package/dist/live-ops-nav.js.map +1 -1
- package/dist/openapi/openapi.json +57 -1
- package/dist/platform.d.ts +2 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +9 -1
- package/dist/platform.js.map +1 -1
- package/dist/routes/data.d.ts.map +1 -1
- package/dist/routes/data.js +43 -15
- package/dist/routes/data.js.map +1 -1
- package/dist/routes/hooks.d.ts.map +1 -1
- package/dist/routes/hooks.js +55 -1
- package/dist/routes/hooks.js.map +1 -1
- package/openapi/openapi.json +57 -1
- package/package.json +1 -1
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/** HTML for GET /_live/hooks — subscription health and callback inbox. */
|
|
2
|
+
export function hooksLiveHtml() {
|
|
3
|
+
return `<!DOCTYPE html>
|
|
4
|
+
<html lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
<title>Memorix · Hook inbox</title>
|
|
9
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
10
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
11
|
+
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
12
|
+
<style>
|
|
13
|
+
:root {
|
|
14
|
+
--bg: #0a0c10; --bg-elev: #10141b; --bg-row: #141922; --line: #242b38;
|
|
15
|
+
--text: #e8ebe6; --muted: #8a9288; --dim: #5c645c;
|
|
16
|
+
--ok: #3dba7a; --bad: #e25a5a; --wait: #7eb8d4; --accent: #c8f082; --accent-ink: #0a0c10;
|
|
17
|
+
--sans: "IBM Plex Sans", system-ui, sans-serif;
|
|
18
|
+
--mono: "IBM Plex Mono", ui-monospace, monospace;
|
|
19
|
+
}
|
|
20
|
+
* { box-sizing: border-box; }
|
|
21
|
+
html, body { margin: 0; }
|
|
22
|
+
body {
|
|
23
|
+
font-family: var(--sans);
|
|
24
|
+
background:
|
|
25
|
+
radial-gradient(1200px 600px at 10% -10%, #1a2214 0%, transparent 55%),
|
|
26
|
+
radial-gradient(900px 500px at 100% 0%, #121820 0%, transparent 50%),
|
|
27
|
+
var(--bg);
|
|
28
|
+
color: var(--text); font-size: 14px; line-height: 1.45;
|
|
29
|
+
}
|
|
30
|
+
a { color: var(--accent); }
|
|
31
|
+
.shell { max-width: 1280px; margin: 0 auto; padding: 36px 28px 64px; }
|
|
32
|
+
header {
|
|
33
|
+
display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
|
|
34
|
+
margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line);
|
|
35
|
+
}
|
|
36
|
+
.brand { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
|
|
37
|
+
.brand span { color: var(--accent); }
|
|
38
|
+
.sub { margin-top: 8px; color: var(--muted); font-size: 13px; max-width: 68ch; }
|
|
39
|
+
.meta { text-align: right; font-family: var(--mono); font-size: 11px; color: var(--dim); display: grid; gap: 4px; }
|
|
40
|
+
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
|
|
41
|
+
.btn, select {
|
|
42
|
+
appearance: none; border: 1px solid var(--line); background: var(--bg-row); color: var(--text);
|
|
43
|
+
font: 500 12px/1 var(--sans); padding: 10px 14px; border-radius: 2px;
|
|
44
|
+
}
|
|
45
|
+
.btn { cursor: pointer; }
|
|
46
|
+
.btn:hover { border-color: var(--accent); }
|
|
47
|
+
select { min-width: 160px; }
|
|
48
|
+
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
|
|
49
|
+
.card { background: var(--bg-elev); border: 1px solid var(--line); padding: 12px 14px; }
|
|
50
|
+
.card h3 {
|
|
51
|
+
margin: 0 0 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
|
|
52
|
+
text-transform: uppercase; color: var(--dim); font-weight: 500;
|
|
53
|
+
}
|
|
54
|
+
.card .val { font-family: var(--mono); font-size: 22px; font-weight: 600; }
|
|
55
|
+
.card.wait .val { color: var(--wait); }
|
|
56
|
+
.card.bad .val { color: var(--bad); }
|
|
57
|
+
.card.ok .val { color: var(--ok); }
|
|
58
|
+
h2 {
|
|
59
|
+
margin: 22px 0 10px; font-size: 12px; font-family: var(--mono);
|
|
60
|
+
letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); font-weight: 500;
|
|
61
|
+
}
|
|
62
|
+
table { width: 100%; border-collapse: collapse; background: var(--bg-elev); border: 1px solid var(--line); }
|
|
63
|
+
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
64
|
+
th {
|
|
65
|
+
font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
|
|
66
|
+
color: var(--dim); font-weight: 500; background: #0d1016; position: sticky; top: 0;
|
|
67
|
+
}
|
|
68
|
+
tr:last-child td { border-bottom: 0; }
|
|
69
|
+
tr:hover td { background: var(--bg-row); }
|
|
70
|
+
tr.clickable { cursor: pointer; }
|
|
71
|
+
.mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }
|
|
72
|
+
.badge { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--line); }
|
|
73
|
+
.badge.pending { color: var(--wait); }
|
|
74
|
+
.badge.delivered { color: var(--ok); }
|
|
75
|
+
.badge.rejected, .badge.failed, .badge.failing { color: var(--bad); }
|
|
76
|
+
.badge.ok { color: var(--ok); }
|
|
77
|
+
.err { color: var(--bad); margin: 8px 0; }
|
|
78
|
+
.detail {
|
|
79
|
+
margin-top: 8px; padding: 12px; background: #0d1016; border: 1px solid var(--line);
|
|
80
|
+
font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: pre-wrap;
|
|
81
|
+
}
|
|
82
|
+
footer { margin-top: 28px; color: var(--dim); font-size: 12px; }
|
|
83
|
+
</style>
|
|
84
|
+
</head>
|
|
85
|
+
<body>
|
|
86
|
+
<div class="shell">
|
|
87
|
+
<header>
|
|
88
|
+
<div>
|
|
89
|
+
<div class="brand">Memorix <span>hook inbox</span></div>
|
|
90
|
+
<p class="sub">Registered callbacks and the notices still waiting. A POST is informed only on 202 <span class="mono">{ accepted: true }</span> or 409. Anything else stays pending until the subscriber accepts it or clears it.</p>
|
|
91
|
+
</div>
|
|
92
|
+
<div class="meta">
|
|
93
|
+
<div><strong>UI</strong> /_live/hooks</div>
|
|
94
|
+
<div><strong>API</strong> /_live/api/hooks</div>
|
|
95
|
+
<div><a href="/_live">← live view</a> · <a href="/_live/activity">activity</a> · <a href="/_live/changes">data changes</a></div>
|
|
96
|
+
</div>
|
|
97
|
+
</header>
|
|
98
|
+
<div class="toolbar">
|
|
99
|
+
<label class="mono">Org <select id="org"></select></label>
|
|
100
|
+
<label class="mono">Status <select id="status">
|
|
101
|
+
<option value="">all</option>
|
|
102
|
+
<option value="pending">pending</option>
|
|
103
|
+
<option value="delivered">delivered</option>
|
|
104
|
+
<option value="rejected">rejected</option>
|
|
105
|
+
<option value="failed">failed</option>
|
|
106
|
+
</select></label>
|
|
107
|
+
<button class="btn" id="refresh" type="button">Refresh</button>
|
|
108
|
+
<span class="mono" id="asof"></span>
|
|
109
|
+
</div>
|
|
110
|
+
<div class="cards" id="cards"></div>
|
|
111
|
+
<div id="error" class="err" hidden></div>
|
|
112
|
+
<h2>Subscriptions</h2>
|
|
113
|
+
<div id="subs"></div>
|
|
114
|
+
<h2>Callbacks</h2>
|
|
115
|
+
<div id="rows"></div>
|
|
116
|
+
<div id="detail" class="detail" hidden></div>
|
|
117
|
+
<footer>Refreshes every 3 seconds · signing keys are not shown · waiting notices stay until accepted or completed</footer>
|
|
118
|
+
</div>
|
|
119
|
+
<script>
|
|
120
|
+
const $ = (id) => document.getElementById(id);
|
|
121
|
+
let report = null;
|
|
122
|
+
let timer = 0;
|
|
123
|
+
|
|
124
|
+
function badge(status) {
|
|
125
|
+
return '<span class="badge ' + status + '">' + status + '</span>';
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function address(row) {
|
|
129
|
+
const a = row.address || {};
|
|
130
|
+
const rev = a.revision == null ? "" : " r" + a.revision;
|
|
131
|
+
return (a.objectType || "") + " / " + (a.contentType || "") + " / " + (a.recordId || "") + rev;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function render() {
|
|
135
|
+
if (!report) return;
|
|
136
|
+
const s = report.summary || {};
|
|
137
|
+
$("cards").innerHTML = [
|
|
138
|
+
["Subscriptions", s.subscriptions, ""],
|
|
139
|
+
["Waiting", s.pending, "wait"],
|
|
140
|
+
["Failing", s.failing, "bad"],
|
|
141
|
+
["Delivered", s.delivered, "ok"],
|
|
142
|
+
["Rejected", s.rejected, ""],
|
|
143
|
+
["Failed", s.failed, s.failed ? "bad" : ""],
|
|
144
|
+
].map(([label, n, cls]) =>
|
|
145
|
+
'<div class="card ' + cls + '"><h3>' + label + '</h3><div class="val">' + n + '</div></div>'
|
|
146
|
+
).join("");
|
|
147
|
+
|
|
148
|
+
const subs = report.subscriptions || [];
|
|
149
|
+
$("subs").innerHTML = subs.length
|
|
150
|
+
? '<table><thead><tr><th>Subscription</th><th>Org</th><th>Agents</th><th>Match</th><th>Endpoint</th><th>Health</th><th>Waiting</th></tr></thead><tbody>' +
|
|
151
|
+
subs.map((row) => '<tr><td class="mono">' + row.subscriptionId + '</td><td class="mono">' + row.orgId +
|
|
152
|
+
'</td><td class="mono">' + (row.agentIds || []).join(", ") + '</td><td class="mono">' +
|
|
153
|
+
row.match.objectType + " / " + row.match.contentType + '</td><td class="mono">' + row.endpoint +
|
|
154
|
+
'</td><td>' + badge(row.health) + (row.enabled ? "" : ' <span class="mono">disabled</span>') +
|
|
155
|
+
'</td><td class="mono">' + row.waiting + '</td></tr>').join("") +
|
|
156
|
+
'</tbody></table>'
|
|
157
|
+
: '<p class="mono">No subscriptions.</p>';
|
|
158
|
+
|
|
159
|
+
const want = $("status").value;
|
|
160
|
+
const rows = (report.deliveries || []).filter((row) => !want || row.status === want);
|
|
161
|
+
$("rows").innerHTML = rows.length
|
|
162
|
+
? '<table><thead><tr><th>When</th><th>Status</th><th>Event</th><th>Subscription</th><th>Address</th><th>Attempt</th><th>Next</th></tr></thead><tbody>' +
|
|
163
|
+
rows.map((row, i) => '<tr class="clickable" data-i="' + i + '"><td class="mono">' + row.occurredAt +
|
|
164
|
+
'</td><td>' + badge(row.status) + '</td><td class="mono">' + row.event + '</td><td class="mono">' +
|
|
165
|
+
row.subscriptionId + '</td><td class="mono">' + address(row) + '</td><td class="mono">' + row.attempt +
|
|
166
|
+
'</td><td class="mono">' + (row.nextAttemptAt || "—") + '</td></tr>').join("") +
|
|
167
|
+
'</tbody></table>'
|
|
168
|
+
: '<p class="mono">No callbacks for this filter.</p>';
|
|
169
|
+
$("rows").querySelectorAll("tr.clickable").forEach((tr) => {
|
|
170
|
+
tr.addEventListener("click", () => {
|
|
171
|
+
const row = rows[Number(tr.getAttribute("data-i"))];
|
|
172
|
+
const box = $("detail");
|
|
173
|
+
box.hidden = false;
|
|
174
|
+
box.textContent = JSON.stringify({
|
|
175
|
+
deliveryId: row.deliveryId,
|
|
176
|
+
status: row.status,
|
|
177
|
+
event: row.event,
|
|
178
|
+
address: row.address,
|
|
179
|
+
change: row.change,
|
|
180
|
+
attempt: row.attempt,
|
|
181
|
+
nextAttemptAt: row.nextAttemptAt,
|
|
182
|
+
}, null, 2);
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
$("asof").textContent = report.generatedAt || "";
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
async function load() {
|
|
189
|
+
const org = $("org").value;
|
|
190
|
+
const url = "/_live/api/hooks" + (org ? "?orgId=" + encodeURIComponent(org) : "");
|
|
191
|
+
try {
|
|
192
|
+
const res = await fetch(url);
|
|
193
|
+
const body = await res.json();
|
|
194
|
+
if (!res.ok || body.ok === false) throw new Error(body.error?.message || res.statusText);
|
|
195
|
+
report = body;
|
|
196
|
+
const select = $("org");
|
|
197
|
+
const current = select.value;
|
|
198
|
+
const ids = body.orgIds || [];
|
|
199
|
+
select.innerHTML = '<option value="">all orgs</option>' + ids.map((id) =>
|
|
200
|
+
'<option value="' + id + '">' + id + '</option>').join("");
|
|
201
|
+
select.value = ids.includes(current) || current === "" ? current : "";
|
|
202
|
+
$("error").hidden = true;
|
|
203
|
+
render();
|
|
204
|
+
} catch (err) {
|
|
205
|
+
$("error").hidden = false;
|
|
206
|
+
$("error").textContent = err instanceof Error ? err.message : String(err);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
$("refresh").addEventListener("click", load);
|
|
211
|
+
$("org").addEventListener("change", load);
|
|
212
|
+
$("status").addEventListener("change", render);
|
|
213
|
+
load();
|
|
214
|
+
timer = setInterval(load, 3000);
|
|
215
|
+
document.addEventListener("visibilitychange", () => {
|
|
216
|
+
if (document.hidden) {
|
|
217
|
+
clearInterval(timer);
|
|
218
|
+
timer = 0;
|
|
219
|
+
} else if (!timer) {
|
|
220
|
+
load();
|
|
221
|
+
timer = setInterval(load, 3000);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
</script>
|
|
225
|
+
</body>
|
|
226
|
+
</html>`;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=hooks-live-ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks-live-ui.js","sourceRoot":"","sources":["../src/hooks-live-ui.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,UAAU,aAAa;IAC3B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA+ND,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { HookStore } from "./hooks/types.js";
|
|
2
|
+
export type HookLiveSource = {
|
|
3
|
+
listKnownOperationalOrgIds(): Promise<string[]>;
|
|
4
|
+
hookOrgIds(): string[];
|
|
5
|
+
hooksFor(orgId: string): HookStore;
|
|
6
|
+
};
|
|
7
|
+
export declare function snapshotHookLive(source: HookLiveSource, orgId?: string): Promise<{
|
|
8
|
+
orgIds: string[];
|
|
9
|
+
orgId: string | null;
|
|
10
|
+
summary: {
|
|
11
|
+
subscriptions: number;
|
|
12
|
+
failing: number;
|
|
13
|
+
pending: number;
|
|
14
|
+
delivered: number;
|
|
15
|
+
rejected: number;
|
|
16
|
+
failed: number;
|
|
17
|
+
};
|
|
18
|
+
subscriptions: (import("./hooks/types.js").HookSubscriptionPublic & {
|
|
19
|
+
orgId: string;
|
|
20
|
+
waiting: number;
|
|
21
|
+
})[];
|
|
22
|
+
deliveries: ({
|
|
23
|
+
deliveryId: string;
|
|
24
|
+
subscriptionId: string;
|
|
25
|
+
event: "created" | "updated" | "removed";
|
|
26
|
+
occurredAt: string;
|
|
27
|
+
address: import("./hooks/types.js").HookAddress;
|
|
28
|
+
change: {
|
|
29
|
+
previousRevision: number | null;
|
|
30
|
+
dataChanged: boolean;
|
|
31
|
+
};
|
|
32
|
+
attempt: number;
|
|
33
|
+
status: "failed" | "pending" | "delivered" | "rejected";
|
|
34
|
+
} & {
|
|
35
|
+
nextAttemptAt: string | null;
|
|
36
|
+
})[];
|
|
37
|
+
}>;
|
|
38
|
+
//# sourceMappingURL=hooks-live.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks-live.d.ts","sourceRoot":"","sources":["../src/hooks-live.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlD,MAAM,MAAM,cAAc,GAAG;IAC3B,0BAA0B,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAChD,UAAU,IAAI,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC;AAEF,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,MAAM;;;;;;;;;;;;eAkBG,MAAM;iBAAW,MAAM;;;;;;;;;;;;;;;uBACvB,MAAM,GAAG,IAAI;;GA+B5F"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { toInboxDelivery, toPublicSubscription } from "./hooks/types.js";
|
|
2
|
+
export async function snapshotHookLive(source, orgId) {
|
|
3
|
+
const known = new Set([
|
|
4
|
+
...(await source.listKnownOperationalOrgIds()),
|
|
5
|
+
...source.hookOrgIds(),
|
|
6
|
+
]);
|
|
7
|
+
const orgIds = [...known].sort((a, b) => a.localeCompare(b));
|
|
8
|
+
const selected = orgId?.trim() ? orgId.trim() : "";
|
|
9
|
+
const scan = selected ? orgIds.filter((id) => id === selected) : orgIds;
|
|
10
|
+
if (selected && scan.length === 0)
|
|
11
|
+
scan.push(selected);
|
|
12
|
+
const summary = {
|
|
13
|
+
subscriptions: 0,
|
|
14
|
+
failing: 0,
|
|
15
|
+
pending: 0,
|
|
16
|
+
delivered: 0,
|
|
17
|
+
rejected: 0,
|
|
18
|
+
failed: 0,
|
|
19
|
+
};
|
|
20
|
+
const subscriptions = [];
|
|
21
|
+
const deliveries = [];
|
|
22
|
+
for (const id of scan) {
|
|
23
|
+
const store = source.hooksFor(id);
|
|
24
|
+
const rows = await store.listSubscriptions();
|
|
25
|
+
for (const row of rows) {
|
|
26
|
+
const counts = await store.countDeliveries(row.subscriptionId);
|
|
27
|
+
summary.subscriptions += 1;
|
|
28
|
+
if (row.health === "failing")
|
|
29
|
+
summary.failing += 1;
|
|
30
|
+
summary.pending += counts.pending;
|
|
31
|
+
summary.delivered += counts.delivered;
|
|
32
|
+
summary.rejected += counts.rejected;
|
|
33
|
+
summary.failed += counts.failed;
|
|
34
|
+
subscriptions.push({ ...toPublicSubscription(row), waiting: counts.pending });
|
|
35
|
+
const recent = await store.listDeliveries(row.subscriptionId, { limit: 40 });
|
|
36
|
+
for (const delivery of recent) {
|
|
37
|
+
deliveries.push({ ...toInboxDelivery(delivery), nextAttemptAt: delivery.nextAttemptAt });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
subscriptions.sort((a, b) => a.subscriptionId.localeCompare(b.subscriptionId));
|
|
42
|
+
deliveries.sort((a, b) => (a.occurredAt < b.occurredAt ? 1 : a.occurredAt > b.occurredAt ? -1 : 0));
|
|
43
|
+
return {
|
|
44
|
+
orgIds,
|
|
45
|
+
orgId: selected || null,
|
|
46
|
+
summary,
|
|
47
|
+
subscriptions,
|
|
48
|
+
deliveries: de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Ac,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;IAC/E,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpG,OAAO;QACL,MAAM;QACN,KAAK,EAAE,QAAQ,IAAI,IAAI;QACvB,OAAO;QACP,aAAa;QACb,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-ops-nav.d.ts","sourceRoot":"","sources":["../src/live-ops-nav.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"live-ops-nav.d.ts","sourceRoot":"","sources":["../src/live-ops-nav.ts"],"names":[],"mappings":"AAsDA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM1D"}
|
package/dist/live-ops-nav.js
CHANGED
|
@@ -28,6 +28,10 @@ const NAV_HTML = `
|
|
|
28
28
|
}
|
|
29
29
|
</style>
|
|
30
30
|
<nav id="memorix-ops-nav" aria-label="Memorix operator pages">
|
|
31
|
+
<a href="/_live/catalog">
|
|
32
|
+
<strong>Catalog</strong>
|
|
33
|
+
<span>Object types and content types per agent</span>
|
|
34
|
+
</a>
|
|
31
35
|
<a href="/_live/activity">
|
|
32
36
|
<strong>Activity</strong>
|
|
33
37
|
<span>Pushed · Processed · Fetched</span>
|
|
@@ -40,6 +44,10 @@ const NAV_HTML = `
|
|
|
40
44
|
<strong>Data changes</strong>
|
|
41
45
|
<span>OT × CT change matrix</span>
|
|
42
46
|
</a>
|
|
47
|
+
<a href="/_live/hooks">
|
|
48
|
+
<strong>Hook inbox</strong>
|
|
49
|
+
<span>Waiting callbacks and delivery status</span>
|
|
50
|
+
</a>
|
|
43
51
|
</nav>
|
|
44
52
|
`;
|
|
45
53
|
export function withMemorixLiveOpsNav(html) {
|
package/dist/live-ops-nav.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-ops-nav.js","sourceRoot":"","sources":["../src/live-ops-nav.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,QAAQ,GAAG,sBAAsB,CAAC;AAExC,MAAM,QAAQ,GAAG
|
|
1
|
+
{"version":3,"file":"live-ops-nav.js","sourceRoot":"","sources":["../src/live-ops-nav.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,QAAQ,GAAG,sBAAsB,CAAC;AAExC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8ChB,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IAClD,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,cAAc,QAAQ,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.0.3",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Memorix Service API",
|
|
5
|
-
"version": "3.12.
|
|
5
|
+
"version": "3.12.3",
|
|
6
6
|
"description": "One versioned product API over accepted Memorix packages. Scope: orgId + agentIds[]. Headers x-memorix-org-id and x-memorix-agent-ids (comma-separated). MX-CALLER-01: every /api request requires x-memorix-caller (calling app id). Intelligence never auto-installs. Relationships /links is forbidden. IntegrationsRegistry (Stage −1) and RestrictedStore (FG-A3 dual-mode blob)."
|
|
7
7
|
},
|
|
8
8
|
"servers": [
|
|
@@ -15031,6 +15031,62 @@
|
|
|
15031
15031
|
"200": { "description": "Delivery rows. Not stored on the subject record." }
|
|
15032
15032
|
}
|
|
15033
15033
|
}
|
|
15034
|
+
},
|
|
15035
|
+
"/api/hooks/v1/subscriptions/{subscriptionId}/inbox": {
|
|
15036
|
+
"get": {
|
|
15037
|
+
"operationId": "hooksInbox",
|
|
15038
|
+
"tags": ["Hooks"],
|
|
15039
|
+
"summary": "Waiting notices, oldest first",
|
|
15040
|
+
"description": "Pending deliveries the subscriber has not accepted. A POST that returns HTTP 200 without { accepted: true }, or times out, or returns 5xx, stays here. Clear one with hooksCompleteDelivery.",
|
|
15041
|
+
"parameters": [
|
|
15042
|
+
{ "$ref": "#/components/parameters/XMemorixCaller" },
|
|
15043
|
+
{ "$ref": "#/components/parameters/XMemorixOrgId" },
|
|
15044
|
+
{ "$ref": "#/components/parameters/XMemorixAgentIds" },
|
|
15045
|
+
{ "name": "subscriptionId", "in": "path", "required": true, "schema": { "type": "string" } },
|
|
15046
|
+
{ "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } }
|
|
15047
|
+
],
|
|
15048
|
+
"responses": {
|
|
15049
|
+
"200": { "description": "Open deliveries, including address, event, and change." },
|
|
15050
|
+
"404": { "description": "HOOK_SUBSCRIPTION_NOT_FOUND" }
|
|
15051
|
+
}
|
|
15052
|
+
}
|
|
15053
|
+
},
|
|
15054
|
+
"/api/hooks/v1/subscriptions/{subscriptionId}/backfill": {
|
|
15055
|
+
"post": {
|
|
15056
|
+
"operationId": "hooksBackfill",
|
|
15057
|
+
"tags": ["Hooks"],
|
|
15058
|
+
"summary": "Enqueue inbox deliveries for stored rows this subscription has not taken",
|
|
15059
|
+
"description": "Selects stored content of the subscription match object type and content type that has no trigger mark for this subscription. Each selected row becomes one pending inbox delivery, and that enqueue is the mark. A later call returns enqueued 0 for those rows. Completing a delivery leaves the mark. A later save of a marked row still emits a live delivery.",
|
|
15060
|
+
"parameters": [
|
|
15061
|
+
{ "$ref": "#/components/parameters/XMemorixCaller" },
|
|
15062
|
+
{ "$ref": "#/components/parameters/XMemorixOrgId" },
|
|
15063
|
+
{ "$ref": "#/components/parameters/XMemorixAgentIds" },
|
|
15064
|
+
{ "name": "subscriptionId", "in": "path", "required": true, "schema": { "type": "string" } }
|
|
15065
|
+
],
|
|
15066
|
+
"responses": {
|
|
15067
|
+
"200": { "description": "{ subscriptionId, enqueued, alreadyTriggered }" },
|
|
15068
|
+
"404": { "description": "HOOK_SUBSCRIPTION_NOT_FOUND" }
|
|
15069
|
+
}
|
|
15070
|
+
}
|
|
15071
|
+
},
|
|
15072
|
+
"/api/hooks/v1/subscriptions/{subscriptionId}/deliveries/{deliveryId}/complete": {
|
|
15073
|
+
"post": {
|
|
15074
|
+
"operationId": "hooksCompleteDelivery",
|
|
15075
|
+
"tags": ["Hooks"],
|
|
15076
|
+
"summary": "Clear one waiting notice",
|
|
15077
|
+
"parameters": [
|
|
15078
|
+
{ "$ref": "#/components/parameters/XMemorixCaller" },
|
|
15079
|
+
{ "$ref": "#/components/parameters/XMemorixOrgId" },
|
|
15080
|
+
{ "$ref": "#/components/parameters/XMemorixAgentIds" },
|
|
15081
|
+
{ "name": "subscriptionId", "in": "path", "required": true, "schema": { "type": "string" } },
|
|
15082
|
+
{ "name": "deliveryId", "in": "path", "required": true, "schema": { "type": "string" } }
|
|
15083
|
+
],
|
|
15084
|
+
"responses": {
|
|
15085
|
+
"200": { "description": "{ deliveryId, cleared: true }. Completing an already delivered row is the same." },
|
|
15086
|
+
"404": { "description": "HOOK_SUBSCRIPTION_NOT_FOUND or HOOK_DELIVERY_NOT_FOUND" },
|
|
15087
|
+
"409": { "description": "HOOK_DELIVERY_CLOSED" }
|
|
15088
|
+
}
|
|
15089
|
+
}
|
|
15034
15090
|
}
|
|
15035
15091
|
},
|
|
15036
15092
|
"components": {
|
package/dist/platform.d.ts
CHANGED
|
@@ -118,6 +118,8 @@ export type MemorixPlatform = {
|
|
|
118
118
|
* Used by Jobs Manager unscoped (All orgs) list/overview fan-out.
|
|
119
119
|
*/
|
|
120
120
|
listKnownOperationalOrgIds(): Promise<string[]>;
|
|
121
|
+
/** Org ids that already have an in-process hook store. */
|
|
122
|
+
hookOrgIds(): string[];
|
|
121
123
|
intelligenceArtifactsFor(orgId: string): IntelligenceArtifactPersistence;
|
|
122
124
|
/** Fail-closed: throws if ports cannot be constructed. */
|
|
123
125
|
portsFor(scope: MemorixScope): OrgPorts;
|
package/dist/platform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAQL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAU5B,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAeL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAGL,KAAK,+BAA+B,EACrC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAQL,KAAK,SAAS,EACd,KAAK,eAAe,EAGrB,MAAM,2BAA2B,CAAC;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alizeOrgId } from "./scope.js";
|
|
30
30
|
import { createMemoryHookStore, createMongoHookStore } from "./hooks/store.js";
|
|
31
31
|
import { enqueueContentHooks } from "./hooks/enqueue.js";
|
|
32
|
+
import { noteHookTrigger } from "./hooks/request-trigger.js";
|
|
32
33
|
import { tickHookStore } from "./hooks/worker.js";
|
|
33
34
|
import { assertSafeSandboxOrgId, recordCreatedDatabase, } from "./isolation.js";
|
|
34
35
|
import { createMagitPackService, isMetadataMagitEnabled, magitPackageTypeIdConfigured, magitPackageTypeIdForDiagnostics, magitStoreSelectorConfigured, magitTypedStoreConfigured, resolveMagitCatalogTenant, resolveMagitRepoRootParent, resolveMagitStorageTokenEnv, } from "./magit/magit-pack-service.js";
|
|
@@ -287,6 +288,9 @@ export async function createMemorixPlatform(deps) {
|
|
|
287
288
|
hookStores.set(orgId, store);
|
|
288
289
|
return store;
|
|
289
290
|
}
|
|
291
|
+
function hookOrgIds() {
|
|
292
|
+
return [...hookStores.keys()];
|
|
293
|
+
}
|
|
290
294
|
async function listKnownOperationalOrgIds() {
|
|
291
295
|
const ids = new Set();
|
|
292
296
|
if (client) {
|
|
@@ -511,7 +515,10 @@ export async function createMemorixPlatform(deps) {
|
|
|
511
515
|
catalog,
|
|
512
516
|
plane,
|
|
513
517
|
clock: SYSTEM_CLOCK,
|
|
514
|
-
onContentCommit: (fact) =>
|
|
518
|
+
onContentCommit: async (fact) => {
|
|
519
|
+
const result = await enqueueContentHooks(hooksFor(fact.scope.orgId), fact, kickContentHooks);
|
|
520
|
+
noteHookTrigger(result);
|
|
521
|
+
},
|
|
515
522
|
});
|
|
516
523
|
const { abstractWriter: concreteAbstractWriter } = createMongoAbstractWriter({
|
|
517
524
|
client,
|
|
@@ -1173,6 +1180,7 @@ export async function createMemorixPlatform(deps) {
|
|
|
1173
1180
|
operationalStoresFor,
|
|
1174
1181
|
resolveOrgId,
|
|
1175
1182
|
listKnownOperationalOrgIds,
|
|
1183
|
+
hookOrgIds,
|
|
1176
1184
|
intelligenceArtifactsFor,
|
|
1177
1185
|
portsFor,
|
|
1178
1186
|
invalidateOrgPortsCache,
|