@jeffjassky/telemetry 0.8.0 → 0.8.1
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/index.cjs +26 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp.cjs +26 -1
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.js +26 -1
- package/dist/mcp.js.map +1 -1
- package/package.json +1 -1
package/dist/mcp.cjs
CHANGED
|
@@ -325,6 +325,31 @@ var BREAKDOWN_FIELDS = [
|
|
|
325
325
|
"error.type",
|
|
326
326
|
"error.handled"
|
|
327
327
|
];
|
|
328
|
+
var GENERIC_SUBJECT_TYPES = ["anon", "session"];
|
|
329
|
+
var mostSpecificSubject = {
|
|
330
|
+
$let: {
|
|
331
|
+
vars: { keys: { $ifNull: ["$subjectKeys", []] } },
|
|
332
|
+
in: {
|
|
333
|
+
$ifNull: [
|
|
334
|
+
{
|
|
335
|
+
$arrayElemAt: [
|
|
336
|
+
{
|
|
337
|
+
$filter: {
|
|
338
|
+
input: "$$keys",
|
|
339
|
+
as: "k",
|
|
340
|
+
cond: {
|
|
341
|
+
$not: [{ $in: [{ $arrayElemAt: [{ $split: ["$$k", ":"] }, 0] }, GENERIC_SUBJECT_TYPES] }]
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
0
|
|
346
|
+
]
|
|
347
|
+
},
|
|
348
|
+
{ $arrayElemAt: ["$$keys", 0] }
|
|
349
|
+
]
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
};
|
|
328
353
|
var typePrefix = (ref) => ({
|
|
329
354
|
$let: {
|
|
330
355
|
vars: { ref },
|
|
@@ -352,7 +377,7 @@ function dimExpression(dim2) {
|
|
|
352
377
|
}
|
|
353
378
|
return { $ifNull: [`$${path}`, null] };
|
|
354
379
|
}
|
|
355
|
-
if (dim2 === "subjectType") return typePrefix(
|
|
380
|
+
if (dim2 === "subjectType") return typePrefix(mostSpecificSubject);
|
|
356
381
|
if (dim2 === "actorType") return typePrefix("$actor");
|
|
357
382
|
throw badRequest(
|
|
358
383
|
`"${dim2}" is not a dimension. Use "attr:<key>", "field:<path>", "subjectType" or "actorType".`
|