@winccoa-tools-pack/npm-winccoa-core 0.1.0-04b5cbe

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 (357) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +234 -0
  3. package/dist/cjs/index.js +24 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/cjs/types/components/WinCCOAComponent.js +327 -0
  6. package/dist/cjs/types/components/WinCCOAComponent.js.map +1 -0
  7. package/dist/cjs/types/components/implementations/AlertManagerComponent.js +14 -0
  8. package/dist/cjs/types/components/implementations/AlertManagerComponent.js.map +1 -0
  9. package/dist/cjs/types/components/implementations/AndroidComponent.js +17 -0
  10. package/dist/cjs/types/components/implementations/AndroidComponent.js.map +1 -0
  11. package/dist/cjs/types/components/implementations/ApiComponent.js +14 -0
  12. package/dist/cjs/types/components/implementations/ApiComponent.js.map +1 -0
  13. package/dist/cjs/types/components/implementations/AsciiManagerComponent.js +14 -0
  14. package/dist/cjs/types/components/implementations/AsciiManagerComponent.js.map +1 -0
  15. package/dist/cjs/types/components/implementations/ConfComponent.js +17 -0
  16. package/dist/cjs/types/components/implementations/ConfComponent.js.map +1 -0
  17. package/dist/cjs/types/components/implementations/CtrlComponent.js +34 -0
  18. package/dist/cjs/types/components/implementations/CtrlComponent.js.map +1 -0
  19. package/dist/cjs/types/components/implementations/DNP3Component.js +17 -0
  20. package/dist/cjs/types/components/implementations/DNP3Component.js.map +1 -0
  21. package/dist/cjs/types/components/implementations/DataComponent.js +17 -0
  22. package/dist/cjs/types/components/implementations/DataComponent.js.map +1 -0
  23. package/dist/cjs/types/components/implementations/DbManagerComponent.js +14 -0
  24. package/dist/cjs/types/components/implementations/DbManagerComponent.js.map +1 -0
  25. package/dist/cjs/types/components/implementations/DistComponent.js +14 -0
  26. package/dist/cjs/types/components/implementations/DistComponent.js.map +1 -0
  27. package/dist/cjs/types/components/implementations/DriverComponent.js +14 -0
  28. package/dist/cjs/types/components/implementations/DriverComponent.js.map +1 -0
  29. package/dist/cjs/types/components/implementations/EventComponent.js +17 -0
  30. package/dist/cjs/types/components/implementations/EventComponent.js.map +1 -0
  31. package/dist/cjs/types/components/implementations/HttpComponent.js +14 -0
  32. package/dist/cjs/types/components/implementations/HttpComponent.js.map +1 -0
  33. package/dist/cjs/types/components/implementations/IEC60870Component.js +17 -0
  34. package/dist/cjs/types/components/implementations/IEC60870Component.js.map +1 -0
  35. package/dist/cjs/types/components/implementations/IEC61850Component.js +17 -0
  36. package/dist/cjs/types/components/implementations/IEC61850Component.js.map +1 -0
  37. package/dist/cjs/types/components/implementations/IosComponent.js +17 -0
  38. package/dist/cjs/types/components/implementations/IosComponent.js.map +1 -0
  39. package/dist/cjs/types/components/implementations/JavaComponent.js +17 -0
  40. package/dist/cjs/types/components/implementations/JavaComponent.js.map +1 -0
  41. package/dist/cjs/types/components/implementations/JavaScriptComponent.js +17 -0
  42. package/dist/cjs/types/components/implementations/JavaScriptComponent.js.map +1 -0
  43. package/dist/cjs/types/components/implementations/ModbusComponent.js +17 -0
  44. package/dist/cjs/types/components/implementations/ModbusComponent.js.map +1 -0
  45. package/dist/cjs/types/components/implementations/OpcComponent.js +17 -0
  46. package/dist/cjs/types/components/implementations/OpcComponent.js.map +1 -0
  47. package/dist/cjs/types/components/implementations/OpcDaComponent.js +17 -0
  48. package/dist/cjs/types/components/implementations/OpcDaComponent.js.map +1 -0
  49. package/dist/cjs/types/components/implementations/OpcUaComponent.js +17 -0
  50. package/dist/cjs/types/components/implementations/OpcUaComponent.js.map +1 -0
  51. package/dist/cjs/types/components/implementations/PmonComponent.js +728 -0
  52. package/dist/cjs/types/components/implementations/PmonComponent.js.map +1 -0
  53. package/dist/cjs/types/components/implementations/RdbComponent.js +14 -0
  54. package/dist/cjs/types/components/implementations/RdbComponent.js.map +1 -0
  55. package/dist/cjs/types/components/implementations/ReduComponent.js +14 -0
  56. package/dist/cjs/types/components/implementations/ReduComponent.js.map +1 -0
  57. package/dist/cjs/types/components/implementations/ReportManagerComponent.js +14 -0
  58. package/dist/cjs/types/components/implementations/ReportManagerComponent.js.map +1 -0
  59. package/dist/cjs/types/components/implementations/S7Component.js +17 -0
  60. package/dist/cjs/types/components/implementations/S7Component.js.map +1 -0
  61. package/dist/cjs/types/components/implementations/S7TopSapComponent.js +17 -0
  62. package/dist/cjs/types/components/implementations/S7TopSapComponent.js.map +1 -0
  63. package/dist/cjs/types/components/implementations/SimComponent.js +17 -0
  64. package/dist/cjs/types/components/implementations/SimComponent.js.map +1 -0
  65. package/dist/cjs/types/components/implementations/SplitComponent.js +14 -0
  66. package/dist/cjs/types/components/implementations/SplitComponent.js.map +1 -0
  67. package/dist/cjs/types/components/implementations/UIComponent.js +36 -0
  68. package/dist/cjs/types/components/implementations/UIComponent.js.map +1 -0
  69. package/dist/cjs/types/components/implementations/ValueArchManagerComponent.js +14 -0
  70. package/dist/cjs/types/components/implementations/ValueArchManagerComponent.js.map +1 -0
  71. package/dist/cjs/types/components/implementations/VideoDriverComponent.js +14 -0
  72. package/dist/cjs/types/components/implementations/VideoDriverComponent.js.map +1 -0
  73. package/dist/cjs/types/components/implementations/VisionComponent.js +17 -0
  74. package/dist/cjs/types/components/implementations/VisionComponent.js.map +1 -0
  75. package/dist/cjs/types/components/implementations/WebUIComponent.js +17 -0
  76. package/dist/cjs/types/components/implementations/WebUIComponent.js.map +1 -0
  77. package/dist/cjs/types/components/implementations/index.js +74 -0
  78. package/dist/cjs/types/components/implementations/index.js.map +1 -0
  79. package/dist/cjs/types/index.js +23 -0
  80. package/dist/cjs/types/index.js.map +1 -0
  81. package/dist/cjs/types/localization/OaLanguage.js +136 -0
  82. package/dist/cjs/types/localization/OaLanguage.js.map +1 -0
  83. package/dist/cjs/types/logs/WinCCOAErrorHandler.js +94 -0
  84. package/dist/cjs/types/logs/WinCCOAErrorHandler.js.map +1 -0
  85. package/dist/cjs/types/logs/WinCCOALogEntry.js +3 -0
  86. package/dist/cjs/types/logs/WinCCOALogEntry.js.map +1 -0
  87. package/dist/cjs/types/logs/WinCCOALogParser.js +213 -0
  88. package/dist/cjs/types/logs/WinCCOALogParser.js.map +1 -0
  89. package/dist/cjs/types/project/CurrentProjectInfo.js +12 -0
  90. package/dist/cjs/types/project/CurrentProjectInfo.js.map +1 -0
  91. package/dist/cjs/types/project/ProjEnv.js +109 -0
  92. package/dist/cjs/types/project/ProjEnv.js.map +1 -0
  93. package/dist/cjs/types/project/ProjEnvErrorHandler.js +12 -0
  94. package/dist/cjs/types/project/ProjEnvErrorHandler.js.map +1 -0
  95. package/dist/cjs/types/project/ProjEnvPmonStatus.js +22 -0
  96. package/dist/cjs/types/project/ProjEnvPmonStatus.js.map +1 -0
  97. package/dist/cjs/types/project/ProjEnvProject.js +1015 -0
  98. package/dist/cjs/types/project/ProjEnvProject.js.map +1 -0
  99. package/dist/cjs/types/project/ProjEnvProjectConfig.js +327 -0
  100. package/dist/cjs/types/project/ProjEnvProjectConfig.js.map +1 -0
  101. package/dist/cjs/types/project/ProjEnvProjectRegistry.js +327 -0
  102. package/dist/cjs/types/project/ProjEnvProjectRegistry.js.map +1 -0
  103. package/dist/cjs/types/status/WinCCOAManager.js +3 -0
  104. package/dist/cjs/types/status/WinCCOAManager.js.map +1 -0
  105. package/dist/cjs/types/version/DetailedVersionInfo.js +6 -0
  106. package/dist/cjs/types/version/DetailedVersionInfo.js.map +1 -0
  107. package/dist/cjs/utils/index.js +25 -0
  108. package/dist/cjs/utils/index.js.map +1 -0
  109. package/dist/cjs/utils/winccoa-components.js +7 -0
  110. package/dist/cjs/utils/winccoa-components.js.map +1 -0
  111. package/dist/cjs/utils/winccoa-localization.js +12 -0
  112. package/dist/cjs/utils/winccoa-localization.js.map +1 -0
  113. package/dist/cjs/utils/winccoa-logging.js +3 -0
  114. package/dist/cjs/utils/winccoa-logging.js.map +1 -0
  115. package/dist/cjs/utils/winccoa-paths.js +222 -0
  116. package/dist/cjs/utils/winccoa-paths.js.map +1 -0
  117. package/dist/cjs/utils/winccoa-project-environment.js +73 -0
  118. package/dist/cjs/utils/winccoa-project-environment.js.map +1 -0
  119. package/dist/cjs/utils/winccoa-version-info.js +23 -0
  120. package/dist/cjs/utils/winccoa-version-info.js.map +1 -0
  121. package/dist/esm/index.js +8 -0
  122. package/dist/esm/index.js.map +1 -0
  123. package/dist/esm/types/components/WinCCOAComponent.js +290 -0
  124. package/dist/esm/types/components/WinCCOAComponent.js.map +1 -0
  125. package/dist/esm/types/components/implementations/AlertManagerComponent.js +10 -0
  126. package/dist/esm/types/components/implementations/AlertManagerComponent.js.map +1 -0
  127. package/dist/esm/types/components/implementations/AndroidComponent.js +13 -0
  128. package/dist/esm/types/components/implementations/AndroidComponent.js.map +1 -0
  129. package/dist/esm/types/components/implementations/ApiComponent.js +10 -0
  130. package/dist/esm/types/components/implementations/ApiComponent.js.map +1 -0
  131. package/dist/esm/types/components/implementations/AsciiManagerComponent.js +10 -0
  132. package/dist/esm/types/components/implementations/AsciiManagerComponent.js.map +1 -0
  133. package/dist/esm/types/components/implementations/ConfComponent.js +13 -0
  134. package/dist/esm/types/components/implementations/ConfComponent.js.map +1 -0
  135. package/dist/esm/types/components/implementations/CtrlComponent.js +30 -0
  136. package/dist/esm/types/components/implementations/CtrlComponent.js.map +1 -0
  137. package/dist/esm/types/components/implementations/DNP3Component.js +13 -0
  138. package/dist/esm/types/components/implementations/DNP3Component.js.map +1 -0
  139. package/dist/esm/types/components/implementations/DataComponent.js +13 -0
  140. package/dist/esm/types/components/implementations/DataComponent.js.map +1 -0
  141. package/dist/esm/types/components/implementations/DbManagerComponent.js +10 -0
  142. package/dist/esm/types/components/implementations/DbManagerComponent.js.map +1 -0
  143. package/dist/esm/types/components/implementations/DistComponent.js +10 -0
  144. package/dist/esm/types/components/implementations/DistComponent.js.map +1 -0
  145. package/dist/esm/types/components/implementations/DriverComponent.js +10 -0
  146. package/dist/esm/types/components/implementations/DriverComponent.js.map +1 -0
  147. package/dist/esm/types/components/implementations/EventComponent.js +13 -0
  148. package/dist/esm/types/components/implementations/EventComponent.js.map +1 -0
  149. package/dist/esm/types/components/implementations/HttpComponent.js +10 -0
  150. package/dist/esm/types/components/implementations/HttpComponent.js.map +1 -0
  151. package/dist/esm/types/components/implementations/IEC60870Component.js +13 -0
  152. package/dist/esm/types/components/implementations/IEC60870Component.js.map +1 -0
  153. package/dist/esm/types/components/implementations/IEC61850Component.js +13 -0
  154. package/dist/esm/types/components/implementations/IEC61850Component.js.map +1 -0
  155. package/dist/esm/types/components/implementations/IosComponent.js +13 -0
  156. package/dist/esm/types/components/implementations/IosComponent.js.map +1 -0
  157. package/dist/esm/types/components/implementations/JavaComponent.js +13 -0
  158. package/dist/esm/types/components/implementations/JavaComponent.js.map +1 -0
  159. package/dist/esm/types/components/implementations/JavaScriptComponent.js +13 -0
  160. package/dist/esm/types/components/implementations/JavaScriptComponent.js.map +1 -0
  161. package/dist/esm/types/components/implementations/ModbusComponent.js +13 -0
  162. package/dist/esm/types/components/implementations/ModbusComponent.js.map +1 -0
  163. package/dist/esm/types/components/implementations/OpcComponent.js +13 -0
  164. package/dist/esm/types/components/implementations/OpcComponent.js.map +1 -0
  165. package/dist/esm/types/components/implementations/OpcDaComponent.js +13 -0
  166. package/dist/esm/types/components/implementations/OpcDaComponent.js.map +1 -0
  167. package/dist/esm/types/components/implementations/OpcUaComponent.js +13 -0
  168. package/dist/esm/types/components/implementations/OpcUaComponent.js.map +1 -0
  169. package/dist/esm/types/components/implementations/PmonComponent.js +723 -0
  170. package/dist/esm/types/components/implementations/PmonComponent.js.map +1 -0
  171. package/dist/esm/types/components/implementations/RdbComponent.js +10 -0
  172. package/dist/esm/types/components/implementations/RdbComponent.js.map +1 -0
  173. package/dist/esm/types/components/implementations/ReduComponent.js +10 -0
  174. package/dist/esm/types/components/implementations/ReduComponent.js.map +1 -0
  175. package/dist/esm/types/components/implementations/ReportManagerComponent.js +10 -0
  176. package/dist/esm/types/components/implementations/ReportManagerComponent.js.map +1 -0
  177. package/dist/esm/types/components/implementations/S7Component.js +13 -0
  178. package/dist/esm/types/components/implementations/S7Component.js.map +1 -0
  179. package/dist/esm/types/components/implementations/S7TopSapComponent.js +13 -0
  180. package/dist/esm/types/components/implementations/S7TopSapComponent.js.map +1 -0
  181. package/dist/esm/types/components/implementations/SimComponent.js +13 -0
  182. package/dist/esm/types/components/implementations/SimComponent.js.map +1 -0
  183. package/dist/esm/types/components/implementations/SplitComponent.js +10 -0
  184. package/dist/esm/types/components/implementations/SplitComponent.js.map +1 -0
  185. package/dist/esm/types/components/implementations/UIComponent.js +32 -0
  186. package/dist/esm/types/components/implementations/UIComponent.js.map +1 -0
  187. package/dist/esm/types/components/implementations/ValueArchManagerComponent.js +10 -0
  188. package/dist/esm/types/components/implementations/ValueArchManagerComponent.js.map +1 -0
  189. package/dist/esm/types/components/implementations/VideoDriverComponent.js +10 -0
  190. package/dist/esm/types/components/implementations/VideoDriverComponent.js.map +1 -0
  191. package/dist/esm/types/components/implementations/VisionComponent.js +13 -0
  192. package/dist/esm/types/components/implementations/VisionComponent.js.map +1 -0
  193. package/dist/esm/types/components/implementations/WebUIComponent.js +13 -0
  194. package/dist/esm/types/components/implementations/WebUIComponent.js.map +1 -0
  195. package/dist/esm/types/components/implementations/index.js +36 -0
  196. package/dist/esm/types/components/implementations/index.js.map +1 -0
  197. package/dist/esm/types/index.js +7 -0
  198. package/dist/esm/types/index.js.map +1 -0
  199. package/dist/esm/types/localization/OaLanguage.js +132 -0
  200. package/dist/esm/types/localization/OaLanguage.js.map +1 -0
  201. package/dist/esm/types/logs/WinCCOAErrorHandler.js +90 -0
  202. package/dist/esm/types/logs/WinCCOAErrorHandler.js.map +1 -0
  203. package/dist/esm/types/logs/WinCCOALogEntry.js +2 -0
  204. package/dist/esm/types/logs/WinCCOALogEntry.js.map +1 -0
  205. package/dist/esm/types/logs/WinCCOALogParser.js +176 -0
  206. package/dist/esm/types/logs/WinCCOALogParser.js.map +1 -0
  207. package/dist/esm/types/project/CurrentProjectInfo.js +11 -0
  208. package/dist/esm/types/project/CurrentProjectInfo.js.map +1 -0
  209. package/dist/esm/types/project/ProjEnv.js +103 -0
  210. package/dist/esm/types/project/ProjEnv.js.map +1 -0
  211. package/dist/esm/types/project/ProjEnvErrorHandler.js +8 -0
  212. package/dist/esm/types/project/ProjEnvErrorHandler.js.map +1 -0
  213. package/dist/esm/types/project/ProjEnvPmonStatus.js +18 -0
  214. package/dist/esm/types/project/ProjEnvPmonStatus.js.map +1 -0
  215. package/dist/esm/types/project/ProjEnvProject.js +1008 -0
  216. package/dist/esm/types/project/ProjEnvProject.js.map +1 -0
  217. package/dist/esm/types/project/ProjEnvProjectConfig.js +287 -0
  218. package/dist/esm/types/project/ProjEnvProjectConfig.js.map +1 -0
  219. package/dist/esm/types/project/ProjEnvProjectRegistry.js +283 -0
  220. package/dist/esm/types/project/ProjEnvProjectRegistry.js.map +1 -0
  221. package/dist/esm/types/status/WinCCOAManager.js +2 -0
  222. package/dist/esm/types/status/WinCCOAManager.js.map +1 -0
  223. package/dist/esm/types/version/DetailedVersionInfo.js +5 -0
  224. package/dist/esm/types/version/DetailedVersionInfo.js.map +1 -0
  225. package/dist/esm/utils/index.js +9 -0
  226. package/dist/esm/utils/index.js.map +1 -0
  227. package/dist/esm/utils/winccoa-components.js +4 -0
  228. package/dist/esm/utils/winccoa-components.js.map +1 -0
  229. package/dist/esm/utils/winccoa-localization.js +9 -0
  230. package/dist/esm/utils/winccoa-localization.js.map +1 -0
  231. package/dist/esm/utils/winccoa-logging.js +3 -0
  232. package/dist/esm/utils/winccoa-logging.js.map +1 -0
  233. package/dist/esm/utils/winccoa-paths.js +184 -0
  234. package/dist/esm/utils/winccoa-paths.js.map +1 -0
  235. package/dist/esm/utils/winccoa-project-environment.js +66 -0
  236. package/dist/esm/utils/winccoa-project-environment.js.map +1 -0
  237. package/dist/esm/utils/winccoa-version-info.js +20 -0
  238. package/dist/esm/utils/winccoa-version-info.js.map +1 -0
  239. package/dist/index.d.ts +7 -0
  240. package/dist/index.d.ts.map +1 -0
  241. package/dist/types/components/WinCCOAComponent.d.ts +138 -0
  242. package/dist/types/components/WinCCOAComponent.d.ts.map +1 -0
  243. package/dist/types/components/implementations/AlertManagerComponent.d.ts +6 -0
  244. package/dist/types/components/implementations/AlertManagerComponent.d.ts.map +1 -0
  245. package/dist/types/components/implementations/AndroidComponent.d.ts +9 -0
  246. package/dist/types/components/implementations/AndroidComponent.d.ts.map +1 -0
  247. package/dist/types/components/implementations/ApiComponent.d.ts +6 -0
  248. package/dist/types/components/implementations/ApiComponent.d.ts.map +1 -0
  249. package/dist/types/components/implementations/AsciiManagerComponent.d.ts +6 -0
  250. package/dist/types/components/implementations/AsciiManagerComponent.d.ts.map +1 -0
  251. package/dist/types/components/implementations/ConfComponent.d.ts +9 -0
  252. package/dist/types/components/implementations/ConfComponent.d.ts.map +1 -0
  253. package/dist/types/components/implementations/CtrlComponent.d.ts +10 -0
  254. package/dist/types/components/implementations/CtrlComponent.d.ts.map +1 -0
  255. package/dist/types/components/implementations/DNP3Component.d.ts +9 -0
  256. package/dist/types/components/implementations/DNP3Component.d.ts.map +1 -0
  257. package/dist/types/components/implementations/DataComponent.d.ts +9 -0
  258. package/dist/types/components/implementations/DataComponent.d.ts.map +1 -0
  259. package/dist/types/components/implementations/DbManagerComponent.d.ts +6 -0
  260. package/dist/types/components/implementations/DbManagerComponent.d.ts.map +1 -0
  261. package/dist/types/components/implementations/DistComponent.d.ts +6 -0
  262. package/dist/types/components/implementations/DistComponent.d.ts.map +1 -0
  263. package/dist/types/components/implementations/DriverComponent.d.ts +6 -0
  264. package/dist/types/components/implementations/DriverComponent.d.ts.map +1 -0
  265. package/dist/types/components/implementations/EventComponent.d.ts +9 -0
  266. package/dist/types/components/implementations/EventComponent.d.ts.map +1 -0
  267. package/dist/types/components/implementations/HttpComponent.d.ts +6 -0
  268. package/dist/types/components/implementations/HttpComponent.d.ts.map +1 -0
  269. package/dist/types/components/implementations/IEC60870Component.d.ts +9 -0
  270. package/dist/types/components/implementations/IEC60870Component.d.ts.map +1 -0
  271. package/dist/types/components/implementations/IEC61850Component.d.ts +9 -0
  272. package/dist/types/components/implementations/IEC61850Component.d.ts.map +1 -0
  273. package/dist/types/components/implementations/IosComponent.d.ts +9 -0
  274. package/dist/types/components/implementations/IosComponent.d.ts.map +1 -0
  275. package/dist/types/components/implementations/JavaComponent.d.ts +9 -0
  276. package/dist/types/components/implementations/JavaComponent.d.ts.map +1 -0
  277. package/dist/types/components/implementations/JavaScriptComponent.d.ts +9 -0
  278. package/dist/types/components/implementations/JavaScriptComponent.d.ts.map +1 -0
  279. package/dist/types/components/implementations/ModbusComponent.d.ts +9 -0
  280. package/dist/types/components/implementations/ModbusComponent.d.ts.map +1 -0
  281. package/dist/types/components/implementations/OpcComponent.d.ts +9 -0
  282. package/dist/types/components/implementations/OpcComponent.d.ts.map +1 -0
  283. package/dist/types/components/implementations/OpcDaComponent.d.ts +9 -0
  284. package/dist/types/components/implementations/OpcDaComponent.d.ts.map +1 -0
  285. package/dist/types/components/implementations/OpcUaComponent.d.ts +9 -0
  286. package/dist/types/components/implementations/OpcUaComponent.d.ts.map +1 -0
  287. package/dist/types/components/implementations/PmonComponent.d.ts +168 -0
  288. package/dist/types/components/implementations/PmonComponent.d.ts.map +1 -0
  289. package/dist/types/components/implementations/RdbComponent.d.ts +6 -0
  290. package/dist/types/components/implementations/RdbComponent.d.ts.map +1 -0
  291. package/dist/types/components/implementations/ReduComponent.d.ts +6 -0
  292. package/dist/types/components/implementations/ReduComponent.d.ts.map +1 -0
  293. package/dist/types/components/implementations/ReportManagerComponent.d.ts +6 -0
  294. package/dist/types/components/implementations/ReportManagerComponent.d.ts.map +1 -0
  295. package/dist/types/components/implementations/S7Component.d.ts +9 -0
  296. package/dist/types/components/implementations/S7Component.d.ts.map +1 -0
  297. package/dist/types/components/implementations/S7TopSapComponent.d.ts +9 -0
  298. package/dist/types/components/implementations/S7TopSapComponent.d.ts.map +1 -0
  299. package/dist/types/components/implementations/SimComponent.d.ts +9 -0
  300. package/dist/types/components/implementations/SimComponent.d.ts.map +1 -0
  301. package/dist/types/components/implementations/SplitComponent.d.ts +6 -0
  302. package/dist/types/components/implementations/SplitComponent.d.ts.map +1 -0
  303. package/dist/types/components/implementations/UIComponent.d.ts +13 -0
  304. package/dist/types/components/implementations/UIComponent.d.ts.map +1 -0
  305. package/dist/types/components/implementations/ValueArchManagerComponent.d.ts +6 -0
  306. package/dist/types/components/implementations/ValueArchManagerComponent.d.ts.map +1 -0
  307. package/dist/types/components/implementations/VideoDriverComponent.d.ts +6 -0
  308. package/dist/types/components/implementations/VideoDriverComponent.d.ts.map +1 -0
  309. package/dist/types/components/implementations/VisionComponent.d.ts +9 -0
  310. package/dist/types/components/implementations/VisionComponent.d.ts.map +1 -0
  311. package/dist/types/components/implementations/WebUIComponent.d.ts +9 -0
  312. package/dist/types/components/implementations/WebUIComponent.d.ts.map +1 -0
  313. package/dist/types/components/implementations/index.d.ts +36 -0
  314. package/dist/types/components/implementations/index.d.ts.map +1 -0
  315. package/dist/types/index.d.ts +7 -0
  316. package/dist/types/index.d.ts.map +1 -0
  317. package/dist/types/localization/OaLanguage.d.ts +101 -0
  318. package/dist/types/localization/OaLanguage.d.ts.map +1 -0
  319. package/dist/types/logs/WinCCOAErrorHandler.d.ts +35 -0
  320. package/dist/types/logs/WinCCOAErrorHandler.d.ts.map +1 -0
  321. package/dist/types/logs/WinCCOALogEntry.d.ts +12 -0
  322. package/dist/types/logs/WinCCOALogEntry.d.ts.map +1 -0
  323. package/dist/types/logs/WinCCOALogParser.d.ts +53 -0
  324. package/dist/types/logs/WinCCOALogParser.d.ts.map +1 -0
  325. package/dist/types/project/CurrentProjectInfo.d.ts +24 -0
  326. package/dist/types/project/CurrentProjectInfo.d.ts.map +1 -0
  327. package/dist/types/project/ProjEnv.d.ts +73 -0
  328. package/dist/types/project/ProjEnv.d.ts.map +1 -0
  329. package/dist/types/project/ProjEnvErrorHandler.d.ts +6 -0
  330. package/dist/types/project/ProjEnvErrorHandler.d.ts.map +1 -0
  331. package/dist/types/project/ProjEnvPmonStatus.d.ts +23 -0
  332. package/dist/types/project/ProjEnvPmonStatus.d.ts.map +1 -0
  333. package/dist/types/project/ProjEnvProject.d.ts +475 -0
  334. package/dist/types/project/ProjEnvProject.d.ts.map +1 -0
  335. package/dist/types/project/ProjEnvProjectConfig.d.ts +54 -0
  336. package/dist/types/project/ProjEnvProjectConfig.d.ts.map +1 -0
  337. package/dist/types/project/ProjEnvProjectRegistry.d.ts +61 -0
  338. package/dist/types/project/ProjEnvProjectRegistry.d.ts.map +1 -0
  339. package/dist/types/status/WinCCOAManager.d.ts +15 -0
  340. package/dist/types/status/WinCCOAManager.d.ts.map +1 -0
  341. package/dist/types/version/DetailedVersionInfo.d.ts +16 -0
  342. package/dist/types/version/DetailedVersionInfo.d.ts.map +1 -0
  343. package/dist/utils/index.d.ts +9 -0
  344. package/dist/utils/index.d.ts.map +1 -0
  345. package/dist/utils/winccoa-components.d.ts +3 -0
  346. package/dist/utils/winccoa-components.d.ts.map +1 -0
  347. package/dist/utils/winccoa-localization.d.ts +7 -0
  348. package/dist/utils/winccoa-localization.d.ts.map +1 -0
  349. package/dist/utils/winccoa-logging.d.ts +1 -0
  350. package/dist/utils/winccoa-logging.d.ts.map +1 -0
  351. package/dist/utils/winccoa-paths.d.ts +49 -0
  352. package/dist/utils/winccoa-paths.d.ts.map +1 -0
  353. package/dist/utils/winccoa-project-environment.d.ts +34 -0
  354. package/dist/utils/winccoa-project-environment.d.ts.map +1 -0
  355. package/dist/utils/winccoa-version-info.d.ts +14 -0
  356. package/dist/utils/winccoa-version-info.d.ts.map +1 -0
  357. package/package.json +70 -0
