@skmtc/core 0.0.273 → 0.0.274

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 (359) hide show
  1. package/esm/context/CoreContext.d.ts +32 -3
  2. package/esm/context/CoreContext.d.ts.map +1 -1
  3. package/esm/context/CoreContext.js +131 -26
  4. package/esm/context/GenerateContext.d.ts +4 -0
  5. package/esm/context/GenerateContext.d.ts.map +1 -1
  6. package/esm/context/GenerateContext.js +13 -1
  7. package/esm/context/RenderContext.d.ts +4 -2
  8. package/esm/context/RenderContext.d.ts.map +1 -1
  9. package/esm/context/RenderContext.js +17 -1
  10. package/esm/deps/jsr.io/@std/fmt/1.0.1/colors.d.ts +700 -0
  11. package/esm/deps/jsr.io/@std/fmt/1.0.1/colors.d.ts.map +1 -0
  12. package/esm/deps/jsr.io/@std/fmt/1.0.1/colors.js +903 -0
  13. package/esm/deps/jsr.io/@std/fs/1.0.2/exists.d.ts +198 -0
  14. package/esm/deps/jsr.io/@std/fs/1.0.2/exists.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@std/fs/1.0.2/exists.js +251 -0
  16. package/esm/deps/jsr.io/@std/io/0.224.6/types.d.ts +95 -0
  17. package/esm/deps/jsr.io/@std/io/0.224.6/types.d.ts.map +1 -0
  18. package/esm/deps/jsr.io/@std/io/0.224.6/types.js +3 -0
  19. package/esm/deps/jsr.io/@std/io/0.224.6/write_all.d.ts +51 -0
  20. package/esm/deps/jsr.io/@std/io/0.224.6/write_all.d.ts.map +1 -0
  21. package/esm/deps/jsr.io/@std/io/0.224.6/write_all.js +61 -0
  22. package/esm/deps/jsr.io/@std/log/0.224.6/_config.d.ts +4 -0
  23. package/esm/deps/jsr.io/@std/log/0.224.6/_config.d.ts.map +1 -0
  24. package/esm/deps/jsr.io/@std/log/0.224.6/_config.js +14 -0
  25. package/esm/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.d.ts +8 -0
  26. package/esm/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.d.ts.map +1 -0
  27. package/esm/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.js +8 -0
  28. package/esm/deps/jsr.io/@std/log/0.224.6/_state.d.ts +8 -0
  29. package/esm/deps/jsr.io/@std/log/0.224.6/_state.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@std/log/0.224.6/_state.js +7 -0
  31. package/esm/deps/jsr.io/@std/log/0.224.6/base_handler.d.ts +22 -0
  32. package/esm/deps/jsr.io/@std/log/0.224.6/base_handler.d.ts.map +1 -0
  33. package/esm/deps/jsr.io/@std/log/0.224.6/base_handler.js +60 -0
  34. package/esm/deps/jsr.io/@std/log/0.224.6/console_handler.d.ts +18 -0
  35. package/esm/deps/jsr.io/@std/log/0.224.6/console_handler.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/log/0.224.6/console_handler.js +58 -0
  37. package/esm/deps/jsr.io/@std/log/0.224.6/critical.d.ts +5 -0
  38. package/esm/deps/jsr.io/@std/log/0.224.6/critical.d.ts.map +1 -0
  39. package/esm/deps/jsr.io/@std/log/0.224.6/critical.js +10 -0
  40. package/esm/deps/jsr.io/@std/log/0.224.6/debug.d.ts +5 -0
  41. package/esm/deps/jsr.io/@std/log/0.224.6/debug.d.ts.map +1 -0
  42. package/esm/deps/jsr.io/@std/log/0.224.6/debug.js +10 -0
  43. package/esm/deps/jsr.io/@std/log/0.224.6/error.d.ts +5 -0
  44. package/esm/deps/jsr.io/@std/log/0.224.6/error.d.ts.map +1 -0
  45. package/esm/deps/jsr.io/@std/log/0.224.6/error.js +10 -0
  46. package/esm/deps/jsr.io/@std/log/0.224.6/file_handler.d.ts +51 -0
  47. package/esm/deps/jsr.io/@std/log/0.224.6/file_handler.d.ts.map +1 -0
  48. package/esm/deps/jsr.io/@std/log/0.224.6/file_handler.js +135 -0
  49. package/esm/deps/jsr.io/@std/log/0.224.6/formatters.d.ts +6 -0
  50. package/esm/deps/jsr.io/@std/log/0.224.6/formatters.d.ts.map +1 -0
  51. package/esm/deps/jsr.io/@std/log/0.224.6/formatters.js +19 -0
  52. package/esm/deps/jsr.io/@std/log/0.224.6/get_logger.d.ts +4 -0
  53. package/esm/deps/jsr.io/@std/log/0.224.6/get_logger.d.ts.map +1 -0
  54. package/esm/deps/jsr.io/@std/log/0.224.6/get_logger.js +21 -0
  55. package/esm/deps/jsr.io/@std/log/0.224.6/info.d.ts +5 -0
  56. package/esm/deps/jsr.io/@std/log/0.224.6/info.d.ts.map +1 -0
  57. package/esm/deps/jsr.io/@std/log/0.224.6/info.js +10 -0
  58. package/esm/deps/jsr.io/@std/log/0.224.6/levels.d.ts +26 -0
  59. package/esm/deps/jsr.io/@std/log/0.224.6/levels.d.ts.map +1 -0
  60. package/esm/deps/jsr.io/@std/log/0.224.6/levels.js +43 -0
  61. package/esm/deps/jsr.io/@std/log/0.224.6/logger.d.ts +62 -0
  62. package/esm/deps/jsr.io/@std/log/0.224.6/logger.d.ts.map +1 -0
  63. package/esm/deps/jsr.io/@std/log/0.224.6/logger.js +179 -0
  64. package/esm/deps/jsr.io/@std/log/0.224.6/mod.d.ts +390 -0
  65. package/esm/deps/jsr.io/@std/log/0.224.6/mod.d.ts.map +1 -0
  66. package/esm/deps/jsr.io/@std/log/0.224.6/mod.js +390 -0
  67. package/esm/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.d.ts +53 -0
  68. package/esm/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.d.ts.map +1 -0
  69. package/esm/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.js +125 -0
  70. package/esm/deps/jsr.io/@std/log/0.224.6/setup.d.ts +4 -0
  71. package/esm/deps/jsr.io/@std/log/0.224.6/setup.d.ts.map +1 -0
  72. package/esm/deps/jsr.io/@std/log/0.224.6/setup.js +41 -0
  73. package/esm/deps/jsr.io/@std/log/0.224.6/warn.d.ts +5 -0
  74. package/esm/deps/jsr.io/@std/log/0.224.6/warn.d.ts.map +1 -0
  75. package/esm/deps/jsr.io/@std/log/0.224.6/warn.js +10 -0
  76. package/esm/dsl/OasBase.d.ts.map +1 -0
  77. package/esm/{oas-elements → dsl}/OasBase.js +5 -4
  78. package/esm/generate/generate.d.ts +3 -1
  79. package/esm/generate/generate.d.ts.map +1 -1
  80. package/esm/generate/generate.js +5 -2
  81. package/esm/generate/generateModels.d.ts.map +1 -1
  82. package/esm/generate/generateModels.js +18 -5
  83. package/esm/generate/generateOperations.d.ts.map +1 -1
  84. package/esm/generate/generateOperations.js +20 -6
  85. package/esm/helpers/isImported.d.ts +2 -0
  86. package/esm/helpers/isImported.d.ts.map +1 -0
  87. package/esm/helpers/isImported.js +4 -0
  88. package/esm/helpers/refFns.d.ts +0 -1
  89. package/esm/helpers/refFns.d.ts.map +1 -1
  90. package/esm/helpers/refFns.js +0 -5
  91. package/esm/mod.d.ts +1 -2
  92. package/esm/mod.d.ts.map +1 -1
  93. package/esm/mod.js +1 -2
  94. package/esm/oas/array/Array.d.ts +1 -1
  95. package/esm/oas/array/Array.d.ts.map +1 -1
  96. package/esm/oas/array/Array.js +1 -1
  97. package/esm/oas/boolean/Boolean.d.ts +1 -1
  98. package/esm/oas/boolean/Boolean.d.ts.map +1 -1
  99. package/esm/oas/boolean/Boolean.js +1 -1
  100. package/esm/oas/components/Components.d.ts +1 -1
  101. package/esm/oas/components/Components.d.ts.map +1 -1
  102. package/esm/oas/components/Components.js +1 -1
  103. package/esm/oas/discriminator/Discriminator.d.ts +1 -1
  104. package/esm/oas/discriminator/Discriminator.d.ts.map +1 -1
  105. package/esm/oas/discriminator/Discriminator.js +1 -1
  106. package/esm/oas/document/Document.d.ts +1 -1
  107. package/esm/oas/document/Document.d.ts.map +1 -1
  108. package/esm/oas/document/Document.js +1 -1
  109. package/esm/oas/example/Example.d.ts +1 -1
  110. package/esm/oas/example/Example.d.ts.map +1 -1
  111. package/esm/oas/example/Example.js +1 -1
  112. package/esm/oas/example/toExamplesV3.js +1 -1
  113. package/esm/oas/header/Header.d.ts +1 -1
  114. package/esm/oas/header/Header.d.ts.map +1 -1
  115. package/esm/oas/header/Header.js +1 -1
  116. package/esm/oas/info/Info.d.ts +1 -1
  117. package/esm/oas/info/Info.d.ts.map +1 -1
  118. package/esm/oas/info/Info.js +1 -1
  119. package/esm/oas/integer/Integer.d.ts +1 -1
  120. package/esm/oas/integer/Integer.d.ts.map +1 -1
  121. package/esm/oas/integer/Integer.js +1 -1
  122. package/esm/oas/intersection/Intersection.d.ts +1 -1
  123. package/esm/oas/intersection/Intersection.d.ts.map +1 -1
  124. package/esm/oas/intersection/Intersection.js +1 -1
  125. package/esm/oas/mediaType/MediaType.d.ts +1 -1
  126. package/esm/oas/mediaType/MediaType.d.ts.map +1 -1
  127. package/esm/oas/mediaType/MediaType.js +1 -1
  128. package/esm/oas/number/Number.d.ts +1 -1
  129. package/esm/oas/number/Number.d.ts.map +1 -1
  130. package/esm/oas/number/Number.js +1 -1
  131. package/esm/oas/object/Object.d.ts +1 -1
  132. package/esm/oas/object/Object.d.ts.map +1 -1
  133. package/esm/oas/object/Object.js +1 -1
  134. package/esm/oas/operation/Operation.d.ts +1 -1
  135. package/esm/oas/operation/Operation.d.ts.map +1 -1
  136. package/esm/oas/operation/Operation.js +1 -1
  137. package/esm/oas/parameter/Parameter.d.ts +1 -1
  138. package/esm/oas/parameter/Parameter.d.ts.map +1 -1
  139. package/esm/oas/parameter/Parameter.js +1 -1
  140. package/esm/oas/pathItem/PathItem.d.ts +1 -1
  141. package/esm/oas/pathItem/PathItem.d.ts.map +1 -1
  142. package/esm/oas/pathItem/PathItem.js +1 -1
  143. package/esm/oas/ref/Ref.d.ts +1 -1
  144. package/esm/oas/ref/Ref.d.ts.map +1 -1
  145. package/esm/oas/ref/Ref.js +1 -1
  146. package/esm/oas/requestBody/RequestBody.d.ts +1 -1
  147. package/esm/oas/requestBody/RequestBody.d.ts.map +1 -1
  148. package/esm/oas/requestBody/RequestBody.js +1 -1
  149. package/esm/oas/response/Response.d.ts +1 -1
  150. package/esm/oas/response/Response.d.ts.map +1 -1
  151. package/esm/oas/response/Response.js +1 -1
  152. package/esm/oas/string/String.d.ts +1 -1
  153. package/esm/oas/string/String.d.ts.map +1 -1
  154. package/esm/oas/string/String.js +1 -1
  155. package/esm/oas/tag/Tag.d.ts +1 -1
  156. package/esm/oas/tag/Tag.d.ts.map +1 -1
  157. package/esm/oas/tag/Tag.js +1 -1
  158. package/esm/oas/union/Union.d.ts +1 -1
  159. package/esm/oas/union/Union.d.ts.map +1 -1
  160. package/esm/oas/union/Union.js +1 -1
  161. package/esm/oas/unknown/Unknown.d.ts +1 -1
  162. package/esm/oas/unknown/Unknown.d.ts.map +1 -1
  163. package/esm/oas/unknown/Unknown.js +1 -1
  164. package/esm/oas/void/Void.d.ts +1 -1
  165. package/esm/oas/void/Void.d.ts.map +1 -1
  166. package/esm/oas/void/Void.js +1 -1
  167. package/esm/server/createServer.d.ts.map +1 -1
  168. package/esm/server/createServer.js +8 -4
  169. package/esm/types/Manifest.d.ts +25 -1
  170. package/esm/types/Manifest.d.ts.map +1 -1
  171. package/esm/types/Manifest.js +7 -0
  172. package/package.json +1 -1
  173. package/script/context/CoreContext.d.ts +32 -3
  174. package/script/context/CoreContext.d.ts.map +1 -1
  175. package/script/context/CoreContext.js +132 -26
  176. package/script/context/GenerateContext.d.ts +4 -0
  177. package/script/context/GenerateContext.d.ts.map +1 -1
  178. package/script/context/GenerateContext.js +12 -0
  179. package/script/context/RenderContext.d.ts +4 -2
  180. package/script/context/RenderContext.d.ts.map +1 -1
  181. package/script/context/RenderContext.js +17 -1
  182. package/script/deps/jsr.io/@std/fmt/1.0.1/colors.d.ts +700 -0
  183. package/script/deps/jsr.io/@std/fmt/1.0.1/colors.d.ts.map +1 -0
  184. package/script/deps/jsr.io/@std/fmt/1.0.1/colors.js +976 -0
  185. package/script/deps/jsr.io/@std/fs/1.0.2/exists.d.ts +198 -0
  186. package/script/deps/jsr.io/@std/fs/1.0.2/exists.d.ts.map +1 -0
  187. package/script/deps/jsr.io/@std/fs/1.0.2/exists.js +278 -0
  188. package/script/deps/jsr.io/@std/io/0.224.6/types.d.ts +95 -0
  189. package/script/deps/jsr.io/@std/io/0.224.6/types.d.ts.map +1 -0
  190. package/script/deps/jsr.io/@std/io/0.224.6/types.js +4 -0
  191. package/script/deps/jsr.io/@std/io/0.224.6/write_all.d.ts +51 -0
  192. package/script/deps/jsr.io/@std/io/0.224.6/write_all.d.ts.map +1 -0
  193. package/script/deps/jsr.io/@std/io/0.224.6/write_all.js +65 -0
  194. package/script/deps/jsr.io/@std/log/0.224.6/_config.d.ts +4 -0
  195. package/script/deps/jsr.io/@std/log/0.224.6/_config.d.ts.map +1 -0
  196. package/script/deps/jsr.io/@std/log/0.224.6/_config.js +17 -0
  197. package/script/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.d.ts +8 -0
  198. package/script/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.d.ts.map +1 -0
  199. package/script/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.js +11 -0
  200. package/script/deps/jsr.io/@std/log/0.224.6/_state.d.ts +8 -0
  201. package/script/deps/jsr.io/@std/log/0.224.6/_state.d.ts.map +1 -0
  202. package/script/deps/jsr.io/@std/log/0.224.6/_state.js +10 -0
  203. package/script/deps/jsr.io/@std/log/0.224.6/base_handler.d.ts +22 -0
  204. package/script/deps/jsr.io/@std/log/0.224.6/base_handler.d.ts.map +1 -0
  205. package/script/deps/jsr.io/@std/log/0.224.6/base_handler.js +64 -0
  206. package/script/deps/jsr.io/@std/log/0.224.6/console_handler.d.ts +18 -0
  207. package/script/deps/jsr.io/@std/log/0.224.6/console_handler.d.ts.map +1 -0
  208. package/script/deps/jsr.io/@std/log/0.224.6/console_handler.js +62 -0
  209. package/script/deps/jsr.io/@std/log/0.224.6/critical.d.ts +5 -0
  210. package/script/deps/jsr.io/@std/log/0.224.6/critical.d.ts.map +1 -0
  211. package/script/deps/jsr.io/@std/log/0.224.6/critical.js +13 -0
  212. package/script/deps/jsr.io/@std/log/0.224.6/debug.d.ts +5 -0
  213. package/script/deps/jsr.io/@std/log/0.224.6/debug.d.ts.map +1 -0
  214. package/script/deps/jsr.io/@std/log/0.224.6/debug.js +13 -0
  215. package/script/deps/jsr.io/@std/log/0.224.6/error.d.ts +5 -0
  216. package/script/deps/jsr.io/@std/log/0.224.6/error.d.ts.map +1 -0
  217. package/script/deps/jsr.io/@std/log/0.224.6/error.js +13 -0
  218. package/script/deps/jsr.io/@std/log/0.224.6/file_handler.d.ts +51 -0
  219. package/script/deps/jsr.io/@std/log/0.224.6/file_handler.d.ts.map +1 -0
  220. package/script/deps/jsr.io/@std/log/0.224.6/file_handler.js +162 -0
  221. package/script/deps/jsr.io/@std/log/0.224.6/formatters.d.ts +6 -0
  222. package/script/deps/jsr.io/@std/log/0.224.6/formatters.d.ts.map +1 -0
  223. package/script/deps/jsr.io/@std/log/0.224.6/formatters.js +23 -0
  224. package/script/deps/jsr.io/@std/log/0.224.6/get_logger.d.ts +4 -0
  225. package/script/deps/jsr.io/@std/log/0.224.6/get_logger.d.ts.map +1 -0
  226. package/script/deps/jsr.io/@std/log/0.224.6/get_logger.js +24 -0
  227. package/script/deps/jsr.io/@std/log/0.224.6/info.d.ts +5 -0
  228. package/script/deps/jsr.io/@std/log/0.224.6/info.d.ts.map +1 -0
  229. package/script/deps/jsr.io/@std/log/0.224.6/info.js +13 -0
  230. package/script/deps/jsr.io/@std/log/0.224.6/levels.d.ts +26 -0
  231. package/script/deps/jsr.io/@std/log/0.224.6/levels.d.ts.map +1 -0
  232. package/script/deps/jsr.io/@std/log/0.224.6/levels.js +48 -0
  233. package/script/deps/jsr.io/@std/log/0.224.6/logger.d.ts +62 -0
  234. package/script/deps/jsr.io/@std/log/0.224.6/logger.d.ts.map +1 -0
  235. package/script/deps/jsr.io/@std/log/0.224.6/logger.js +185 -0
  236. package/script/deps/jsr.io/@std/log/0.224.6/mod.d.ts +390 -0
  237. package/script/deps/jsr.io/@std/log/0.224.6/mod.d.ts.map +1 -0
  238. package/script/deps/jsr.io/@std/log/0.224.6/mod.js +406 -0
  239. package/script/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.d.ts +53 -0
  240. package/script/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.d.ts.map +1 -0
  241. package/script/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.js +152 -0
  242. package/script/deps/jsr.io/@std/log/0.224.6/setup.d.ts +4 -0
  243. package/script/deps/jsr.io/@std/log/0.224.6/setup.d.ts.map +1 -0
  244. package/script/deps/jsr.io/@std/log/0.224.6/setup.js +44 -0
  245. package/script/deps/jsr.io/@std/log/0.224.6/warn.d.ts +5 -0
  246. package/script/deps/jsr.io/@std/log/0.224.6/warn.d.ts.map +1 -0
  247. package/script/deps/jsr.io/@std/log/0.224.6/warn.js +13 -0
  248. package/script/dsl/OasBase.d.ts.map +1 -0
  249. package/script/{oas-elements → dsl}/OasBase.js +5 -4
  250. package/script/generate/generate.d.ts +3 -1
  251. package/script/generate/generate.d.ts.map +1 -1
  252. package/script/generate/generate.js +5 -2
  253. package/script/generate/generateModels.d.ts.map +1 -1
  254. package/script/generate/generateModels.js +18 -5
  255. package/script/generate/generateOperations.d.ts.map +1 -1
  256. package/script/generate/generateOperations.js +20 -6
  257. package/script/helpers/isImported.d.ts +2 -0
  258. package/script/helpers/isImported.d.ts.map +1 -0
  259. package/script/helpers/isImported.js +8 -0
  260. package/script/helpers/refFns.d.ts +0 -1
  261. package/script/helpers/refFns.d.ts.map +1 -1
  262. package/script/helpers/refFns.js +1 -7
  263. package/script/mod.d.ts +1 -2
  264. package/script/mod.d.ts.map +1 -1
  265. package/script/mod.js +1 -2
  266. package/script/oas/array/Array.d.ts +1 -1
  267. package/script/oas/array/Array.d.ts.map +1 -1
  268. package/script/oas/array/Array.js +1 -1
  269. package/script/oas/boolean/Boolean.d.ts +1 -1
  270. package/script/oas/boolean/Boolean.d.ts.map +1 -1
  271. package/script/oas/boolean/Boolean.js +1 -1
  272. package/script/oas/components/Components.d.ts +1 -1
  273. package/script/oas/components/Components.d.ts.map +1 -1
  274. package/script/oas/components/Components.js +1 -1
  275. package/script/oas/discriminator/Discriminator.d.ts +1 -1
  276. package/script/oas/discriminator/Discriminator.d.ts.map +1 -1
  277. package/script/oas/discriminator/Discriminator.js +1 -1
  278. package/script/oas/document/Document.d.ts +1 -1
  279. package/script/oas/document/Document.d.ts.map +1 -1
  280. package/script/oas/document/Document.js +1 -1
  281. package/script/oas/example/Example.d.ts +1 -1
  282. package/script/oas/example/Example.d.ts.map +1 -1
  283. package/script/oas/example/Example.js +1 -1
  284. package/script/oas/example/toExamplesV3.js +1 -1
  285. package/script/oas/header/Header.d.ts +1 -1
  286. package/script/oas/header/Header.d.ts.map +1 -1
  287. package/script/oas/header/Header.js +1 -1
  288. package/script/oas/info/Info.d.ts +1 -1
  289. package/script/oas/info/Info.d.ts.map +1 -1
  290. package/script/oas/info/Info.js +1 -1
  291. package/script/oas/integer/Integer.d.ts +1 -1
  292. package/script/oas/integer/Integer.d.ts.map +1 -1
  293. package/script/oas/integer/Integer.js +1 -1
  294. package/script/oas/intersection/Intersection.d.ts +1 -1
  295. package/script/oas/intersection/Intersection.d.ts.map +1 -1
  296. package/script/oas/intersection/Intersection.js +1 -1
  297. package/script/oas/mediaType/MediaType.d.ts +1 -1
  298. package/script/oas/mediaType/MediaType.d.ts.map +1 -1
  299. package/script/oas/mediaType/MediaType.js +1 -1
  300. package/script/oas/number/Number.d.ts +1 -1
  301. package/script/oas/number/Number.d.ts.map +1 -1
  302. package/script/oas/number/Number.js +1 -1
  303. package/script/oas/object/Object.d.ts +1 -1
  304. package/script/oas/object/Object.d.ts.map +1 -1
  305. package/script/oas/object/Object.js +1 -1
  306. package/script/oas/operation/Operation.d.ts +1 -1
  307. package/script/oas/operation/Operation.d.ts.map +1 -1
  308. package/script/oas/operation/Operation.js +1 -1
  309. package/script/oas/parameter/Parameter.d.ts +1 -1
  310. package/script/oas/parameter/Parameter.d.ts.map +1 -1
  311. package/script/oas/parameter/Parameter.js +1 -1
  312. package/script/oas/pathItem/PathItem.d.ts +1 -1
  313. package/script/oas/pathItem/PathItem.d.ts.map +1 -1
  314. package/script/oas/pathItem/PathItem.js +1 -1
  315. package/script/oas/ref/Ref.d.ts +1 -1
  316. package/script/oas/ref/Ref.d.ts.map +1 -1
  317. package/script/oas/ref/Ref.js +1 -1
  318. package/script/oas/requestBody/RequestBody.d.ts +1 -1
  319. package/script/oas/requestBody/RequestBody.d.ts.map +1 -1
  320. package/script/oas/requestBody/RequestBody.js +1 -1
  321. package/script/oas/response/Response.d.ts +1 -1
  322. package/script/oas/response/Response.d.ts.map +1 -1
  323. package/script/oas/response/Response.js +1 -1
  324. package/script/oas/string/String.d.ts +1 -1
  325. package/script/oas/string/String.d.ts.map +1 -1
  326. package/script/oas/string/String.js +1 -1
  327. package/script/oas/tag/Tag.d.ts +1 -1
  328. package/script/oas/tag/Tag.d.ts.map +1 -1
  329. package/script/oas/tag/Tag.js +1 -1
  330. package/script/oas/union/Union.d.ts +1 -1
  331. package/script/oas/union/Union.d.ts.map +1 -1
  332. package/script/oas/union/Union.js +1 -1
  333. package/script/oas/unknown/Unknown.d.ts +1 -1
  334. package/script/oas/unknown/Unknown.d.ts.map +1 -1
  335. package/script/oas/unknown/Unknown.js +1 -1
  336. package/script/oas/void/Void.d.ts +1 -1
  337. package/script/oas/void/Void.d.ts.map +1 -1
  338. package/script/oas/void/Void.js +1 -1
  339. package/script/server/createServer.d.ts.map +1 -1
  340. package/script/server/createServer.js +8 -4
  341. package/script/types/Manifest.d.ts +25 -1
  342. package/script/types/Manifest.d.ts.map +1 -1
  343. package/script/types/Manifest.js +8 -1
  344. package/esm/context/LogStore.d.ts +0 -25
  345. package/esm/context/LogStore.d.ts.map +0 -1
  346. package/esm/context/LogStore.js +0 -53
  347. package/esm/helpers/logStatus.d.ts +0 -19
  348. package/esm/helpers/logStatus.d.ts.map +0 -1
  349. package/esm/helpers/logStatus.js +0 -16
  350. package/esm/oas-elements/OasBase.d.ts.map +0 -1
  351. package/script/context/LogStore.d.ts +0 -25
  352. package/script/context/LogStore.d.ts.map +0 -1
  353. package/script/context/LogStore.js +0 -57
  354. package/script/helpers/logStatus.d.ts +0 -19
  355. package/script/helpers/logStatus.d.ts.map +0 -1
  356. package/script/helpers/logStatus.js +0 -21
  357. package/script/oas-elements/OasBase.d.ts.map +0 -1
  358. /package/esm/{oas-elements → dsl}/OasBase.d.ts +0 -0
  359. /package/script/{oas-elements → dsl}/OasBase.d.ts +0 -0
