tunli 0.0.26 → 0.1.0

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 (387) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +158 -67
  3. package/bin/tunli +4 -5
  4. package/dist/api-client/ApiClient.d.ts +18 -0
  5. package/dist/api-client/ApiClient.d.ts.map +1 -0
  6. package/dist/api-client/ApiClient.js +100 -0
  7. package/dist/api-client/ApiClient.js.map +1 -0
  8. package/dist/api-client/types.d.ts +26 -0
  9. package/dist/api-client/types.d.ts.map +1 -0
  10. package/dist/api-client/types.js +2 -0
  11. package/dist/api-client/types.js.map +1 -0
  12. package/dist/api-client/utils.d.ts +4 -0
  13. package/dist/api-client/utils.d.ts.map +1 -0
  14. package/dist/api-client/utils.js +13 -0
  15. package/dist/api-client/utils.js.map +1 -0
  16. package/dist/cli-app/AppEventEmitter.d.ts +57 -0
  17. package/dist/cli-app/AppEventEmitter.d.ts.map +1 -0
  18. package/dist/cli-app/AppEventEmitter.js +11 -0
  19. package/dist/cli-app/AppEventEmitter.js.map +1 -0
  20. package/dist/cli-app/Dashboard.d.ts +4 -0
  21. package/dist/cli-app/Dashboard.d.ts.map +1 -0
  22. package/dist/cli-app/Dashboard.js +149 -0
  23. package/dist/cli-app/Dashboard.js.map +1 -0
  24. package/dist/cli-app/LiveLog.d.ts +4 -0
  25. package/dist/cli-app/LiveLog.d.ts.map +1 -0
  26. package/dist/cli-app/LiveLog.js +28 -0
  27. package/dist/cli-app/LiveLog.js.map +1 -0
  28. package/dist/cli-app/types.d.ts +10 -0
  29. package/dist/cli-app/types.d.ts.map +1 -0
  30. package/dist/cli-app/types.js +2 -0
  31. package/dist/cli-app/types.js.map +1 -0
  32. package/dist/cli-app/versionCheck.d.ts +4 -0
  33. package/dist/cli-app/versionCheck.d.ts.map +1 -0
  34. package/dist/cli-app/versionCheck.js +46 -0
  35. package/dist/cli-app/versionCheck.js.map +1 -0
  36. package/dist/client.d.ts +2 -0
  37. package/dist/client.d.ts.map +1 -0
  38. package/dist/client.js +75 -0
  39. package/dist/client.js.map +1 -0
  40. package/dist/commander/Argument.d.ts +19 -0
  41. package/dist/commander/Argument.d.ts.map +1 -0
  42. package/dist/commander/Argument.js +25 -0
  43. package/dist/commander/Argument.js.map +1 -0
  44. package/dist/commander/Command.d.ts +23 -0
  45. package/dist/commander/Command.d.ts.map +1 -0
  46. package/dist/commander/Command.js +159 -0
  47. package/dist/commander/Command.js.map +1 -0
  48. package/dist/commander/InvalidArgumentError.d.ts +5 -0
  49. package/dist/commander/InvalidArgumentError.d.ts.map +1 -0
  50. package/dist/commander/InvalidArgumentError.js +8 -0
  51. package/dist/commander/InvalidArgumentError.js.map +1 -0
  52. package/dist/commander/Option.d.ts +15 -0
  53. package/dist/commander/Option.d.ts.map +1 -0
  54. package/dist/commander/Option.js +43 -0
  55. package/dist/commander/Option.js.map +1 -0
  56. package/dist/commander/index.d.ts +7 -0
  57. package/dist/commander/index.d.ts.map +1 -0
  58. package/dist/commander/index.js +5 -0
  59. package/dist/commander/index.js.map +1 -0
  60. package/dist/commander/types.d.ts +2 -0
  61. package/dist/commander/types.d.ts.map +1 -0
  62. package/dist/commander/types.js +2 -0
  63. package/dist/commander/types.js.map +1 -0
  64. package/dist/commands/CommandAuth/CommandAuth.d.ts +4 -0
  65. package/dist/commands/CommandAuth/CommandAuth.d.ts.map +1 -0
  66. package/dist/commands/CommandAuth/CommandAuth.js +24 -0
  67. package/dist/commands/CommandAuth/CommandAuth.js.map +1 -0
  68. package/dist/commands/CommandConfig/CommandConfig.d.ts +4 -0
  69. package/dist/commands/CommandConfig/CommandConfig.d.ts.map +1 -0
  70. package/dist/commands/CommandConfig/CommandConfig.js +37 -0
  71. package/dist/commands/CommandConfig/CommandConfig.js.map +1 -0
  72. package/dist/commands/CommandConfig/sub-commands/configDeleteCommand.d.ts +4 -0
  73. package/dist/commands/CommandConfig/sub-commands/configDeleteCommand.d.ts.map +1 -0
  74. package/dist/commands/CommandConfig/sub-commands/configDeleteCommand.js +20 -0
  75. package/dist/commands/CommandConfig/sub-commands/configDeleteCommand.js.map +1 -0
  76. package/dist/commands/CommandConfig/sub-commands/configGetCommand.d.ts +5 -0
  77. package/dist/commands/CommandConfig/sub-commands/configGetCommand.d.ts.map +1 -0
  78. package/dist/commands/CommandConfig/sub-commands/configGetCommand.js +23 -0
  79. package/dist/commands/CommandConfig/sub-commands/configGetCommand.js.map +1 -0
  80. package/dist/commands/CommandConfig/sub-commands/configSetCommand.d.ts +4 -0
  81. package/dist/commands/CommandConfig/sub-commands/configSetCommand.d.ts.map +1 -0
  82. package/dist/commands/CommandConfig/sub-commands/configSetCommand.js +69 -0
  83. package/dist/commands/CommandConfig/sub-commands/configSetCommand.js.map +1 -0
  84. package/dist/commands/CommandConfig/types.d.ts +6 -0
  85. package/dist/commands/CommandConfig/types.d.ts.map +1 -0
  86. package/dist/commands/CommandConfig/types.js +2 -0
  87. package/dist/commands/CommandConfig/types.js.map +1 -0
  88. package/dist/commands/CommandConfig/utils/preparePrimaryOptions.d.ts +3 -0
  89. package/dist/commands/CommandConfig/utils/preparePrimaryOptions.d.ts.map +1 -0
  90. package/dist/commands/CommandConfig/utils/preparePrimaryOptions.js +8 -0
  91. package/dist/commands/CommandConfig/utils/preparePrimaryOptions.js.map +1 -0
  92. package/dist/commands/CommandConfig/utils/resolveConfig.d.ts +8 -0
  93. package/dist/commands/CommandConfig/utils/resolveConfig.d.ts.map +1 -0
  94. package/dist/commands/CommandConfig/utils/resolveConfig.js +33 -0
  95. package/dist/commands/CommandConfig/utils/resolveConfig.js.map +1 -0
  96. package/dist/commands/CommandConfig/utils/sharedOptions.d.ts +3 -0
  97. package/dist/commands/CommandConfig/utils/sharedOptions.d.ts.map +1 -0
  98. package/dist/commands/CommandConfig/utils/sharedOptions.js +14 -0
  99. package/dist/commands/CommandConfig/utils/sharedOptions.js.map +1 -0
  100. package/dist/commands/CommandDaemon/CommandDaemon.d.ts +4 -0
  101. package/dist/commands/CommandDaemon/CommandDaemon.d.ts.map +1 -0
  102. package/dist/commands/CommandDaemon/CommandDaemon.js +57 -0
  103. package/dist/commands/CommandDaemon/CommandDaemon.js.map +1 -0
  104. package/dist/commands/CommandDashboard/CommandDashboard.d.ts +4 -0
  105. package/dist/commands/CommandDashboard/CommandDashboard.d.ts.map +1 -0
  106. package/dist/commands/CommandDashboard/CommandDashboard.js +54 -0
  107. package/dist/commands/CommandDashboard/CommandDashboard.js.map +1 -0
  108. package/dist/commands/CommandHTTP/CommandHttp.d.ts +4 -0
  109. package/dist/commands/CommandHTTP/CommandHttp.d.ts.map +1 -0
  110. package/dist/commands/CommandHTTP/CommandHttp.js +50 -0
  111. package/dist/commands/CommandHTTP/CommandHttp.js.map +1 -0
  112. package/dist/commands/CommandInit/CommandInit.d.ts +4 -0
  113. package/dist/commands/CommandInit/CommandInit.d.ts.map +1 -0
  114. package/dist/commands/CommandInit/CommandInit.js +36 -0
  115. package/dist/commands/CommandInit/CommandInit.js.map +1 -0
  116. package/dist/commands/CommandList/CommandList.d.ts +4 -0
  117. package/dist/commands/CommandList/CommandList.d.ts.map +1 -0
  118. package/dist/commands/CommandList/CommandList.js +54 -0
  119. package/dist/commands/CommandList/CommandList.js.map +1 -0
  120. package/dist/commands/CommandLogs/CommandLogs.d.ts +4 -0
  121. package/dist/commands/CommandLogs/CommandLogs.d.ts.map +1 -0
  122. package/dist/commands/CommandLogs/CommandLogs.js +33 -0
  123. package/dist/commands/CommandLogs/CommandLogs.js.map +1 -0
  124. package/dist/commands/CommandProfile/CommandProfile.d.ts +5 -0
  125. package/dist/commands/CommandProfile/CommandProfile.d.ts.map +1 -0
  126. package/dist/commands/CommandProfile/CommandProfile.js +64 -0
  127. package/dist/commands/CommandProfile/CommandProfile.js.map +1 -0
  128. package/dist/commands/CommandRegister/CommandRegister.d.ts +4 -0
  129. package/dist/commands/CommandRegister/CommandRegister.d.ts.map +1 -0
  130. package/dist/commands/CommandRegister/CommandRegister.js +43 -0
  131. package/dist/commands/CommandRegister/CommandRegister.js.map +1 -0
  132. package/dist/commands/CommandRestart/CommandRestart.d.ts +4 -0
  133. package/dist/commands/CommandRestart/CommandRestart.d.ts.map +1 -0
  134. package/dist/commands/CommandRestart/CommandRestart.js +62 -0
  135. package/dist/commands/CommandRestart/CommandRestart.js.map +1 -0
  136. package/dist/commands/CommandServer/CommandServer.d.ts +4 -0
  137. package/dist/commands/CommandServer/CommandServer.d.ts.map +1 -0
  138. package/dist/commands/CommandServer/CommandServer.js +24 -0
  139. package/dist/commands/CommandServer/CommandServer.js.map +1 -0
  140. package/dist/commands/CommandStop/CommandStop.d.ts +4 -0
  141. package/dist/commands/CommandStop/CommandStop.d.ts.map +1 -0
  142. package/dist/commands/CommandStop/CommandStop.js +25 -0
  143. package/dist/commands/CommandStop/CommandStop.js.map +1 -0
  144. package/dist/commands/CommandUpdate/CommandUpdate.d.ts +4 -0
  145. package/dist/commands/CommandUpdate/CommandUpdate.d.ts.map +1 -0
  146. package/dist/commands/CommandUpdate/CommandUpdate.js +38 -0
  147. package/dist/commands/CommandUpdate/CommandUpdate.js.map +1 -0
  148. package/dist/commands/CommandUseProfile/CommandUseProfile.d.ts +4 -0
  149. package/dist/commands/CommandUseProfile/CommandUseProfile.d.ts.map +1 -0
  150. package/dist/commands/CommandUseProfile/CommandUseProfile.js +63 -0
  151. package/dist/commands/CommandUseProfile/CommandUseProfile.js.map +1 -0
  152. package/dist/commands/helper/Help.d.ts +4 -0
  153. package/dist/commands/helper/Help.d.ts.map +1 -0
  154. package/dist/commands/helper/Help.js +134 -0
  155. package/dist/commands/helper/Help.js.map +1 -0
  156. package/dist/commands/helper/Parser.d.ts +55 -0
  157. package/dist/commands/helper/Parser.d.ts.map +1 -0
  158. package/dist/commands/helper/Parser.js +280 -0
  159. package/dist/commands/helper/Parser.js.map +1 -0
  160. package/dist/commands/shared/allowDenyCidrCommand.d.ts +3 -0
  161. package/dist/commands/shared/allowDenyCidrCommand.d.ts.map +1 -0
  162. package/dist/commands/shared/allowDenyCidrCommand.js +10 -0
  163. package/dist/commands/shared/allowDenyCidrCommand.js.map +1 -0
  164. package/dist/commands/shared/configServersCommand.d.ts +4 -0
  165. package/dist/commands/shared/configServersCommand.d.ts.map +1 -0
  166. package/dist/commands/shared/configServersCommand.js +19 -0
  167. package/dist/commands/shared/configServersCommand.js.map +1 -0
  168. package/dist/commands/utils.d.ts +3 -0
  169. package/dist/commands/utils.d.ts.map +1 -0
  170. package/dist/commands/utils.js +17 -0
  171. package/dist/commands/utils.js.map +1 -0
  172. package/dist/config/ParsedConfig.d.ts +31 -0
  173. package/dist/config/ParsedConfig.d.ts.map +1 -0
  174. package/dist/config/ParsedConfig.js +116 -0
  175. package/dist/config/ParsedConfig.js.map +1 -0
  176. package/dist/config/ParsedGlobalConfig.d.ts +5 -0
  177. package/dist/config/ParsedGlobalConfig.d.ts.map +1 -0
  178. package/dist/config/ParsedGlobalConfig.js +7 -0
  179. package/dist/config/ParsedGlobalConfig.js.map +1 -0
  180. package/dist/config/ParsedLocalConfig.d.ts +5 -0
  181. package/dist/config/ParsedLocalConfig.d.ts.map +1 -0
  182. package/dist/config/ParsedLocalConfig.js +7 -0
  183. package/dist/config/ParsedLocalConfig.js.map +1 -0
  184. package/dist/config/ParsedProfileConfig.d.ts +46 -0
  185. package/dist/config/ParsedProfileConfig.d.ts.map +1 -0
  186. package/dist/config/ParsedProfileConfig.js +120 -0
  187. package/dist/config/ParsedProfileConfig.js.map +1 -0
  188. package/dist/config/ParsedServerConfig.d.ts +20 -0
  189. package/dist/config/ParsedServerConfig.d.ts.map +1 -0
  190. package/dist/config/ParsedServerConfig.js +55 -0
  191. package/dist/config/ParsedServerConfig.js.map +1 -0
  192. package/dist/config/TempProfileConfig.d.ts +8 -0
  193. package/dist/config/TempProfileConfig.d.ts.map +1 -0
  194. package/dist/config/TempProfileConfig.js +13 -0
  195. package/dist/config/TempProfileConfig.js.map +1 -0
  196. package/dist/config/utils.d.ts +2 -0
  197. package/dist/config/utils.d.ts.map +1 -0
  198. package/dist/config/utils.js +8 -0
  199. package/dist/config/utils.js.map +1 -0
  200. package/dist/config/validations/validateProfileConfig.d.ts +4 -0
  201. package/dist/config/validations/validateProfileConfig.d.ts.map +1 -0
  202. package/dist/config/validations/validateProfileConfig.js +76 -0
  203. package/dist/config/validations/validateProfileConfig.js.map +1 -0
  204. package/dist/core/FS/utils.d.ts +12 -0
  205. package/dist/core/FS/utils.d.ts.map +1 -0
  206. package/dist/core/FS/utils.js +55 -0
  207. package/dist/core/FS/utils.js.map +1 -0
  208. package/dist/daemon/DaemonClient.d.ts +16 -0
  209. package/dist/daemon/DaemonClient.d.ts.map +1 -0
  210. package/dist/daemon/DaemonClient.js +158 -0
  211. package/dist/daemon/DaemonClient.js.map +1 -0
  212. package/dist/daemon/DaemonServer.d.ts +8 -0
  213. package/dist/daemon/DaemonServer.d.ts.map +1 -0
  214. package/dist/daemon/DaemonServer.js +201 -0
  215. package/dist/daemon/DaemonServer.js.map +1 -0
  216. package/dist/daemon/protocol.d.ts +101 -0
  217. package/dist/daemon/protocol.d.ts.map +1 -0
  218. package/dist/daemon/protocol.js +2 -0
  219. package/dist/daemon/protocol.js.map +1 -0
  220. package/dist/daemon-main.d.ts +2 -0
  221. package/dist/daemon-main.d.ts.map +1 -0
  222. package/dist/daemon-main.js +13 -0
  223. package/dist/daemon-main.js.map +1 -0
  224. package/dist/launcher-main.d.ts +2 -0
  225. package/dist/launcher-main.d.ts.map +1 -0
  226. package/dist/launcher-main.js +57 -0
  227. package/dist/launcher-main.js.map +1 -0
  228. package/dist/lib/Flow/applyUpdate.d.ts +3 -0
  229. package/dist/lib/Flow/applyUpdate.d.ts.map +1 -0
  230. package/dist/lib/Flow/applyUpdate.js +34 -0
  231. package/dist/lib/Flow/applyUpdate.js.map +1 -0
  232. package/dist/lib/Flow/downloadBinaryUpdate.d.ts +3 -0
  233. package/dist/lib/Flow/downloadBinaryUpdate.d.ts.map +1 -0
  234. package/dist/lib/Flow/downloadBinaryUpdate.js +54 -0
  235. package/dist/lib/Flow/downloadBinaryUpdate.js.map +1 -0
  236. package/dist/lib/Flow/getLatestVersion.d.ts +2 -0
  237. package/dist/lib/Flow/getLatestVersion.d.ts.map +1 -0
  238. package/dist/lib/Flow/getLatestVersion.js +13 -0
  239. package/dist/lib/Flow/getLatestVersion.js.map +1 -0
  240. package/dist/lib/defs.d.ts +18 -0
  241. package/dist/lib/defs.d.ts.map +1 -0
  242. package/dist/lib/defs.js +33 -0
  243. package/dist/lib/defs.js.map +1 -0
  244. package/dist/logger/logger.d.ts +6 -0
  245. package/dist/logger/logger.d.ts.map +1 -0
  246. package/dist/logger/logger.js +34 -0
  247. package/dist/logger/logger.js.map +1 -0
  248. package/dist/output-formats/colors.d.ts +7 -0
  249. package/dist/output-formats/colors.d.ts.map +1 -0
  250. package/dist/output-formats/colors.js +8 -0
  251. package/dist/output-formats/colors.js.map +1 -0
  252. package/dist/output-formats/formatConfig.d.ts +3 -0
  253. package/dist/output-formats/formatConfig.d.ts.map +1 -0
  254. package/dist/output-formats/formatConfig.js +59 -0
  255. package/dist/output-formats/formatConfig.js.map +1 -0
  256. package/dist/output-formats/formatConfigPath.d.ts +4 -0
  257. package/dist/output-formats/formatConfigPath.d.ts.map +1 -0
  258. package/dist/output-formats/formatConfigPath.js +7 -0
  259. package/dist/output-formats/formatConfigPath.js.map +1 -0
  260. package/dist/output-formats/formatPath.d.ts +2 -0
  261. package/dist/output-formats/formatPath.d.ts.map +1 -0
  262. package/dist/output-formats/formatPath.js +6 -0
  263. package/dist/output-formats/formatPath.js.map +1 -0
  264. package/dist/output-formats/formatProfile.d.ts +3 -0
  265. package/dist/output-formats/formatProfile.d.ts.map +1 -0
  266. package/dist/output-formats/formatProfile.js +35 -0
  267. package/dist/output-formats/formatProfile.js.map +1 -0
  268. package/dist/output-formats/formatProfilesShort.d.ts +3 -0
  269. package/dist/output-formats/formatProfilesShort.d.ts.map +1 -0
  270. package/dist/output-formats/formatProfilesShort.js +19 -0
  271. package/dist/output-formats/formatProfilesShort.js.map +1 -0
  272. package/dist/output-formats/formatSaveResult.d.ts +4 -0
  273. package/dist/output-formats/formatSaveResult.d.ts.map +1 -0
  274. package/dist/output-formats/formatSaveResult.js +7 -0
  275. package/dist/output-formats/formatSaveResult.js.map +1 -0
  276. package/dist/output-formats/table.d.ts +8 -0
  277. package/dist/output-formats/table.d.ts.map +1 -0
  278. package/dist/output-formats/table.js +15 -0
  279. package/dist/output-formats/table.js.map +1 -0
  280. package/dist/package-json/packageJson.d.ts +6 -0
  281. package/dist/package-json/packageJson.d.ts.map +1 -0
  282. package/dist/package-json/packageJson.js +12 -0
  283. package/dist/package-json/packageJson.js.map +1 -0
  284. package/dist/proxy/Proxy.d.ts +6 -0
  285. package/dist/proxy/Proxy.d.ts.map +1 -0
  286. package/dist/proxy/Proxy.js +203 -0
  287. package/dist/proxy/Proxy.js.map +1 -0
  288. package/dist/sea-main.d.ts +2 -0
  289. package/dist/sea-main.d.ts.map +1 -0
  290. package/dist/sea-main.js +20 -0
  291. package/dist/sea-main.js.map +1 -0
  292. package/dist/types/types.d.ts +55 -0
  293. package/dist/types/types.d.ts.map +1 -0
  294. package/dist/types/types.js +2 -0
  295. package/dist/types/types.js.map +1 -0
  296. package/dist/utils/arrayFunctions.d.ts +24 -0
  297. package/dist/utils/arrayFunctions.d.ts.map +1 -0
  298. package/dist/utils/arrayFunctions.js +43 -0
  299. package/dist/utils/arrayFunctions.js.map +1 -0
  300. package/dist/utils/assertFunctions.d.ts +7 -0
  301. package/dist/utils/assertFunctions.d.ts.map +1 -0
  302. package/dist/utils/assertFunctions.js +20 -0
  303. package/dist/utils/assertFunctions.js.map +1 -0
  304. package/dist/utils/checkFunctions.d.ts +34 -0
  305. package/dist/utils/checkFunctions.d.ts.map +1 -0
  306. package/dist/utils/checkFunctions.js +87 -0
  307. package/dist/utils/checkFunctions.js.map +1 -0
  308. package/dist/utils/cliFunctions.d.ts +10 -0
  309. package/dist/utils/cliFunctions.d.ts.map +1 -0
  310. package/dist/utils/cliFunctions.js +68 -0
  311. package/dist/utils/cliFunctions.js.map +1 -0
  312. package/dist/utils/hashFunctions.d.ts +10 -0
  313. package/dist/utils/hashFunctions.d.ts.map +1 -0
  314. package/dist/utils/hashFunctions.js +11 -0
  315. package/dist/utils/hashFunctions.js.map +1 -0
  316. package/dist/utils/npmFunctions.d.ts +3 -0
  317. package/dist/utils/npmFunctions.d.ts.map +1 -0
  318. package/dist/utils/npmFunctions.js +28 -0
  319. package/dist/utils/npmFunctions.js.map +1 -0
  320. package/dist/utils/stringFunctions.d.ts +12 -0
  321. package/dist/utils/stringFunctions.d.ts.map +1 -0
  322. package/dist/utils/stringFunctions.js +37 -0
  323. package/dist/utils/stringFunctions.js.map +1 -0
  324. package/package.json +39 -16
  325. package/client.js +0 -33
  326. package/src/cli-app/Dashboard.js +0 -211
  327. package/src/cli-app/Screen.js +0 -135
  328. package/src/cli-app/elements/ElementNode.js +0 -97
  329. package/src/cli-app/elements/Line.js +0 -21
  330. package/src/cli-app/elements/List/List.js +0 -227
  331. package/src/cli-app/elements/List/ListCell.js +0 -83
  332. package/src/cli-app/elements/List/ListColumn.js +0 -52
  333. package/src/cli-app/elements/List/ListRow.js +0 -118
  334. package/src/cli-app/elements/Row.js +0 -38
  335. package/src/cli-app/helper/utils.js +0 -42
  336. package/src/commands/Action/addDelValuesAction.js +0 -56
  337. package/src/commands/CommandAuth.js +0 -32
  338. package/src/commands/CommandClearAll.js +0 -27
  339. package/src/commands/CommandConfig.js +0 -59
  340. package/src/commands/CommandHTTP.js +0 -192
  341. package/src/commands/CommandInvite.js +0 -38
  342. package/src/commands/CommandRefresh.js +0 -35
  343. package/src/commands/CommandRegister.js +0 -48
  344. package/src/commands/Option/DeleteOption.js +0 -6
  345. package/src/commands/Option/ProfileListOption.js +0 -65
  346. package/src/commands/Option/SelectConfigOption.js +0 -52
  347. package/src/commands/SubCommand/AllowDenyCidrCommand.js +0 -28
  348. package/src/commands/SubCommand/HostCommand.js +0 -22
  349. package/src/commands/SubCommand/PortCommand.js +0 -20
  350. package/src/commands/SubCommand/ProtocolCommand.js +0 -21
  351. package/src/commands/helper/AliasResolver.js +0 -13
  352. package/src/commands/helper/BindArgs.js +0 -53
  353. package/src/commands/helper/SharedArg.js +0 -32
  354. package/src/commands/utils.js +0 -96
  355. package/src/config/ConfigAbstract.js +0 -353
  356. package/src/config/ConfigManager.js +0 -70
  357. package/src/config/GlobalConfig.js +0 -14
  358. package/src/config/GlobalLocalShardConfigAbstract.js +0 -98
  359. package/src/config/LocalConfig.js +0 -7
  360. package/src/config/PropertyConfig.js +0 -122
  361. package/src/config/SystemConfig.js +0 -31
  362. package/src/core/FS/utils.js +0 -60
  363. package/src/core/Ref.js +0 -70
  364. package/src/lib/Flow/getCurrentIp.js +0 -18
  365. package/src/lib/Flow/getLatestVersion.js +0 -13
  366. package/src/lib/Flow/proxyUrl.js +0 -35
  367. package/src/lib/Flow/validateAuthToken.js +0 -19
  368. package/src/lib/HttpClient.js +0 -61
  369. package/src/lib/Proxy.js +0 -42
  370. package/src/lib/defs.js +0 -13
  371. package/src/net/IPV4.js +0 -139
  372. package/src/net/http/IncomingMessage.js +0 -92
  373. package/src/net/http/ServerResponse.js +0 -126
  374. package/src/net/http/TunliRequest.js +0 -1
  375. package/src/net/http/TunliResponse.js +0 -1
  376. package/src/net/http/TunnelRequest.js +0 -229
  377. package/src/net/http/TunnelResponse.js +0 -119
  378. package/src/tunnel-client/TunnelClient.js +0 -144
  379. package/src/utils/arrayFunctions.js +0 -45
  380. package/src/utils/checkFunctions.js +0 -182
  381. package/src/utils/cliFunctions.js +0 -63
  382. package/src/utils/createRequest.js +0 -12
  383. package/src/utils/hashFunctions.js +0 -9
  384. package/src/utils/httpFunction.js +0 -23
  385. package/src/utils/npmFunctions.js +0 -27
  386. package/src/utils/stringFunctions.js +0 -59
  387. package/types/index.d.ts +0 -119