@@ -0,0 +1,728 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PmonComponent = exports.PmonComponentCredential = void 0;
4
+ const WinCCOAComponent_js_1 = require("../WinCCOAComponent.js");
5
+ const ProjEnvPmonStatus_js_1 = require("../../project/ProjEnvPmonStatus.js");
6
+ const ProjEnv_js_1 = require("../../project/ProjEnv.js");
7
+ class PmonComponentCredential {
8
+ constructor(username, password) {
9
+ this.username = username;
10
+ this.password = password;
11
+ }
12
+ }
13
+ exports.PmonComponentCredential = PmonComponentCredential;
14
+ class PmonComponent extends WinCCOAComponent_js_1.WinCCOAComponent {
15
+ constructor() {
16
+ //-------------------------------------------------------------------------
17
+ //@public members
18
+ //-------------------------------------------------------------------------
19
+ super(...arguments);
20
+ //-------------------------------------------------------------------------
21
+ //@private members
22
+ //-------------------------------------------------------------------------
23
+ this.currentCredentials = null;
24
+ }
25
+ //-------------------------------------------------------------------------
26
+ /**
27
+ * Returns the component name
28
+ */
29
+ getName() {
30
+ return 'WCCILpmon';
31
+ }
32
+ //-------------------------------------------------------------------------
33
+ /**
34
+ * Returns the component description
35
+ */
36
+ getDescription() {
37
+ return 'Process Monitor';
38
+ }
39
+ //-------------------------------------------------------------------------
40
+ /**
41
+ * Registers a sub-project using pmon's -regsubf option
42
+ * @param projectPath - Path to the sub-project directory
43
+ * @returns Promise that resolves when registration is complete
44
+ */
45
+ async registerSubProject(projectPath) {
46
+ const args = ['-regsubf', '-proj', projectPath, '-log', '+stderr'];
47
+ return this.startAndValidateOutput(args, { checkStdout: false });
48
+ }
49
+ //-------------------------------------------------------------------------
50
+ /**
51
+ * Unregisters a project using pmon's -unreg option
52
+ * @param projectName - Name of the project to unregister
53
+ * @param outputCallback - Optional callback for output logging
54
+ * @returns Promise that resolves when unregistration is complete
55
+ */
56
+ async unregisterProject(projectName) {
57
+ // Use -unreg option to unregister project
58
+ const args = ['-unreg', projectName, '-log', '+stderr'];
59
+ return this.startAndValidateOutput(args, { checkStdout: false });
60
+ }
61
+ //-------------------------------------------------------------------------
62
+ /**
63
+ * Registers a runnable project using pmon's -config -autofreg -status options
64
+ * @param configPath - Path to the project config file
65
+ * @param outputCallback - Optional callback for output logging
66
+ * @returns Promise that resolves when registration is complete with exit code
67
+ */
68
+ async registerProject(configPath, projectVersion) {
69
+ if (configPath === undefined || configPath === '') {
70
+ throw new Error('Config path is not set for PmonComponent');
71
+ }
72
+ // Use -config -autofreg -status options to register runnable project
73
+ const args = ['-config', configPath, '-log', '+stderr', '-autofreg', '-status'];
74
+ super.setVersion(projectVersion);
75
+ const code = this.startAndValidateOutput(args, { checkStdout: false });
76
+ // the pmon returns 3 if the project is not running after registrations
77
+ const state = this.pmonStateCodeToStatus(await code);
78
+ return state !== ProjEnvPmonStatus_js_1.ProjEnvPmonStatus.Unknown ? 0 : -1;
79
+ }
80
+ //-------------------------------------------------------------------------
81
+ /**
82
+ * Get pmon status. It check if the pmon is running or not
83
+ */
84
+ async getStatus(projectName) {
85
+ /*
86
+ -status ... returns status of pmon:
87
+ 0=pmon is running, 3=pmon is stopped, 4=unknown
88
+ */
89
+ const args = ['-status', '-proj', projectName, '-log', '+stdout'];
90
+ const code = this.startAndValidateOutput(args, { checkStdout: () => { } });
91
+ return this.pmonStateCodeToStatus(await code);
92
+ }
93
+ //-------------------------------------------------------------------------
94
+ /**
95
+ * Starts pmon only (without auto-starting managers)
96
+ */
97
+ async startPmonOnly(projectName) {
98
+ const args = ['-proj', projectName, '-noAutostart'];
99
+ return this.startAndValidateOutput(args, { detached: true, waitForLog: 'WAIT_MODE' });
100
+ }
101
+ //-------------------------------------------------------------------------
102
+ /**
103
+ * Starts a project with all managers
104
+ */
105
+ async startProject(projectName, startAll = true) {
106
+ let args = ['-proj', projectName];
107
+ if (startAll) {
108
+ args = args.concat(['-command', this.makeCliCredentials() + 'START_ALL:']);
109
+ // INFO, 9/pmon, Das Projekt wurde gestartet und läuft. Gehe in den Überwachungsmodus
110
+ return this.startAndValidateOutput(args, { waitForLog: '9/pmon' });
111
+ }
112
+ else {
113
+ // starting pmon only without extra arguments means, it will start the project too.
114
+ // that means the pmon process will never end (hopefully, otherwise it crashed), so we need to detach
115
+ return this.startAndValidateOutput(args, { detached: true, waitForLog: 'WAIT_MODE' });
116
+ }
117
+ }
118
+ //-------------------------------------------------------------------------
119
+ /**
120
+ * Stops all managers in a project
121
+ */
122
+ async stopProject(projectName) {
123
+ const args = [
124
+ '-proj',
125
+ projectName,
126
+ '-command',
127
+ this.makeCliCredentials() + 'STOP_ALL:',
128
+ '-log',
129
+ '+stderr',
130
+ ];
131
+ // INFO, 13/pmon, Projekt wurde komplett gestoppt - warte auf Befehle
132
+ return this.startAndValidateOutput(args, { waitForLog: '13/pmon' });
133
+ }
134
+ //-------------------------------------------------------------------------
135
+ /**
136
+ * Stops all managers and exits pmon
137
+ */
138
+ async stopProjectAndPmon(projectName, timeout) {
139
+ const args = ['-proj', projectName, '-stopWait', '-log', '+stderr'];
140
+ return this.startAndValidateOutput(args, { timeout: timeout, checkStdout: false });
141
+ }
142
+ //-------------------------------------------------------------------------
143
+ /**
144
+ * Restarts all managers in a project
145
+ */
146
+ async restartProject(projectName) {
147
+ const args = [
148
+ '-proj',
149
+ projectName,
150
+ '-command',
151
+ this.makeCliCredentials() + 'RESTART_ALL:',
152
+ '-log',
153
+ '+stderr',
154
+ ];
155
+ return this.startAndValidateOutput(args);
156
+ }
157
+ //-------------------------------------------------------------------------
158
+ /**
159
+ * Sets pmon wait mode
160
+ */
161
+ async setWaitMode(projectName) {
162
+ const args = [
163
+ '-proj',
164
+ projectName,
165
+ '-command',
166
+ this.makeCliCredentials() + 'WAIT_MODE:',
167
+ '-log',
168
+ '+stderr',
169
+ ];
170
+ return this.startAndValidateOutput(args);
171
+ }
172
+ //-------------------------------------------------------------------------
173
+ /**
174
+ * Starts a specific manager by index
175
+ */
176
+ async startManager(projectName, managerIndex) {
177
+ const args = [
178
+ '-proj',
179
+ projectName,
180
+ '-command',
181
+ this.makeCliCredentials() + 'SINGLE_MGR:START',
182
+ managerIndex.toString(),
183
+ '-log',
184
+ '+stderr',
185
+ ];
186
+ return this.startAndValidateOutput(args);
187
+ }
188
+ //-------------------------------------------------------------------------
189
+ /**
190
+ * Stops a specific manager by index
191
+ */
192
+ async stopManager(projectName, managerIndex) {
193
+ const args = [
194
+ '-proj',
195
+ projectName,
196
+ '-command',
197
+ this.makeCliCredentials() + 'SINGLE_MGR:STOP',
198
+ managerIndex.toString(),
199
+ '-log',
200
+ '+stderr',
201
+ ];
202
+ return this.startAndValidateOutput(args);
203
+ }
204
+ //-------------------------------------------------------------------------
205
+ /**
206
+ * Kills a specific manager by index
207
+ */
208
+ async killManager(projectName, managerIndex) {
209
+ const args = [
210
+ '-proj',
211
+ projectName,
212
+ '-command',
213
+ this.makeCliCredentials() + 'SINGLE_MGR:KILL',
214
+ managerIndex.toString(),
215
+ '-log',
216
+ '+stderr',
217
+ ];
218
+ return this.startAndValidateOutput(args);
219
+ }
220
+ //-------------------------------------------------------------------------
221
+ /**
222
+ * Removes a specific manager by index
223
+ */
224
+ async removeManager(projectName, managerIndex) {
225
+ const args = [
226
+ '-proj',
227
+ projectName,
228
+ '-command',
229
+ this.makeCliCredentials() + 'SINGLE_MGR:DEL',
230
+ managerIndex.toString(),
231
+ '-log',
232
+ '+stderr',
233
+ ];
234
+ return this.startAndValidateOutput(args);
235
+ }
236
+ //-------------------------------------------------------------------------
237
+ /**
238
+ * Gets the list of managers in a project
239
+ */
240
+ async getManagerOptionsList(projectName) {
241
+ const pmonPath = this.getPath();
242
+ if (!pmonPath) {
243
+ throw new Error('WCCILpmon executable not found');
244
+ }
245
+ const args = [
246
+ '-proj',
247
+ projectName,
248
+ '-command',
249
+ this.makeCliCredentials() + 'MGRLIST:LIST',
250
+ '-log',
251
+ '+stdout',
252
+ ];
253
+ const callPath = pmonPath ?? '';
254
+ const lines = await this.execAndCollectLines(callPath, args);
255
+ const parsed = this.parseManagerList(lines.join('\n'));
256
+ return parsed;
257
+ }
258
+ //-------------------------------------------------------------------------
259
+ /**
260
+ * Convenience accessor for manager option (from MGRLIST:LIST) by index.
261
+ * If `projectName` is provided, it will refresh the options list first.
262
+ * If omitted, it returns the manager from last fetched list if available.
263
+ *
264
+ * TODO use command `>WCCILpmon.exe -proj Bla -log +stderr -command SINGLE_MGR:PROP_GET 2
265
+ once 30 3 1 -m gedi -n -num 5` to get the properties. It shall be mu more faster, then query the whole list
266
+ */
267
+ async getManagerOptionsAt(index, projectName) {
268
+ if (typeof index !== 'number' || index < 0)
269
+ return undefined;
270
+ if (projectName) {
271
+ const list = await this.getManagerOptionsList(projectName);
272
+ return list[index];
273
+ }
274
+ return undefined;
275
+ }
276
+ //-------------------------------------------------------------------------
277
+ /** Sets manager options at a specific index in project
278
+ *
279
+ * @param options
280
+ * @param projectName
281
+ * @param managerIndex
282
+ * @returns
283
+ */
284
+ async setManagerOptionsAt(options, projectName, managerIndex) {
285
+ const args = [
286
+ '-proj',
287
+ projectName,
288
+ '-command',
289
+ this.makeCliCredentials() + 'SINGLE_MGR:PROP_PUT',
290
+ managerIndex.toString(),
291
+ (0, ProjEnv_js_1.startModeToString)(options.startMode),
292
+ options.secondToKill.toString(),
293
+ options.resetStartCounter.toString(),
294
+ options.resetMin.toString(),
295
+ options.startOptions,
296
+ '-log',
297
+ '+stderr',
298
+ ];
299
+ return this.startAndValidateOutput(args);
300
+ }
301
+ //-------------------------------------------------------------------------
302
+ /** Inserts a manager at a specific index into project
303
+ * @param options Manager options
304
+ * @param projectName Project name
305
+ * @param managerIndex Index to insert at
306
+ */
307
+ async insertManagerAt(options, projectName, managerIndex) {
308
+ if (managerIndex === undefined) {
309
+ managerIndex =
310
+ (await this.getManagerOptionsList(projectName).then((list) => list.length)) + 1;
311
+ }
312
+ // SINGLE_MGR:INS <idx> <manager> <startmode> <seckill> <restartcount> <resetmin> <args>
313
+ const args = [
314
+ '-proj',
315
+ projectName,
316
+ '-command',
317
+ this.makeCliCredentials() + 'SINGLE_MGR:INS',
318
+ managerIndex.toString(),
319
+ options.component,
320
+ (0, ProjEnv_js_1.startModeToString)(options.startMode),
321
+ options.secondToKill.toString(),
322
+ options.resetStartCounter.toString(),
323
+ options.resetMin.toString(),
324
+ options.startOptions,
325
+ '-log',
326
+ '+stderr',
327
+ ];
328
+ return this.startAndValidateOutput(args);
329
+ }
330
+ //-------------------------------------------------------------------------
331
+ /** Sends a debug flag to a specific manager
332
+ * @param flag Debug flag to send (e.g., '-dbg http', '-dbg all')
333
+ * @param projectName Project name
334
+ * @param managerIndex Manager index
335
+ */
336
+ async sendDebugFlag(flag, projectName, managerIndex) {
337
+ const args = [
338
+ '-proj',
339
+ projectName,
340
+ '-command',
341
+ this.makeCliCredentials() + 'SINGLE_MGR:DEBUG',
342
+ managerIndex.toString(),
343
+ flag,
344
+ '-log',
345
+ '+stderr',
346
+ ];
347
+ return this.startAndValidateOutput(args);
348
+ }
349
+ //-------------------------------------------------------------------------
350
+ /** Gets detailed project and manager status (MGRLIST:STATI) and returns typed
351
+ * managers and optional project state
352
+ * @param projectName Project name
353
+ * @returns Parsed project status
354
+ */
355
+ async getProjectStatus(projectName) {
356
+ const pmonPath = this.getPath();
357
+ if (!pmonPath) {
358
+ const errorMsg = 'Could not locate WCCILpmon executable';
359
+ throw new Error(errorMsg);
360
+ }
361
+ const args = [
362
+ '-proj',
363
+ projectName,
364
+ '-command',
365
+ this.makeCliCredentials() + 'MGRLIST:STATI',
366
+ '-log',
367
+ '+stdout',
368
+ ];
369
+ const callPath = pmonPath ?? '';
370
+ const lines = await this.execAndCollectLines(callPath, args);
371
+ const raw = lines.join('\n');
372
+ const parsed = this.parseManagerStatus(raw);
373
+ return parsed;
374
+ }
375
+ //-------------------------------------------------------------------------
376
+ /**
377
+ * Convenience method to get a single manager status by index.
378
+ * If `projectName` is provided, it will refresh the list first.
379
+ * If omitted, it returns the manager from last fetched list if available.
380
+ */
381
+ async getManagerStatusAt(index, projectName) {
382
+ if (typeof index !== 'number' || index < 0)
383
+ return undefined;
384
+ if (projectName) {
385
+ const res = await this.getProjectStatus(projectName);
386
+ return res.managers[index];
387
+ }
388
+ // No cached data and no project specified
389
+ return undefined;
390
+ }
391
+ //-------------------------------------------------------------------------
392
+ /** Saves credentials for pmon authentication
393
+ *
394
+ * @param projectName Project name
395
+ * @param credentials Credentials to save
396
+ * @returns
397
+ */
398
+ async saveCredentials(projectName, credentials) {
399
+ if (!this.currentCredentials) {
400
+ this.currentCredentials = { username: '', password: '' };
401
+ }
402
+ this.validateCredentials(credentials);
403
+ const code = this._storeCredentials(projectName, this.currentCredentials, credentials);
404
+ if ((await code) === 0) {
405
+ this.currentCredentials = credentials;
406
+ console.log('Saved credentials for project', projectName);
407
+ }
408
+ else {
409
+ console.log('Failed to save credentials for project', projectName);
410
+ }
411
+ return code;
412
+ }
413
+ //-------------------------------------------------------------------------
414
+ /** Validates pmon credentials
415
+ *
416
+ * @param credentials
417
+ * throws Error if credentials are invalid
418
+ */
419
+ validateCredentials(credentials) {
420
+ if (!credentials.username || credentials.username.trim() === '') {
421
+ throw new Error('Username cannot be empty');
422
+ }
423
+ if (!credentials.password || credentials.password.trim() === '') {
424
+ throw new Error('Password cannot be empty');
425
+ }
426
+ if (credentials.username.indexOf('#') !== -1) {
427
+ throw new Error('Username cannot contains the character "#"');
428
+ }
429
+ if (credentials.password.indexOf('#') !== -1) {
430
+ throw new Error('Password cannot contains the character "#"');
431
+ }
432
+ }
433
+ //-------------------------------------------------------------------------
434
+ /** Gets the currently used credentials
435
+ *
436
+ * @returns
437
+ */
438
+ getCredentials() {
439
+ return this.currentCredentials;
440
+ }
441
+ //-------------------------------------------------------------------------
442
+ /** Verifies pmon credentials
443
+ *
444
+ * @param projectName Project name
445
+ * @param credentials Credentials to verify
446
+ * @returns
447
+ */
448
+ verifyCredentials(projectName, credentials) {
449
+ const oldCredentials = credentials;
450
+ // just try to store the same credentials again
451
+ return this._storeCredentials(projectName, oldCredentials, credentials).then((code) => code === 0);
452
+ }
453
+ makeCliCredentials() {
454
+ if (!this.currentCredentials) {
455
+ return '';
456
+ }
457
+ return `${this.currentCredentials.username}#${this.currentCredentials.password}`;
458
+ }
459
+ //-------------------------------------------------------------------------
460
+ _storeCredentials(projectName, oldCredentials, newCredentials) {
461
+ const args = [
462
+ '-proj',
463
+ projectName,
464
+ '-auth',
465
+ oldCredentials.username,
466
+ oldCredentials.password,
467
+ newCredentials.username,
468
+ newCredentials.password,
469
+ '-log',
470
+ '+stderr',
471
+ ];
472
+ return this.startAndValidateOutput(args);
473
+ }
474
+ startAndValidateOutput(args = [], options = {}) {
475
+ if (options.checkStdout === undefined) {
476
+ options.checkStdout = (stdout) => {
477
+ if (!stdout) {
478
+ console.warn('WARNING: Pmon command returned empty output. Do you means stdErr: ' +
479
+ this.stdErr);
480
+ return;
481
+ }
482
+ stdout = stdout.trim();
483
+ if (stdout != 'OK') {
484
+ console.error('ERROR: Pmon command failed with output:', stdout);
485
+ }
486
+ else if (stdout.startsWith('ERROR')) {
487
+ throw new Error(`Pmon command failed with error: ${stdout}`);
488
+ }
489
+ };
490
+ }
491
+ return super.start(args, options);
492
+ }
493
+ //-------------------------------------------------------------------------
494
+ /** Converts pmon exit code to ProjEnvPmonStatus
495
+ *
496
+ * @param code
497
+ * @returns
498
+ */
499
+ pmonStateCodeToStatus(code) {
500
+ console.log('Pmon status code:', code);
501
+ let status = ProjEnvPmonStatus_js_1.ProjEnvPmonStatus.Unknown;
502
+ if (code === 0)
503
+ status = ProjEnvPmonStatus_js_1.ProjEnvPmonStatus.Running;
504
+ else if (code === 3)
505
+ status = ProjEnvPmonStatus_js_1.ProjEnvPmonStatus.NotRunning;
506
+ else
507
+ status = ProjEnvPmonStatus_js_1.ProjEnvPmonStatus.Unknown;
508
+ return status;
509
+ }
510
+ //-------------------------------------------------------------------------
511
+ // Private parser for manager list output
512
+ parseManagerList(output) {
513
+ const lines = output
514
+ .split(/\r?\n/)
515
+ .map((l) => l.trim())
516
+ .filter((l) => l.length > 0 && l !== ';');
517
+ if (lines.length === 0)
518
+ return [];
519
+ if (/^LIST:\d+/i.test(lines[0]))
520
+ lines.shift();
521
+ const result = [];
522
+ for (const line of lines) {
523
+ const parts = line.split(';');
524
+ if (parts.length < 1)
525
+ continue;
526
+ if (parts.length < 6) {
527
+ throw new Error(`The line '${line}' has incorrect format`);
528
+ }
529
+ const name = parts[0];
530
+ const startModeNum = Number(parts[1]);
531
+ const seckill = Number(parts[2]);
532
+ const restartCount = Number(parts[3]);
533
+ const resetMin = Number(parts[4]);
534
+ const args = parts.slice(5).filter(Boolean).join(';');
535
+ let startModeEnum;
536
+ switch (startModeNum) {
537
+ case 0:
538
+ startModeEnum = ProjEnv_js_1.ProjEnvManagerStartMode.Manual;
539
+ break;
540
+ case 1:
541
+ startModeEnum = ProjEnv_js_1.ProjEnvManagerStartMode.Once;
542
+ break;
543
+ case 2:
544
+ startModeEnum = ProjEnv_js_1.ProjEnvManagerStartMode.Always;
545
+ break;
546
+ default:
547
+ throw new Error(`The line '${line}' contains invalid start mode. Expected 0,1,2 becames ${startModeNum}`);
548
+ }
549
+ result.push({
550
+ component: name,
551
+ startMode: startModeEnum,
552
+ secondToKill: seckill,
553
+ resetMin: resetMin,
554
+ resetStartCounter: restartCount,
555
+ startOptions: args,
556
+ });
557
+ }
558
+ return result;
559
+ }
560
+ //-------------------------------------------------------------------------
561
+ // Parse project state line from STATI output
562
+ parseProjectState(line) {
563
+ const parts = line.trim().split(/\s+/);
564
+ if (parts.length >= 4) {
565
+ const statusCode = parseInt(parts[0], 10);
566
+ const text = parts[1];
567
+ const emergency = parseInt(parts[2], 10) === 1;
568
+ const demo = parseInt(parts[3], 10) === 1;
569
+ let status = ProjEnv_js_1.ProjEnvProjectState.Unknown;
570
+ switch (statusCode) {
571
+ case -1:
572
+ status = ProjEnv_js_1.ProjEnvProjectState.Unknown;
573
+ break;
574
+ case 0:
575
+ status = ProjEnv_js_1.ProjEnvProjectState.Down;
576
+ break;
577
+ case 1:
578
+ status = ProjEnv_js_1.ProjEnvProjectState.Starting;
579
+ break;
580
+ case 2:
581
+ status = ProjEnv_js_1.ProjEnvProjectState.Monitoring;
582
+ break;
583
+ case 3:
584
+ status = ProjEnv_js_1.ProjEnvProjectState.Stopping;
585
+ break;
586
+ case 5:
587
+ status = ProjEnv_js_1.ProjEnvProjectState.Restarting;
588
+ break;
589
+ default:
590
+ status = ProjEnv_js_1.ProjEnvProjectState.Unknown;
591
+ break;
592
+ }
593
+ return { status, statusCode, text, emergency, demo };
594
+ }
595
+ return null;
596
+ }
597
+ //-------------------------------------------------------------------------
598
+ // Parse STATI output into typed managers and project state
599
+ parseManagerStatus(output) {
600
+ const managers = [];
601
+ const lines = output.split('\n');
602
+ let listStarted = false;
603
+ let projectState = undefined;
604
+ let projectStateLineFound = false;
605
+ for (let i = 0; i < lines.length; i++) {
606
+ const trimmed = lines[i].trim();
607
+ if (trimmed.startsWith('STATI:') || trimmed.startsWith('LIST:')) {
608
+ listStarted = true;
609
+ continue;
610
+ }
611
+ if (trimmed === ';') {
612
+ break;
613
+ }
614
+ if (!listStarted || !trimmed)
615
+ continue;
616
+ // Look ahead to detect project state line (line before ';')
617
+ let isProjectStateLine = false;
618
+ for (let j = i + 1; j < lines.length; j++) {
619
+ const nextTrimmed = lines[j].trim();
620
+ if (nextTrimmed === ';') {
621
+ isProjectStateLine = true;
622
+ break;
623
+ }
624
+ else if (nextTrimmed !== '')
625
+ break;
626
+ }
627
+ if (isProjectStateLine && !projectStateLineFound) {
628
+ const parsed = this.parseProjectState(trimmed);
629
+ if (parsed)
630
+ projectState = parsed;
631
+ projectStateLineFound = true;
632
+ continue;
633
+ }
634
+ const parts = trimmed.split(';');
635
+ if (parts.length >= 5) {
636
+ const runningStateNum = parseInt(parts[0].trim(), 10);
637
+ const pid = parseInt(parts[1].trim(), 10);
638
+ const startModeNum = parseInt(parts[2].trim(), 10);
639
+ const startTimeStamp = parts[3].trim();
640
+ const managerNumber = parseInt(parts[4].trim(), 10);
641
+ let runningStateEnum;
642
+ switch (runningStateNum) {
643
+ case 0:
644
+ runningStateEnum = ProjEnv_js_1.ProjEnvManagerState.NotRunning;
645
+ break;
646
+ case 1:
647
+ runningStateEnum = ProjEnv_js_1.ProjEnvManagerState.Init;
648
+ break;
649
+ case 2:
650
+ runningStateEnum = ProjEnv_js_1.ProjEnvManagerState.Running;
651
+ break;
652
+ case 3:
653
+ runningStateEnum = ProjEnv_js_1.ProjEnvManagerState.Blocked;
654
+ break;
655
+ default:
656
+ runningStateEnum = ProjEnv_js_1.ProjEnvManagerState.NotRunning;
657
+ break;
658
+ }
659
+ let startModeEnum;
660
+ switch (startModeNum) {
661
+ case 0:
662
+ startModeEnum = ProjEnv_js_1.ProjEnvManagerStartMode.Manual;
663
+ break;
664
+ case 1:
665
+ startModeEnum = ProjEnv_js_1.ProjEnvManagerStartMode.Once;
666
+ break;
667
+ case 2:
668
+ startModeEnum = ProjEnv_js_1.ProjEnvManagerStartMode.Always;
669
+ break;
670
+ default:
671
+ startModeEnum = ProjEnv_js_1.ProjEnvManagerStartMode.Manual;
672
+ break;
673
+ }
674
+ let parsedTimestamp;
675
+ if (startTimeStamp &&
676
+ startTimeStamp !== '0' &&
677
+ startTimeStamp !== '' &&
678
+ startTimeStamp !== '-1' &&
679
+ !startTimeStamp.startsWith('1970')) {
680
+ try {
681
+ const winccOaMatch = startTimeStamp.match(/^(\d{4})\.(\d{2})\.(\d{2})\s+(\d{2}):(\d{2}):(\d{2})\.(\d{3})$/);
682
+ if (winccOaMatch) {
683
+ const [, year, month, day, hours, minutes, seconds, milliseconds] = winccOaMatch;
684
+ parsedTimestamp = new Date(parseInt(year, 10), parseInt(month, 10) - 1, parseInt(day, 10), parseInt(hours, 10), parseInt(minutes, 10), parseInt(seconds, 10), parseInt(milliseconds, 10));
685
+ }
686
+ }
687
+ catch {
688
+ parsedTimestamp = undefined;
689
+ }
690
+ }
691
+ // Build object with new typed fields and include legacy field names for compatibility
692
+ const managerObj = {
693
+ state: runningStateEnum,
694
+ pid: pid === -1 ? undefined : pid,
695
+ startMode: startModeEnum,
696
+ startTime: parsedTimestamp,
697
+ managerNumber,
698
+ };
699
+ // Legacy compatibility fields used by older consumers/tests
700
+ managerObj.runningState =
701
+ runningStateEnum === ProjEnv_js_1.ProjEnvManagerState.Running
702
+ ? 'running'
703
+ : runningStateEnum === ProjEnv_js_1.ProjEnvManagerState.Init
704
+ ? 'init'
705
+ : runningStateEnum === ProjEnv_js_1.ProjEnvManagerState.Blocked
706
+ ? 'blocked'
707
+ : 'stopped';
708
+ managerObj.startTimeStamp = parsedTimestamp;
709
+ managerObj.startMode =
710
+ startModeEnum === ProjEnv_js_1.ProjEnvManagerStartMode.Always
711
+ ? 'always'
712
+ : startModeEnum === ProjEnv_js_1.ProjEnvManagerStartMode.Once
713
+ ? 'once'
714
+ : startModeEnum === ProjEnv_js_1.ProjEnvManagerStartMode.Manual
715
+ ? 'manual'
716
+ : 'unknown';
717
+ managers.push(managerObj);
718
+ }
719
+ }
720
+ const state = {
721
+ managers: managers,
722
+ project: projectState,
723
+ };
724
+ return state;
725
+ }
726
+ }
727
+ exports.PmonComponent = PmonComponent;
728
+ //# sourceMappingURL=PmonComponent.js.map