@flink-app/flink 0.14.3 → 2.0.0-alpha.100

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 (280) hide show
  1. package/CHANGELOG.md +1051 -0
  2. package/SCHEMA_EXTRACTION_ANALYSIS.md +494 -0
  3. package/SIMPLE_AST_FEASIBILITY.md +570 -0
  4. package/bin/flink.ts +13 -2
  5. package/cli/build.ts +24 -44
  6. package/cli/clean.ts +13 -25
  7. package/cli/cli-utils.ts +190 -17
  8. package/cli/dev.ts +252 -0
  9. package/cli/loadEnvFiles.ts +116 -0
  10. package/cli/run.ts +45 -62
  11. package/dist/bin/flink.js +61 -2
  12. package/dist/cli/build.js +20 -25
  13. package/dist/cli/clean.js +12 -10
  14. package/dist/cli/cli-utils.d.ts +34 -3
  15. package/dist/cli/cli-utils.js +193 -12
  16. package/dist/cli/dev.d.ts +2 -0
  17. package/dist/cli/dev.js +279 -0
  18. package/dist/cli/loadEnvFiles.d.ts +30 -0
  19. package/dist/cli/loadEnvFiles.js +113 -0
  20. package/dist/cli/run.js +47 -46
  21. package/dist/src/DependencyTracker.d.ts +44 -0
  22. package/dist/src/DependencyTracker.js +239 -0
  23. package/dist/src/FlinkApp.d.ts +163 -10
  24. package/dist/src/FlinkApp.js +847 -184
  25. package/dist/src/FlinkContext.d.ts +41 -0
  26. package/dist/src/FlinkErrors.d.ts +19 -6
  27. package/dist/src/FlinkErrors.js +36 -42
  28. package/dist/src/FlinkHttpHandler.d.ts +219 -26
  29. package/dist/src/FlinkHttpHandler.js +37 -1
  30. package/dist/src/FlinkJob.d.ts +10 -0
  31. package/dist/src/FlinkLog.d.ts +82 -18
  32. package/dist/src/FlinkLog.js +165 -13
  33. package/dist/src/FlinkLogFactory.d.ts +288 -0
  34. package/dist/src/FlinkLogFactory.js +619 -0
  35. package/dist/src/FlinkRepo.d.ts +10 -2
  36. package/dist/src/FlinkRepo.js +11 -1
  37. package/dist/src/FlinkRequestContext.d.ts +63 -0
  38. package/dist/src/FlinkRequestContext.js +74 -0
  39. package/dist/src/FlinkResponse.d.ts +6 -0
  40. package/dist/src/FlinkService.d.ts +38 -0
  41. package/dist/src/FlinkService.js +46 -0
  42. package/dist/src/LeaderElection.d.ts +45 -0
  43. package/dist/src/LeaderElection.js +269 -0
  44. package/dist/src/SchemaCache.d.ts +84 -0
  45. package/dist/src/SchemaCache.js +289 -0
  46. package/dist/src/TypeScriptCompiler.d.ts +161 -51
  47. package/dist/src/TypeScriptCompiler.js +1253 -617
  48. package/dist/src/TypeScriptUtils.js +4 -0
  49. package/dist/src/ai/AgentRunner.d.ts +39 -0
  50. package/dist/src/ai/AgentRunner.js +760 -0
  51. package/dist/src/ai/ConversationAgent.d.ts +279 -0
  52. package/dist/src/ai/ConversationAgent.js +404 -0
  53. package/dist/src/ai/ConversationFlinkAgent.d.ts +278 -0
  54. package/dist/src/ai/ConversationFlinkAgent.js +404 -0
  55. package/dist/src/ai/FlinkAgent.d.ts +690 -0
  56. package/dist/src/ai/FlinkAgent.js +729 -0
  57. package/dist/src/ai/FlinkTool.d.ts +135 -0
  58. package/dist/src/ai/FlinkTool.js +2 -0
  59. package/dist/src/ai/InMemoryConversationAgent.d.ts +121 -0
  60. package/dist/src/ai/InMemoryConversationAgent.js +209 -0
  61. package/dist/src/ai/LLMAdapter.d.ts +148 -0
  62. package/dist/src/ai/LLMAdapter.js +2 -0
  63. package/dist/src/ai/PersistentFlinkAgent.d.ts +278 -0
  64. package/dist/src/ai/PersistentFlinkAgent.js +403 -0
  65. package/dist/src/ai/SubAgentExecutor.d.ts +38 -0
  66. package/dist/src/ai/SubAgentExecutor.js +223 -0
  67. package/dist/src/ai/ToolExecutor.d.ts +64 -0
  68. package/dist/src/ai/ToolExecutor.js +497 -0
  69. package/dist/src/ai/agentInstructions.d.ts +68 -0
  70. package/dist/src/ai/agentInstructions.js +286 -0
  71. package/dist/src/ai/index.d.ts +8 -0
  72. package/dist/src/ai/index.js +26 -0
  73. package/dist/src/ai/instructionFileLoader.d.ts +44 -0
  74. package/dist/src/ai/instructionFileLoader.js +179 -0
  75. package/dist/src/auth/FlinkAuthPlugin.d.ts +1 -1
  76. package/dist/src/handlers/StreamWriterFactory.d.ts +20 -0
  77. package/dist/src/handlers/StreamWriterFactory.js +83 -0
  78. package/dist/src/index.d.ts +14 -0
  79. package/dist/src/index.js +17 -0
  80. package/dist/src/loadPluginSchemas.d.ts +45 -0
  81. package/dist/src/loadPluginSchemas.js +143 -0
  82. package/dist/src/schema-extraction/ComplexTypeDetection.d.ts +40 -0
  83. package/dist/src/schema-extraction/ComplexTypeDetection.js +75 -0
  84. package/dist/src/schema-extraction/TypeScriptSourceParser.d.ts +321 -0
  85. package/dist/src/schema-extraction/TypeScriptSourceParser.js +925 -0
  86. package/dist/src/schema-extraction/TypeScriptSourceParser.spec.d.ts +1 -0
  87. package/dist/src/schema-extraction/TypeScriptSourceParser.spec.js +233 -0
  88. package/dist/src/schema-extraction/TypeScriptTokenizer.d.ts +57 -0
  89. package/dist/src/schema-extraction/TypeScriptTokenizer.js +177 -0
  90. package/dist/src/schema-extraction/index.d.ts +2 -0
  91. package/dist/src/schema-extraction/index.js +20 -0
  92. package/dist/src/schema-extraction/types.d.ts +31 -0
  93. package/dist/src/schema-extraction/types.js +2 -0
  94. package/dist/src/utils/loadFlinkConfig.d.ts +53 -0
  95. package/dist/src/utils/loadFlinkConfig.js +77 -0
  96. package/dist/src/utils.d.ts +30 -0
  97. package/dist/src/utils.js +52 -0
  98. package/dist/src/workers/SchemaGeneratorWorker.d.ts +1 -0
  99. package/dist/src/workers/SchemaGeneratorWorker.js +49 -0
  100. package/dist/src/workers/WorkerPool.d.ts +60 -0
  101. package/dist/src/workers/WorkerPool.js +306 -0
  102. package/examples/logging-hierarchical-example.ts +125 -0
  103. package/package.json +29 -4
  104. package/readme.md +499 -0
  105. package/spec/AgentDescendantDetection.spec.ts +335 -0
  106. package/spec/AgentDuplicateDetection.spec.ts +112 -0
  107. package/spec/AgentObserver.spec.ts +266 -0
  108. package/spec/AgentRunner.spec.ts +1062 -0
  109. package/spec/AsyncLocalStorageContext.spec.ts +223 -0
  110. package/spec/ConversationHooks.spec.ts +257 -0
  111. package/spec/FlinkAgent.spec.ts +681 -0
  112. package/spec/FlinkApp.htmlResponse.spec.ts +260 -0
  113. package/spec/FlinkApp.onError.invocation.spec.ts +151 -0
  114. package/spec/FlinkApp.onError.spec.ts +1 -2
  115. package/spec/FlinkApp.query.spec.ts +107 -0
  116. package/spec/FlinkApp.routeOrdering.spec.ts +61 -0
  117. package/spec/FlinkApp.undefinedResponse.spec.ts +123 -0
  118. package/spec/FlinkApp.validationMode.spec.ts +155 -0
  119. package/spec/FlinkJob.spec.ts +171 -0
  120. package/spec/FlinkLogFactory.spec.ts +337 -0
  121. package/spec/FlinkRepo.spec.ts +1 -1
  122. package/spec/LeaderElection.spec.ts +174 -0
  123. package/spec/StreamingIntegration.spec.ts +139 -0
  124. package/spec/ToolExecutor.spec.ts +465 -0
  125. package/spec/TypeScriptCompiler.spec.ts +1 -1
  126. package/spec/TypeScriptSourceParser.spec.ts +1215 -0
  127. package/spec/TypeScriptTokenizer.spec.ts +366 -0
  128. package/spec/ai/ContextCompaction.spec.ts +405 -0
  129. package/spec/ai/ConversationAgent.spec.ts +520 -0
  130. package/spec/ai/InMemoryConversationAgent.spec.ts +144 -0
  131. package/spec/ai/agentInstructions.spec.ts +358 -0
  132. package/spec/fixtures/agent-instructions/TestAgent.ts +24 -0
  133. package/spec/fixtures/agent-instructions/simple.md +3 -0
  134. package/spec/fixtures/agent-instructions/template.md +18 -0
  135. package/spec/fixtures/agent-instructions/yaml-format.yaml +9 -0
  136. package/spec/mock-project/dist/.tsbuildinfo +1 -0
  137. package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCar.js +56 -0
  138. package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCar2.js +58 -0
  139. package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithArraySchema.js +52 -0
  140. package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithArraySchema2.js +52 -0
  141. package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithArraySchema3.js +52 -0
  142. package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithLiteralSchema.js +54 -0
  143. package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithLiteralSchema2.js +54 -0
  144. package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithSchemaInFile.js +57 -0
  145. package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithSchemaInFile2.js +57 -0
  146. package/spec/mock-project/dist/spec/mock-project/src/handlers/ManuallyAddedHandler.js +53 -0
  147. package/spec/mock-project/dist/spec/mock-project/src/handlers/ManuallyAddedHandler2.js +55 -0
  148. package/spec/mock-project/dist/spec/mock-project/src/handlers/PatchCar.js +57 -0
  149. package/spec/mock-project/dist/spec/mock-project/src/handlers/PatchOnboardingSession.js +75 -0
  150. package/spec/mock-project/dist/spec/mock-project/src/handlers/PatchOrderWithComplexTypes.js +57 -0
  151. package/spec/mock-project/dist/spec/mock-project/src/handlers/PatchProductWithIntersection.js +58 -0
  152. package/spec/mock-project/dist/spec/mock-project/src/handlers/PatchUserWithUnion.js +58 -0
  153. package/spec/mock-project/dist/spec/mock-project/src/handlers/PostCar.js +54 -0
  154. package/spec/mock-project/dist/spec/mock-project/src/handlers/PostLogin.js +55 -0
  155. package/spec/mock-project/dist/spec/mock-project/src/handlers/PostLogout.js +54 -0
  156. package/spec/mock-project/dist/spec/mock-project/src/handlers/PutCar.js +54 -0
  157. package/spec/mock-project/dist/spec/mock-project/src/index.js +83 -0
  158. package/spec/mock-project/dist/spec/mock-project/src/repos/CarRepo.js +26 -0
  159. package/spec/mock-project/dist/spec/mock-project/src/schemas/Car.js +2 -0
  160. package/spec/mock-project/dist/spec/mock-project/src/schemas/DefaultExportSchema.js +2 -0
  161. package/spec/mock-project/dist/spec/mock-project/src/schemas/FileWithTwoSchemas.js +2 -0
  162. package/spec/mock-project/dist/src/FlinkApp.js +1000 -0
  163. package/spec/mock-project/dist/src/FlinkContext.js +2 -0
  164. package/spec/mock-project/dist/src/FlinkErrors.js +143 -0
  165. package/spec/mock-project/dist/src/FlinkHttpHandler.js +47 -0
  166. package/spec/mock-project/dist/src/FlinkJob.js +2 -0
  167. package/spec/mock-project/dist/src/FlinkLog.js +119 -0
  168. package/spec/mock-project/dist/src/FlinkLogFactory.js +617 -0
  169. package/spec/mock-project/dist/src/FlinkPlugin.js +2 -0
  170. package/spec/mock-project/dist/src/FlinkRepo.js +224 -0
  171. package/spec/mock-project/dist/src/FlinkRequestContext.js +74 -0
  172. package/spec/mock-project/dist/src/FlinkResponse.js +2 -0
  173. package/spec/mock-project/dist/src/ai/AgentExecutor.js +279 -0
  174. package/spec/mock-project/dist/src/ai/AgentRunner.js +632 -0
  175. package/spec/mock-project/dist/src/ai/ConversationAgent.js +402 -0
  176. package/spec/mock-project/dist/src/ai/ConversationFlinkAgent.js +422 -0
  177. package/spec/mock-project/dist/src/ai/FlinkAgent.js +699 -0
  178. package/spec/mock-project/dist/src/ai/FlinkTool.js +2 -0
  179. package/spec/mock-project/dist/src/ai/InMemoryConversationAgent.js +209 -0
  180. package/spec/mock-project/dist/src/ai/LLMAdapter.js +2 -0
  181. package/spec/mock-project/dist/src/ai/SubAgentExecutor.js +223 -0
  182. package/spec/mock-project/dist/src/ai/ToolExecutor.js +412 -0
  183. package/spec/mock-project/dist/src/ai/agentInstructions.js +246 -0
  184. package/spec/mock-project/dist/src/auth/FlinkAuthPlugin.js +2 -0
  185. package/spec/mock-project/dist/src/auth/FlinkAuthUser.js +2 -0
  186. package/spec/mock-project/dist/src/handlers/GetCar.js +26 -52
  187. package/spec/mock-project/dist/src/handlers/GetCar.js.map +1 -0
  188. package/spec/mock-project/dist/src/handlers/GetCar2.js +32 -54
  189. package/spec/mock-project/dist/src/handlers/GetCar2.js.map +1 -0
  190. package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema.js +26 -48
  191. package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema.js.map +1 -0
  192. package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema2.js +28 -48
  193. package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema2.js.map +1 -0
  194. package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema3.js +29 -48
  195. package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema3.js.map +1 -0
  196. package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema.js +26 -50
  197. package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema.js.map +1 -0
  198. package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema2.js +28 -50
  199. package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema2.js.map +1 -0
  200. package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile.js +27 -53
  201. package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile.js.map +1 -0
  202. package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile2.js +29 -53
  203. package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile2.js.map +1 -0
  204. package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler.js +16 -49
  205. package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler.js.map +1 -0
  206. package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler2.js +25 -50
  207. package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler2.js.map +1 -0
  208. package/spec/mock-project/dist/src/handlers/PatchCar.js +27 -53
  209. package/spec/mock-project/dist/src/handlers/PatchCar.js.map +1 -0
  210. package/spec/mock-project/dist/src/handlers/PatchOnboardingSession.js +44 -70
  211. package/spec/mock-project/dist/src/handlers/PatchOnboardingSession.js.map +1 -0
  212. package/spec/mock-project/dist/src/handlers/PatchOrderWithComplexTypes.js +27 -53
  213. package/spec/mock-project/dist/src/handlers/PatchOrderWithComplexTypes.js.map +1 -0
  214. package/spec/mock-project/dist/src/handlers/PatchProductWithIntersection.js +28 -54
  215. package/spec/mock-project/dist/src/handlers/PatchProductWithIntersection.js.map +1 -0
  216. package/spec/mock-project/dist/src/handlers/PatchUserWithUnion.js +28 -54
  217. package/spec/mock-project/dist/src/handlers/PatchUserWithUnion.js.map +1 -0
  218. package/spec/mock-project/dist/src/handlers/PostCar.js +24 -50
  219. package/spec/mock-project/dist/src/handlers/PostCar.js.map +1 -0
  220. package/spec/mock-project/dist/src/handlers/PostLogin.js +25 -51
  221. package/spec/mock-project/dist/src/handlers/PostLogin.js.map +1 -0
  222. package/spec/mock-project/dist/src/handlers/PostLogout.js +24 -50
  223. package/spec/mock-project/dist/src/handlers/PostLogout.js.map +1 -0
  224. package/spec/mock-project/dist/src/handlers/PutCar.js +24 -50
  225. package/spec/mock-project/dist/src/handlers/PutCar.js.map +1 -0
  226. package/spec/mock-project/dist/src/handlers/StreamWriterFactory.js +83 -0
  227. package/spec/mock-project/dist/src/index.js +52 -76
  228. package/spec/mock-project/dist/src/index.js.map +1 -0
  229. package/spec/mock-project/dist/src/mock-data-generator.js +9 -0
  230. package/spec/mock-project/dist/src/repos/CarRepo.js +12 -24
  231. package/spec/mock-project/dist/src/repos/CarRepo.js.map +1 -0
  232. package/spec/mock-project/dist/src/schemas/Car.js +3 -1
  233. package/spec/mock-project/dist/src/schemas/Car.js.map +1 -0
  234. package/spec/mock-project/dist/src/schemas/DefaultExportSchema.js +3 -1
  235. package/spec/mock-project/dist/src/schemas/DefaultExportSchema.js.map +1 -0
  236. package/spec/mock-project/dist/src/schemas/FileWithTwoSchemas.js +3 -1
  237. package/spec/mock-project/dist/src/schemas/FileWithTwoSchemas.js.map +1 -0
  238. package/spec/mock-project/dist/src/utils.js +290 -0
  239. package/spec/mock-project/tsconfig.json +6 -1
  240. package/spec/schema-generation-nested-objects.spec.ts +97 -0
  241. package/spec/testHelpers.ts +49 -0
  242. package/spec/utils.caseConversion.spec.ts +78 -0
  243. package/spec/utils.spec.ts +13 -13
  244. package/src/DependencyTracker.ts +166 -0
  245. package/src/FlinkApp.ts +919 -155
  246. package/src/FlinkContext.ts +43 -0
  247. package/src/FlinkErrors.ts +32 -12
  248. package/src/FlinkHttpHandler.ts +246 -28
  249. package/src/FlinkJob.ts +11 -0
  250. package/src/FlinkLog.ts +119 -12
  251. package/src/FlinkLogFactory.ts +699 -0
  252. package/src/FlinkRepo.ts +10 -3
  253. package/src/FlinkRequestContext.ts +95 -0
  254. package/src/FlinkResponse.ts +6 -0
  255. package/src/FlinkService.ts +49 -0
  256. package/src/LeaderElection.ts +203 -0
  257. package/src/SchemaCache.ts +232 -0
  258. package/src/TypeScriptCompiler.ts +1347 -610
  259. package/src/TypeScriptUtils.ts +5 -0
  260. package/src/ai/AgentRunner.ts +646 -0
  261. package/src/ai/ConversationAgent.ts +413 -0
  262. package/src/ai/FlinkAgent.ts +1069 -0
  263. package/src/ai/FlinkTool.ts +165 -0
  264. package/src/ai/InMemoryConversationAgent.ts +149 -0
  265. package/src/ai/LLMAdapter.ts +126 -0
  266. package/src/ai/ToolExecutor.ts +485 -0
  267. package/src/ai/agentInstructions.ts +245 -0
  268. package/src/ai/index.ts +8 -0
  269. package/src/ai/instructionFileLoader.ts +156 -0
  270. package/src/auth/FlinkAuthPlugin.ts +2 -1
  271. package/src/handlers/StreamWriterFactory.ts +84 -0
  272. package/src/index.ts +14 -0
  273. package/src/loadPluginSchemas.ts +141 -0
  274. package/src/schema-extraction/TypeScriptSourceParser.ts +1058 -0
  275. package/src/schema-extraction/TypeScriptTokenizer.ts +205 -0
  276. package/src/schema-extraction/index.ts +2 -0
  277. package/src/schema-extraction/types.ts +34 -0
  278. package/src/utils/loadFlinkConfig.ts +89 -0
  279. package/src/utils.ts +52 -0
  280. package/tsconfig.json +6 -1