package/package.json CHANGED
@@ -1,43 +1,67 @@
1
1
  {
2
2
  "name": "tunli",
3
- "description": "Node.js application for creating HTTP tunnels to make local software projects accessible over the internet.",
4
- "version": "0.0.26",
3
+ "description": "Developer-first HTTP tunneling CLI with daemon-based tunnel management, profiles, and self-hosted server support.",
4
+ "version": "0.1.0",
5
5
  "main": "bin/tunli",
6
6
  "bin": {
7
7
  "tunli": "bin/tunli"
8
8
  },
9
9
  "scripts": {
10
- "dev": "nodemon client.js"
10
+ "prepublishOnly": "npm test",
11
+ "build": "npm run clean && tsc",
12
+ "build:sea": "npm run clean && tsc && scripts/build-main.sh && scripts/build-launcher.sh",
13
+ "build:main": "npm run clean && tsc && scripts/build-main.sh",
14
+ "build:launcher": "npm run clean && tsc && scripts/build-launcher.sh",
15
+ "clean": "rm -rf dist",
16
+ "test": "npm run build && node --test",
17
+ "test:coverage": "npm run build && node --test --experimental-test-coverage --test-coverage-exclude='test/**'",
18
+ "test:coverage:c8": "npm run build && npx c8 node --test",
19
+ "test:coverage:lcov": "npm run build && npx c8 --src src node --enable-source-maps --test"
11
20
  },
12
21
  "keywords": [
13
- "HTTP tunnel",
22
+ "tunnel",
23
+ "http tunnel",
14
24
  "reverse proxy",
15
- "remote access",
16
25
  "local development",
17
- "Node.js"
26
+ "websocket",
27
+ "daemon",
28
+ "self-hosted"
18
29
  ],
19
30
  "author": "Pascal Pfeifer <pascal@tunli.app>",
20
31
  "imports": {
21
- "#lib/*": "./src/lib/*.js",
22
- "#commands/*": "./src/commands/*.js",
23
- "#src/*": "./src/*.js"
32
+ "#*": "./dist/*.js"
24
33
  },
34
+ "files": [
35
+ "bin/",
36
+ "dist/",
37
+ "README.md",
38
+ "CHANGELOG.md",
39
+ "LICENSE"
40
+ ],
25
41
  "type": "module",
26
42
  "dependencies": {
27
- "axios": "^1.11.0",
28
- "blessed": "^0.1.81",
43
+ "@pfeiferio/ipv4": "^1.1.0",
44
+ "@pfeiferio/string-interpolate": "^1.0.0",
29
45
  "chalk": "^5.5.0",
30
- "commander": "^14.0.0",
46
+ "ink": "^6.8.0",
47
+ "qrcode": "^1.5.4",
48
+ "react": "^19.2.4",
31
49
  "socket.io-client": "^4.8.1"
32
50
  },
33
51
  "devDependencies": {
34
- "nodemon": "^3.1.10"
52
+ "@types/qrcode": "^1.5.6",
53
+ "@types/react": "^19.0.0",
54
+ "esbuild": "^0.27.4",
55
+ "nodemon": "^3.1.10",
56
+ "tsx": "^4.19.3",
57
+ "typescript": "^5.9.3"
35
58
  },
36
59
  "repository": {
37
60
  "type": "git",
38
- "url": "https://github.com/tunlijs/tunli-client"
61
+ "url": "git+https://github.com/tunlijs/tunli-client"
39
62
  },
40
63
  "publishConfig": {
64
+ "access": "public",
41
65
  "registry": "https://registry.npmjs.org"
42
66
  },
43
67
  "homepage": "https://tunli.app",
@@ -46,8 +70,7 @@
46
70
  "url": "https://github.com/tunlijs/tunli-client/issues"
47
71
  },
