mailery 0.16.7 → 0.16.8
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/admin/spa/index-m4wK04gU.js.map +1 -1
- package/dist/index.cjs +24 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6450,9 +6450,30 @@ function createAdminApiRouter(mailer, opts = {}) {
|
|
|
6450
6450
|
const seenNames = await c.events.distinct("name");
|
|
6451
6451
|
const known = new Set(registered.map((r2) => r2.name));
|
|
6452
6452
|
const unregistered = seenNames.filter((n) => n && !known.has(n));
|
|
6453
|
+
const now = Date.now();
|
|
6454
|
+
const d7 = new Date(now - 7 * 864e5);
|
|
6455
|
+
const d30 = new Date(now - 30 * 864e5);
|
|
6456
|
+
const rows = await c.events.aggregate([
|
|
6457
|
+
{
|
|
6458
|
+
$group: {
|
|
6459
|
+
_id: "$name",
|
|
6460
|
+
total: { $sum: 1 },
|
|
6461
|
+
last7d: { $sum: { $cond: [{ $gte: ["$createdAt", d7] }, 1, 0] } },
|
|
6462
|
+
last30d: { $sum: { $cond: [{ $gte: ["$createdAt", d30] }, 1, 0] } },
|
|
6463
|
+
lastAt: { $max: "$createdAt" },
|
|
6464
|
+
firstAt: { $min: "$createdAt" }
|
|
6465
|
+
}
|
|
6466
|
+
}
|
|
6467
|
+
]).toArray();
|
|
6468
|
+
const stats = {};
|
|
6469
|
+
for (const r2 of rows) {
|
|
6470
|
+
if (!r2._id) continue;
|
|
6471
|
+
stats[r2._id] = { total: r2.total, last7d: r2.last7d, last30d: r2.last30d, firstAt: r2.firstAt, lastAt: r2.lastAt };
|
|
6472
|
+
}
|
|
6453
6473
|
res.json({
|
|
6454
6474
|
registered: registered.sort((a, b) => a.name.localeCompare(b.name)),
|
|
6455
|
-
seen: unregistered.sort()
|
|
6475
|
+
seen: unregistered.sort(),
|
|
6476
|
+
stats
|
|
6456
6477
|
});
|
|
6457
6478
|
})
|
|
6458
6479
|
);
|
|
@@ -8342,7 +8363,7 @@ function unitToMs2(value, unit) {
|
|
|
8342
8363
|
}
|
|
8343
8364
|
|
|
8344
8365
|
// src/server/api/agent.ts
|
|
8345
|
-
var VERSION = "0.16.
|
|
8366
|
+
var VERSION = "0.16.8" ;
|
|
8346
8367
|
var agentTagsInputSchema = zod.z.object({
|
|
8347
8368
|
add: zod.z.array(zod.z.string().min(1).max(128)).max(25).default([]),
|
|
8348
8369
|
remove: zod.z.array(zod.z.string().min(1).max(128)).max(25).default([])
|
|
@@ -10230,7 +10251,7 @@ var DEDUPE_POLICIES = [
|
|
|
10230
10251
|
];
|
|
10231
10252
|
|
|
10232
10253
|
// src/server/index.ts
|
|
10233
|
-
var VERSION2 = "0.16.
|
|
10254
|
+
var VERSION2 = "0.16.8" ;
|
|
10234
10255
|
|
|
10235
10256
|
exports.DEDUPE_POLICIES = DEDUPE_POLICIES;
|
|
10236
10257
|
exports.DEFAULT_BOT_UA_RE = DEFAULT_BOT_UA_RE;
|