@dudousxd/nestjs-catalog 0.16.0 → 0.17.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Davide Carvalho
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -302,8 +302,30 @@ export interface CatalogTraceSpan {
302
302
  * second answer to a question that already has one.
303
303
  */
304
304
  principalId?: string;
305
- /** The event payload, verbatim — the same bytes the flat trail shows. */
306
- detail: Record<string, unknown>;
305
+ /**
306
+ * The event payload, verbatim — the same bytes the flat trail shows.
307
+ *
308
+ * Optional, and which call you made decides whether it is there:
309
+ * {@link CatalogTraceStore.getTrace} carries it, {@link
310
+ * CatalogTraceStore.listTraces} does not.
311
+ *
312
+ * The asymmetry is the whole point. A payload is arbitrary JSON of unbounded
313
+ * width, and a page of traces carries every span of every trace on it — a
314
+ * real 50-trace page measured 28,022 spans, of which the payloads alone were
315
+ * 4.3 MB of a 10.4 MB answer, read from the database, parsed, and serialised
316
+ * again on a screen that re-polls every ten seconds. None of it was drawn:
317
+ * the list renders a waterfall, which needs when each event happened and
318
+ * whether it failed, and the payload is read only when somebody expands a
319
+ * trace — at which point there is exactly one trace to fetch it for.
320
+ *
321
+ * So the list is not missing anything it showed before. `failed` and `error`
322
+ * are still derived from the payload, in the database rather than from these
323
+ * bytes, and a consumer that needs the payload asks `getTrace` for the one
324
+ * trace it needs it for. Guard it rather than assuming it: a `?? {}` on a
325
+ * list span is correct, and dereferencing it is the one thing this shape
326
+ * makes unsafe.
327
+ */
328
+ detail?: Record<string, unknown>;
307
329
  occurredAt: string;
308
330
  /** Milliseconds from the first event of the trace. Where the bar starts. */
309
331
  offsetMs: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudousxd/nestjs-catalog",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "A metadata registry for NestJS: object types, properties and relations, derived from your ORM and enriched with decorators.",
5
5
  "license": "MIT",
6
6
  "author": "Davide Carvalho",
@@ -30,10 +30,6 @@
30
30
  "files": [
31
31
  "dist"
32
32
  ],
33
- "scripts": {
34
- "build": "tsc -p tsconfig.json",
35
- "dev": "tsc -p tsconfig.json --watch"
36
- },
37
33
  "peerDependencies": {
38
34
  "@mikro-orm/core": ">=6",
39
35
  "@nestjs/common": ">=10",
@@ -50,5 +46,9 @@
50
46
  },
51
47
  "dependencies": {
52
48
  "@dudousxd/nestjs-diagnostics": "0.7.0"
49
+ },
50
+ "scripts": {
51
+ "build": "tsc -p tsconfig.json",
52
+ "dev": "tsc -p tsconfig.json --watch"
53
53
  }
54
- }
54
+ }