hotstaq 0.5.24

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 (299) hide show
  1. package/.eslintignore +17 -0
  2. package/.eslintrc.js +11 -0
  3. package/.vscode/launch.json +199 -0
  4. package/.vscode/settings.json +2 -0
  5. package/.vscode/tasks.json +78 -0
  6. package/CONTRIBUTING.md +157 -0
  7. package/README.md +126 -0
  8. package/bin/hotstaq +3 -0
  9. package/bin/hotstaq.cmd +1 -0
  10. package/build/src/Hot.d.ts +167 -0
  11. package/build/src/Hot.d.ts.map +1 -0
  12. package/build/src/Hot.js +365 -0
  13. package/build/src/Hot.js.map +1 -0
  14. package/build/src/HotAPI.d.ts +130 -0
  15. package/build/src/HotAPI.d.ts.map +1 -0
  16. package/build/src/HotAPI.js +353 -0
  17. package/build/src/HotAPI.js.map +1 -0
  18. package/build/src/HotAgentAPI.d.ts +22 -0
  19. package/build/src/HotAgentAPI.d.ts.map +1 -0
  20. package/build/src/HotAgentAPI.js +85 -0
  21. package/build/src/HotAgentAPI.js.map +1 -0
  22. package/build/src/HotAgentRoute.d.ts +17 -0
  23. package/build/src/HotAgentRoute.d.ts.map +1 -0
  24. package/build/src/HotAgentRoute.js +109 -0
  25. package/build/src/HotAgentRoute.js.map +1 -0
  26. package/build/src/HotBuilder.d.ts +52 -0
  27. package/build/src/HotBuilder.d.ts.map +1 -0
  28. package/build/src/HotBuilder.js +239 -0
  29. package/build/src/HotBuilder.js.map +1 -0
  30. package/build/src/HotClient.d.ts +31 -0
  31. package/build/src/HotClient.d.ts.map +1 -0
  32. package/build/src/HotClient.js +19 -0
  33. package/build/src/HotClient.js.map +1 -0
  34. package/build/src/HotComponent.d.ts +118 -0
  35. package/build/src/HotComponent.d.ts.map +1 -0
  36. package/build/src/HotComponent.js +89 -0
  37. package/build/src/HotComponent.js.map +1 -0
  38. package/build/src/HotCreator.d.ts +92 -0
  39. package/build/src/HotCreator.d.ts.map +1 -0
  40. package/build/src/HotCreator.js +465 -0
  41. package/build/src/HotCreator.js.map +1 -0
  42. package/build/src/HotDB.d.ts +69 -0
  43. package/build/src/HotDB.d.ts.map +1 -0
  44. package/build/src/HotDB.js +29 -0
  45. package/build/src/HotDB.js.map +1 -0
  46. package/build/src/HotDBConnectionInterface.d.ts +40 -0
  47. package/build/src/HotDBConnectionInterface.d.ts.map +1 -0
  48. package/build/src/HotDBConnectionInterface.js +3 -0
  49. package/build/src/HotDBConnectionInterface.js.map +1 -0
  50. package/build/src/HotFile.d.ts +134 -0
  51. package/build/src/HotFile.d.ts.map +1 -0
  52. package/build/src/HotFile.js +454 -0
  53. package/build/src/HotFile.js.map +1 -0
  54. package/build/src/HotHTTPServer.d.ts +162 -0
  55. package/build/src/HotHTTPServer.d.ts.map +1 -0
  56. package/build/src/HotHTTPServer.js +863 -0
  57. package/build/src/HotHTTPServer.js.map +1 -0
  58. package/build/src/HotIO.d.ts +39 -0
  59. package/build/src/HotIO.d.ts.map +1 -0
  60. package/build/src/HotIO.js +195 -0
  61. package/build/src/HotIO.js.map +1 -0
  62. package/build/src/HotLog.d.ts +60 -0
  63. package/build/src/HotLog.d.ts.map +1 -0
  64. package/build/src/HotLog.js +126 -0
  65. package/build/src/HotLog.js.map +1 -0
  66. package/build/src/HotPage.d.ts +125 -0
  67. package/build/src/HotPage.d.ts.map +1 -0
  68. package/build/src/HotPage.js +178 -0
  69. package/build/src/HotPage.js.map +1 -0
  70. package/build/src/HotRoute.d.ts +82 -0
  71. package/build/src/HotRoute.d.ts.map +1 -0
  72. package/build/src/HotRoute.js +83 -0
  73. package/build/src/HotRoute.js.map +1 -0
  74. package/build/src/HotRouteMethod.d.ts +129 -0
  75. package/build/src/HotRouteMethod.d.ts.map +1 -0
  76. package/build/src/HotRouteMethod.js +84 -0
  77. package/build/src/HotRouteMethod.js.map +1 -0
  78. package/build/src/HotServer.d.ts +152 -0
  79. package/build/src/HotServer.d.ts.map +1 -0
  80. package/build/src/HotServer.js +109 -0
  81. package/build/src/HotServer.js.map +1 -0
  82. package/build/src/HotSetAsWeb.d.ts +2 -0
  83. package/build/src/HotSetAsWeb.d.ts.map +1 -0
  84. package/build/src/HotSetAsWeb.js +5 -0
  85. package/build/src/HotSetAsWeb.js.map +1 -0
  86. package/build/src/HotStaq.d.ts +601 -0
  87. package/build/src/HotStaq.d.ts.map +1 -0
  88. package/build/src/HotStaq.js +1258 -0
  89. package/build/src/HotStaq.js.map +1 -0
  90. package/build/src/HotStaqWeb.d.ts +18 -0
  91. package/build/src/HotStaqWeb.d.ts.map +1 -0
  92. package/build/src/HotStaqWeb.js +44 -0
  93. package/build/src/HotStaqWeb.js.map +1 -0
  94. package/build/src/HotTestDriver.d.ts +63 -0
  95. package/build/src/HotTestDriver.d.ts.map +1 -0
  96. package/build/src/HotTestDriver.js +187 -0
  97. package/build/src/HotTestDriver.js.map +1 -0
  98. package/build/src/HotTestElement.d.ts +71 -0
  99. package/build/src/HotTestElement.d.ts.map +1 -0
  100. package/build/src/HotTestElement.js +37 -0
  101. package/build/src/HotTestElement.js.map +1 -0
  102. package/build/src/HotTestMap.d.ts +83 -0
  103. package/build/src/HotTestMap.d.ts.map +1 -0
  104. package/build/src/HotTestMap.js +58 -0
  105. package/build/src/HotTestMap.js.map +1 -0
  106. package/build/src/HotTestSeleniumDriver.d.ts +82 -0
  107. package/build/src/HotTestSeleniumDriver.d.ts.map +1 -0
  108. package/build/src/HotTestSeleniumDriver.js +398 -0
  109. package/build/src/HotTestSeleniumDriver.js.map +1 -0
  110. package/build/src/HotTester.d.ts +188 -0
  111. package/build/src/HotTester.d.ts.map +1 -0
  112. package/build/src/HotTester.js +623 -0
  113. package/build/src/HotTester.js.map +1 -0
  114. package/build/src/HotTesterAPI.d.ts +15 -0
  115. package/build/src/HotTesterAPI.d.ts.map +1 -0
  116. package/build/src/HotTesterAPI.js +161 -0
  117. package/build/src/HotTesterAPI.js.map +1 -0
  118. package/build/src/HotTesterMocha.d.ts +50 -0
  119. package/build/src/HotTesterMocha.d.ts.map +1 -0
  120. package/build/src/HotTesterMocha.js +205 -0
  121. package/build/src/HotTesterMocha.js.map +1 -0
  122. package/build/src/HotTesterMochaSelenium.d.ts +70 -0
  123. package/build/src/HotTesterMochaSelenium.d.ts.map +1 -0
  124. package/build/src/HotTesterMochaSelenium.js +257 -0
  125. package/build/src/HotTesterMochaSelenium.js.map +1 -0
  126. package/build/src/HotTesterServer.d.ts +114 -0
  127. package/build/src/HotTesterServer.d.ts.map +1 -0
  128. package/build/src/HotTesterServer.js +575 -0
  129. package/build/src/HotTesterServer.js.map +1 -0
  130. package/build/src/api.d.ts +33 -0
  131. package/build/src/api.d.ts.map +1 -0
  132. package/build/src/api.js +78 -0
  133. package/build/src/api.js.map +1 -0
  134. package/build/src/cli.d.ts +2 -0
  135. package/build/src/cli.d.ts.map +1 -0
  136. package/build/src/cli.js +935 -0
  137. package/build/src/cli.js.map +1 -0
  138. package/build/src/schemas/HotDBInflux.d.ts +63 -0
  139. package/build/src/schemas/HotDBInflux.d.ts.map +1 -0
  140. package/build/src/schemas/HotDBInflux.js +239 -0
  141. package/build/src/schemas/HotDBInflux.js.map +1 -0
  142. package/build/src/schemas/HotDBMigration.d.ts +19 -0
  143. package/build/src/schemas/HotDBMigration.d.ts.map +1 -0
  144. package/build/src/schemas/HotDBMigration.js +15 -0
  145. package/build/src/schemas/HotDBMigration.js.map +1 -0
  146. package/build/src/schemas/HotDBMySQL.d.ts +65 -0
  147. package/build/src/schemas/HotDBMySQL.d.ts.map +1 -0
  148. package/build/src/schemas/HotDBMySQL.js +387 -0
  149. package/build/src/schemas/HotDBMySQL.js.map +1 -0
  150. package/build/src/schemas/HotDBSchema.d.ts +15 -0
  151. package/build/src/schemas/HotDBSchema.d.ts.map +1 -0
  152. package/build/src/schemas/HotDBSchema.js +19 -0
  153. package/build/src/schemas/HotDBSchema.js.map +1 -0
  154. package/build/src/schemas/influx/InfluxSchema.d.ts +14 -0
  155. package/build/src/schemas/influx/InfluxSchema.d.ts.map +1 -0
  156. package/build/src/schemas/influx/InfluxSchema.js +33 -0
  157. package/build/src/schemas/influx/InfluxSchema.js.map +1 -0
  158. package/build/src/schemas/mysql/MySQLSchema.d.ts +39 -0
  159. package/build/src/schemas/mysql/MySQLSchema.d.ts.map +1 -0
  160. package/build/src/schemas/mysql/MySQLSchema.js +151 -0
  161. package/build/src/schemas/mysql/MySQLSchema.js.map +1 -0
  162. package/build/src/schemas/mysql/MySQLSchemaField.d.ts +168 -0
  163. package/build/src/schemas/mysql/MySQLSchemaField.d.ts.map +1 -0
  164. package/build/src/schemas/mysql/MySQLSchemaField.js +260 -0
  165. package/build/src/schemas/mysql/MySQLSchemaField.js.map +1 -0
  166. package/build/src/schemas/mysql/MySQLSchemaTable.d.ts +49 -0
  167. package/build/src/schemas/mysql/MySQLSchemaTable.d.ts.map +1 -0
  168. package/build/src/schemas/mysql/MySQLSchemaTable.js +310 -0
  169. package/build/src/schemas/mysql/MySQLSchemaTable.js.map +1 -0
  170. package/build-web/HotStaq.js +2 -0
  171. package/build-web/HotStaq.min.js +125 -0
  172. package/builder/docker/Dockerfile.linux.gen +42 -0
  173. package/builder/docker/README.md +36 -0
  174. package/builder/docker/app/start.sh +8 -0
  175. package/builder/docker/dockerignore +3 -0
  176. package/builder/docker/scripts/build.bat +11 -0
  177. package/builder/docker/scripts/build.sh +11 -0
  178. package/builder/docker/scripts/start-app.bat +7 -0
  179. package/builder/docker/scripts/start-app.sh +7 -0
  180. package/builder/docker/scripts/stop-app.bat +5 -0
  181. package/builder/docker/scripts/stop-app.sh +5 -0
  182. package/builder/docker-compose/docker-compose.gen.yaml +41 -0
  183. package/builder/docker-compose/env-skeleton +4 -0
  184. package/creator/project/.vscode/launch.json +59 -0
  185. package/creator/project/README.md +20 -0
  186. package/creator/project/gitignore +118 -0
  187. package/creator/project/npmignore +118 -0
  188. package/creator/public/api-test.hott +28 -0
  189. package/creator/public/index.hott +12 -0
  190. package/creator/ts/src/AppAPI.ts +30 -0
  191. package/creator/ts/src/HelloWorld.ts +39 -0
  192. package/creator/ts/src/WebExport.ts +7 -0
  193. package/creator/ts/tsconfig-web.json +73 -0
  194. package/creator/ts/tsconfig.json +73 -0
  195. package/creator/ts/webpack-api.config.js +57 -0
  196. package/dbstart.sh +19 -0
  197. package/dbstop.sh +4 -0
  198. package/docs/.nojekyll +1 -0
  199. package/docs/README.md +128 -0
  200. package/docs/classes/Hot.md +477 -0
  201. package/docs/classes/HotAPI.md +369 -0
  202. package/docs/classes/HotClient.md +95 -0
  203. package/docs/classes/HotComponent.md +279 -0
  204. package/docs/classes/HotDB.md +247 -0
  205. package/docs/classes/HotDBInflux.md +404 -0
  206. package/docs/classes/HotDBMigration.md +80 -0
  207. package/docs/classes/HotDBMySQL.md +310 -0
  208. package/docs/classes/HotDBSchema.md +51 -0
  209. package/docs/classes/HotFile.md +353 -0
  210. package/docs/classes/HotHTTPServer.md +700 -0
  211. package/docs/classes/HotLog.md +162 -0
  212. package/docs/classes/HotPage.md +357 -0
  213. package/docs/classes/HotRoute.md +312 -0
  214. package/docs/classes/HotRouteMethod.md +271 -0
  215. package/docs/classes/HotServer.md +311 -0
  216. package/docs/classes/HotStaq.md +1153 -0
  217. package/docs/classes/HotTestDestination.md +58 -0
  218. package/docs/classes/HotTestDriver.md +332 -0
  219. package/docs/classes/HotTestElement.md +88 -0
  220. package/docs/classes/HotTestElementOptions.md +71 -0
  221. package/docs/classes/HotTestMap.md +92 -0
  222. package/docs/classes/HotTestSeleniumDriver.md +529 -0
  223. package/docs/classes/HotTester.md +653 -0
  224. package/docs/classes/HotTesterAPI.md +493 -0
  225. package/docs/classes/HotTesterMocha.md +843 -0
  226. package/docs/classes/HotTesterMochaSelenium.md +896 -0
  227. package/docs/classes/HotTesterServer.md +633 -0
  228. package/docs/classes/InfluxSchema.md +74 -0
  229. package/docs/classes/MySQLSchema.md +199 -0
  230. package/docs/classes/MySQLSchemaField.md +330 -0
  231. package/docs/classes/MySQLSchemaTable.md +176 -0
  232. package/docs/enums/ConnectionStatus.md +43 -0
  233. package/docs/enums/DeveloperMode.md +38 -0
  234. package/docs/enums/EventExecutionType.md +43 -0
  235. package/docs/enums/HTTPMethod.md +32 -0
  236. package/docs/enums/HotDBGenerationType.md +30 -0
  237. package/docs/enums/HotLogLevel.md +88 -0
  238. package/docs/interfaces/HotDBConnectionInterface.md +116 -0
  239. package/docs/interfaces/HotDestination.md +62 -0
  240. package/docs/interfaces/HotSite.md +187 -0
  241. package/docs/interfaces/HotSiteMapPath.md +37 -0
  242. package/docs/interfaces/HotSiteRoute.md +79 -0
  243. package/docs/interfaces/HotStartOptions.md +115 -0
  244. package/docs/interfaces/HotTestPage.md +44 -0
  245. package/docs/interfaces/HotTestStop.md +62 -0
  246. package/docs/interfaces/IHotComponent.md +135 -0
  247. package/docs/interfaces/IHotStaq.md +118 -0
  248. package/docs/interfaces/IHotTestElement.md +54 -0
  249. package/docs/interfaces/IHotTestElementOptions.md +43 -0
  250. package/docs/interfaces/MySQLResults.md +43 -0
  251. package/docs/interfaces/MySQLSchemaFieldResult.md +75 -0
  252. package/docs/modules.md +162 -0
  253. package/package.json +65 -0
  254. package/selenium-start.sh +7 -0
  255. package/selenium-stop.sh +3 -0
  256. package/src/Hot.ts +319 -0
  257. package/src/HotAPI.ts +378 -0
  258. package/src/HotAgentAPI.ts +43 -0
  259. package/src/HotAgentRoute.ts +44 -0
  260. package/src/HotBuilder.ts +221 -0
  261. package/src/HotClient.ts +40 -0
  262. package/src/HotComponent.ts +158 -0
  263. package/src/HotCreator.ts +482 -0
  264. package/src/HotDB.ts +79 -0
  265. package/src/HotDBConnectionInterface.ts +40 -0
  266. package/src/HotFile.ts +617 -0
  267. package/src/HotHTTPServer.ts +954 -0
  268. package/src/HotIO.ts +128 -0
  269. package/src/HotLog.ts +158 -0
  270. package/src/HotPage.ts +206 -0
  271. package/src/HotRoute.ts +137 -0
  272. package/src/HotRouteMethod.ts +216 -0
  273. package/src/HotServer.ts +211 -0
  274. package/src/HotSetAsWeb.ts +3 -0
  275. package/src/HotStaq.ts +1877 -0
  276. package/src/HotStaqWeb.ts +59 -0
  277. package/src/HotTestDriver.ts +172 -0
  278. package/src/HotTestElement.ts +97 -0
  279. package/src/HotTestMap.ts +130 -0
  280. package/src/HotTestSeleniumDriver.ts +374 -0
  281. package/src/HotTester.ts +697 -0
  282. package/src/HotTesterAPI.ts +126 -0
  283. package/src/HotTesterMocha.ts +133 -0
  284. package/src/HotTesterMochaSelenium.ts +189 -0
  285. package/src/HotTesterServer.ts +551 -0
  286. package/src/api.ts +102 -0
  287. package/src/cli.ts +1147 -0
  288. package/src/schemas/HotDBInflux.ts +211 -0
  289. package/src/schemas/HotDBMigration.ts +24 -0
  290. package/src/schemas/HotDBMySQL.ts +312 -0
  291. package/src/schemas/HotDBSchema.ts +21 -0
  292. package/src/schemas/influx/InfluxSchema.ts +19 -0
  293. package/src/schemas/mysql/MySQLSchema.ts +90 -0
  294. package/src/schemas/mysql/MySQLSchemaField.ts +408 -0
  295. package/src/schemas/mysql/MySQLSchemaTable.ts +353 -0
  296. package/tsconfig-web.json +74 -0
  297. package/tsconfig.json +73 -0
  298. package/webpack.config.js +51 -0
  299. package/webpack.config.tests.js +56 -0
