@skmtc/core 0.0.798 → 0.0.800

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 (103) hide show
  1. package/esm/context/GenerateContext.d.ts +26 -1
  2. package/esm/context/GenerateContext.d.ts.map +1 -1
  3. package/esm/context/GenerateContext.js +26 -1
  4. package/esm/context/ParseContext.d.ts +64 -3
  5. package/esm/context/ParseContext.d.ts.map +1 -1
  6. package/esm/context/ParseContext.js +61 -0
  7. package/esm/context/ResultsHandler.d.ts +10 -3
  8. package/esm/context/ResultsHandler.d.ts.map +1 -1
  9. package/esm/dsl/model/types.d.ts +51 -4
  10. package/esm/dsl/model/types.d.ts.map +1 -1
  11. package/esm/dsl/operation/types.d.ts +61 -3
  12. package/esm/dsl/operation/types.d.ts.map +1 -1
  13. package/esm/oas/array/array-types.d.ts +23 -0
  14. package/esm/oas/array/array-types.d.ts.map +1 -1
  15. package/esm/oas/array/array-types.js +7 -0
  16. package/esm/oas/boolean/boolean-types.d.ts +25 -1
  17. package/esm/oas/boolean/boolean-types.d.ts.map +1 -1
  18. package/esm/oas/boolean/boolean-types.js +6 -0
  19. package/esm/oas/discriminator/discriminator-types.d.ts +17 -0
  20. package/esm/oas/discriminator/discriminator-types.d.ts.map +1 -1
  21. package/esm/oas/discriminator/discriminator-types.js +7 -0
  22. package/esm/oas/integer/integer-types.d.ts +18 -0
  23. package/esm/oas/integer/integer-types.d.ts.map +1 -1
  24. package/esm/oas/integer/integer-types.js +18 -0
  25. package/esm/oas/mediaType/mediaType-types.d.ts +17 -0
  26. package/esm/oas/mediaType/mediaType-types.d.ts.map +1 -1
  27. package/esm/oas/mediaType/mediaType-types.js +6 -0
  28. package/esm/oas/number/number-types.d.ts +12 -0
  29. package/esm/oas/number/number-types.d.ts.map +1 -1
  30. package/esm/oas/number/number-types.js +12 -0
  31. package/esm/oas/operation/Operation.d.ts +47 -2
  32. package/esm/oas/operation/Operation.d.ts.map +1 -1
  33. package/esm/oas/operation/Operation.js +43 -0
  34. package/esm/oas/ref/Ref.d.ts +49 -2
  35. package/esm/oas/ref/Ref.d.ts.map +1 -1
  36. package/esm/oas/ref/Ref.js +28 -0
  37. package/esm/oas/serverVariable/ServerVariable.d.ts +34 -0
  38. package/esm/oas/serverVariable/ServerVariable.d.ts.map +1 -1
  39. package/esm/oas/serverVariable/ServerVariable.js +24 -0
  40. package/esm/oas/string/string-types.d.ts +38 -1
  41. package/esm/oas/string/string-types.d.ts.map +1 -1
  42. package/esm/oas/string/string-types.js +12 -0
  43. package/esm/oas/union/union-types.d.ts +20 -0
  44. package/esm/oas/union/union-types.d.ts.map +1 -1
  45. package/esm/oas/union/union-types.js +7 -0
  46. package/esm/oas/unknown/unknown-types.d.ts +18 -0
  47. package/esm/oas/unknown/unknown-types.d.ts.map +1 -1
  48. package/esm/oas/unknown/unknown-types.js +6 -0
  49. package/esm/typescript/List.d.ts +64 -3
  50. package/esm/typescript/List.d.ts.map +1 -1
  51. package/esm/typescript/List.js +43 -0
  52. package/package.json +1 -1
  53. package/script/context/GenerateContext.d.ts +26 -1
  54. package/script/context/GenerateContext.d.ts.map +1 -1
  55. package/script/context/GenerateContext.js +26 -1
  56. package/script/context/ParseContext.d.ts +64 -3
  57. package/script/context/ParseContext.d.ts.map +1 -1
  58. package/script/context/ParseContext.js +61 -0
  59. package/script/context/ResultsHandler.d.ts +10 -3
  60. package/script/context/ResultsHandler.d.ts.map +1 -1
  61. package/script/dsl/model/types.d.ts +51 -4
  62. package/script/dsl/model/types.d.ts.map +1 -1
  63. package/script/dsl/operation/types.d.ts +61 -3
  64. package/script/dsl/operation/types.d.ts.map +1 -1
  65. package/script/oas/array/array-types.d.ts +23 -0
  66. package/script/oas/array/array-types.d.ts.map +1 -1
  67. package/script/oas/array/array-types.js +7 -0
  68. package/script/oas/boolean/boolean-types.d.ts +25 -1
  69. package/script/oas/boolean/boolean-types.d.ts.map +1 -1
  70. package/script/oas/boolean/boolean-types.js +6 -0
  71. package/script/oas/discriminator/discriminator-types.d.ts +17 -0
  72. package/script/oas/discriminator/discriminator-types.d.ts.map +1 -1
  73. package/script/oas/discriminator/discriminator-types.js +7 -0
  74. package/script/oas/integer/integer-types.d.ts +18 -0
  75. package/script/oas/integer/integer-types.d.ts.map +1 -1
  76. package/script/oas/integer/integer-types.js +18 -0
  77. package/script/oas/mediaType/mediaType-types.d.ts +17 -0
  78. package/script/oas/mediaType/mediaType-types.d.ts.map +1 -1
  79. package/script/oas/mediaType/mediaType-types.js +6 -0
  80. package/script/oas/number/number-types.d.ts +12 -0
  81. package/script/oas/number/number-types.d.ts.map +1 -1
  82. package/script/oas/number/number-types.js +12 -0
  83. package/script/oas/operation/Operation.d.ts +47 -2
  84. package/script/oas/operation/Operation.d.ts.map +1 -1
  85. package/script/oas/operation/Operation.js +43 -0
  86. package/script/oas/ref/Ref.d.ts +49 -2
  87. package/script/oas/ref/Ref.d.ts.map +1 -1
  88. package/script/oas/ref/Ref.js +28 -0
  89. package/script/oas/serverVariable/ServerVariable.d.ts +34 -0
  90. package/script/oas/serverVariable/ServerVariable.d.ts.map +1 -1
  91. package/script/oas/serverVariable/ServerVariable.js +24 -0
  92. package/script/oas/string/string-types.d.ts +38 -1
  93. package/script/oas/string/string-types.d.ts.map +1 -1
  94. package/script/oas/string/string-types.js +12 -0
  95. package/script/oas/union/union-types.d.ts +20 -0
  96. package/script/oas/union/union-types.d.ts.map +1 -1
  97. package/script/oas/union/union-types.js +7 -0
  98. package/script/oas/unknown/unknown-types.d.ts +18 -0
  99. package/script/oas/unknown/unknown-types.d.ts.map +1 -1
  100. package/script/oas/unknown/unknown-types.js +6 -0
  101. package/script/typescript/List.d.ts +64 -3
  102. package/script/typescript/List.d.ts.map +1 -1
  103. package/script/typescript/List.js +43 -0
