@riddix/hamh 2.1.0-alpha.838 → 2.1.0-alpha.839
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/backend/cli.js
CHANGED
|
@@ -157250,6 +157250,70 @@ function seedExistingSessionStarts(startedAt, sessions, now = Date.now()) {
|
|
|
157250
157250
|
}
|
|
157251
157251
|
}
|
|
157252
157252
|
|
|
157253
|
+
// src/services/bridges/subscription-summary.ts
|
|
157254
|
+
function readPaths(value) {
|
|
157255
|
+
return Array.isArray(value) ? value : null;
|
|
157256
|
+
}
|
|
157257
|
+
function unknownSummary(id) {
|
|
157258
|
+
return {
|
|
157259
|
+
id,
|
|
157260
|
+
attributePaths: 0,
|
|
157261
|
+
eventPaths: 0,
|
|
157262
|
+
scope: "unknown",
|
|
157263
|
+
endpointIds: []
|
|
157264
|
+
};
|
|
157265
|
+
}
|
|
157266
|
+
function summarizeSubscription(sub) {
|
|
157267
|
+
let id = null;
|
|
157268
|
+
let request;
|
|
157269
|
+
try {
|
|
157270
|
+
const s = sub;
|
|
157271
|
+
if (typeof s.subscriptionId === "number") {
|
|
157272
|
+
id = s.subscriptionId;
|
|
157273
|
+
}
|
|
157274
|
+
request = s.request;
|
|
157275
|
+
} catch {
|
|
157276
|
+
return unknownSummary(id);
|
|
157277
|
+
}
|
|
157278
|
+
if (request == null || typeof request !== "object") {
|
|
157279
|
+
return unknownSummary(id);
|
|
157280
|
+
}
|
|
157281
|
+
const req = request;
|
|
157282
|
+
const attrPaths = readPaths(req.attributeRequests);
|
|
157283
|
+
const eventPaths = readPaths(req.eventRequests);
|
|
157284
|
+
if (attrPaths === null && eventPaths === null) {
|
|
157285
|
+
return unknownSummary(id);
|
|
157286
|
+
}
|
|
157287
|
+
const all = [...attrPaths ?? [], ...eventPaths ?? []];
|
|
157288
|
+
let wildcard = false;
|
|
157289
|
+
const endpointIds = /* @__PURE__ */ new Set();
|
|
157290
|
+
for (const path14 of all) {
|
|
157291
|
+
const ep = path14?.endpointId;
|
|
157292
|
+
if (ep == null) {
|
|
157293
|
+
wildcard = true;
|
|
157294
|
+
} else if (typeof ep === "number" || typeof ep === "bigint") {
|
|
157295
|
+
endpointIds.add(Number(ep));
|
|
157296
|
+
}
|
|
157297
|
+
}
|
|
157298
|
+
return {
|
|
157299
|
+
id,
|
|
157300
|
+
attributePaths: attrPaths?.length ?? 0,
|
|
157301
|
+
eventPaths: eventPaths?.length ?? 0,
|
|
157302
|
+
scope: wildcard ? "wildcard" : "endpoint-specific",
|
|
157303
|
+
endpointIds: [...endpointIds].sort((a, b) => a - b)
|
|
157304
|
+
};
|
|
157305
|
+
}
|
|
157306
|
+
function summarizeSubscriptions(subscriptions) {
|
|
157307
|
+
const out = [];
|
|
157308
|
+
try {
|
|
157309
|
+
for (const sub of subscriptions) {
|
|
157310
|
+
out.push(summarizeSubscription(sub));
|
|
157311
|
+
}
|
|
157312
|
+
} catch {
|
|
157313
|
+
}
|
|
157314
|
+
return out;
|
|
157315
|
+
}
|
|
157316
|
+
|
|
157253
157317
|
// src/services/bridges/wedge-watchdog.ts
|
|
157254
157318
|
var WEDGE_WARMUP_MS = 15 * 60 * 1e3;
|
|
157255
157319
|
var WEDGE_IM_SILENCE_MS = 45 * 60 * 1e3;
|
|
@@ -157366,6 +157430,7 @@ var Bridge = class {
|
|
|
157366
157430
|
const sessionList = sessions.map((s) => {
|
|
157367
157431
|
const subCount = s.subscriptions.size;
|
|
157368
157432
|
totalSubscriptions += subCount;
|
|
157433
|
+
const subscriptions = summarizeSubscriptions(s.subscriptions);
|
|
157369
157434
|
const fi = typeof s.fabric?.fabricIndex === "number" ? s.fabric.fabricIndex : null;
|
|
157370
157435
|
if (fi !== null) {
|
|
157371
157436
|
const existing = fabricMap.get(fi) ?? {
|
|
@@ -157387,6 +157452,7 @@ var Bridge = class {
|
|
|
157387
157452
|
peerNodeId: String(s.peerNodeId),
|
|
157388
157453
|
fabricIndex: fi,
|
|
157389
157454
|
subscriptionCount: subCount,
|
|
157455
|
+
subscriptions,
|
|
157390
157456
|
lastActiveMsAgo,
|
|
157391
157457
|
lastAnyActivityMsAgo,
|
|
157392
157458
|
lastImRequestMsAgo,
|
|
@@ -175166,6 +175232,7 @@ var ServerModeBridge = class {
|
|
|
175166
175232
|
const sessionList = sessions.map((s) => {
|
|
175167
175233
|
const subCount = s.subscriptions.size;
|
|
175168
175234
|
totalSubscriptions += subCount;
|
|
175235
|
+
const subscriptions = summarizeSubscriptions(s.subscriptions);
|
|
175169
175236
|
const fi = typeof s.fabric?.fabricIndex === "number" ? s.fabric.fabricIndex : null;
|
|
175170
175237
|
if (fi !== null) {
|
|
175171
175238
|
const existing = fabricMap.get(fi) ?? {
|
|
@@ -175187,6 +175254,7 @@ var ServerModeBridge = class {
|
|
|
175187
175254
|
peerNodeId: String(s.peerNodeId),
|
|
175188
175255
|
fabricIndex: fi,
|
|
175189
175256
|
subscriptionCount: subCount,
|
|
175257
|
+
subscriptions,
|
|
175190
175258
|
lastActiveMsAgo,
|
|
175191
175259
|
lastAnyActivityMsAgo,
|
|
175192
175260
|
lastImRequestMsAgo,
|