@@ -0,0 +1,312 @@
1
+ [hotstaq](../README.md) / [Modules](../modules.md) / HotRoute
2
+
3
+ # Class: HotRoute
4
+
5
+ The route to use.
6
+
7
+ ## Table of contents
8
+
9
+ ### Constructors
10
+
11
+ - [constructor](HotRoute.md#constructor)
12
+
13
+ ### Properties
14
+
15
+ - [authCredentials](HotRoute.md#authcredentials)
16
+ - [connection](HotRoute.md#connection)
17
+ - [errors](HotRoute.md#errors)
18
+ - [logger](HotRoute.md#logger)
19
+ - [methods](HotRoute.md#methods)
20
+ - [onAuthorizeUser](HotRoute.md#onauthorizeuser)
21
+ - [onPostRegister](HotRoute.md#onpostregister)
22
+ - [onPreRegister](HotRoute.md#onpreregister)
23
+ - [onRegister](HotRoute.md#onregister)
24
+ - [prefix](HotRoute.md#prefix)
25
+ - [route](HotRoute.md#route)
26
+ - [version](HotRoute.md#version)
27
+
28
+ ### Methods
29
+
30
+ - [addMethod](HotRoute.md#addmethod)
31
+ - [getMethod](HotRoute.md#getmethod)
32
+ - [createError](HotRoute.md#createerror)
33
+
34
+ ## Constructors
35
+
36
+ ### constructor
37
+
38
+ • **new HotRoute**(`connection`, `route`, `methods?`)
39
+
40
+ #### Parameters
41
+
42
+ | Name | Type | Default value |
43
+ | :------ | :------ | :------ |
44
+ | `connection` | [`HotServer`](HotServer.md) \| [`HotClient`](HotClient.md) | `undefined` |
45
+ | `route` | `string` | `undefined` |
46
+ | `methods` | [`HotRouteMethod`](HotRouteMethod.md)[] | `[]` |
47
+
48
+ #### Defined in
49
+
50
+ [HotRoute.ts:46](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L46)
51
+
52
+ ## Properties
53
+
54
+ ### authCredentials
55
+
56
+ • **authCredentials**: `any`
57
+
58
+ The authorization credentials to be used by the client
59
+ when connecting to the server.
60
+
61
+ #### Defined in
62
+
63
+ [HotRoute.ts:35](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L35)
64
+
65
+ ___
66
+
67
+ ### connection
68
+
69
+ • **connection**: [`HotServer`](HotServer.md) \| [`HotClient`](HotClient.md)
70
+
71
+ The server that maintains the connections.
72
+
73
+ #### Defined in
74
+
75
+ [HotRoute.ts:14](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L14)
76
+
77
+ ___
78
+
79
+ ### errors
80
+
81
+ • **errors**: `Object`
82
+
83
+ The errors and their JSON that can be thrown. Can be:
84
+ * not_authorized
85
+
86
+ #### Index signature
87
+
88
+ ▪ [error: `string`]: `any`
89
+
90
+ #### Defined in
91
+
92
+ [HotRoute.ts:44](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L44)
93
+
94
+ ___
95
+
96
+ ### logger
97
+
98
+ • **logger**: [`HotLog`](HotLog.md)
99
+
100
+ The associated logger.
101
+
102
+ #### Defined in
103
+
104
+ [HotRoute.ts:18](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L18)
105
+
106
+ ___
107
+
108
+ ### methods
109
+
110
+ • **methods**: [`HotRouteMethod`](HotRouteMethod.md)[]
111
+
112
+ The calls that can be made.
113
+
114
+ #### Defined in
115
+
116
+ [HotRoute.ts:39](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L39)
117
+
118
+ ___
119
+
120
+ ### onAuthorizeUser
121
+
122
+ • **onAuthorizeUser**: (`req`: `any`, `res`: `any`) => `Promise`<`any`\> = `null`
123
+
124
+ #### Type declaration
125
+
126
+ ▸ (`req`, `res`): `Promise`<`any`\>
127
+
128
+ Executes when authorizing a called method.
129
+ The value returned from here will be passed to onExecute in the
130
+ called HotRouteMethod. Undefined returning from here will mean
131
+ the authorization failed.
132
+
133
+ ##### Parameters
134
+
135
+ | Name | Type |
136
+ | :------ | :------ |
137
+ | `req` | `any` |
138
+ | `res` | `any` |
139
+
140
+ ##### Returns
141
+
142
+ `Promise`<`any`\>
143
+
144
+ #### Defined in
145
+
146
+ [HotRoute.ts:136](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L136)
147
+
148
+ ___
149
+
150
+ ### onPostRegister
151
+
152
+ • **onPostRegister**: () => `Promise`<`void`\> = `null`
153
+
154
+ #### Type declaration
155
+
156
+ ▸ (): `Promise`<`void`\>
157
+
158
+ Executes after all routes have been registered.
159
+
160
+ ##### Returns
161
+
162
+ `Promise`<`void`\>
163
+
164
+ #### Defined in
165
+
166
+ [HotRoute.ts:128](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L128)
167
+
168
+ ___
169
+
170
+ ### onPreRegister
171
+
172
+ • **onPreRegister**: () => `Promise`<`void`\> = `null`
173
+
174
+ #### Type declaration
175
+
176
+ ▸ (): `Promise`<`void`\>
177
+
178
+ Executes before all routes have been registered.
179
+
180
+ ##### Returns
181
+
182
+ `Promise`<`void`\>
183
+
184
+ #### Defined in
185
+
186
+ [HotRoute.ts:119](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L119)
187
+
188
+ ___
189
+
190
+ ### onRegister
191
+
192
+ • **onRegister**: () => `Promise`<`boolean`\> = `null`
193
+
194
+ #### Type declaration
195
+
196
+ ▸ (): `Promise`<`boolean`\>
197
+
198
+ Executes when first registering this route with Express. If
199
+ this returns false, the route will not be registered.
200
+
201
+ ##### Returns
202
+
203
+ `Promise`<`boolean`\>
204
+
205
+ #### Defined in
206
+
207
+ [HotRoute.ts:124](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L124)
208
+
209
+ ___
210
+
211
+ ### prefix
212
+
213
+ • **prefix**: `string`
214
+
215
+ The prefix to add to the beginning of each route method.
216
+
217
+ #### Defined in
218
+
219
+ [HotRoute.ts:30](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L30)
220
+
221
+ ___
222
+
223
+ ### route
224
+
225
+ • **route**: `string`
226
+
227
+ The route.
228
+
229
+ #### Defined in
230
+
231
+ [HotRoute.ts:22](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L22)
232
+
233
+ ___
234
+
235
+ ### version
236
+
237
+ • **version**: `string`
238
+
239
+ The version.
240
+
241
+ #### Defined in
242
+
243
+ [HotRoute.ts:26](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L26)
244
+
245
+ ## Methods
246
+
247
+ ### addMethod
248
+
249
+ ▸ **addMethod**(`method`, `executeFunction?`, `type?`, `testCases?`): `void`
250
+
251
+ Add an API method to this route.
252
+
253
+ #### Parameters
254
+
255
+ | Name | Type | Default value | Description |
256
+ | :------ | :------ | :------ | :------ |
257
+ | `method` | `string` \| [`HotRouteMethod`](HotRouteMethod.md) | `undefined` | The name of the method to add. If a HotRouteMethod is supplied, the rest of the arguments supplied will be ignored. |
258
+ | `executeFunction` | [`ServerExecutionFunction`](../modules.md#serverexecutionfunction) | `null` | - |
259
+ | `type` | [`HTTPMethod`](../enums/HTTPMethod.md) | `HTTPMethod.POST` | - |
260
+ | `testCases` | (`string` \| `TestCaseFunction`)[] \| `TestCaseFunction`[] \| `TestCaseObject`[] | `null` | - |
261
+
262
+ #### Returns
263
+
264
+ `void`
265
+
266
+ #### Defined in
267
+
268
+ [HotRoute.ts:81](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L81)
269
+
270
+ ___
271
+
272
+ ### getMethod
273
+
274
+ ▸ **getMethod**(`name`): [`HotRouteMethod`](HotRouteMethod.md)
275
+
276
+ Get a method by it's name.
277
+
278
+ #### Parameters
279
+
280
+ | Name | Type |
281
+ | :------ | :------ |
282
+ | `name` | `string` |
283
+
284
+ #### Returns
285
+
286
+ [`HotRouteMethod`](HotRouteMethod.md)
287
+
288
+ #### Defined in
289
+
290
+ [HotRoute.ts:97](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L97)
291
+
292
+ ___
293
+
294
+ ### createError
295
+
296
+ ▸ `Static` **createError**(`message`): `any`
297
+
298
+ Create an error JSON object.
299
+
300
+ #### Parameters
301
+
302
+ | Name | Type |
303
+ | :------ | :------ |
304
+ | `message` | `string` |
305
+
306
+ #### Returns
307
+
308
+ `any`
309
+
310
+ #### Defined in
311
+
312
+ [HotRoute.ts:70](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRoute.ts#L70)
@@ -0,0 +1,271 @@
1
+ [hotstaq](../README.md) / [Modules](../modules.md) / HotRouteMethod
2
+
3
+ # Class: HotRouteMethod
4
+
5
+ An API method to make.
6
+
7
+ ## Table of contents
8
+
9
+ ### Constructors
10
+
11
+ - [constructor](HotRouteMethod.md#constructor)
12
+
13
+ ### Properties
14
+
15
+ - [authCredentials](HotRouteMethod.md#authcredentials)
16
+ - [executeSetup](HotRouteMethod.md#executesetup)
17
+ - [isRegistered](HotRouteMethod.md#isregistered)
18
+ - [name](HotRouteMethod.md#name)
19
+ - [onClientExecute](HotRouteMethod.md#onclientexecute)
20
+ - [onPostRegister](HotRouteMethod.md#onpostregister)
21
+ - [onPreRegister](HotRouteMethod.md#onpreregister)
22
+ - [onRegister](HotRouteMethod.md#onregister)
23
+ - [onServerAuthorize](HotRouteMethod.md#onserverauthorize)
24
+ - [onServerExecute](HotRouteMethod.md#onserverexecute)
25
+ - [parentRoute](HotRouteMethod.md#parentroute)
26
+ - [testCases](HotRouteMethod.md#testcases)
27
+ - [type](HotRouteMethod.md#type)
28
+
29
+ ### Methods
30
+
31
+ - [addTestCase](HotRouteMethod.md#addtestcase)
32
+
33
+ ## Constructors
34
+
35
+ ### constructor
36
+
37
+ • **new HotRouteMethod**(`route`, `name`, `onExecute?`, `type?`, `onServerAuthorize?`, `onRegister?`, `authCredentials?`, `testCases?`)
38
+
39
+ #### Parameters
40
+
41
+ | Name | Type | Default value |
42
+ | :------ | :------ | :------ |
43
+ | `route` | [`HotRoute`](HotRoute.md) | `undefined` |
44
+ | `name` | `string` | `undefined` |
45
+ | `onExecute` | [`ServerExecutionFunction`](../modules.md#serverexecutionfunction) \| `ClientExecutionFunction` | `null` |
46
+ | `type` | [`HTTPMethod`](../enums/HTTPMethod.md) | `HTTPMethod.POST` |
47
+ | `onServerAuthorize` | [`ServerAuthorizationFunction`](../modules.md#serverauthorizationfunction) | `null` |
48
+ | `onRegister` | `ServerRegistrationFunction` | `null` |
49
+ | `authCredentials` | `any` | `null` |
50
+ | `testCases` | (`string` \| `TestCaseFunction`)[] \| `TestCaseFunction`[] \| `TestCaseObject`[] | `null` |
51
+
52
+ #### Defined in
53
+
54
+ [HotRouteMethod.ts:95](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L95)
55
+
56
+ ## Properties
57
+
58
+ ### authCredentials
59
+
60
+ • **authCredentials**: `any`
61
+
62
+ The authorization credentials to be used by the client
63
+ when connecting to the server.
64
+
65
+ #### Defined in
66
+
67
+ [HotRouteMethod.ts:87](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L87)
68
+
69
+ ___
70
+
71
+ ### executeSetup
72
+
73
+ • **executeSetup**: `boolean`
74
+
75
+ Has this method been registered with the server? This
76
+ prevents the method from being reregistered.
77
+
78
+ #### Defined in
79
+
80
+ [HotRouteMethod.ts:82](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L82)
81
+
82
+ ___
83
+
84
+ ### isRegistered
85
+
86
+ • **isRegistered**: `boolean`
87
+
88
+ Has this method been registered with the server? This
89
+ prevents the method from being reregistered.
90
+
91
+ #### Defined in
92
+
93
+ [HotRouteMethod.ts:77](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L77)
94
+
95
+ ___
96
+
97
+ ### name
98
+
99
+ • **name**: `string`
100
+
101
+ The api call name.
102
+
103
+ #### Defined in
104
+
105
+ [HotRouteMethod.ts:68](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L68)
106
+
107
+ ___
108
+
109
+ ### onClientExecute
110
+
111
+ • `Optional` **onClientExecute**: `ClientExecutionFunction`
112
+
113
+ Executes when executing a called method from the client side.
114
+
115
+ **`fixme`** Is this necessary?
116
+
117
+ #### Defined in
118
+
119
+ [HotRouteMethod.ts:178](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L178)
120
+
121
+ ___
122
+
123
+ ### onPostRegister
124
+
125
+ • `Optional` **onPostRegister**: () => `Promise`<`void`\>
126
+
127
+ #### Type declaration
128
+
129
+ ▸ (): `Promise`<`void`\>
130
+
131
+ Executes after all routes have been registered.
132
+
133
+ ##### Returns
134
+
135
+ `Promise`<`void`\>
136
+
137
+ #### Defined in
138
+
139
+ [HotRouteMethod.ts:151](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L151)
140
+
141
+ ___
142
+
143
+ ### onPreRegister
144
+
145
+ • `Optional` **onPreRegister**: () => `Promise`<`void`\>
146
+
147
+ #### Type declaration
148
+
149
+ ▸ (): `Promise`<`void`\>
150
+
151
+ Executes before all routes have been registered.
152
+
153
+ ##### Returns
154
+
155
+ `Promise`<`void`\>
156
+
157
+ #### Defined in
158
+
159
+ [HotRouteMethod.ts:142](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L142)
160
+
161
+ ___
162
+
163
+ ### onRegister
164
+
165
+ • `Optional` **onRegister**: `ServerRegistrationFunction`
166
+
167
+ Executes when first registering this method with Express. If
168
+ this returns false, the method will not be registered.
169
+
170
+ #### Defined in
171
+
172
+ [HotRouteMethod.ts:147](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L147)
173
+
174
+ ___
175
+
176
+ ### onServerAuthorize
177
+
178
+ • `Optional` **onServerAuthorize**: [`ServerAuthorizationFunction`](../modules.md#serverauthorizationfunction)
179
+
180
+ Executes when authorizing a called method. If this method
181
+ is set, this will not call onAuthorize for the parent HotRoute.
182
+ The value returned from here will be passed to onExecute.
183
+ Undefined returning from here will mean the authorization failed.
184
+ If any exceptions are thrown from this function, they will be sent
185
+ to the server as an { error: string; } object with the exception
186
+ message as the error.
187
+
188
+ #### Defined in
189
+
190
+ [HotRouteMethod.ts:162](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L162)
191
+
192
+ ___
193
+
194
+ ### onServerExecute
195
+
196
+ • `Optional` **onServerExecute**: [`ServerExecutionFunction`](../modules.md#serverexecutionfunction)
197
+
198
+ Executes when executing a called method from the server side.
199
+ This will stringify any JSON object and send it as a JSON response.
200
+ If undefined is returned no response will be sent to the server.
201
+ So the developer would have to send a response using "res".
202
+ If any exceptions are thrown from this function, they will be sent
203
+ to the server as an { error: string; } object with the exception
204
+ message as the error.
205
+
206
+ #### Defined in
207
+
208
+ [HotRouteMethod.ts:173](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L173)
209
+
210
+ ___
211
+
212
+ ### parentRoute
213
+
214
+ • **parentRoute**: [`HotRoute`](HotRoute.md)
215
+
216
+ The parent route.
217
+
218
+ #### Defined in
219
+
220
+ [HotRouteMethod.ts:64](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L64)
221
+
222
+ ___
223
+
224
+ ### testCases
225
+
226
+ • **testCases**: `Object`
227
+
228
+ The test case objects to execute during tests.
229
+
230
+ #### Index signature
231
+
232
+ ▪ [name: `string`]: `TestCaseObject`
233
+
234
+ #### Defined in
235
+
236
+ [HotRouteMethod.ts:91](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L91)
237
+
238
+ ___
239
+
240
+ ### type
241
+
242
+ • **type**: [`HTTPMethod`](../enums/HTTPMethod.md)
243
+
244
+ The api call name.
245
+
246
+ #### Defined in
247
+
248
+ [HotRouteMethod.ts:72](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L72)
249
+
250
+ ## Methods
251
+
252
+ ### addTestCase
253
+
254
+ ▸ **addTestCase**(`newTestCase`, `testCaseFunction?`): `void`
255
+
256
+ Add a new test case.
257
+
258
+ #### Parameters
259
+
260
+ | Name | Type | Default value |
261
+ | :------ | :------ | :------ |
262
+ | `newTestCase` | `string` \| `TestCaseFunction` \| `TestCaseObject` | `undefined` |
263
+ | `testCaseFunction` | `TestCaseFunction` | `null` |
264
+
265
+ #### Returns
266
+
267
+ `void`
268
+
269
+ #### Defined in
270
+
271
+ [HotRouteMethod.ts:183](https://github.com/OurFreeLight/HotStaq/blob/3f2c5d8/src/HotRouteMethod.ts#L183)