hotstaq 0.5.3

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 (318) hide show
  1. package/.dockerignore +123 -0
  2. package/.eslintignore +17 -0
  3. package/.eslintrc.js +11 -0
  4. package/.vscode/launch.json +201 -0
  5. package/.vscode/settings.json +2 -0
  6. package/.vscode/tasks.json +88 -0
  7. package/CONTRIBUTING.md +157 -0
  8. package/LICENSE +21 -0
  9. package/README.md +128 -0
  10. package/bin/hotstaq +3 -0
  11. package/bin/hotstaq.cmd +1 -0
  12. package/build/src/Hot.d.ts +167 -0
  13. package/build/src/Hot.d.ts.map +1 -0
  14. package/build/src/Hot.js +365 -0
  15. package/build/src/Hot.js.map +1 -0
  16. package/build/src/HotAPI.d.ts +137 -0
  17. package/build/src/HotAPI.d.ts.map +1 -0
  18. package/build/src/HotAPI.js +353 -0
  19. package/build/src/HotAPI.js.map +1 -0
  20. package/build/src/HotAgentAPI.d.ts +22 -0
  21. package/build/src/HotAgentAPI.d.ts.map +1 -0
  22. package/build/src/HotAgentAPI.js +85 -0
  23. package/build/src/HotAgentAPI.js.map +1 -0
  24. package/build/src/HotAgentRoute.d.ts +17 -0
  25. package/build/src/HotAgentRoute.d.ts.map +1 -0
  26. package/build/src/HotAgentRoute.js +109 -0
  27. package/build/src/HotAgentRoute.js.map +1 -0
  28. package/build/src/HotBuilder.d.ts +52 -0
  29. package/build/src/HotBuilder.d.ts.map +1 -0
  30. package/build/src/HotBuilder.js +242 -0
  31. package/build/src/HotBuilder.js.map +1 -0
  32. package/build/src/HotClient.d.ts +31 -0
  33. package/build/src/HotClient.d.ts.map +1 -0
  34. package/build/src/HotClient.js +19 -0
  35. package/build/src/HotClient.js.map +1 -0
  36. package/build/src/HotComponent.d.ts +118 -0
  37. package/build/src/HotComponent.d.ts.map +1 -0
  38. package/build/src/HotComponent.js +89 -0
  39. package/build/src/HotComponent.js.map +1 -0
  40. package/build/src/HotCreator.d.ts +88 -0
  41. package/build/src/HotCreator.d.ts.map +1 -0
  42. package/build/src/HotCreator.js +445 -0
  43. package/build/src/HotCreator.js.map +1 -0
  44. package/build/src/HotDB.d.ts +69 -0
  45. package/build/src/HotDB.d.ts.map +1 -0
  46. package/build/src/HotDB.js +29 -0
  47. package/build/src/HotDB.js.map +1 -0
  48. package/build/src/HotDBConnectionInterface.d.ts +40 -0
  49. package/build/src/HotDBConnectionInterface.d.ts.map +1 -0
  50. package/build/src/HotDBConnectionInterface.js +3 -0
  51. package/build/src/HotDBConnectionInterface.js.map +1 -0
  52. package/build/src/HotFile.d.ts +134 -0
  53. package/build/src/HotFile.d.ts.map +1 -0
  54. package/build/src/HotFile.js +454 -0
  55. package/build/src/HotFile.js.map +1 -0
  56. package/build/src/HotGenerator.d.ts +80 -0
  57. package/build/src/HotGenerator.d.ts.map +1 -0
  58. package/build/src/HotGenerator.js +342 -0
  59. package/build/src/HotGenerator.js.map +1 -0
  60. package/build/src/HotHTTPServer.d.ts +162 -0
  61. package/build/src/HotHTTPServer.d.ts.map +1 -0
  62. package/build/src/HotHTTPServer.js +863 -0
  63. package/build/src/HotHTTPServer.js.map +1 -0
  64. package/build/src/HotIO.d.ts +47 -0
  65. package/build/src/HotIO.d.ts.map +1 -0
  66. package/build/src/HotIO.js +232 -0
  67. package/build/src/HotIO.js.map +1 -0
  68. package/build/src/HotLog.d.ts +60 -0
  69. package/build/src/HotLog.d.ts.map +1 -0
  70. package/build/src/HotLog.js +126 -0
  71. package/build/src/HotLog.js.map +1 -0
  72. package/build/src/HotPage.d.ts +125 -0
  73. package/build/src/HotPage.d.ts.map +1 -0
  74. package/build/src/HotPage.js +178 -0
  75. package/build/src/HotPage.js.map +1 -0
  76. package/build/src/HotRoute.d.ts +82 -0
  77. package/build/src/HotRoute.d.ts.map +1 -0
  78. package/build/src/HotRoute.js +83 -0
  79. package/build/src/HotRoute.js.map +1 -0
  80. package/build/src/HotRouteMethod.d.ts +129 -0
  81. package/build/src/HotRouteMethod.d.ts.map +1 -0
  82. package/build/src/HotRouteMethod.js +84 -0
  83. package/build/src/HotRouteMethod.js.map +1 -0
  84. package/build/src/HotServer.d.ts +152 -0
  85. package/build/src/HotServer.d.ts.map +1 -0
  86. package/build/src/HotServer.js +109 -0
  87. package/build/src/HotServer.js.map +1 -0
  88. package/build/src/HotSetAsWeb.d.ts +2 -0
  89. package/build/src/HotSetAsWeb.d.ts.map +1 -0
  90. package/build/src/HotSetAsWeb.js +5 -0
  91. package/build/src/HotSetAsWeb.js.map +1 -0
  92. package/build/src/HotStaq.d.ts +603 -0
  93. package/build/src/HotStaq.d.ts.map +1 -0
  94. package/build/src/HotStaq.js +1260 -0
  95. package/build/src/HotStaq.js.map +1 -0
  96. package/build/src/HotStaqWeb.d.ts +18 -0
  97. package/build/src/HotStaqWeb.d.ts.map +1 -0
  98. package/build/src/HotStaqWeb.js +44 -0
  99. package/build/src/HotStaqWeb.js.map +1 -0
  100. package/build/src/HotTestDriver.d.ts +63 -0
  101. package/build/src/HotTestDriver.d.ts.map +1 -0
  102. package/build/src/HotTestDriver.js +187 -0
  103. package/build/src/HotTestDriver.js.map +1 -0
  104. package/build/src/HotTestElement.d.ts +71 -0
  105. package/build/src/HotTestElement.d.ts.map +1 -0
  106. package/build/src/HotTestElement.js +37 -0
  107. package/build/src/HotTestElement.js.map +1 -0
  108. package/build/src/HotTestMap.d.ts +83 -0
  109. package/build/src/HotTestMap.d.ts.map +1 -0
  110. package/build/src/HotTestMap.js +58 -0
  111. package/build/src/HotTestMap.js.map +1 -0
  112. package/build/src/HotTestSeleniumDriver.d.ts +86 -0
  113. package/build/src/HotTestSeleniumDriver.d.ts.map +1 -0
  114. package/build/src/HotTestSeleniumDriver.js +400 -0
  115. package/build/src/HotTestSeleniumDriver.js.map +1 -0
  116. package/build/src/HotTester.d.ts +188 -0
  117. package/build/src/HotTester.d.ts.map +1 -0
  118. package/build/src/HotTester.js +622 -0
  119. package/build/src/HotTester.js.map +1 -0
  120. package/build/src/HotTesterAPI.d.ts +15 -0
  121. package/build/src/HotTesterAPI.d.ts.map +1 -0
  122. package/build/src/HotTesterAPI.js +161 -0
  123. package/build/src/HotTesterAPI.js.map +1 -0
  124. package/build/src/HotTesterMocha.d.ts +50 -0
  125. package/build/src/HotTesterMocha.d.ts.map +1 -0
  126. package/build/src/HotTesterMocha.js +205 -0
  127. package/build/src/HotTesterMocha.js.map +1 -0
  128. package/build/src/HotTesterMochaSelenium.d.ts +70 -0
  129. package/build/src/HotTesterMochaSelenium.d.ts.map +1 -0
  130. package/build/src/HotTesterMochaSelenium.js +257 -0
  131. package/build/src/HotTesterMochaSelenium.js.map +1 -0
  132. package/build/src/HotTesterServer.d.ts +114 -0
  133. package/build/src/HotTesterServer.d.ts.map +1 -0
  134. package/build/src/HotTesterServer.js +575 -0
  135. package/build/src/HotTesterServer.js.map +1 -0
  136. package/build/src/api copy.d.ts +2 -0
  137. package/build/src/api copy.d.ts.map +1 -0
  138. package/build/src/api copy.js +153 -0
  139. package/build/src/api copy.js.map +1 -0
  140. package/build/src/api-web.d.ts +2 -0
  141. package/build/src/api-web.d.ts.map +1 -0
  142. package/build/src/api-web.js +45 -0
  143. package/build/src/api-web.js.map +1 -0
  144. package/build/src/api.d.ts +33 -0
  145. package/build/src/api.d.ts.map +1 -0
  146. package/build/src/api.js +78 -0
  147. package/build/src/api.js.map +1 -0
  148. package/build/src/cli.d.ts +2 -0
  149. package/build/src/cli.d.ts.map +1 -0
  150. package/build/src/cli.js +1040 -0
  151. package/build/src/cli.js.map +1 -0
  152. package/build/src/schemas/HotDBInflux.d.ts +63 -0
  153. package/build/src/schemas/HotDBInflux.d.ts.map +1 -0
  154. package/build/src/schemas/HotDBInflux.js +239 -0
  155. package/build/src/schemas/HotDBInflux.js.map +1 -0
  156. package/build/src/schemas/HotDBMigration.d.ts +19 -0
  157. package/build/src/schemas/HotDBMigration.d.ts.map +1 -0
  158. package/build/src/schemas/HotDBMigration.js +15 -0
  159. package/build/src/schemas/HotDBMigration.js.map +1 -0
  160. package/build/src/schemas/HotDBMySQL.d.ts +65 -0
  161. package/build/src/schemas/HotDBMySQL.d.ts.map +1 -0
  162. package/build/src/schemas/HotDBMySQL.js +387 -0
  163. package/build/src/schemas/HotDBMySQL.js.map +1 -0
  164. package/build/src/schemas/HotDBSchema.d.ts +15 -0
  165. package/build/src/schemas/HotDBSchema.d.ts.map +1 -0
  166. package/build/src/schemas/HotDBSchema.js +19 -0
  167. package/build/src/schemas/HotDBSchema.js.map +1 -0
  168. package/build/src/schemas/influx/InfluxSchema.d.ts +14 -0
  169. package/build/src/schemas/influx/InfluxSchema.d.ts.map +1 -0
  170. package/build/src/schemas/influx/InfluxSchema.js +33 -0
  171. package/build/src/schemas/influx/InfluxSchema.js.map +1 -0
  172. package/build/src/schemas/mysql/MySQLSchema.d.ts +39 -0
  173. package/build/src/schemas/mysql/MySQLSchema.d.ts.map +1 -0
  174. package/build/src/schemas/mysql/MySQLSchema.js +151 -0
  175. package/build/src/schemas/mysql/MySQLSchema.js.map +1 -0
  176. package/build/src/schemas/mysql/MySQLSchemaField.d.ts +168 -0
  177. package/build/src/schemas/mysql/MySQLSchemaField.d.ts.map +1 -0
  178. package/build/src/schemas/mysql/MySQLSchemaField.js +260 -0
  179. package/build/src/schemas/mysql/MySQLSchemaField.js.map +1 -0
  180. package/build/src/schemas/mysql/MySQLSchemaTable.d.ts +49 -0
  181. package/build/src/schemas/mysql/MySQLSchemaTable.d.ts.map +1 -0
  182. package/build/src/schemas/mysql/MySQLSchemaTable.js +310 -0
  183. package/build/src/schemas/mysql/MySQLSchemaTable.js.map +1 -0
  184. package/build-web/HotStaq.js +2 -0
  185. package/build-web/HotStaq.min.js +119 -0
  186. package/build-web/HotStaqTests_HelloWorldAPI.js +133 -0
  187. package/builder/docker/Dockerfile.linux.gen +42 -0
  188. package/builder/docker/README.md +36 -0
  189. package/builder/docker/app/start.sh +8 -0
  190. package/builder/docker/dockerignore +3 -0
  191. package/builder/docker/scripts/build.bat +11 -0
  192. package/builder/docker/scripts/build.sh +11 -0
  193. package/builder/docker/scripts/start-app.bat +7 -0
  194. package/builder/docker/scripts/start-app.sh +7 -0
  195. package/builder/docker/scripts/stop-app.bat +5 -0
  196. package/builder/docker/scripts/stop-app.sh +5 -0
  197. package/builder/docker-compose/docker-compose.gen.yaml +41 -0
  198. package/builder/docker-compose/env-skeleton +4 -0
  199. package/creator/project/.vscode/launch.json +59 -0
  200. package/creator/project/README.md +20 -0
  201. package/creator/project/gitignore +118 -0
  202. package/creator/project/npmignore +118 -0
  203. package/creator/public/api-test.hott +28 -0
  204. package/creator/public/index.hott +12 -0
  205. package/creator/ts/src/AppAPI.ts +30 -0
  206. package/creator/ts/src/HelloWorld.ts +39 -0
  207. package/creator/ts/src/WebExport.ts +7 -0
  208. package/creator/ts/tsconfig-web.json +73 -0
  209. package/creator/ts/tsconfig.json +73 -0
  210. package/creator/ts/webpack-api.config.js +57 -0
  211. package/dbstart.sh +19 -0
  212. package/dbstop.sh +4 -0
  213. package/docs/.nojekyll +1 -0
  214. package/docs/README.md +130 -0
  215. package/docs/classes/Hot.md +477 -0
  216. package/docs/classes/HotAPI.md +369 -0
  217. package/docs/classes/HotClient.md +95 -0
  218. package/docs/classes/HotComponent.md +279 -0
  219. package/docs/classes/HotDB.md +247 -0
  220. package/docs/classes/HotDBInflux.md +404 -0
  221. package/docs/classes/HotDBMigration.md +80 -0
  222. package/docs/classes/HotDBMySQL.md +310 -0
  223. package/docs/classes/HotDBSchema.md +51 -0
  224. package/docs/classes/HotFile.md +353 -0
  225. package/docs/classes/HotHTTPServer.md +700 -0
  226. package/docs/classes/HotLog.md +162 -0
  227. package/docs/classes/HotPage.md +357 -0
  228. package/docs/classes/HotRoute.md +312 -0
  229. package/docs/classes/HotRouteMethod.md +271 -0
  230. package/docs/classes/HotServer.md +311 -0
  231. package/docs/classes/HotStaq.md +1155 -0
  232. package/docs/classes/HotTestDestination.md +58 -0
  233. package/docs/classes/HotTestDriver.md +332 -0
  234. package/docs/classes/HotTestElement.md +88 -0
  235. package/docs/classes/HotTestElementOptions.md +71 -0
  236. package/docs/classes/HotTestMap.md +92 -0
  237. package/docs/classes/HotTestSeleniumDriver.md +542 -0
  238. package/docs/classes/HotTester.md +653 -0
  239. package/docs/classes/HotTesterAPI.md +493 -0
  240. package/docs/classes/HotTesterMocha.md +843 -0
  241. package/docs/classes/HotTesterMochaSelenium.md +896 -0
  242. package/docs/classes/HotTesterServer.md +633 -0
  243. package/docs/classes/InfluxSchema.md +74 -0
  244. package/docs/classes/MySQLSchema.md +199 -0
  245. package/docs/classes/MySQLSchemaField.md +330 -0
  246. package/docs/classes/MySQLSchemaTable.md +176 -0
  247. package/docs/enums/ConnectionStatus.md +43 -0
  248. package/docs/enums/DeveloperMode.md +38 -0
  249. package/docs/enums/EventExecutionType.md +43 -0
  250. package/docs/enums/HTTPMethod.md +32 -0
  251. package/docs/enums/HotDBGenerationType.md +30 -0
  252. package/docs/enums/HotLogLevel.md +88 -0
  253. package/docs/interfaces/HotDBConnectionInterface.md +116 -0
  254. package/docs/interfaces/HotDestination.md +62 -0
  255. package/docs/interfaces/HotSite.md +187 -0
  256. package/docs/interfaces/HotSiteMapPath.md +37 -0
  257. package/docs/interfaces/HotSiteRoute.md +79 -0
  258. package/docs/interfaces/HotStartOptions.md +115 -0
  259. package/docs/interfaces/HotTestPage.md +44 -0
  260. package/docs/interfaces/HotTestStop.md +62 -0
  261. package/docs/interfaces/IHotComponent.md +135 -0
  262. package/docs/interfaces/IHotStaq.md +118 -0
  263. package/docs/interfaces/IHotTestElement.md +54 -0
  264. package/docs/interfaces/IHotTestElementOptions.md +43 -0
  265. package/docs/interfaces/MySQLResults.md +43 -0
  266. package/docs/interfaces/MySQLSchemaFieldResult.md +75 -0
  267. package/docs/modules.md +182 -0
  268. package/package.json +65 -0
  269. package/selenium-start.sh +7 -0
  270. package/selenium-stop.sh +3 -0
  271. package/src/Hot.ts +319 -0
  272. package/src/HotAPI.ts +386 -0
  273. package/src/HotAgentAPI.ts +43 -0
  274. package/src/HotAgentRoute.ts +44 -0
  275. package/src/HotBuilder.ts +221 -0
  276. package/src/HotClient.ts +40 -0
  277. package/src/HotComponent.ts +158 -0
  278. package/src/HotCreator.ts +470 -0
  279. package/src/HotDB.ts +79 -0
  280. package/src/HotDBConnectionInterface.ts +40 -0
  281. package/src/HotFile.ts +617 -0
  282. package/src/HotGenerator.ts +446 -0
  283. package/src/HotHTTPServer.ts +954 -0
  284. package/src/HotIO.ts +160 -0
  285. package/src/HotLog.ts +158 -0
  286. package/src/HotPage.ts +206 -0
  287. package/src/HotRoute.ts +137 -0
  288. package/src/HotRouteMethod.ts +216 -0
  289. package/src/HotServer.ts +211 -0
  290. package/src/HotSetAsWeb.ts +3 -0
  291. package/src/HotStaq.ts +1881 -0
  292. package/src/HotTestDriver.ts +171 -0
  293. package/src/HotTestElement.ts +97 -0
  294. package/src/HotTestMap.ts +130 -0
  295. package/src/HotTestSeleniumDriver.ts +381 -0
  296. package/src/HotTester.ts +696 -0
  297. package/src/HotTesterAPI.ts +126 -0
  298. package/src/HotTesterMocha.ts +133 -0
  299. package/src/HotTesterMochaSelenium.ts +189 -0
  300. package/src/HotTesterServer.ts +551 -0
  301. package/src/api-web.ts +48 -0
  302. package/src/api.ts +103 -0
  303. package/src/cli.ts +1225 -0
  304. package/src/schemas/HotDBInflux.ts +211 -0
  305. package/src/schemas/HotDBMigration.ts +24 -0
  306. package/src/schemas/HotDBMySQL.ts +312 -0
  307. package/src/schemas/HotDBSchema.ts +21 -0
  308. package/src/schemas/influx/InfluxSchema.ts +19 -0
  309. package/src/schemas/mysql/MySQLSchema.ts +90 -0
  310. package/src/schemas/mysql/MySQLSchemaField.ts +408 -0
  311. package/src/schemas/mysql/MySQLSchemaTable.ts +353 -0
  312. package/temp/HotStaqWeb.ts +59 -0
  313. package/tsconfig-generator.json +17 -0
  314. package/tsconfig-web.json +74 -0
  315. package/tsconfig.json +73 -0
  316. package/webpack.config.generator.js +41 -0
  317. package/webpack.config.js +53 -0
  318. package/webpack.config.tests.js +56 -0
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ var __generator = (this && this.__generator) || function (thisArg, body) {
46
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
+ function verb(n) { return function (v) { return step([n, v]); }; }
49
+ function step(op) {
50
+ if (f) throw new TypeError("Generator is already executing.");
51
+ while (_) try {
52
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
53
+ if (y = 0, t) op = [op[0] & 2, t.value];
54
+ switch (op[0]) {
55
+ case 0: case 1: t = op; break;
56
+ case 4: _.label++; return { value: op[1], done: false };
57
+ case 5: _.label++; y = op[1]; op = [0]; continue;
58
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
+ default:
60
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
+ if (t[2]) _.ops.pop();
65
+ _.trys.pop(); continue;
66
+ }
67
+ op = body.call(thisArg, _);
68
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
+ }
71
+ };
72
+ Object.defineProperty(exports, "__esModule", { value: true });
73
+ exports.HotAgentRoute = void 0;
74
+ var api_1 = require("./api");
75
+ var fs = __importStar(require("fs"));
76
+ var vm = __importStar(require("vm"));
77
+ /**
78
+ * Hello world route.
79
+ */
80
+ var HotAgentRoute = /** @class */ (function (_super) {
81
+ __extends(HotAgentRoute, _super);
82
+ function HotAgentRoute(api) {
83
+ var _this = _super.call(this, api.connection, "agent") || this;
84
+ _this.thisApi = api;
85
+ _this.addMethod(new api_1.HotRouteMethod(_this, "execute", _this.execute, api_1.HTTPMethod.POST, api.userAuth));
86
+ return _this;
87
+ }
88
+ /**
89
+ * Execute a file.
90
+ */
91
+ HotAgentRoute.prototype.execute = function (req, res, authorizedValue, jsonObj, queryObj) {
92
+ return __awaiter(this, void 0, void 0, function () {
93
+ var cmd, data, foundCmd, cmdData;
94
+ return __generator(this, function (_a) {
95
+ cmd = api_1.HotStaq.getParam("cmd", jsonObj);
96
+ data = api_1.HotStaq.getParamDefault("data", jsonObj, undefined);
97
+ foundCmd = this.thisApi.commands[cmd];
98
+ if (foundCmd == null)
99
+ throw new Error("Command ".concat(cmd, " not found!"));
100
+ cmdData = fs.readFileSync(foundCmd).toString();
101
+ vm.runInNewContext(cmdData, data);
102
+ return [2 /*return*/, (true)];
103
+ });
104
+ });
105
+ };
106
+ return HotAgentRoute;
107
+ }(api_1.HotRoute));
108
+ exports.HotAgentRoute = HotAgentRoute;
109
+ //# sourceMappingURL=HotAgentRoute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HotAgentRoute.js","sourceRoot":"","sources":["../../src/HotAgentRoute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAsE;AAGtE,qCAAyB;AACzB,qCAAyB;AAEzB;;GAEG;AACH;IAAmC,iCAAQ;IAO1C,uBAAa,GAAgB;QAA7B,YAEC,kBAAO,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,SAM/B;QAJM,KAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QAEzB,KAAI,CAAC,SAAS,CAAE,IAAI,oBAAc,CAAE,KAAI,EAAE,SAAS,EAAE,KAAI,CAAC,OAAO,EAChE,gBAAU,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;;IAClC,CAAC;IAED;;OAEG;IACa,+BAAO,GAAvB,UAAyB,GAAQ,EAAE,GAAQ,EAAE,eAAoB,EAAE,OAAY,EAAE,QAAa;;;;gBAEvF,GAAG,GAAW,aAAO,CAAC,QAAQ,CAAE,KAAK,EAAE,OAAO,CAAC,CAAC;gBAChD,IAAI,GAAQ,aAAO,CAAC,eAAe,CAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;gBAC7D,QAAQ,GAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAElD,IAAI,QAAQ,IAAI,IAAI;oBAChB,MAAM,IAAI,KAAK,CAAE,kBAAW,GAAG,gBAAa,CAAC,CAAC;gBAE5C,OAAO,GAAW,EAAE,CAAC,YAAY,CAAE,QAAQ,CAAC,CAAC,QAAQ,EAAG,CAAC;gBAC/D,EAAE,CAAC,eAAe,CAAE,OAAO,EAAE,IAAI,CAAC,CAAC;gBAEnC,sBAAO,CAAC,IAAI,CAAC,EAAC;;;KACpB;IACF,oBAAC;AAAD,CAAC,AAlCD,CAAmC,cAAQ,GAkC1C;AAlCY,sCAAa"}
@@ -0,0 +1,52 @@
1
+ import { HotSite } from "./HotStaq";
2
+ import { HotLog } from "./HotLog";
3
+ /**
4
+ * Builds stuff for the CLI like docker images and Kubernetes clusters.
5
+ */
6
+ export declare class HotBuilder {
7
+ /**
8
+ * The HotSites to build from.
9
+ */
10
+ hotsites: HotSite[];
11
+ /**
12
+ * Will build the web api.
13
+ * @default true
14
+ */
15
+ api: boolean;
16
+ /**
17
+ * Will build the Dockerfiles.
18
+ */
19
+ dockerFiles: boolean;
20
+ /**
21
+ * Will harden the Dockerfiles security when possible.
22
+ */
23
+ dockerHardenSecurity: boolean;
24
+ /**
25
+ * Will append the docker documentation to the existing README.md.
26
+ */
27
+ appendReadMe: boolean;
28
+ /**
29
+ * Will build the Docker compose file.
30
+ */
31
+ dockerCompose: boolean;
32
+ /**
33
+ * Will build the Kubernetes cluster.
34
+ */
35
+ kubernetes: boolean;
36
+ /**
37
+ * The logger.
38
+ */
39
+ logger: HotLog;
40
+ /**
41
+ * The output directory.
42
+ */
43
+ outputDir: string;
44
+ constructor(logger: HotLog);
45
+ /**
46
+ * Build everything and output to outputDir.
47
+ *
48
+ * @fixme Needs tests!
49
+ */
50
+ build(): Promise<void>;
51
+ }
52
+ //# sourceMappingURL=HotBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HotBuilder.d.ts","sourceRoot":"","sources":["../../src/HotBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAW,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;GAEG;AACH,qBAAa,UAAU;IAEtB;;OAEG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB;;;OAGG;IACH,GAAG,EAAE,OAAO,CAAC;IACb;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;gBAEL,MAAM,EAAE,MAAM;IAa3B;;;;OAIG;IACG,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;CAyJ7B"}
@@ -0,0 +1,242 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
+ return new (P || (P = Promise))(function (resolve, reject) {
24
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ var __generator = (this && this.__generator) || function (thisArg, body) {
31
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
32
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
33
+ function verb(n) { return function (v) { return step([n, v]); }; }
34
+ function step(op) {
35
+ if (f) throw new TypeError("Generator is already executing.");
36
+ while (_) try {
37
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
38
+ if (y = 0, t) op = [op[0] & 2, t.value];
39
+ switch (op[0]) {
40
+ case 0: case 1: t = op; break;
41
+ case 4: _.label++; return { value: op[1], done: false };
42
+ case 5: _.label++; y = op[1]; op = [0]; continue;
43
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
44
+ default:
45
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
46
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
47
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
48
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
49
+ if (t[2]) _.ops.pop();
50
+ _.trys.pop(); continue;
51
+ }
52
+ op = body.call(thisArg, _);
53
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
54
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
55
+ }
56
+ };
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ exports.HotBuilder = void 0;
59
+ var ppath = __importStar(require("path"));
60
+ var HotIO_1 = require("./HotIO");
61
+ var HotStaq_1 = require("./HotStaq");
62
+ /**
63
+ * Builds stuff for the CLI like docker images and Kubernetes clusters.
64
+ */
65
+ var HotBuilder = /** @class */ (function () {
66
+ function HotBuilder(logger) {
67
+ this.api = true;
68
+ this.dockerFiles = true;
69
+ this.dockerHardenSecurity = true;
70
+ this.appendReadMe = true;
71
+ this.dockerCompose = false;
72
+ this.kubernetes = false;
73
+ this.hotsites = [];
74
+ this.logger = logger;
75
+ this.outputDir = ppath.normalize("".concat(process.cwd(), "/"));
76
+ }
77
+ /**
78
+ * Build everything and output to outputDir.
79
+ *
80
+ * @fixme Needs tests!
81
+ */
82
+ HotBuilder.prototype.build = function () {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var dockerDir, dockerFileContent, startFileContent, _loop_1, this_1, iIdx, dockerDir, dockerFileContent, startFileContent, iIdx, hotsite;
85
+ var _this = this;
86
+ return __generator(this, function (_a) {
87
+ switch (_a.label) {
88
+ case 0:
89
+ if (this.api === true) {
90
+ this.logger.info("Building web API...");
91
+ /// @todo Finish this...
92
+ this.logger.info("Finished building web API...");
93
+ }
94
+ if (!(this.dockerFiles === true)) return [3 /*break*/, 7];
95
+ this.logger.info("Building docker files...");
96
+ dockerDir = ppath.normalize("".concat(__dirname, "/../../builder/docker"));
97
+ return [4 /*yield*/, HotIO_1.HotIO.readTextFile(ppath.normalize("".concat(dockerDir, "/Dockerfile.linux.gen")))];
98
+ case 1:
99
+ dockerFileContent = _a.sent();
100
+ return [4 /*yield*/, HotIO_1.HotIO.readTextFile(ppath.normalize("".concat(dockerDir, "/app/start.sh")))];
101
+ case 2:
102
+ startFileContent = _a.sent();
103
+ _loop_1 = function (iIdx) {
104
+ var hotsite, hotsiteName, outputDir, newDockerfileContent, newStartFileContent, dockerfilePortsStr, dockercomposeAppPortsStr, dockercomposeAppAPIPortsStr, httpPort, httpsPort, hotsitePath, hardenSecurity, replaceKeywords, replaceKeywordsInFile, _b, _c, _d, prevREADME, dockerREADME;
105
+ return __generator(this, function (_e) {
106
+ switch (_e.label) {
107
+ case 0:
108
+ hotsite = this_1.hotsites[iIdx];
109
+ this_1.logger.info("Building Dockerfile \"".concat(hotsite.name, "\"..."));
110
+ if (hotsite.name == null)
111
+ throw new Error("HotSite ".concat(hotsite.hotsitePath, " is missing a name!"));
112
+ HotStaq_1.HotStaq.checkHotSiteName(hotsite.name, true);
113
+ hotsiteName = hotsite.name;
114
+ outputDir = ppath.normalize("".concat(this_1.outputDir, "/"));
115
+ newDockerfileContent = dockerFileContent;
116
+ newStartFileContent = startFileContent;
117
+ dockerfilePortsStr = "";
118
+ dockercomposeAppPortsStr = "";
119
+ dockercomposeAppAPIPortsStr = "";
120
+ httpPort = HotStaq_1.HotStaq.getValueFromHotSiteObj(hotsite, ["server", "ports", "http"]);
121
+ httpsPort = HotStaq_1.HotStaq.getValueFromHotSiteObj(hotsite, ["server", "ports", "https"]);
122
+ hotsitePath = "/app/".concat(hotsiteName, "/HotSite.json");
123
+ hardenSecurity = "\nRUN npm -g uninstall npm && apk --purge del apk-tools\n";
124
+ replaceKeywords = function (str) {
125
+ str = str.replace(/\$\{HOTSITE_NAME\}/g, hotsiteName);
126
+ str = str.replace(/\$\{DOCKERFILE_PORTS\}/g, dockerfilePortsStr);
127
+ str = str.replace(/\$\{DOCKER_COMPOSE_APP_PORTS\}/g, dockercomposeAppPortsStr);
128
+ str = str.replace(/\$\{DOCKER_COMPOSE_APP_API_PORTS\}/g, dockercomposeAppAPIPortsStr);
129
+ str = str.replace(/\$\{HARDEN\_SECURITY\}/g, hardenSecurity);
130
+ str = str.replace(/\$\{HOTSITE_PATH\}/g, hotsitePath);
131
+ return (str);
132
+ };
133
+ replaceKeywordsInFile = function (filepath) { return __awaiter(_this, void 0, void 0, function () {
134
+ var fileContent;
135
+ return __generator(this, function (_a) {
136
+ switch (_a.label) {
137
+ case 0: return [4 /*yield*/, HotIO_1.HotIO.readTextFile(ppath.normalize(filepath))];
138
+ case 1:
139
+ fileContent = _a.sent();
140
+ fileContent = replaceKeywords(fileContent);
141
+ return [2 /*return*/, (fileContent)];
142
+ }
143
+ });
144
+ }); };
145
+ if (this_1.dockerHardenSecurity === false)
146
+ hardenSecurity = "";
147
+ return [4 /*yield*/, HotIO_1.HotIO.mkdir("".concat(outputDir, "/docker/").concat(hotsiteName, "/app/"))];
148
+ case 1:
149
+ _e.sent();
150
+ if (httpPort != null) {
151
+ dockerfilePortsStr += "ARG HTTP_PORT=".concat(httpPort, "\nENV HTTP_PORT ${HTTP_PORT}\nEXPOSE ${HTTP_PORT}");
152
+ dockercomposeAppPortsStr += "\n ports:\n - \"".concat(httpPort, ":").concat(httpPort, "\"");
153
+ }
154
+ if (httpsPort != null) {
155
+ dockerfilePortsStr += "ARG HTTPS_PORT=".concat(httpsPort, "\nENV HTTPS_PORT ${HTTPS_PORT}\nEXPOSE ${HTTPS_PORT}");
156
+ dockercomposeAppPortsStr += "\n\t\t\t\t\t- \"".concat(httpsPort, ":").concat(httpsPort, "\"");
157
+ }
158
+ if (dockerfilePortsStr === "") {
159
+ dockerfilePortsStr += "ARG HTTP_PORT=80\nENV HTTP_PORT ${HTTP_PORT}\nEXPOSE ${HTTP_PORT}";
160
+ dockercomposeAppPortsStr += "\nports:\n- \"80:80\"";
161
+ }
162
+ newDockerfileContent = replaceKeywords(newDockerfileContent);
163
+ newStartFileContent = replaceKeywords(newStartFileContent);
164
+ return [4 /*yield*/, HotIO_1.HotIO.writeTextFile("".concat(outputDir, "/docker/").concat(hotsiteName, "/Dockerfile"), newDockerfileContent)];
165
+ case 2:
166
+ _e.sent();
167
+ return [4 /*yield*/, HotIO_1.HotIO.copyFiles("".concat(dockerDir, "/scripts/"), "".concat(outputDir, "/"))];
168
+ case 3:
169
+ _e.sent();
170
+ return [4 /*yield*/, HotIO_1.HotIO.writeTextFile("".concat(outputDir, "/docker/").concat(hotsiteName, "/app/start.sh"), newStartFileContent)];
171
+ case 4:
172
+ _e.sent();
173
+ _c = (_b = HotIO_1.HotIO).writeTextFile;
174
+ _d = ["".concat(outputDir, "/start-app.sh")];
175
+ return [4 /*yield*/, HotIO_1.HotIO.readTextFile(ppath.normalize("".concat(outputDir, "/start-app.sh")))];
176
+ case 5: return [4 /*yield*/, _c.apply(_b, _d.concat([_e.sent()]))];
177
+ case 6:
178
+ _e.sent();
179
+ return [4 /*yield*/, HotIO_1.HotIO.copyFile("".concat(dockerDir, "/dockerignore"), "".concat(outputDir, "/.dockerignore"))];
180
+ case 7:
181
+ _e.sent();
182
+ return [4 /*yield*/, HotIO_1.HotIO.exists("".concat(outputDir, "/README.md"))];
183
+ case 8:
184
+ if (!((_e.sent()) === true)) return [3 /*break*/, 12];
185
+ return [4 /*yield*/, HotIO_1.HotIO.readTextFile("".concat(outputDir, "/README.md"))];
186
+ case 9:
187
+ prevREADME = _e.sent();
188
+ return [4 /*yield*/, HotIO_1.HotIO.readTextFile("".concat(dockerDir, "/README.md"))];
189
+ case 10:
190
+ dockerREADME = _e.sent();
191
+ if (!(prevREADME.indexOf("Docker Getting Started") < 0)) return [3 /*break*/, 12];
192
+ return [4 /*yield*/, HotIO_1.HotIO.writeTextFile("".concat(outputDir, "/README.md"), "".concat(prevREADME, "\n").concat(dockerREADME))];
193
+ case 11:
194
+ _e.sent();
195
+ _e.label = 12;
196
+ case 12:
197
+ this_1.logger.info("Finished building Dockerfile \"".concat(hotsite.name, "\"..."));
198
+ return [2 /*return*/];
199
+ }
200
+ });
201
+ };
202
+ this_1 = this;
203
+ iIdx = 0;
204
+ _a.label = 3;
205
+ case 3:
206
+ if (!(iIdx < this.hotsites.length)) return [3 /*break*/, 6];
207
+ return [5 /*yield**/, _loop_1(iIdx)];
208
+ case 4:
209
+ _a.sent();
210
+ _a.label = 5;
211
+ case 5:
212
+ iIdx++;
213
+ return [3 /*break*/, 3];
214
+ case 6:
215
+ this.logger.info("Finished building docker files...");
216
+ _a.label = 7;
217
+ case 7:
218
+ if (!(this.dockerCompose === true)) return [3 /*break*/, 10];
219
+ this.logger.info("Building Docker Compose files...");
220
+ dockerDir = ppath.normalize("".concat(__dirname, "/../../builder/docker-compose"));
221
+ return [4 /*yield*/, HotIO_1.HotIO.readTextFile(ppath.normalize("".concat(dockerDir, "/docker-compose.gen.yaml")))];
222
+ case 8:
223
+ dockerFileContent = _a.sent();
224
+ return [4 /*yield*/, HotIO_1.HotIO.readTextFile(ppath.normalize("".concat(dockerDir, "/app/start.sh")))];
225
+ case 9:
226
+ startFileContent = _a.sent();
227
+ for (iIdx = 0; iIdx < this.hotsites.length; iIdx++) {
228
+ hotsite = this.hotsites[iIdx];
229
+ this.logger.info("Building Docker Compose files...");
230
+ this.logger.info("Finished building Docker Compose \"".concat(hotsite.name, "\"..."));
231
+ }
232
+ this.logger.info("Finished building Docker Compose files...");
233
+ _a.label = 10;
234
+ case 10: return [2 /*return*/];
235
+ }
236
+ });
237
+ });
238
+ };
239
+ return HotBuilder;
240
+ }());
241
+ exports.HotBuilder = HotBuilder;
242
+ //# sourceMappingURL=HotBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HotBuilder.js","sourceRoot":"","sources":["../../src/HotBuilder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA8B;AAC9B,iCAAgC;AAEhC,qCAA6C;AAG7C;;GAEG;AACH;IAwCC,oBAAa,MAAc;QAE1B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAE,UAAG,OAAO,CAAC,GAAG,EAAG,MAAG,CAAC,CAAC;IACzD,CAAC;IAED;;;;OAIG;IACG,0BAAK,GAAX;;;;;;;wBAEC,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,EACrB;4BACC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAE,qBAAqB,CAAC,CAAC;4BAEzC,wBAAwB;4BAExB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAE,8BAA8B,CAAC,CAAC;yBAClD;6BAEG,CAAA,IAAI,CAAC,WAAW,KAAK,IAAI,CAAA,EAAzB,wBAAyB;wBAE5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAE,0BAA0B,CAAC,CAAC;wBAExC,SAAS,GAAW,KAAK,CAAC,SAAS,CAAE,UAAG,SAAS,0BAAuB,CAAC,CAAC;wBAC9C,qBAAM,aA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CAAC,CAAC;4BAE7C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAE,kCAAkC,CAAC,CAAC;4BACtD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAE,8CAAsC,OAAO,CAAC,IAAI,UAAM,CAAC,CAAC;yBAC5E;wBAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAE,2CAA2C,CAAC,CAAC;;;;;;KAEhE;IACF,iBAAC;AAAD,CAAC,AAnND,IAmNC;AAnNY,gCAAU"}
@@ -0,0 +1,31 @@
1
+ import { HotStaq } from "./HotStaq";
2
+ import { HotAPI } from "./HotAPI";
3
+ import { HotServerType } from "./HotServer";
4
+ import { HotLog } from "./HotLog";
5
+ /**
6
+ * A client connected to a server.
7
+ */
8
+ export declare class HotClient {
9
+ /**
10
+ * The processor to use.
11
+ */
12
+ processor: HotStaq;
13
+ /**
14
+ * The API to use.
15
+ */
16
+ api: HotAPI;
17
+ /**
18
+ * The tester API to use.
19
+ */
20
+ testerAPI: HotAPI;
21
+ /**
22
+ * The type of server.
23
+ */
24
+ type: HotServerType;
25
+ /**
26
+ * The logger.
27
+ */
28
+ logger: HotLog;
29
+ constructor(processor: HotStaq);
30
+ }
31
+ //# sourceMappingURL=HotClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HotClient.d.ts","sourceRoot":"","sources":["../../src/HotClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;GAEG;AACH,qBAAa,SAAS;IAErB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC;IACpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;gBAEF,SAAS,EAAE,OAAO;CAQ/B"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HotClient = void 0;
4
+ var HotServer_1 = require("./HotServer");
5
+ /**
6
+ * A client connected to a server.
7
+ */
8
+ var HotClient = /** @class */ (function () {
9
+ function HotClient(processor) {
10
+ this.processor = processor;
11
+ this.api = null;
12
+ this.testerAPI = null;
13
+ this.type = HotServer_1.HotServerType.HTTP;
14
+ this.logger = processor.logger;
15
+ }
16
+ return HotClient;
17
+ }());
18
+ exports.HotClient = HotClient;
19
+ //# sourceMappingURL=HotClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HotClient.js","sourceRoot":"","sources":["../../src/HotClient.ts"],"names":[],"mappings":";;;AAEA,yCAA4C;AAG5C;;GAEG;AACH;IAuBC,mBAAa,SAAkB;QAE9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,yBAAa,CAAC,IAAI,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IAChC,CAAC;IACF,gBAAC;AAAD,CAAC,AA/BD,IA+BC;AA/BY,8BAAS"}
@@ -0,0 +1,118 @@
1
+ import { HotAPI } from "./HotAPI";
2
+ import { HotStaq } from "./HotStaq";
3
+ /**
4
+ * A component to preprocess.
5
+ */
6
+ export interface IHotComponent {
7
+ /**
8
+ * The processor to use.
9
+ */
10
+ processor: HotStaq;
11
+ /**
12
+ * The associated HTMLElement.
13
+ */
14
+ htmlElement?: HTMLElement;
15
+ /**
16
+ * The name of the page.
17
+ */
18
+ name?: string;
19
+ /**
20
+ * The name of the tag.
21
+ */
22
+ tag?: string;
23
+ /**
24
+ * The connected API.
25
+ */
26
+ api?: HotAPI;
27
+ /**
28
+ * The options to include with registering this component.
29
+ */
30
+ elementOptions?: ElementDefinitionOptions;
31
+ /**
32
+ * The type of component.
33
+ */
34
+ type?: string;
35
+ /**
36
+ * The value of the component.
37
+ */
38
+ value?: any;
39
+ /**
40
+ * The events to trigger.
41
+ */
42
+ events?: {
43
+ [name: string]: {
44
+ type: string;
45
+ func: Function;
46
+ options?: any;
47
+ };
48
+ };
49
+ }
50
+ /**
51
+ * A component to preprocess.
52
+ */
53
+ export declare abstract class HotComponent implements IHotComponent {
54
+ /**
55
+ * The processor to use.
56
+ */
57
+ processor: HotStaq;
58
+ /**
59
+ * The associated HTMLElement.
60
+ */
61
+ htmlElement: HTMLElement;
62
+ /**
63
+ * The name of the component.
64
+ */
65
+ name: string;
66
+ /**
67
+ * The name of the tag.
68
+ */
69
+ tag: string;
70
+ /**
71
+ * The connected API.
72
+ */
73
+ api: HotAPI;
74
+ /**
75
+ * The options to include with registering this component.
76
+ */
77
+ elementOptions: ElementDefinitionOptions;
78
+ /**
79
+ * The type of component.
80
+ */
81
+ type: string;
82
+ /**
83
+ * The value of the component.
84
+ */
85
+ value: any;
86
+ /**
87
+ * The events to trigger.
88
+ */
89
+ events: {
90
+ [name: string]: {
91
+ type: string;
92
+ func: Function;
93
+ options: any;
94
+ };
95
+ };
96
+ constructor(copy: IHotComponent | HotStaq, api?: HotAPI);
97
+ /**
98
+ * Event that's called when this component is created. This is
99
+ * called before output is called. Right after this is called,
100
+ * the attributes from the HTMLElement will be processed. If
101
+ * the functionality of the attributes processing need to be
102
+ * overwritten, use the handleAttributes method to handle them.
103
+ */
104
+ onCreated(element: HTMLElement): Promise<any>;
105
+ /**
106
+ * Handle the attributes manually.
107
+ */
108
+ handleAttributes?(attributes: NamedNodeMap): Promise<void>;
109
+ /**
110
+ * Handle a click event.
111
+ */
112
+ abstract click(): Promise<void>;
113
+ /**
114
+ * Output the component.
115
+ */
116
+ abstract output(): Promise<string>;
117
+ }
118
+ //# sourceMappingURL=HotComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HotComponent.d.ts","sourceRoot":"","sources":["../../src/HotComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,aAAa;IAE7B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;OAEG;IACH,MAAM,CAAC,EAAE;QACP,CAAC,IAAI,EAAE,MAAM,GAAG;YACf,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,QAAQ,CAAC;YACf,OAAO,CAAC,EAAE,GAAG,CAAC;SACd,CAAA;KACD,CAAC;CACH;AAED;;GAEG;AACH,8BAAsB,YAAa,YAAW,aAAa;IAE1D;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,cAAc,EAAE,wBAAwB,CAAC;IACzC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,GAAG,CAAC;IACX;;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