@@ -0,0 +1,390 @@
1
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
+ /**
3
+ * Logging library with the support for terminal and file outputs. Also provides
4
+ * interfaces for building custom loggers.
5
+ *
6
+ * ## Loggers
7
+ *
8
+ * Loggers are objects that you interact with. When you use a logger method it
9
+ * constructs a `LogRecord` and passes it down to its handlers for output. To
10
+ * create custom loggers, specify them in `loggers` when calling `log.setup`.
11
+ *
12
+ * ## Custom message format
13
+ *
14
+ * If you want to override default format of message you can define `formatter`
15
+ * option for handler. It can a function that takes `LogRecord`
16
+ * as argument and outputs string.
17
+ *
18
+ * The default log format is `{levelName} {msg}`.
19
+ *
20
+ * ### Logging Structured JSON Lines
21
+ *
22
+ * To output logs in a structured JSON format you can configure most handlers
23
+ * with a formatter that produces a JSON string. Either use the premade
24
+ * `log.formatters.jsonFormatter` or write your own function that takes a
25
+ * {@linkcode LogRecord} and returns a JSON.stringify'd object.
26
+ * If you want the log to go to stdout then use {@linkcode ConsoleHandler} with
27
+ * the configuration `useColors: false` to turn off the ANSI terminal colours.
28
+ *
29
+ * ```ts
30
+ * import * as log from "@std/log";
31
+ *
32
+ * log.setup({
33
+ * handlers: {
34
+ * default: new log.ConsoleHandler("DEBUG", {
35
+ * formatter: log.formatters.jsonFormatter,
36
+ * useColors: false,
37
+ * }),
38
+ * },
39
+ * });
40
+ * ```
41
+ *
42
+ * The first argument passed to a log function is always treated as the
43
+ * message and will be stringified differently. To have arguments JSON.stringify'd
44
+ * you must pass them after the first.
45
+ *
46
+ * ```ts
47
+ * import * as log from "@std/log";
48
+ *
49
+ * log.info("This is the message", { thisWillBe: "JSON.stringify'd"});
50
+ * // {"level":"INFO","datetime":1702501580505,"message":"This is the message","args":{"thisWillBe":"JSON.stringify'd"}}
51
+ *
52
+ * log.info({ thisWontBe: "JSON.stringify'd"}, "This is an argument");
53
+ * // {"level":"INFO","datetime":1702501580505,"message":"{\"thisWontBe\":\"JSON.stringify'd\"}","args":"This is an argument"}
54
+ * ```
55
+ *
56
+ * ## Inline Logging
57
+ *
58
+ * Log functions return the data passed in the `msg` parameter. Data is returned
59
+ * regardless if the logger actually logs it.
60
+ *
61
+ * ## Lazy Log Evaluation
62
+ *
63
+ * Some log statements are expensive to compute. In these cases, you can use
64
+ * lazy log evaluation to prevent the computation taking place if the logger
65
+ * won't log the message.
66
+ *
67
+ * > NOTE: When using lazy log evaluation, `undefined` will be returned if the
68
+ * > resolver function is not called because the logger won't log it. It is an
69
+ * > antipattern use lazy evaluation with inline logging because the return value
70
+ * > depends on the current log level.
71
+ *
72
+ * ## For module authors
73
+ *
74
+ * The authors of public modules can let the users display the internal logs of the
75
+ * module by using a custom logger:
76
+ *
77
+ * ```ts
78
+ * import { getLogger } from "@std/log";
79
+ *
80
+ * function logger() {
81
+ * return getLogger("my-awesome-module");
82
+ * }
83
+ *
84
+ * export function sum(a: number, b: number) {
85
+ * logger().debug(`running ${a} + ${b}`);
86
+ * return a + b;
87
+ * }
88
+ *
89
+ * export function mult(a: number, b: number) {
90
+ * logger().debug(`running ${a} * ${b}`);
91
+ * return a * b;
92
+ * }
93
+ * ```
94
+ *
95
+ * The user of the module can then display the internal logs with:
96
+ *
97
+ * ```ts, ignore
98
+ * import * as log from "@std/log";
99
+ * import { sum } from "<the-awesome-module>/mod.ts";
100
+ *
101
+ * log.setup({
102
+ * handlers: {
103
+ * console: new log.ConsoleHandler("DEBUG"),
104
+ * },
105
+ *
106
+ * loggers: {
107
+ * "my-awesome-module": {
108
+ * level: "DEBUG",
109
+ * handlers: ["console"],
110
+ * },
111
+ * },
112
+ * });
113
+ *
114
+ * sum(1, 2); // prints "running 1 + 2" to the console
115
+ * ```
116
+ *
117
+ * Please note that, due to the order of initialization of the loggers, the
118
+ * following won't work:
119
+ *
120
+ * ```ts
121
+ * import { getLogger } from "@std/log";
122
+ *
123
+ * const logger = getLogger("my-awesome-module");
124
+ *
125
+ * export function sum(a: number, b: number) {
126
+ * logger.debug(`running ${a} + ${b}`); // no message will be logged, because getLogger() was called before log.setup()
127
+ * return a + b;
128
+ * }
129
+ * ```
130
+ *
131
+ * @example
132
+ * ```ts
133
+ * import * as log from "@std/log";
134
+ *
135
+ * // Simple default logger out of the box. You can customize it
136
+ * // by overriding logger and handler named "default", or providing
137
+ * // additional logger configurations. You can log any data type.
138
+ * log.debug("Hello world");
139
+ * log.info(123456);
140
+ * log.warn(true);
141
+ * log.error({ foo: "bar", fizz: "bazz" });
142
+ * log.critical("500 Internal server error");
143
+ *
144
+ * // custom configuration with 2 loggers (the default and `tasks` loggers).
145
+ * log.setup({
146
+ * handlers: {
147
+ * console: new log.ConsoleHandler("DEBUG"),
148
+ *
149
+ * file: new log.FileHandler("WARN", {
150
+ * filename: "./log.txt",
151
+ * // you can change format of output message using any keys in `LogRecord`.
152
+ * formatter: (record) => `${record.levelName} ${record.msg}`,
153
+ * }),
154
+ * },
155
+ *
156
+ * loggers: {
157
+ * // configure default logger available via short-hand methods above.
158
+ * default: {
159
+ * level: "DEBUG",
160
+ * handlers: ["console", "file"],
161
+ * },
162
+ *
163
+ * tasks: {
164
+ * level: "ERROR",
165
+ * handlers: ["console"],
166
+ * },
167
+ * },
168
+ * });
169
+ *
170
+ * let logger;
171
+ *
172
+ * // get default logger.
173
+ * logger = log.getLogger();
174
+ * logger.debug("fizz"); // logs to `console`, because `file` handler requires "WARN" level.
175
+ * logger.warn(41256); // logs to both `console` and `file` handlers.
176
+ *
177
+ * // get custom logger
178
+ * logger = log.getLogger("tasks");
179
+ * logger.debug("fizz"); // won't get output because this logger has "ERROR" level.
180
+ * logger.error({ productType: "book", value: "126.11" }); // log to `console`.
181
+ *
182
+ * // if you try to use a logger that hasn't been configured
183
+ * // you're good to go, it gets created automatically with level set to 0
184
+ * // so no message is logged.
185
+ * const unknownLogger = log.getLogger("mystery");
186
+ * unknownLogger.info("foobar"); // no-op
187
+ * ```
188
+ *
189
+ * @example
190
+ * Custom message format example
191
+ * ```ts
192
+ * import * as log from "@std/log";
193
+ *
194
+ * log.setup({
195
+ * handlers: {
196
+ * stringFmt: new log.ConsoleHandler("DEBUG", {
197
+ * formatter: (record) => `[${record.levelName}] ${record.msg}`,
198
+ * }),
199
+ *
200
+ * functionFmt: new log.ConsoleHandler("DEBUG", {
201
+ * formatter: (logRecord) => {
202
+ * let msg = `${logRecord.level} ${logRecord.msg}`;
203
+ *
204
+ * logRecord.args.forEach((arg, index) => {
205
+ * msg += `, arg${index}: ${arg}`;
206
+ * });
207
+ *
208
+ * return msg;
209
+ * },
210
+ * }),
211
+ *
212
+ * anotherFmt: new log.ConsoleHandler("DEBUG", {
213
+ * formatter: (record) => `[${record.loggerName}] - ${record.levelName} ${record.msg}`,
214
+ * }),
215
+ * },
216
+ *
217
+ * loggers: {
218
+ * default: {
219
+ * level: "DEBUG",
220
+ * handlers: ["stringFmt", "functionFmt"],
221
+ * },
222
+ * dataLogger: {
223
+ * level: "INFO",
224
+ * handlers: ["anotherFmt"],
225
+ * },
226
+ * },
227
+ * });
228
+ *
229
+ * // calling:
230
+ * log.debug("Hello, world!", 1, "two", [3, 4, 5]);
231
+ * // results in: [DEBUG] Hello, world!
232
+ * // output from "stringFmt" handler.
233
+ * // 10 Hello, world!, arg0: 1, arg1: two, arg3: [3, 4, 5] // output from "functionFmt" formatter.
234
+ *
235
+ * // calling:
236
+ * log.getLogger("dataLogger").error("oh no!");
237
+ * // results in:
238
+ * // [dataLogger] - ERROR oh no! // output from anotherFmt handler.
239
+ * ```
240
+
241
+ *
242
+ * @example
243
+ * JSON to stdout with no color example
244
+ * ```ts
245
+ * import * as log from "@std/log";
246
+ *
247
+ * log.setup({
248
+ * handlers: {
249
+ * jsonStdout: new log.ConsoleHandler("DEBUG", {
250
+ * formatter: log.formatters.jsonFormatter,
251
+ * useColors: false,
252
+ * }),
253
+ * },
254
+ *
255
+ * loggers: {
256
+ * default: {
257
+ * level: "DEBUG",
258
+ * handlers: ["jsonStdout"],
259
+ * },
260
+ * },
261
+ * });
262
+ *
263
+ * // calling:
264
+ * log.info("Hey");
265
+ * // results in:
266
+ * // {"level":"INFO","datetime":1702481922294,"message":"Hey"}
267
+ *
268
+ * // calling:
269
+ * log.info("Hey", { product: "nail" });
270
+ * // results in:
271
+ * // {"level":"INFO","datetime":1702484111115,"message":"Hey","args":{"product":"nail"}}
272
+ *
273
+ * // calling:
274
+ * log.info("Hey", 1, "two", [3, 4, 5]);
275
+ * // results in:
276
+ * // {"level":"INFO","datetime":1702481922294,"message":"Hey","args":[1,"two",[3,4,5]]}
277
+ * ```
278
+ *
279
+ * @example
280
+ * Custom JSON example
281
+ * ```ts
282
+ * import * as log from "@std/log";
283
+ *
284
+ * log.setup({
285
+ * handlers: {
286
+ * customJsonFmt: new log.ConsoleHandler("DEBUG", {
287
+ * formatter: (record) => JSON.stringify({
288
+ * lvl: record.level,
289
+ * msg: record.msg,
290
+ * time: record.datetime.toISOString(),
291
+ * name: record.loggerName,
292
+ * }),
293
+ * useColors: false,
294
+ * }),
295
+ * },
296
+ *
297
+ * loggers: {
298
+ * default: {
299
+ * level: "DEBUG",
300
+ * handlers: ["customJsonFmt"],
301
+ * },
302
+ * },
303
+ * });
304
+ *
305
+ * // calling:
306
+ * log.info("complete");
307
+ * // results in:
308
+ * // {"lvl":20,"msg":"complete","time":"2023-12-13T16:38:27.328Z","name":"default"}
309
+ * ```
310
+ *
311
+ * @example
312
+ * Inline Logging
313
+ * ```ts
314
+ * import * as logger from "@std/log";
315
+ *
316
+ * const stringData: string = logger.debug("hello world");
317
+ * const booleanData: boolean = logger.debug(true, 1, "abc");
318
+ * const fn = (): number => {
319
+ * return 123;
320
+ * };
321
+ * const resolvedFunctionData: number = logger.debug(fn());
322
+ * console.log(stringData); // 'hello world'
323
+ * console.log(booleanData); // true
324
+ * console.log(resolvedFunctionData); // 123
325
+ * ```
326
+ *
327
+ * @example
328
+ * Lazy Log Evaluation
329
+ * ```ts
330
+ * import * as log from "@std/log";
331
+ *
332
+ * log.setup({
333
+ * handlers: {
334
+ * console: new log.ConsoleHandler("DEBUG"),
335
+ * },
336
+ *
337
+ * loggers: {
338
+ * tasks: {
339
+ * level: "ERROR",
340
+ * handlers: ["console"],
341
+ * },
342
+ * },
343
+ * });
344
+ *
345
+ * function someExpensiveFn(num: number, bool: boolean) {
346
+ * // do some expensive computation
347
+ * }
348
+ *
349
+ * // not logged, as debug < error.
350
+ * const data = log.debug(() => someExpensiveFn(5, true));
351
+ * console.log(data); // undefined
352
+ * ```
353
+ *
354
+ * Handlers are responsible for actual output of log messages. When a handler is
355
+ * called by a logger, it firstly checks that {@linkcode LogRecord}'s level is
356
+ * not lower than level of the handler. If level check passes, handlers formats
357
+ * log record into string and outputs it to target.
358
+ *
359
+ * ## Custom handlers
360
+ *
361
+ * Custom handlers can be implemented by subclassing {@linkcode BaseHandler} or
362
+ * {@linkcode WriterHandler}.
363
+ *
364
+ * {@linkcode BaseHandler} is bare-bones handler that has no output logic at all,
365
+ *
366
+ * {@linkcode WriterHandler} is an abstract class that supports any target with
367
+ * `Writer` interface.
368
+ *
369
+ * During setup async hooks `setup` and `destroy` are called, you can use them
370
+ * to open and close file/HTTP connection or any other action you might need.
371
+ *
372
+ * For examples check source code of {@linkcode FileHandler}`
373
+ * and {@linkcode TestHandler}.
374
+ *
375
+ * @module
376
+ */
377
+ export * from "./base_handler.js";
378
+ export * from "./console_handler.js";
379
+ export * from "./file_handler.js";
380
+ export * from "./rotating_file_handler.js";
381
+ export * from "./levels.js";
382
+ export * from "./logger.js";
383
+ export * from "./formatters.js";
384
+ export * from "./critical.js";
385
+ export * from "./debug.js";
386
+ export * from "./error.js";
387
+ export * from "./get_logger.js";
388
+ export * from "./info.js";
389
+ export * from "./setup.js";
390
+ export * from "./warn.js";
@@ -0,0 +1,53 @@
1
+ import type { LevelName } from "./levels.js";
2
+ import { FileHandler, type FileHandlerOptions } from "./file_handler.js";
3
+ interface RotatingFileHandlerOptions extends FileHandlerOptions {
4
+ maxBytes: number;
5
+ maxBackupCount: number;
6
+ }
7
+ /**
8
+ * This handler extends the functionality of the {@linkcode FileHandler} by
9
+ * "rotating" the log file when it reaches a certain size. `maxBytes` specifies
10
+ * the maximum size in bytes that the log file can grow to before rolling over
11
+ * to a new one. If the size of the new log message plus the current log file
12
+ * size exceeds `maxBytes` then a roll-over is triggered. When a roll-over
13
+ * occurs, before the log message is written, the log file is renamed and
14
+ * appended with `.1`. If a `.1` version already existed, it would have been
15
+ * renamed `.2` first and so on. The maximum number of log files to keep is
16
+ * specified by `maxBackupCount`. After the renames are complete the log message
17
+ * is written to the original, now blank, file.
18
+ *
19
+ * Example: Given `log.txt`, `log.txt.1`, `log.txt.2` and `log.txt.3`, a
20
+ * `maxBackupCount` of 3 and a new log message which would cause `log.txt` to
21
+ * exceed `maxBytes`, then `log.txt.2` would be renamed to `log.txt.3` (thereby
22
+ * discarding the original contents of `log.txt.3` since 3 is the maximum number
23
+ * of backups to keep), `log.txt.1` would be renamed to `log.txt.2`, `log.txt`
24
+ * would be renamed to `log.txt.1` and finally `log.txt` would be created from
25
+ * scratch where the new log message would be written.
26
+ *
27
+ * This handler uses a buffer for writing log messages to file. Logs can be
28
+ * manually flushed with `fileHandler.flush()`. Log messages with a log level
29
+ * greater than ERROR are immediately flushed. Logs are also flushed on process
30
+ * completion.
31
+ *
32
+ * Additional notes on `mode` as described above:
33
+ *
34
+ * - `'a'` Default mode. As above, this will pick up where the logs left off in
35
+ * rotation, or create a new log file if it doesn't exist.
36
+ * - `'w'` in addition to starting with a clean `filename`, this mode will also
37
+ * cause any existing backups (up to `maxBackupCount`) to be deleted on setup
38
+ * giving a fully clean slate.
39
+ * - `'x'` requires that neither `filename`, nor any backups (up to
40
+ * `maxBackupCount`), exist before setup.
41
+ *
42
+ * This handler requires both `--allow-read` and `--allow-write` permissions on
43
+ * the log files.
44
+ */
45
+ export declare class RotatingFileHandler extends FileHandler {
46
+ #private;
47
+ constructor(levelName: LevelName, options: RotatingFileHandlerOptions);
48
+ setup(): void;
49
+ log(msg: string): void;
50
+ rotateLogFiles(): void;
51
+ }
52
+ export {};
53
+ //# sourceMappingURL=rotating_file_handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotating_file_handler.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AASzE,UAAU,0BAA2B,SAAQ,kBAAkB;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;;gBAKtC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,0BAA0B;IAM5D,KAAK;IAyCL,GAAG,CAAC,GAAG,EAAE,MAAM;IAaxB,cAAc;CAkBf"}
@@ -0,0 +1,125 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _RotatingFileHandler_maxBytes, _RotatingFileHandler_maxBackupCount, _RotatingFileHandler_currentFileSize;
13
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
14
+ import * as dntShim from "../../../../../_dnt.shims.js";
15
+ import { existsSync } from "../../fs/1.0.2/exists.js";
16
+ import { FileHandler } from "./file_handler.js";
17
+ import { encoderSymbol, filenameSymbol, fileSymbol, modeSymbol, openOptionsSymbol, } from "./_file_handler_symbols.js";
18
+ /**
19
+ * This handler extends the functionality of the {@linkcode FileHandler} by
20
+ * "rotating" the log file when it reaches a certain size. `maxBytes` specifies
21
+ * the maximum size in bytes that the log file can grow to before rolling over
22
+ * to a new one. If the size of the new log message plus the current log file
23
+ * size exceeds `maxBytes` then a roll-over is triggered. When a roll-over
24
+ * occurs, before the log message is written, the log file is renamed and
25
+ * appended with `.1`. If a `.1` version already existed, it would have been
26
+ * renamed `.2` first and so on. The maximum number of log files to keep is
27
+ * specified by `maxBackupCount`. After the renames are complete the log message
28
+ * is written to the original, now blank, file.
29
+ *
30
+ * Example: Given `log.txt`, `log.txt.1`, `log.txt.2` and `log.txt.3`, a
31
+ * `maxBackupCount` of 3 and a new log message which would cause `log.txt` to
32
+ * exceed `maxBytes`, then `log.txt.2` would be renamed to `log.txt.3` (thereby
33
+ * discarding the original contents of `log.txt.3` since 3 is the maximum number
34
+ * of backups to keep), `log.txt.1` would be renamed to `log.txt.2`, `log.txt`
35
+ * would be renamed to `log.txt.1` and finally `log.txt` would be created from
36
+ * scratch where the new log message would be written.
37
+ *
38
+ * This handler uses a buffer for writing log messages to file. Logs can be
39
+ * manually flushed with `fileHandler.flush()`. Log messages with a log level
40
+ * greater than ERROR are immediately flushed. Logs are also flushed on process
41
+ * completion.
42
+ *
43
+ * Additional notes on `mode` as described above:
44
+ *
45
+ * - `'a'` Default mode. As above, this will pick up where the logs left off in
46
+ * rotation, or create a new log file if it doesn't exist.
47
+ * - `'w'` in addition to starting with a clean `filename`, this mode will also
48
+ * cause any existing backups (up to `maxBackupCount`) to be deleted on setup
49
+ * giving a fully clean slate.
50
+ * - `'x'` requires that neither `filename`, nor any backups (up to
51
+ * `maxBackupCount`), exist before setup.
52
+ *
53
+ * This handler requires both `--allow-read` and `--allow-write` permissions on
54
+ * the log files.
55
+ */
56
+ export class RotatingFileHandler extends FileHandler {
57
+ constructor(levelName, options) {
58
+ super(levelName, options);
59
+ _RotatingFileHandler_maxBytes.set(this, void 0);
60
+ _RotatingFileHandler_maxBackupCount.set(this, void 0);
61
+ _RotatingFileHandler_currentFileSize.set(this, 0);
62
+ __classPrivateFieldSet(this, _RotatingFileHandler_maxBytes, options.maxBytes, "f");
63
+ __classPrivateFieldSet(this, _RotatingFileHandler_maxBackupCount, options.maxBackupCount, "f");
64
+ }
65
+ setup() {
66
+ if (__classPrivateFieldGet(this, _RotatingFileHandler_maxBytes, "f") < 1) {
67
+ this.destroy();
68
+ throw new Error(`"maxBytes" must be >= 1: received ${__classPrivateFieldGet(this, _RotatingFileHandler_maxBytes, "f")}`);
69
+ }
70
+ if (__classPrivateFieldGet(this, _RotatingFileHandler_maxBackupCount, "f") < 1) {
71
+ this.destroy();
72
+ throw new Error(`"maxBackupCount" must be >= 1: received ${__classPrivateFieldGet(this, _RotatingFileHandler_maxBackupCount, "f")}`);
73
+ }
74
+ super.setup();
75
+ if (this[modeSymbol] === "w") {
76
+ // Remove old backups too as it doesn't make sense to start with a clean
77
+ // log file, but old backups
78
+ for (let i = 1; i <= __classPrivateFieldGet(this, _RotatingFileHandler_maxBackupCount, "f"); i++) {
79
+ try {
80
+ dntShim.Deno.removeSync(this[filenameSymbol] + "." + i);
81
+ }
82
+ catch (error) {
83
+ if (!(error instanceof dntShim.Deno.errors.NotFound)) {
84
+ throw error;
85
+ }
86
+ }
87
+ }
88
+ }
89
+ else if (this[modeSymbol] === "x") {
90
+ // Throw if any backups also exist
91
+ for (let i = 1; i <= __classPrivateFieldGet(this, _RotatingFileHandler_maxBackupCount, "f"); i++) {
92
+ if (existsSync(this[filenameSymbol] + "." + i)) {
93
+ this.destroy();
94
+ throw new dntShim.Deno.errors.AlreadyExists("Backup log file " + this[filenameSymbol] + "." + i +
95
+ " already exists");
96
+ }
97
+ }
98
+ }
99
+ else {
100
+ __classPrivateFieldSet(this, _RotatingFileHandler_currentFileSize, (dntShim.Deno.statSync(this[filenameSymbol])).size, "f");
101
+ }
102
+ }
103
+ log(msg) {
104
+ const msgByteLength = this[encoderSymbol].encode(msg).byteLength + 1;
105
+ if (__classPrivateFieldGet(this, _RotatingFileHandler_currentFileSize, "f") + msgByteLength > __classPrivateFieldGet(this, _RotatingFileHandler_maxBytes, "f")) {
106
+ this.rotateLogFiles();
107
+ __classPrivateFieldSet(this, _RotatingFileHandler_currentFileSize, 0, "f");
108
+ }
109
+ super.log(msg);
110
+ __classPrivateFieldSet(this, _RotatingFileHandler_currentFileSize, __classPrivateFieldGet(this, _RotatingFileHandler_currentFileSize, "f") + msgByteLength, "f");
111
+ }
112
+ rotateLogFiles() {
113
+ this.flush();
114
+ this[fileSymbol].close();
115
+ for (let i = __classPrivateFieldGet(this, _RotatingFileHandler_maxBackupCount, "f") - 1; i >= 0; i--) {
116
+ const source = this[filenameSymbol] + (i === 0 ? "" : "." + i);
117
+ const dest = this[filenameSymbol] + "." + (i + 1);
118
+ if (existsSync(source)) {
119
+ dntShim.Deno.renameSync(source, dest);
120
+ }
121
+ }
122
+ this[fileSymbol] = dntShim.Deno.openSync(this[filenameSymbol], this[openOptionsSymbol]);
123
+ }
124
+ }
125
+ _RotatingFileHandler_maxBytes = new WeakMap(), _RotatingFileHandler_maxBackupCount = new WeakMap(), _RotatingFileHandler_currentFileSize = new WeakMap();
@@ -0,0 +1,4 @@
1
+ import { type LogConfig } from "./logger.js";
2
+ /** Setup logger config. */
3
+ export declare function setup(config: LogConfig): void;
4
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/log/0.224.6/setup.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,aAAa,CAAC;AAGrD,2BAA2B;AAC3B,wBAAgB,KAAK,CAAC,MAAM,EAAE,SAAS,QAwCtC"}
@@ -0,0 +1,41 @@
1
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { DEFAULT_CONFIG, DEFAULT_LEVEL } from "./_config.js";
4
+ import { Logger } from "./logger.js";
5
+ import { state } from "./_state.js";
6
+ /** Setup logger config. */
7
+ export function setup(config) {
8
+ state.config = {
9
+ handlers: { ...DEFAULT_CONFIG.handlers, ...config.handlers },
10
+ loggers: { ...DEFAULT_CONFIG.loggers, ...config.loggers },
11
+ };
12
+ // tear down existing handlers
13
+ state.handlers.forEach((handler) => {
14
+ handler.destroy();
15
+ });
16
+ state.handlers.clear();
17
+ // setup handlers
18
+ const handlers = state.config.handlers || {};
19
+ for (const [handlerName, handler] of Object.entries(handlers)) {
20
+ handler.setup();
21
+ state.handlers.set(handlerName, handler);
22
+ }
23
+ // remove existing loggers
24
+ state.loggers.clear();
25
+ // setup loggers
26
+ const loggers = state.config.loggers || {};
27
+ for (const [loggerName, loggerConfig] of Object.entries(loggers)) {
28
+ const handlerNames = loggerConfig.handlers || [];
29
+ const handlers = [];
30
+ handlerNames.forEach((handlerName) => {
31
+ const handler = state.handlers.get(handlerName);
32
+ if (handler) {
33
+ handlers.push(handler);
34
+ }
35
+ });
36
+ const levelName = loggerConfig.level || DEFAULT_LEVEL;
37
+ const logger = new Logger(loggerName, levelName, { handlers: handlers });
38
+ state.loggers.set(loggerName, logger);
39
+ }
40
+ }
41
+ setup(DEFAULT_CONFIG);
@@ -0,0 +1,5 @@
1
+ import type { GenericFunction } from "./logger.js";
2
+ /** Log with warning level, using default logger. */
3
+ export declare function warn<T>(msg: () => T, ...args: unknown[]): T | undefined;
4
+ export declare function warn<T>(msg: T extends GenericFunction ? never : T, ...args: unknown[]): T;
5
+ //# sourceMappingURL=warn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warn.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/log/0.224.6/warn.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,oDAAoD;AACpD,wBAAgB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;AACzE,wBAAgB,IAAI,CAAC,CAAC,EACpB,GAAG,EAAE,CAAC,SAAS,eAAe,GAAG,KAAK,GAAG,CAAC,EAC1C,GAAG,IAAI,EAAE,OAAO,EAAE,GACjB,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { getLogger } from "./get_logger.js";
4
+ export function warn(msg, ...args) {
5
+ // Assist TS compiler with pass-through generic type
6
+ if (msg instanceof Function) {
7
+ return getLogger("default").warn(msg, ...args);
8
+ }
9
+ return getLogger("default").warn(msg, ...args);
10
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OasBase.d.ts","sourceRoot":"","sources":["../../src/dsl/OasBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAE5D,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,KAAK,CAAA;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,OAAO,EAAE,WAAW,CAAA;CACrB,CAAA;AAED,qBAAa,OAAO;IAClB,KAAK,EAAE,KAAK,CAAA;IACZ,OAAO,EAAE,WAAW,CAAA;gBAER,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,WAAW;IAOpD,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAgBlD"}
@@ -17,11 +17,12 @@ export class OasBase {
17
17
  this.logSkippedFields(skipped);
18
18
  }
19
19
  logSkippedFields(skipped) {
20
+ if (this.context.phaseType !== 'parse') {
21
+ return;
22
+ }
23
+ const { logger } = this.context;
20
24
  Object.entries(skipped).forEach(([key, value]) => {
21
- console.warn(JSON.stringify({
22
- trail: this.trail.add(key).toString(),
23
- message: `Property not yet implemented. Please request from support if needed - ${JSON.stringify(value).slice(0, 20)}`
24
- }));
25
+ logger.warn(`Property not yet implemented. Please request from support if needed - ${JSON.stringify(value).slice(0, 30)}`, { trail: this.trail.add(key).toString() });
25
26
  });
26
27
  }
27
28
  }