48
72
  "license": "GPL-3.0",
49
- "readme": "README.md",
50
73
  "engines": {
51
- "node": ">=18"
74
+ "node": ">=22"
52
75
  }
53
76
  }
package/client.js DELETED
@@ -1,33 +0,0 @@
1
- import {dirnameFromMeta, readJsonFile, searchFileInDirectoryTree} from "#src/core/FS/utils";
2
- import {program} from 'commander';
3
- import {createCommandHTTP} from "#commands/CommandHTTP";
4
- import {createCommandAuth} from "#commands/CommandAuth";
5
- import {createCommandConfig} from "#commands/CommandConfig";
6
- import {createCommandRegister} from "#commands/CommandRegister";
7
- import {createCommandRefresh} from "#commands/CommandRefresh";
8
- import {argumentAliasResolver} from "#commands/helper/AliasResolver";
9
- import {createCommandInvite} from "#commands/CommandInvite";
10
- import {addExamples, addUsage} from "#commands/utils";
11
- import {profileListOption} from "#commands/Option/ProfileListOption";
12
-
13
- program
14
- .name('tunli')
15
- .description('HTTP tunnel client')
16
- .option('-v, --version', 'version', () => {
17
- const packageJson = readJsonFile(searchFileInDirectoryTree('package.json', dirnameFromMeta(import.meta)))
18
- console.log(`tunli: ${packageJson.version}`)
19
- process.exit()
20
- })
21
- .addOption(profileListOption())
22
-
23
- program.addCommand(createCommandConfig(program))
24
- program.addCommand(createCommandHTTP(program), {isDefault: true})
25
- program.addCommand(createCommandRegister(program))
26
- program.addCommand(createCommandRefresh(program))
27
- program.addCommand(createCommandInvite(program))
28
- program.addCommand(createCommandAuth(program))
29
-
30
- addExamples(program)
31
- addUsage(program)
32
-
33
- await program.parseAsync(argumentAliasResolver());
@@ -1,211 +0,0 @@
1
- import {concat, createScreen} from "#src/cli-app/helper/utils";
2
- import {dirnameFromMeta, readJsonFile, searchFileInDirectoryTree} from "#src/core/FS/utils";
3
- import {ref} from "#src/core/Ref";
4
- import {trimEnd} from "#src/utils/stringFunctions";
5
- import chalk from "chalk";
6
- import {getLatestVersion} from "#lib/Flow/getLatestVersion";
7
- import {exec} from 'child_process'
8
- import {checkGlobalInstallation, checkLocalInstallation} from "#src/utils/npmFunctions";
9
-
10
- export class Dashboard {
11
-
12
- /**
13
- * @type {TunnelClient}
14
- */
15
- #client
16
- /**
17
- * @type {tunnelClientOptions}
18
- */
19
- #options
20
- /**
21
- * @type {AppConfig}
22
- */
23
- #config
24
- /**
25
- * @type {Screen}
26
- */
27
- #screen
28
- /**
29
- * @type {Ref}
30
- */
31
- #forwardingUrl
32
-
33
- /**
34
- * @param {TunnelClient} client
35
- * @param {tunnelClientOptions} options
36
- * @param {AppConfig} config
37
- */
38
- constructor(client, options, config) {
39
- this.#client = client
40
- this.#options = options
41
- this.#config = config
42
- }
43
-
44
- /**
45
- * @param {string} value
46
- */
47
- set forwardingUrl(value) {
48
- this.#forwardingUrl.value = value
49
- }
50
-
51
- /**
52
- * @return {Screen}
53
- */
54
- get screen() {
55
- return this.#screen
56
- }
57
-
58
- destroy() {
59
- this.#screen.destroy()
60
- }
61
-
62
- init() {
63
-
64
- const options = this.#options
65
- const config = this.#config
66
- const client = this.#client
67
-
68
- const screen = createScreen()
69
- this.#screen = screen
70
- const packageJson = readJsonFile(searchFileInDirectoryTree('package.json', dirnameFromMeta(import.meta)))
71
- const connectionStatus = ref(chalk.yellow('offline'))
72
- const requestCount = ref(0)
73
- const connectionDetails = ref('')
74
- const forwardingUrl = ref(trimEnd(options.server, '/'))
75
-
76
- this.#forwardingUrl = forwardingUrl
77
-
78
- const allowedCidr = options.allowCidr.join(', ')
79
- const deniedCidr = options.denyCidr.join(', ')
80
-
81
- const blockedCount = ref(0)
82
- const lastBlockedIp = ref('')
83
- const availableUpdate = ref('')
84
-
85
- getLatestVersion().then((version) => {
86
- if (version && version !== packageJson.version) {
87
- availableUpdate.value = chalk.yellow(`update available (version ${version}, Ctrl-U to update)`)
88
-
89
- screen.onceKey('C-u', async (char, details) => {
90
- availableUpdate.value = chalk.yellow('Updating...')
91
- let modifier
92
- if (await checkGlobalInstallation(packageJson.name)) {
93
- modifier = ' -g'
94
- } else if (!await checkLocalInstallation(packageJson.name)) {
95
- availableUpdate.value = chalk.red('Update failed.')
96
- return
97
- }
98
-
99
- const npmUpdateCommand = `npm${modifier} update ${packageJson.name} --registry https://registry.npmjs.org`
100
-
101
- exec(npmUpdateCommand, (error, stdout, stderr) => {
102
- if (error || stderr) {
103
- availableUpdate.value = chalk.red('Update failed. Reason 2.')
104
- return;
105
- }
106
- availableUpdate.value = chalk.green('Update done. Please restart tunli. (Ctrl+R to restart)')
107
- })
108
- })
109
- }
110
- })
111
-
112
- screen.row(packageJson.name)
113
- screen.row('(Ctrl+C to quit)', {
114
- top: -1, right: 0
115
- })
116
-
117
- screen.row("")
118
-
119
- const infoList = screen.list({minWidth: 30})
120
-
121
- screen.row('HTTP Requests')
122
- screen.line()
123
-
124
- const accessLog = screen.list({
125
- length: 30, reverse: true, minWidth: [undefined, 30], maxWidth: [undefined, screen.width - 35]
126
- })
127
-
128
- client.on('tunnel-connection-established', () => {
129
- connectionStatus.value = chalk.bold(chalk.green('online'))
130
- connectionDetails.value = ''
131
- screen.render()
132
- })
133
-
134
- client.on('blocked', ip => {
135
- blockedCount.value++
136
- lastBlockedIp.value = ` (${ip})`
137
- })
138
- client.on('tunnel-connection-closed', () => {
139
- connectionStatus.value = chalk.bold(chalk.red('offline'))
140
- screen.render()
141
- })
142
-
143
- client.on('tunnel-connection-error', (error) => {
144
- if (error.stopPropagation) {
145
- return
146
- }
147
- connectionDetails.value = chalk.bold(chalk.red(` - ${error.message}`))
148
- screen.render()
149
- })
150
-
151
- client.on('response', (res, req) => {
152
-
153
- const code = res.statusCode
154
- let rspMsg = `${res.statusCode} ${res.statusMessage}`
155
- if (code >= 500) {
156
- rspMsg = chalk.red(rspMsg)
157
- } else if (code >= 400) {
158
- rspMsg = chalk.blueBright(rspMsg)
159
- } else {
160
- rspMsg = chalk.green(rspMsg)
161
- }
162
-
163
- rspMsg = chalk.bold(rspMsg)
164
-
165
- requestCount.value++
166
- accessLog.row(req.method, req.path, rspMsg)
167
- screen.render()
168
- })
169
-
170
- screen.key('C-c', (char, details) => {
171
- process.exit(0);
172
- })
173
-
174
- screen.key('C-r', (char, details) => {
175
- process.send('restart')
176
- })
177
-
178
- const target = new URL(`${options.protocol}://${options.host}:${options.port}`)
179
-
180
- infoList.row('Tunnel', concat(connectionStatus, connectionDetails))
181
- infoList.row('Version', packageJson.version)
182
- infoList.row(chalk.yellow('Update'), availableUpdate).if(() => availableUpdate)
183
- infoList.row('Profile', config.profile)
184
- infoList.row('Config', config.configPath)
185
-
186
- if (allowedCidr || deniedCidr) infoList.row('')
187
- if (allowedCidr) infoList.row('Allowed', allowedCidr)
188
- if (deniedCidr) infoList.row('Denied', deniedCidr)
189
- if (allowedCidr || deniedCidr) infoList.row('Blocked', concat(blockedCount, lastBlockedIp))
190
-
191
- infoList.row('')
192
- infoList.row('Latency', concat(client.latency, 'ms'))
193
- infoList.row('Forwarding', concat(forwardingUrl, ` -> ${trimEnd(target.toString(), '/')}`))
194
- infoList.row('Connections', requestCount)
195
-
196
- screen.render();
197
-
198
- return this
199
- }
200
- }
201
-
202
- /**
203
- * @param {TunnelClient} client
204
- * @param {tunnelClientOptions} options
205
- * @param {AppConfig} config
206
- */
207
- export const initDashboard = (client, options, config) => {
208
- const dashboard = new Dashboard(client, options, config)
209
- dashboard.init()
210
- return dashboard
211
- }
@@ -1,135 +0,0 @@
1
- import {List} from "#src/cli-app/elements/List/List";
2
- import EventEmitter from "node:events";
3
- import {Row} from "#src/cli-app/elements/Row";
4
- import {ElementNode} from "#src/cli-app/elements/ElementNode";
5
- import {arrayRemoveEntry} from "#src/utils/arrayFunctions";
6
- import {Line} from "#src/cli-app/elements/Line";
7
-
8
- export class Screen extends EventEmitter {
9
-
10
- #screen
11
-
12
- /**
13
- * @type {ElementNode[]}
14
- */
15
- #elements = []
16
-
17
- constructor(screen) {
18
- super()
19
- this.#screen = screen
20
-
21
- for (const proxyFn of ['append']) {
22
- this[proxyFn] = (...arg) => {
23
- screen[proxyFn](...arg)
24
- }
25
- }
26
-
27
- const ele = new ElementNode(this)
28
- ele._cached.height = ele.height
29
- ele._cached.top = ele.positionTop
30
- this.#elements.push(ele)
31
-
32
- this.on('delete-element', (ele) => {
33
- this.#elements = arrayRemoveEntry(this.#elements, ele)
34
- })
35
-
36
- screen.on('keypress', (char, details) => this.emit('keypress', char, /** keypressEventDetails */ details))
37
- }
38
-
39
- get screen() {
40
- return this.#screen
41
- }
42
-
43
- get children() {
44
- return this.#elements
45
- }
46
-
47
- get width() {
48
- return this.#screen.width
49
- }
50
-
51
- get height() {
52
- return this.#screen.height
53
- }
54
-
55
- /**
56
- * @param {string|array} key
57
- * @param {keypressEventListener} callback
58
- */
59
- key(key, callback) {
60
- this.#screen.key(key, callback)
61
- }
62
-
63
- /**
64
- * @param {string|array} key
65
- * @param {keypressEventListener} callback
66
- */
67
- onceKey(key, callback) {
68
- this.#screen.onceKey(key, callback)
69
- }
70
-
71
- render() {
72
- this.#screen.render()
73
- }
74
-
75
- destroy() {
76
- this.#screen.destroy()
77
- }
78
-
79
- /**
80
- *
81
- * @param {ElementNode} ele
82
- */
83
- updateElement(ele) {
84
-
85
- const heightChanged = ele._cached.height === ele.height
86
- const topChanged = ele._cached.top === ele.positionTop
87
-
88
- ele._cached.height = ele.height
89
- ele._cached.top = ele.positionTop
90
-
91
- if (heightChanged || topChanged) {
92
- ele.nextElementSibling?.emit('prev-resize', ele)
93
- }
94
- }
95
-
96
- /**
97
- * @param {...cliListOption} [options]
98
- * @returns {List}
99
- */
100
- list(options) {
101
- const ele = new List(this)
102
- ele.init(options)
103
-
104
- ele._cached.height = ele.height
105
- ele._cached.top = ele.positionTop
106
-
107
- this.#elements.push(ele)
108
- return ele
109
- }
110
-
111
- /**
112
- * @param content
113
- * @param [top]
114
- * @param [right]
115
- * @returns {Row}
116
- */
117
- row(content, {top, right} = {}) {
118
- const ele = new Row(this)
119
- ele.init(content, {top, right})
120
- ele._cached.height = ele.height
121
- ele._cached.top = ele.positionTop
122
-
123
- this.#elements.push(ele)
124
- return ele
125
- }
126
-
127
- line() {
128
- const ele = new Line(this)
129
- ele.init()
130
- ele._cached.height = ele.height
131
- ele._cached.top = ele.positionTop
132
- this.#elements.push(ele)
133
- return ele
134
- }
135
- }
@@ -1,97 +0,0 @@
1
- import EventEmitter from "node:events";
2
-
3
- export class ElementNode extends EventEmitter {
4
-
5
- _cached = {
6
- top: null,
7
- height: null
8
- }
9
-
10
- /**
11
- * @type {ElementNode}
12
- */
13
- #nextElementSibling
14
- /**
15
- * @type {ElementNode}
16
- */
17
- #prevElementSibling
18
- /**
19
- * @type {Screen}
20
- */
21
- #screen
22
- #height = 0
23
-
24
-
25
- #detached = false
26
- #offsetTop = 0;
27
-
28
- /**
29
- * @param {Screen} screen
30
- */
31
- constructor(screen) {
32
- super()
33
- this.#screen = screen
34
-
35
- if (screen.children.length) {
36
- const before = screen.children[screen.children.length - 1]
37
- before.#nextElementSibling = this
38
- this.#prevElementSibling = before
39
- }
40
-
41
- /**
42
- * prev element postop and height
43
- */
44
- this.on('prev-resize', ({positionTop, height}) => {
45
- this.emit('position-top', positionTop + height)
46
- this.nextElementSibling?.emit('prev-resize', this)
47
- })
48
- }
49
-
50
- get detached() {
51
- return this.#detached
52
- }
53
-
54
- get nextElementSibling() {
55
- return this.#nextElementSibling
56
- }
57
-
58
- get positionTop() {
59
- if (this.#prevElementSibling) {
60
- return this.#prevElementSibling.positionTop + this.#prevElementSibling.height + this.#offsetTop
61
- }
62
- return this.#offsetTop
63
- }
64
-
65
- set offsetTop(offsetTop) {
66
- this.#offsetTop = offsetTop ?? 0
67
- }
68
-
69
- get screen() {
70
- return this.#screen
71
- }
72
-
73
- get height() {
74
- return this.#height
75
- }
76
-
77
- set height(height) {
78
- const update = this.#height !== height
79
- this.#height = height
80
- if (update) {
81
- this.emit('height', height)
82
- }
83
- }
84
-
85
- delete() {
86
-
87
- this.#screen.emit('delete-element', this)
88
- this.emit('delete', this)
89
- this.#detached = true
90
- const next = this.#nextElementSibling
91
-
92
- if (next) {
93
- next.#prevElementSibling = this.#prevElementSibling
94
- this.#nextElementSibling?.emit('prev-resize', this.#prevElementSibling)
95
- }
96
- }
97
- }
@@ -1,21 +0,0 @@
1
- import {ElementNode} from "#src/cli-app/elements/ElementNode";
2
- import blessed from "blessed";
3
-
4
- export class Line extends ElementNode {
5
-
6
- /**
7
- * @param {("horizontal", "vertical")} orientation
8
- */
9
- init(orientation = 'horizontal') {
10
-
11
- const line = blessed.line({
12
- orientation
13
- })
14
-
15
- this.height = 1
16
- this.on('position-top', (val) => line.top = val)
17
- this.on('height', (val) => line.height = val)
18
- this.on('delete', (val) => line.detach())
19
- this.screen.append(line)
20
- }
21
- }