@@ -139,6 +139,14 @@ class List {
139
139
  this.bookends = bookends ?? 'none';
140
140
  this.skipEmpty = skipEmpty ?? false;
141
141
  }
142
+ /**
143
+ * Converts the list to its string representation.
144
+ *
145
+ * Joins all values with the configured separator and wraps with bookends.
146
+ * Returns empty string if skipEmpty is enabled and list is empty.
147
+ *
148
+ * @returns Formatted string representation of the list
149
+ */
142
150
  toString() {
143
151
  if (this.skipEmpty && this.values.length === 0) {
144
152
  return '';
@@ -381,8 +389,20 @@ Object.defineProperty(List, "hasValue", {
381
389
  return true;
382
390
  }
383
391
  });
392
+ /**
393
+ * Utility class for working with arrays of string keys.
394
+ *
395
+ * Provides methods for transforming key arrays into objects and lists
396
+ * with custom mapping functions.
397
+ */
384
398
  class KeyList {
399
+ /**
400
+ * Creates a new KeyList instance.
401
+ *
402
+ * @param keys - Array of string keys to work with
403
+ */
385
404
  constructor(keys) {
405
+ /** Array of string keys */
386
406
  Object.defineProperty(this, "keys", {
387
407
  enumerable: true,
388
408
  configurable: true,
@@ -391,15 +411,38 @@ class KeyList {
391
411
  });
392
412
  this.keys = keys;
393
413
  }
414
+ /**
415
+ * Transforms keys into an object using a mapping function.
416
+ *
417
+ * @param mapFn - Function to transform each key into a value
418
+ * @param options - Options for handling empty values
419
+ * @returns Object with keys mapped to transformed values
420
+ */
394
421
  toObject(mapFn, { skipEmpty } = {}) {
395
422
  return List.toObject(this.keys.map((key, index) => mapFn(key, index)), { skipEmpty });
396
423
  }
424
+ /**
425
+ * Creates a plain object with keys as both keys and values.
426
+ *
427
+ * @returns Object where each key maps to itself
428
+ */
397
429
  toObjectPlain() {
398
430
  return List.toObject(this.keys);
399
431
  }
432
+ /**
433
+ * Transforms keys into a List using a mapping function.
434
+ *
435
+ * @param mapFn - Function to transform each key into a value
436
+ * @returns List containing the transformed values
437
+ */
400
438
  toLines(mapFn) {
401
439
  return List.toLines(this.keys.map((key, index) => mapFn(key, index)));
402
440
  }
441
+ /**
442
+ * Creates a List with keys as the values.
443
+ *
444
+ * @returns List containing the original keys
445
+ */
403
446
  toLinesPlain() {
404
447
  return List.toLines(this.keys);
405
448
  }