@skmtc/core 0.0.793 → 0.0.795

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.
Files changed (63) hide show
  1. package/esm/context/StackTrail.d.ts +293 -0
  2. package/esm/context/StackTrail.d.ts.map +1 -1
  3. package/esm/context/StackTrail.js +294 -0
  4. package/esm/helpers/ResultsLog.d.ts +193 -0
  5. package/esm/helpers/ResultsLog.d.ts.map +1 -1
  6. package/esm/helpers/ResultsLog.js +213 -0
  7. package/esm/helpers/tracer.d.ts +124 -0
  8. package/esm/helpers/tracer.d.ts.map +1 -1
  9. package/esm/helpers/tracer.js +124 -0
  10. package/esm/types/Modifiers.d.ts +68 -0
  11. package/esm/types/Modifiers.d.ts.map +1 -1
  12. package/esm/types/TypeSystem.d.ts +419 -0
  13. package/esm/types/TypeSystem.d.ts.map +1 -1
  14. package/esm/typescript/FunctionParameter.d.ts +313 -0
  15. package/esm/typescript/FunctionParameter.d.ts.map +1 -1
  16. package/esm/typescript/FunctionParameter.js +328 -0
  17. package/esm/typescript/PathParams.d.ts +198 -0
  18. package/esm/typescript/PathParams.d.ts.map +1 -1
  19. package/esm/typescript/PathParams.js +190 -0
  20. package/esm/typescript/ReactRouterPathParams.d.ts +190 -0
  21. package/esm/typescript/ReactRouterPathParams.d.ts.map +1 -1
  22. package/esm/typescript/ReactRouterPathParams.js +183 -0
  23. package/esm/typescript/keyValues.d.ts +125 -0
  24. package/esm/typescript/keyValues.d.ts.map +1 -1
  25. package/esm/typescript/keyValues.js +125 -1
  26. package/esm/typescript/toPathParams.d.ts +179 -0
  27. package/esm/typescript/toPathParams.d.ts.map +1 -1
  28. package/esm/typescript/toPathParams.js +179 -0
  29. package/esm/typescript/toPathTemplate.d.ts +114 -0
  30. package/esm/typescript/toPathTemplate.d.ts.map +1 -1
  31. package/esm/typescript/toPathTemplate.js +114 -0
  32. package/package.json +1 -1
  33. package/script/context/StackTrail.d.ts +293 -0
  34. package/script/context/StackTrail.d.ts.map +1 -1
  35. package/script/context/StackTrail.js +294 -0
  36. package/script/helpers/ResultsLog.d.ts +193 -0
  37. package/script/helpers/ResultsLog.d.ts.map +1 -1
  38. package/script/helpers/ResultsLog.js +213 -0
  39. package/script/helpers/tracer.d.ts +124 -0
  40. package/script/helpers/tracer.d.ts.map +1 -1
  41. package/script/helpers/tracer.js +124 -0
  42. package/script/types/Modifiers.d.ts +68 -0
  43. package/script/types/Modifiers.d.ts.map +1 -1
  44. package/script/types/TypeSystem.d.ts +419 -0
  45. package/script/types/TypeSystem.d.ts.map +1 -1
  46. package/script/typescript/FunctionParameter.d.ts +313 -0
  47. package/script/typescript/FunctionParameter.d.ts.map +1 -1
  48. package/script/typescript/FunctionParameter.js +328 -0
  49. package/script/typescript/PathParams.d.ts +198 -0
  50. package/script/typescript/PathParams.d.ts.map +1 -1
  51. package/script/typescript/PathParams.js +190 -0
  52. package/script/typescript/ReactRouterPathParams.d.ts +190 -0
  53. package/script/typescript/ReactRouterPathParams.d.ts.map +1 -1
  54. package/script/typescript/ReactRouterPathParams.js +183 -0
  55. package/script/typescript/keyValues.d.ts +125 -0
  56. package/script/typescript/keyValues.d.ts.map +1 -1
  57. package/script/typescript/keyValues.js +125 -1
  58. package/script/typescript/toPathParams.d.ts +179 -0
  59. package/script/typescript/toPathParams.d.ts.map +1 -1
  60. package/script/typescript/toPathParams.js +179 -0
  61. package/script/typescript/toPathTemplate.d.ts +114 -0
  62. package/script/typescript/toPathTemplate.d.ts.map +1 -1
  63. package/script/typescript/toPathTemplate.js +114 -0
@@ -15,23 +15,190 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.StackTrail = void 0;
16
16
  require("../_dnt.polyfills.js");
17
17
  const Components_js_1 = require("../oas/components/Components.js");
18
+ /**
19
+ * Represents a stack-based trail for tracking document traversal in OpenAPI processing.
20
+ *
21
+ * The `StackTrail` class maintains a stack of string frames that represent the current
22
+ * path through an OpenAPI document structure. It's used throughout the SKMTC pipeline
23
+ * for tracking context during parsing, generating, and debugging schema processing.
24
+ *
25
+ * This class is essential for error reporting, debugging, and maintaining context
26
+ * when processing nested OpenAPI structures like schemas, operations, and components.
27
+ *
28
+ * ## Key Features
29
+ *
30
+ * - **Path Tracking**: Maintains a trail of traversed document elements
31
+ * - **Context Preservation**: Preserves parsing context for error reporting
32
+ * - **Stack Operations**: Supports push, pop, clone, and manipulation operations
33
+ * - **Reference Resolution**: Can generate OpenAPI reference strings from trails
34
+ * - **Serialization**: Supports string serialization and parsing for persistence
35
+ *
36
+ * @example Basic usage
37
+ * ```typescript
38
+ * import { StackTrail } from '@skmtc/core';
39
+ *
40
+ * // Start with empty trail
41
+ * const trail = new StackTrail();
42
+ *
43
+ * // Build a path through document structure
44
+ * trail.append('components')
45
+ * .append('schemas')
46
+ * .append('User')
47
+ * .append('properties')
48
+ * .append('name');
49
+ *
50
+ * console.log(trail.toString()); // 'components:schemas:User:properties:name'
51
+ * ```
52
+ *
53
+ * @example Schema reference generation
54
+ * ```typescript
55
+ * const schemaTrail = new StackTrail(['components', 'schemas', 'User']);
56
+ * const ref = schemaTrail.toStackRef();
57
+ * console.log(ref); // '#/components/schemas/User'
58
+ * ```
59
+ *
60
+ * @example Error context tracking
61
+ * ```typescript
62
+ * class SchemaProcessor {
63
+ * processSchema(schema: OasSchema, trail: StackTrail) {
64
+ * try {
65
+ * // Process schema logic
66
+ * return this.transformSchema(schema);
67
+ * } catch (error) {
68
+ * throw new Error(`Error at ${trail.toString()}: ${error.message}`);
69
+ * // Error at components:schemas:User:properties:email: Invalid format
70
+ * }
71
+ * }
72
+ * }
73
+ * ```
74
+ *
75
+ * @example Cloning and manipulation
76
+ * ```typescript
77
+ * const baseTrail = new StackTrail(['components', 'schemas']);
78
+ *
79
+ * // Clone for processing different schemas
80
+ * const userTrail = baseTrail.clone().append('User');
81
+ * const productTrail = baseTrail.clone().append('Product');
82
+ *
83
+ * console.log(userTrail.toString()); // 'components:schemas:User'
84
+ * console.log(productTrail.toString()); // 'components:schemas:Product'
85
+ * console.log(baseTrail.toString()); // 'components:schemas' (unchanged)
86
+ * ```
87
+ */
18
88
  class StackTrail {
89
+ /**
90
+ * Creates a new StackTrail instance.
91
+ *
92
+ * @param stack - Initial stack frames (defaults to empty array)
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * // Empty trail
97
+ * const trail1 = new StackTrail();
98
+ *
99
+ * // Pre-populated trail
100
+ * const trail2 = new StackTrail(['components', 'schemas', 'User']);
101
+ * ```
102
+ */
19
103
  constructor(stack = []) {
104
+ /** Internal stack of traversal frames */
20
105
  _StackTrail_stack.set(this, void 0);
21
106
  __classPrivateFieldSet(this, _StackTrail_stack, stack, "f");
22
107
  }
108
+ /**
109
+ * Creates a shallow copy of the stack trail.
110
+ *
111
+ * @returns A new StackTrail instance with copied frames
112
+ *
113
+ * @example
114
+ * ```typescript
115
+ * const original = new StackTrail(['components', 'schemas']);
116
+ * const copy = original.clone();
117
+ *
118
+ * copy.append('User');
119
+ * console.log(original.toString()); // 'components:schemas'
120
+ * console.log(copy.toString()); // 'components:schemas:User'
121
+ * ```
122
+ */
23
123
  clone() {
24
124
  return new StackTrail([...__classPrivateFieldGet(this, _StackTrail_stack, "f")]);
25
125
  }
126
+ /**
127
+ * Creates a new trail from a slice of the current trail.
128
+ *
129
+ * @param start - Starting index (inclusive)
130
+ * @param end - Ending index (exclusive, optional)
131
+ * @returns A new StackTrail with sliced frames
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * const trail = new StackTrail(['a', 'b', 'c', 'd', 'e']);
136
+ *
137
+ * const slice1 = trail.slice(1, 3);
138
+ * console.log(slice1.toString()); // 'b:c'
139
+ *
140
+ * const slice2 = trail.slice(2);
141
+ * console.log(slice2.toString()); // 'c:d:e'
142
+ * ```
143
+ */
26
144
  slice(start, end) {
27
145
  return new StackTrail(__classPrivateFieldGet(this, _StackTrail_stack, "f").slice(start, end));
28
146
  }
147
+ /**
148
+ * Checks if all specified frames exist in the trail.
149
+ *
150
+ * @param frames - Array of frames to check for
151
+ * @returns True if all frames are present in the trail
152
+ *
153
+ * @example
154
+ * ```typescript
155
+ * const trail = new StackTrail(['components', 'schemas', 'User', 'properties']);
156
+ *
157
+ * console.log(trail.includes(['schemas', 'User'])); // true
158
+ * console.log(trail.includes(['schemas', 'Product'])); // false
159
+ * console.log(trail.includes(['components'])); // true
160
+ * ```
161
+ */
29
162
  includes(frames) {
30
163
  return frames.every(frame => __classPrivateFieldGet(this, _StackTrail_stack, "f").includes(frame));
31
164
  }
165
+ /**
166
+ * Gets a copy of the current stack frames.
167
+ *
168
+ * @returns Array of stack frames in order
169
+ *
170
+ * @example
171
+ * ```typescript
172
+ * const trail = new StackTrail(['components', 'schemas', 'User']);
173
+ * const frames = trail.stackTrail;
174
+ * console.log(frames); // ['components', 'schemas', 'User']
175
+ * ```
176
+ */
32
177
  get stackTrail() {
33
178
  return __classPrivateFieldGet(this, _StackTrail_stack, "f");
34
179
  }
180
+ /**
181
+ * Appends frame(s) to the end of the trail.
182
+ *
183
+ * @param frame - Single frame string or array of frames to append
184
+ * @returns This StackTrail instance for chaining
185
+ *
186
+ * @throws {Error} When frame is not a string or string array
187
+ *
188
+ * @example Single frame
189
+ * ```typescript
190
+ * const trail = new StackTrail(['components']);
191
+ * trail.append('schemas').append('User');
192
+ * console.log(trail.toString()); // 'components:schemas:User'
193
+ * ```
194
+ *
195
+ * @example Multiple frames
196
+ * ```typescript
197
+ * const trail = new StackTrail();
198
+ * trail.append(['components', 'schemas', 'User']);
199
+ * console.log(trail.toString()); // 'components:schemas:User'
200
+ * ```
201
+ */
35
202
  append(frame) {
36
203
  if (typeof frame === 'string') {
37
204
  __classPrivateFieldGet(this, _StackTrail_stack, "f").push(frame);
@@ -43,6 +210,22 @@ class StackTrail {
43
210
  }
44
211
  throw new Error(`Unexpected stack frame: ${frame}`);
45
212
  }
213
+ /**
214
+ * Gets the parent name of a property frame.
215
+ *
216
+ * This method is specifically designed to find parent object names
217
+ * for property trails in schema processing.
218
+ *
219
+ * @param frame - The frame name to find the parent of
220
+ * @returns Parent name if found, undefined otherwise
221
+ *
222
+ * @example
223
+ * ```typescript
224
+ * const trail = new StackTrail(['components', 'schemas', 'User', 'properties', 'email']);
225
+ * const parent = trail.getParentOf('email');
226
+ * console.log(parent); // 'User'
227
+ * ```
228
+ */
46
229
  getParentOf(frame) {
47
230
  const lastItemIndex = this.stackTrail.length - 1;
48
231
  if (this.stackTrail?.[lastItemIndex] === frame &&
@@ -51,6 +234,28 @@ class StackTrail {
51
234
  return typeof parentName === 'string' ? parentName : undefined;
52
235
  }
53
236
  }
237
+ /**
238
+ * Converts the trail to an OpenAPI reference string if applicable.
239
+ *
240
+ * Only trails that represent valid OpenAPI component references
241
+ * (starting with 'components') can be converted to reference strings.
242
+ *
243
+ * @returns OpenAPI reference string or undefined if not a valid reference trail
244
+ *
245
+ * @example Valid reference trail
246
+ * ```typescript
247
+ * const trail = new StackTrail(['components', 'schemas', 'User']);
248
+ * const ref = trail.toStackRef();
249
+ * console.log(ref); // '#/components/schemas/User'
250
+ * ```
251
+ *
252
+ * @example Invalid trail
253
+ * ```typescript
254
+ * const trail = new StackTrail(['paths', '/users', 'get']);
255
+ * const ref = trail.toStackRef();
256
+ * console.log(ref); // undefined
257
+ * ```
258
+ */
54
259
  toStackRef() {
55
260
  const [first, second, third] = this.stackTrail;
56
261
  if (first !== 'components') {
@@ -64,6 +269,29 @@ class StackTrail {
64
269
  }
65
270
  return `#/${first}/${second}/${third}`;
66
271
  }
272
+ /**
273
+ * Removes frame(s) from the end of the trail.
274
+ *
275
+ * @param frame - Single frame string or array of frames to remove
276
+ * @returns This StackTrail instance for chaining
277
+ *
278
+ * @throws {Error} When trying to remove a frame that doesn't match the last frame
279
+ * @throws {Error} When frame is not a string or string array
280
+ *
281
+ * @example Single frame removal
282
+ * ```typescript
283
+ * const trail = new StackTrail(['components', 'schemas', 'User', 'properties']);
284
+ * trail.remove('properties');
285
+ * console.log(trail.toString()); // 'components:schemas:User'
286
+ * ```
287
+ *
288
+ * @example Multiple frame removal
289
+ * ```typescript
290
+ * const trail = new StackTrail(['components', 'schemas', 'User', 'properties', 'name']);
291
+ * trail.remove(['name', 'properties']);
292
+ * console.log(trail.toString()); // 'components:schemas:User'
293
+ * ```
294
+ */
67
295
  remove(frame) {
68
296
  if (typeof frame === 'string') {
69
297
  const lastItem = __classPrivateFieldGet(this, _StackTrail_stack, "f")[__classPrivateFieldGet(this, _StackTrail_stack, "f").length - 1];
@@ -79,9 +307,42 @@ class StackTrail {
79
307
  }
80
308
  throw new Error(`Unexpected stack frame: ${frame}`);
81
309
  }
310
+ /**
311
+ * Joins multiple stacks or strings into a single colon-separated string.
312
+ *
313
+ * @param stacks - Array of StackTrail instances or strings to join
314
+ * @returns Joined string with colon separators
315
+ *
316
+ * @example
317
+ * ```typescript
318
+ * const trail1 = new StackTrail(['components', 'schemas']);
319
+ * const trail2 = new StackTrail(['User', 'properties']);
320
+ *
321
+ * const joined = StackTrail.join(trail1, 'separator', trail2);
322
+ * console.log(joined); // 'components:schemas:separator:User:properties'
323
+ * ```
324
+ */
82
325
  static join(...stacks) {
83
326
  return stacks.map(stack => stack.toString()).join(':');
84
327
  }
328
+ /**
329
+ * Parses a colon-separated string into a StackTrail instance.
330
+ *
331
+ * @param value - Colon-separated string to parse
332
+ * @returns New StackTrail instance
333
+ *
334
+ * @throws {Error} When the string contains empty tokens
335
+ *
336
+ * @example
337
+ * ```typescript
338
+ * const trail = StackTrail.parse('components:schemas:User:properties:name');
339
+ * console.log(trail.stackTrail); // ['components', 'schemas', 'User', 'properties', 'name']
340
+ *
341
+ * // Handles escaped colons
342
+ * const escapedTrail = StackTrail.parse('components:schemas:User%3AType');
343
+ * console.log(escapedTrail.stackTrail); // ['components', 'schemas', 'User:Type']
344
+ * ```
345
+ */
85
346
  static parse(value) {
86
347
  const stack = value.split(':').map(item => {
87
348
  if (!item) {
@@ -91,9 +352,42 @@ class StackTrail {
91
352
  });
92
353
  return new StackTrail(stack);
93
354
  }
355
+ /**
356
+ * Converts the trail to JSON representation.
357
+ *
358
+ * Used for serialization in JSON contexts. Returns the same
359
+ * as toString() method.
360
+ *
361
+ * @returns String representation of the trail
362
+ *
363
+ * @example
364
+ * ```typescript
365
+ * const trail = new StackTrail(['components', 'schemas', 'User']);
366
+ * const json = JSON.stringify({ path: trail });
367
+ * console.log(json); // '{"path":"components:schemas:User"}'
368
+ * ```
369
+ */
94
370
  toJSON() {
95
371
  return this.toString();
96
372
  }
373
+ /**
374
+ * Converts the trail to a colon-separated string representation.
375
+ *
376
+ * Colons within frame names are escaped as '%3A' to avoid conflicts
377
+ * with the separator character.
378
+ *
379
+ * @returns String representation of the trail
380
+ *
381
+ * @example
382
+ * ```typescript
383
+ * const trail = new StackTrail(['components', 'schemas', 'User']);
384
+ * console.log(trail.toString()); // 'components:schemas:User'
385
+ *
386
+ * // With colon in frame name
387
+ * const trailWithColon = new StackTrail(['components', 'schemas', 'User:Type']);
388
+ * console.log(trailWithColon.toString()); // 'components:schemas:User%3AType'
389
+ * ```
390
+ */
97
391
  toString() {
98
392
  return __classPrivateFieldGet(this, _StackTrail_stack, "f")
99
393
  .map(item => {
@@ -1,8 +1,201 @@
1
1
  import type { ResultsItem, ResultType } from '../types/Results.js';
2
+ /**
3
+ * Manages and organizes generation results with intelligent prioritization.
4
+ *
5
+ * `ResultsLog` tracks the outcomes of code generation operations, maintaining
6
+ * a hierarchical structure of results organized by stack trail paths. It implements
7
+ * intelligent result prioritization, ensuring that more severe results (errors)
8
+ * take precedence over less severe ones (success, warnings) when multiple results
9
+ * exist for the same path.
10
+ *
11
+ * The class is designed to work with the SKMTC tracing system, using stack trail
12
+ * identifiers to organize results in a meaningful hierarchical structure that
13
+ * reflects the execution flow of the generation process.
14
+ *
15
+ * ## Key Features
16
+ *
17
+ * - **Result Prioritization**: Automatically prioritizes more severe results
18
+ * - **Hierarchical Organization**: Organizes results by stack trail paths
19
+ * - **Tree Structure**: Converts flat result logs into nested tree structures
20
+ * - **Duplicate Handling**: Prevents less severe results from overwriting more severe ones
21
+ *
22
+ * @example Basic usage
23
+ * ```typescript
24
+ * import { ResultsLog } from '@skmtc/core';
25
+ *
26
+ * const resultsLog = new ResultsLog();
27
+ *
28
+ * // Capture results from different parts of generation
29
+ * resultsLog.capture('models:User', 'success');
30
+ * resultsLog.capture('models:Product', 'error');
31
+ * resultsLog.capture('types:Status', 'success');
32
+ *
33
+ * // Convert to hierarchical structure
34
+ * const tree = resultsLog.toTree();
35
+ * console.log(tree);
36
+ * // {
37
+ * // models: {
38
+ * // User: 'success',
39
+ * // Product: 'error'
40
+ * // },
41
+ * // types: {
42
+ * // Status: 'success'
43
+ * // }
44
+ * // }
45
+ * ```
46
+ *
47
+ * @example Result prioritization
48
+ * ```typescript
49
+ * const resultsLog = new ResultsLog();
50
+ *
51
+ * // First capture a success
52
+ * resultsLog.capture('api:createUser', 'success');
53
+ *
54
+ * // Later encounter an error at the same path
55
+ * resultsLog.capture('api:createUser', 'error');
56
+ *
57
+ * // Error takes precedence
58
+ * const tree = resultsLog.toTree();
59
+ * console.log(tree.api.createUser); // 'error'
60
+ *
61
+ * // But success won't overwrite error
62
+ * resultsLog.capture('api:createUser', 'success');
63
+ * console.log(resultsLog.toTree().api.createUser); // Still 'error'
64
+ * ```
65
+ *
66
+ * @example Complex nested paths
67
+ * ```typescript
68
+ * const resultsLog = new ResultsLog();
69
+ *
70
+ * resultsLog.capture('generation:models:User:properties:name', 'success');
71
+ * resultsLog.capture('generation:models:User:properties:email', 'warning');
72
+ * resultsLog.capture('generation:models:Product:validation', 'error');
73
+ * resultsLog.capture('generation:operations:createUser', 'success');
74
+ *
75
+ * const tree = resultsLog.toTree();
76
+ * console.log(tree);
77
+ * // {
78
+ * // generation: {
79
+ * // models: {
80
+ * // User: {
81
+ * // properties: {
82
+ * // name: 'success',
83
+ * // email: 'warning'
84
+ * // }
85
+ * // },
86
+ * // Product: {
87
+ * // validation: 'error'
88
+ * // }
89
+ * // },
90
+ * // operations: {
91
+ * // createUser: 'success'
92
+ * // }
93
+ * // }
94
+ * // }
95
+ * ```
96
+ *
97
+ * @example Integration with tracing
98
+ * ```typescript
99
+ * class TrackedGenerator {
100
+ * private resultsLog = new ResultsLog();
101
+ *
102
+ * generateModel(name: string, schema: OasSchema) {
103
+ * const stackPath = `models:${name}`;
104
+ *
105
+ * try {
106
+ * const model = this.processSchema(schema);
107
+ * this.resultsLog.capture(stackPath, 'success');
108
+ * return model;
109
+ * } catch (error) {
110
+ * this.resultsLog.capture(stackPath, 'error');
111
+ * throw error;
112
+ * }
113
+ * }
114
+ *
115
+ * generateOperation(operationId: string, operation: OasOperation) {
116
+ * const stackPath = `operations:${operationId}`;
117
+ *
118
+ * if (!this.supportsOperation(operation)) {
119
+ * this.resultsLog.capture(stackPath, 'notSupported');
120
+ * return null;
121
+ * }
122
+ *
123
+ * const result = this.processOperation(operation);
124
+ * this.resultsLog.capture(stackPath, 'success');
125
+ * return result;
126
+ * }
127
+ *
128
+ * getResults(): ResultsItem {
129
+ * return this.resultsLog.toTree();
130
+ * }
131
+ * }
132
+ * ```
133
+ */
2
134
  export declare class ResultsLog {
3
135
  #private;
136
+ /**
137
+ * Creates a new ResultsLog instance.
138
+ *
139
+ * Initializes an empty results tracking system ready to capture
140
+ * generation outcomes from various parts of the pipeline.
141
+ */
4
142
  constructor();
143
+ /**
144
+ * Captures a generation result for a specific stack trail path.
145
+ *
146
+ * This method records the outcome of a generation operation, using intelligent
147
+ * prioritization to ensure that more severe results take precedence over less
148
+ * severe ones. For example, an error result will not be overwritten by a
149
+ * success result, but a success can be overwritten by an error.
150
+ *
151
+ * @param stackTrail - Colon-separated path identifying the operation location
152
+ * @param result - The result type to capture (error, warning, success, etc.)
153
+ *
154
+ * @example
155
+ * ```typescript
156
+ * const resultsLog = new ResultsLog();
157
+ *
158
+ * // Capture various results
159
+ * resultsLog.capture('models:User:properties:email', 'success');
160
+ * resultsLog.capture('models:User:validation', 'warning');
161
+ * resultsLog.capture('operations:createUser', 'error');
162
+ * ```
163
+ */
5
164
  capture(stackTrail: string, result: ResultType): void;
165
+ /**
166
+ * Converts the flat results structure into a hierarchical tree.
167
+ *
168
+ * This method transforms the internal flat storage (using colon-separated paths)
169
+ * into a nested object structure that reflects the hierarchy of generation
170
+ * operations. This makes it easier to understand and process results in
171
+ * a structured way.
172
+ *
173
+ * @returns Nested object structure representing the results hierarchy
174
+ *
175
+ * @example
176
+ * ```typescript
177
+ * const resultsLog = new ResultsLog();
178
+ * resultsLog.capture('api:models:User', 'success');
179
+ * resultsLog.capture('api:operations:getUser', 'error');
180
+ * resultsLog.capture('types:Status', 'success');
181
+ *
182
+ * const tree = resultsLog.toTree();
183
+ * console.log(tree);
184
+ * // {
185
+ * // api: {
186
+ * // models: {
187
+ * // User: 'success'
188
+ * // },
189
+ * // operations: {
190
+ * // getUser: 'error'
191
+ * // }
192
+ * // },
193
+ * // types: {
194
+ * // Status: 'success'
195
+ * // }
196
+ * // }
197
+ * ```
198
+ */
6
199
  toTree(): ResultsItem;
7
200
  }
8
201
  //# sourceMappingURL=ResultsLog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResultsLog.d.ts","sourceRoot":"","sources":["../../src/helpers/ResultsLog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAElE,qBAAa,UAAU;;;IAOrB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;IAc9C,MAAM,IAAI,WAAW;CAWtB"}
1
+ {"version":3,"file":"ResultsLog.d.ts","sourceRoot":"","sources":["../../src/helpers/ResultsLog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmIG;AACH,qBAAa,UAAU;;IAGrB;;;;;OAKG;;IAKH;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;IA8B9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,MAAM,IAAI,WAAW;CAWtB"}