@@ -0,0 +1,617 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
14
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
15
+ if (ar || !(i in from)) {
16
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
17
+ ar[i] = from[i];
18
+ }
19
+ }
20
+ return to.concat(ar || Array.prototype.slice.call(from));
21
+ };
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.FlinkLogFactory = exports.ComponentLogger = void 0;
27
+ var node_color_log_1 = __importDefault(require("node-color-log"));
28
+ var LOG_LEVELS = {
29
+ trace: 0,
30
+ debug: 1,
31
+ info: 2,
32
+ warn: 3,
33
+ error: 4,
34
+ };
35
+ /**
36
+ * Component-specific logger with independent log level control
37
+ */
38
+ var ComponentLogger = /** @class */ (function () {
39
+ function ComponentLogger(componentName) {
40
+ this.componentLevel = null;
41
+ this.componentName = componentName;
42
+ this.namedLogger = node_color_log_1.default.createNamedLogger(componentName);
43
+ }
44
+ /**
45
+ * Set log level for this specific component.
46
+ * Overrides the global log level.
47
+ */
48
+ ComponentLogger.prototype.setLevel = function (level) {
49
+ this.componentLevel = level;
50
+ };
51
+ /**
52
+ * Clear component-specific level and fall back to global level
53
+ */
54
+ ComponentLogger.prototype.clearLevel = function () {
55
+ this.componentLevel = null;
56
+ };
57
+ /**
58
+ * Check if a message should be logged based on component and global levels
59
+ */
60
+ ComponentLogger.prototype.shouldLog = function (messageLevel) {
61
+ var _a;
62
+ var effectiveLevel = (_a = this.componentLevel) !== null && _a !== void 0 ? _a : FlinkLogFactory.getGlobalLevel();
63
+ return LOG_LEVELS[messageLevel] >= LOG_LEVELS[effectiveLevel];
64
+ };
65
+ ComponentLogger.prototype.trace = function () {
66
+ var args = [];
67
+ for (var _i = 0; _i < arguments.length; _i++) {
68
+ args[_i] = arguments[_i];
69
+ }
70
+ if (this.shouldLog("trace")) {
71
+ // node-color-log doesn't support trace, use console.log for stdout
72
+ var timestamp = new Date().toISOString();
73
+ console.log.apply(console, __spreadArray(["".concat(timestamp, " [").concat(this.componentName, "] [TRACE]")], args, false));
74
+ }
75
+ };
76
+ ComponentLogger.prototype.debug = function () {
77
+ var _a;
78
+ var args = [];
79
+ for (var _i = 0; _i < arguments.length; _i++) {
80
+ args[_i] = arguments[_i];
81
+ }
82
+ if (this.shouldLog("debug")) {
83
+ (_a = this.namedLogger).debug.apply(_a, args);
84
+ }
85
+ };
86
+ ComponentLogger.prototype.info = function () {
87
+ var _a;
88
+ var args = [];
89
+ for (var _i = 0; _i < arguments.length; _i++) {
90
+ args[_i] = arguments[_i];
91
+ }
92
+ if (this.shouldLog("info")) {
93
+ (_a = this.namedLogger).info.apply(_a, args);
94
+ }
95
+ };
96
+ ComponentLogger.prototype.warn = function () {
97
+ var args = [];
98
+ for (var _i = 0; _i < arguments.length; _i++) {
99
+ args[_i] = arguments[_i];
100
+ }
101
+ if (this.shouldLog("warn")) {
102
+ // Use console.warn to write to stderr (Unix/POSIX best practice)
103
+ var timestamp = new Date().toISOString();
104
+ console.warn.apply(console, __spreadArray(["".concat(timestamp, " [").concat(this.componentName, "] [WARN]")], args, false));
105
+ }
106
+ };
107
+ ComponentLogger.prototype.error = function () {
108
+ var args = [];
109
+ for (var _i = 0; _i < arguments.length; _i++) {
110
+ args[_i] = arguments[_i];
111
+ }
112
+ if (this.shouldLog("error")) {
113
+ // Use console.error to write to stderr (Unix/POSIX best practice)
114
+ var timestamp = new Date().toISOString();
115
+ console.error.apply(console, __spreadArray(["".concat(timestamp, " [").concat(this.componentName, "] [ERROR]")], args, false));
116
+ }
117
+ };
118
+ ComponentLogger.prototype.json = function () {
119
+ var args = [];
120
+ for (var _i = 0; _i < arguments.length; _i++) {
121
+ args[_i] = arguments[_i];
122
+ }
123
+ if (this.shouldLog("debug")) {
124
+ for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {
125
+ var o = args_1[_a];
126
+ console.log(JSON.stringify(o, null, 2));
127
+ }
128
+ }
129
+ };
130
+ ComponentLogger.prototype.bgColorLog = function (color) {
131
+ var _a;
132
+ var args = [];
133
+ for (var _i = 1; _i < arguments.length; _i++) {
134
+ args[_i - 1] = arguments[_i];
135
+ }
136
+ if (this.shouldLog("debug")) {
137
+ (_a = this.namedLogger).bgColorLog.apply(_a, __spreadArray([color], args, false));
138
+ }
139
+ };
140
+ ComponentLogger.prototype.fontColorLog = function (color) {
141
+ var _a;
142
+ var args = [];
143
+ for (var _i = 1; _i < arguments.length; _i++) {
144
+ args[_i - 1] = arguments[_i];
145
+ }
146
+ if (this.shouldLog("info")) {
147
+ (_a = this.namedLogger).fontColorLog.apply(_a, __spreadArray([color], args, false));
148
+ }
149
+ };
150
+ return ComponentLogger;
151
+ }());
152
+ exports.ComponentLogger = ComponentLogger;
153
+ /**
154
+ * Factory for creating component-specific loggers with hierarchical level control
155
+ */
156
+ var FlinkLogFactory = /** @class */ (function () {
157
+ function FlinkLogFactory() {
158
+ }
159
+ /**
160
+ * Set the global log level (affects all loggers without component-specific levels)
161
+ */
162
+ FlinkLogFactory.setGlobalLevel = function (level) {
163
+ FlinkLogFactory.globalLevel = level;
164
+ // node-color-log doesn't support trace, so use debug as the effective level
165
+ var effectiveLevel = level === "trace" ? "debug" : level;
166
+ node_color_log_1.default.setLevel(effectiveLevel);
167
+ };
168
+ /**
169
+ * Get the current global log level
170
+ */
171
+ FlinkLogFactory.getGlobalLevel = function () {
172
+ return FlinkLogFactory.globalLevel;
173
+ };
174
+ /**
175
+ * Get all registered loggers (useful for debugging)
176
+ */
177
+ FlinkLogFactory.getLoggers = function () {
178
+ return FlinkLogFactory.loggers;
179
+ };
180
+ /**
181
+ * Clear all component-specific log levels (fall back to global)
182
+ */
183
+ FlinkLogFactory.resetComponentLevels = function () {
184
+ FlinkLogFactory.componentConfigs = {};
185
+ for (var _i = 0, _a = Array.from(FlinkLogFactory.loggers.values()); _i < _a.length; _i++) {
186
+ var logger = _a[_i];
187
+ logger.clearLevel();
188
+ }
189
+ };
190
+ /**
191
+ * Clear all hierarchical prefix configurations
192
+ */
193
+ FlinkLogFactory.resetHierarchicalLevels = function () {
194
+ FlinkLogFactory.hierarchicalConfigs = [];
195
+ };
196
+ /**
197
+ * Clear all wildcard pattern configurations
198
+ */
199
+ FlinkLogFactory.resetWildcardLevels = function () {
200
+ FlinkLogFactory.wildcardConfigs = [];
201
+ };
202
+ /**
203
+ * Set log level for a specific component by name (exact match)
204
+ */
205
+ FlinkLogFactory.setComponentLevel = function (componentName, level) {
206
+ var normalized = FlinkLogFactory.normalize(componentName);
207
+ if (level === null) {
208
+ // Remove exact match configuration
209
+ delete FlinkLogFactory.componentConfigs[normalized];
210
+ var logger = FlinkLogFactory.loggers.get(normalized);
211
+ if (logger) {
212
+ logger.clearLevel();
213
+ }
214
+ }
215
+ else {
216
+ // Set exact match configuration
217
+ FlinkLogFactory.componentConfigs[normalized] = level;
218
+ var logger = FlinkLogFactory.loggers.get(normalized);
219
+ if (logger) {
220
+ logger.setLevel(level);
221
+ }
222
+ }
223
+ };
224
+ /**
225
+ * Set hierarchical prefix-based log level (Java-style)
226
+ * @param prefix Logger name prefix (e.g., "flink.ai" matches all "flink.ai.*")
227
+ * @param level Log level to apply
228
+ *
229
+ * @example
230
+ * FlinkLogFactory.setHierarchicalLevel("flink.ai", "debug");
231
+ * // Now all loggers starting with "flink.ai." will use debug level
232
+ * // This includes the exact match "flink.ai" AND all children "flink.ai.*"
233
+ */
234
+ FlinkLogFactory.setHierarchicalLevel = function (prefix, level) {
235
+ var normalized = FlinkLogFactory.normalize(prefix);
236
+ // Ensure prefix ends with dot for consistent matching
237
+ var prefixWithDot = normalized.endsWith(".") ? normalized : normalized + ".";
238
+ var specificity = FlinkLogFactory.calculatePrefixSpecificity(normalized);
239
+ // Remove existing config for this prefix if it exists
240
+ FlinkLogFactory.hierarchicalConfigs = FlinkLogFactory.hierarchicalConfigs.filter(function (c) { return c.prefix !== prefixWithDot; });
241
+ // Add new config
242
+ FlinkLogFactory.hierarchicalConfigs.push({
243
+ prefix: prefixWithDot,
244
+ level: level,
245
+ specificity: specificity,
246
+ });
247
+ // Also set exact match for the prefix itself (without trailing dot)
248
+ // This ensures "flink.ai.openai" matches when using setHierarchicalLevel("flink.ai.openai", "debug")
249
+ FlinkLogFactory.componentConfigs[normalized] = level;
250
+ // Sort by specificity (most specific first) for efficient matching
251
+ FlinkLogFactory.hierarchicalConfigs.sort(function (a, b) { return b.specificity - a.specificity; });
252
+ };
253
+ /**
254
+ * Set wildcard pattern-based log level (advanced)
255
+ * @param pattern Wildcard pattern (e.g., "flink.ai.*" or "flink.ai.**")
256
+ * @param level Log level to apply
257
+ *
258
+ * @example
259
+ * FlinkLogFactory.setWildcardLevel("flink.ai.*", "debug");
260
+ * // Matches flink.ai.openai but NOT flink.ai.openai.v4
261
+ *
262
+ * FlinkLogFactory.setWildcardLevel("flink.ai.**", "trace");
263
+ * // Matches any depth under flink.ai.
264
+ */
265
+ FlinkLogFactory.setWildcardLevel = function (pattern, level) {
266
+ var normalized = FlinkLogFactory.normalize(pattern);
267
+ var specificity = FlinkLogFactory.calculateWildcardSpecificity(normalized);
268
+ // Remove existing config for this pattern if it exists
269
+ FlinkLogFactory.wildcardConfigs = FlinkLogFactory.wildcardConfigs.filter(function (c) { return c.pattern !== normalized; });
270
+ // Add new config
271
+ FlinkLogFactory.wildcardConfigs.push({
272
+ pattern: normalized,
273
+ level: level,
274
+ specificity: specificity,
275
+ });
276
+ // Sort by specificity (most specific first) for efficient matching
277
+ FlinkLogFactory.wildcardConfigs.sort(function (a, b) { return b.specificity - a.specificity; });
278
+ };
279
+ /**
280
+ * Get the effective log level for a component (resolved through hierarchy)
281
+ * @param componentName Component name to check
282
+ * @returns Resolved log level or null if only global level applies
283
+ */
284
+ FlinkLogFactory.getEffectiveLevel = function (componentName) {
285
+ return FlinkLogFactory.resolveComponentLevel(componentName);
286
+ };
287
+ /**
288
+ * Initialize logging from environment variables and/or configuration
289
+ *
290
+ * Supports multiple environment variable conventions:
291
+ * 1. LOG_LEVEL=debug - Set global level
292
+ * 2. DEBUG=flink.ai,flink.database - Enable debug for hierarchies (Java-style)
293
+ * 3. LOG_LEVEL_OPENAI=debug - Component-specific level (format: LOG_LEVEL_{COMPONENT})
294
+ * 4. LOG_LEVELS=flink.ai:debug,flink.database:warn - Hierarchical or exact matches (Java-style)
295
+ * 5. LOG_LEVELS=flink.ai.*:debug - Wildcard patterns (advanced)
296
+ *
297
+ * @param config Optional logging configuration (overrides environment)
298
+ *
299
+ * @example
300
+ * ```typescript
301
+ * // In FlinkApp constructor
302
+ * FlinkLogFactory.configure({
303
+ * global: "info",
304
+ * components: { "flink.ai.openai": "trace" },
305
+ * hierarchical: [{ prefix: "flink.ai.", level: "debug", specificity: 2 }]
306
+ * });
307
+ * ```
308
+ */
309
+ FlinkLogFactory.configure = function (config) {
310
+ if (FlinkLogFactory.initialized) {
311
+ return; // Only initialize once
312
+ }
313
+ // 1. Parse environment variables first (lowest priority)
314
+ var envConfig = FlinkLogFactory.parseEnvironment();
315
+ // 2. Merge with provided config (higher priority)
316
+ var finalConfig = {
317
+ global: (config === null || config === void 0 ? void 0 : config.global) || envConfig.global || "info",
318
+ components: __assign(__assign({}, envConfig.components), config === null || config === void 0 ? void 0 : config.components),
319
+ hierarchical: __spreadArray(__spreadArray([], (envConfig.hierarchical || []), true), ((config === null || config === void 0 ? void 0 : config.hierarchical) || []), true),
320
+ wildcards: __spreadArray(__spreadArray([], (envConfig.wildcards || []), true), ((config === null || config === void 0 ? void 0 : config.wildcards) || []), true),
321
+ };
322
+ // 3. Apply global level
323
+ if (finalConfig.global) {
324
+ FlinkLogFactory.setGlobalLevel(finalConfig.global);
325
+ }
326
+ // 4. Store component configs for later (when loggers are created)
327
+ FlinkLogFactory.componentConfigs = finalConfig.components || {};
328
+ // 5. Store hierarchical configs (sorted by specificity)
329
+ FlinkLogFactory.hierarchicalConfigs = (finalConfig.hierarchical || []).sort(function (a, b) { return b.specificity - a.specificity; });
330
+ // 6. Store wildcard configs (sorted by specificity)
331
+ FlinkLogFactory.wildcardConfigs = (finalConfig.wildcards || []).sort(function (a, b) { return b.specificity - a.specificity; });
332
+ FlinkLogFactory.initialized = true;
333
+ };
334
+ /**
335
+ * Parse logging configuration from environment variables
336
+ */
337
+ FlinkLogFactory.parseEnvironment = function () {
338
+ var config = {
339
+ components: {},
340
+ hierarchical: [],
341
+ wildcards: [],
342
+ };
343
+ // 1. Global level: LOG_LEVEL=debug
344
+ if (process.env.LOG_LEVEL) {
345
+ var level = process.env.LOG_LEVEL.toLowerCase();
346
+ if (FlinkLogFactory.isValidLogLevel(level)) {
347
+ config.global = level;
348
+ }
349
+ }
350
+ // 2. Debug shorthand: DEBUG=flink.ai,flink.database (Java-style prefix matching)
351
+ if (process.env.DEBUG) {
352
+ var components = process.env.DEBUG.split(",").map(function (c) { return c.trim(); });
353
+ for (var _i = 0, components_1 = components; _i < components_1.length; _i++) {
354
+ var component = components_1[_i];
355
+ if (component && component !== "*") {
356
+ var normalized = FlinkLogFactory.normalize(component);
357
+ // Check if it's a hierarchical prefix (contains dots)
358
+ if (normalized.includes(".")) {
359
+ var prefixWithDot = normalized.endsWith(".") ? normalized : normalized + ".";
360
+ config.hierarchical.push({
361
+ prefix: prefixWithDot,
362
+ level: "debug",
363
+ specificity: FlinkLogFactory.calculatePrefixSpecificity(normalized),
364
+ });
365
+ }
366
+ else {
367
+ // Simple name without dots - treat as exact match
368
+ config.components[normalized] = "debug";
369
+ }
370
+ }
371
+ else if (component === "*") {
372
+ config.global = "debug";
373
+ }
374
+ }
375
+ }
376
+ // 3. Component-specific: LOG_LEVEL_OPENAI=debug
377
+ for (var _a = 0, _b = Object.entries(process.env); _a < _b.length; _a++) {
378
+ var _c = _b[_a], key = _c[0], value = _c[1];
379
+ if (key.startsWith("LOG_LEVEL_") && value) {
380
+ var componentName = key.replace("LOG_LEVEL_", "");
381
+ var level = value.toLowerCase();
382
+ if (FlinkLogFactory.isValidLogLevel(level)) {
383
+ // Convert to lowercase dot notation
384
+ var normalizedName = FlinkLogFactory.normalize(componentName);
385
+ config.components[normalizedName] = level;
386
+ }
387
+ }
388
+ }
389
+ // 4. Multiple components: LOG_LEVELS=flink.ai:debug,flink.database:warn (Java-style)
390
+ if (process.env.LOG_LEVELS) {
391
+ var pairs = process.env.LOG_LEVELS.split(",");
392
+ for (var _d = 0, pairs_1 = pairs; _d < pairs_1.length; _d++) {
393
+ var pair = pairs_1[_d];
394
+ var parts = pair.split(":");
395
+ if (parts.length !== 2)
396
+ continue;
397
+ var componentOrPattern = parts[0].trim();
398
+ var level = parts[1].trim().toLowerCase();
399
+ if (!FlinkLogFactory.isValidLogLevel(level))
400
+ continue;
401
+ var normalized = FlinkLogFactory.normalize(componentOrPattern);
402
+ if (normalized.includes("*")) {
403
+ // Wildcard pattern (e.g., "flink.ai.*" or "flink.ai.**")
404
+ config.wildcards.push({
405
+ pattern: normalized,
406
+ level: level,
407
+ specificity: FlinkLogFactory.calculateWildcardSpecificity(normalized),
408
+ });
409
+ }
410
+ else if (normalized.endsWith(".")) {
411
+ // Explicit prefix (ends with dot)
412
+ config.hierarchical.push({
413
+ prefix: normalized,
414
+ level: level,
415
+ specificity: FlinkLogFactory.calculatePrefixSpecificity(normalized),
416
+ });
417
+ }
418
+ else if (normalized.includes(".")) {
419
+ // Ambiguous: could be exact or prefix
420
+ // Strategy: Store BOTH exact and hierarchical
421
+ // Exact match will be checked first, so if logger exists it wins
422
+ // Otherwise hierarchical prefix will match child loggers
423
+ config.components[normalized] = level;
424
+ var prefixWithDot = normalized + ".";
425
+ config.hierarchical.push({
426
+ prefix: prefixWithDot,
427
+ level: level,
428
+ specificity: FlinkLogFactory.calculatePrefixSpecificity(normalized),
429
+ });
430
+ }
431
+ else {
432
+ // Simple name (no dots) - exact match only
433
+ config.components[normalized] = level;
434
+ }
435
+ }
436
+ }
437
+ return config;
438
+ };
439
+ /**
440
+ * Normalize logger name to lowercase (Java-style convention)
441
+ * @param name Logger name or pattern
442
+ * @returns Normalized lowercase name
443
+ */
444
+ FlinkLogFactory.normalize = function (name) {
445
+ return name.toLowerCase();
446
+ };
447
+ /**
448
+ * Determine if a name should be treated as a hierarchical prefix
449
+ * @param name Normalized logger name
450
+ * @returns True if it should be treated as a prefix
451
+ */
452
+ FlinkLogFactory.shouldTreatAsPrefix = function (name) {
453
+ // Default: if name contains dots, treat as hierarchical prefix
454
+ // This covers the common case where "flink.ai" should match "flink.ai.*"
455
+ return name.includes(".");
456
+ };
457
+ /**
458
+ * Calculate specificity for prefix matching
459
+ * More specific prefixes (more segments) have higher specificity
460
+ * @param prefix Prefix string (may or may not end with dot)
461
+ * @returns Specificity score (number of segments)
462
+ */
463
+ FlinkLogFactory.calculatePrefixSpecificity = function (prefix) {
464
+ // Remove trailing dot if present
465
+ var normalized = prefix.endsWith(".") ? prefix.slice(0, -1) : prefix;
466
+ // Count dot-separated segments
467
+ return normalized.split(".").filter(function (s) { return s.length > 0; }).length;
468
+ };
469
+ /**
470
+ * Calculate specificity for wildcard patterns
471
+ * More specific patterns (more non-wildcard segments) have higher specificity
472
+ * For same segment count, * (single-level) is more specific than ** (multi-level)
473
+ * @param pattern Wildcard pattern
474
+ * @returns Specificity score (base + decimal for wildcard type)
475
+ */
476
+ FlinkLogFactory.calculateWildcardSpecificity = function (pattern) {
477
+ var segments = pattern.split(".");
478
+ var nonWildcardCount = segments.filter(function (seg) { return seg !== "*" && seg !== "**" && seg.length > 0; }).length;
479
+ // Base specificity: number of non-wildcard segments
480
+ var specificity = nonWildcardCount * 10;
481
+ // Add fractional specificity based on wildcard type
482
+ // * (single-level) = more specific than ** (multi-level)
483
+ if (pattern.includes("*")) {
484
+ if (pattern.includes("**")) {
485
+ specificity += 1; // ** is less specific
486
+ }
487
+ else {
488
+ specificity += 5; // * is more specific
489
+ }
490
+ }
491
+ return specificity;
492
+ };
493
+ /**
494
+ * Resolve component log level through hierarchical matching
495
+ * Order of precedence (highest to lowest):
496
+ * 1. Exact match
497
+ * 2. Most specific prefix match
498
+ * 3. Less specific prefix match
499
+ * 4. Wildcard pattern match
500
+ * 5. null (falls back to global level)
501
+ *
502
+ * @param componentName Component name to resolve
503
+ * @returns Resolved log level or null
504
+ */
505
+ FlinkLogFactory.resolveComponentLevel = function (componentName) {
506
+ var normalized = FlinkLogFactory.normalize(componentName);
507
+ // 1. Try exact match first (O(1) - fastest, highest priority)
508
+ if (FlinkLogFactory.componentConfigs[normalized]) {
509
+ return FlinkLogFactory.componentConfigs[normalized];
510
+ }
511
+ // 2. Try hierarchical prefix matches (O(n) where n = number of prefixes)
512
+ // Already sorted by specificity (most specific first)
513
+ for (var _i = 0, _a = FlinkLogFactory.hierarchicalConfigs; _i < _a.length; _i++) {
514
+ var config = _a[_i];
515
+ if (normalized.startsWith(config.prefix)) {
516
+ return config.level;
517
+ }
518
+ }
519
+ // 3. Try wildcard patterns (O(n) where n = number of patterns)
520
+ // Already sorted by specificity (most specific first)
521
+ for (var _b = 0, _c = FlinkLogFactory.wildcardConfigs; _b < _c.length; _b++) {
522
+ var config = _c[_b];
523
+ if (FlinkLogFactory.matchWildcard(normalized, config.pattern)) {
524
+ return config.level;
525
+ }
526
+ }
527
+ // 4. No match - fall back to global level
528
+ return null;
529
+ };
530
+ /**
531
+ * Simple wildcard matching for logger patterns
532
+ * Supports:
533
+ * - * matches single segment (flink.ai.* matches flink.ai.openai)
534
+ * - ** matches any depth (flink.ai.** matches flink.ai.openai.v4)
535
+ * - Partial segment match (flink.ai.open* matches flink.ai.openai)
536
+ *
537
+ * @param name Logger name to match
538
+ * @param pattern Wildcard pattern
539
+ * @returns True if pattern matches
540
+ */
541
+ FlinkLogFactory.matchWildcard = function (name, pattern) {
542
+ // Special handling for ** (multi-level wildcard)
543
+ // Need to process dots BEFORE replacing **
544
+ // Step 1: Escape dots first (before any other processing)
545
+ var regexPattern = pattern.replace(/\./g, "\\.");
546
+ // Step 2: Replace ** with placeholder (matches anything including dots)
547
+ regexPattern = regexPattern.replace(/\*\*/g, "___DOUBLE_STAR___");
548
+ // Step 3: Replace single * with single-segment match (non-dot chars)
549
+ regexPattern = regexPattern.replace(/\*/g, "[^\\.]+");
550
+ // Step 4: Replace ** placeholder with multi-segment match
551
+ regexPattern = regexPattern.replace(/___DOUBLE_STAR___/g, ".*");
552
+ var regex = new RegExp("^".concat(regexPattern, "$"));
553
+ return regex.test(name);
554
+ };
555
+ /**
556
+ * Check if a string is a valid log level
557
+ */
558
+ FlinkLogFactory.isValidLogLevel = function (level) {
559
+ return ["trace", "debug", "info", "warn", "error"].includes(level);
560
+ };
561
+ /**
562
+ * Create or retrieve a component-specific logger
563
+ * Automatically applies environment/config settings when logger is created
564
+ * Supports hierarchical prefix matching (Java-style)
565
+ *
566
+ * @param componentName Logger name (lowercase dot notation recommended, e.g., "flink.ai.openai")
567
+ * @returns ComponentLogger instance
568
+ *
569
+ * @example
570
+ * ```typescript
571
+ * // Java-style hierarchical naming (recommended)
572
+ * const log = FlinkLogFactory.createLogger("flink.ai.openai");
573
+ * const dbLog = FlinkLogFactory.createLogger("flink.database.mongodb");
574
+ *
575
+ * // Case insensitive - these create the same logger
576
+ * const log1 = FlinkLogFactory.createLogger("flink.ai.openai");
577
+ * const log2 = FlinkLogFactory.createLogger("Flink.AI.OpenAI"); // Same instance
578
+ * ```
579
+ */
580
+ FlinkLogFactory.createLogger = function (componentName) {
581
+ // Initialize from environment if not already done
582
+ if (!FlinkLogFactory.initialized) {
583
+ FlinkLogFactory.configure();
584
+ }
585
+ // Normalize to lowercase for consistent lookup
586
+ var normalized = FlinkLogFactory.normalize(componentName);
587
+ if (!FlinkLogFactory.loggers.has(normalized)) {
588
+ var logger = new ComponentLogger(normalized);
589
+ FlinkLogFactory.loggers.set(normalized, logger);
590
+ // Resolve level through hierarchical matching
591
+ var resolvedLevel = FlinkLogFactory.resolveComponentLevel(normalized);
592
+ if (resolvedLevel) {
593
+ logger.setLevel(resolvedLevel);
594
+ }
595
+ }
596
+ return FlinkLogFactory.loggers.get(normalized);
597
+ };
598
+ FlinkLogFactory.globalLevel = "info";
599
+ FlinkLogFactory.loggers = new Map();
600
+ FlinkLogFactory.initialized = false;
601
+ /**
602
+ * Store component configurations from environment/config for lazy application
603
+ */
604
+ FlinkLogFactory.componentConfigs = {};
605
+ /**
606
+ * Hierarchical prefix configurations (Java-style)
607
+ * Sorted by specificity (most specific first) for efficient matching
608
+ */
609
+ FlinkLogFactory.hierarchicalConfigs = [];
610
+ /**
611
+ * Wildcard pattern configurations (optional, advanced)
612
+ * Sorted by specificity (most specific first) for efficient matching
613
+ */
614
+ FlinkLogFactory.wildcardConfigs = [];
615
+ return FlinkLogFactory;
616
+ }());
617
+ exports.FlinkLogFactory = FlinkLogFactory;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });