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.
- package/.dockerignore +123 -0
- package/.eslintignore +17 -0
- package/.eslintrc.js +11 -0
- package/.vscode/launch.json +201 -0
- package/.vscode/settings.json +2 -0
- package/.vscode/tasks.json +88 -0
- package/CONTRIBUTING.md +157 -0
- package/LICENSE +21 -0
- package/README.md +128 -0
- package/bin/hotstaq +3 -0
- package/bin/hotstaq.cmd +1 -0
- package/build/src/Hot.d.ts +167 -0
- package/build/src/Hot.d.ts.map +1 -0
- package/build/src/Hot.js +365 -0
- package/build/src/Hot.js.map +1 -0
- package/build/src/HotAPI.d.ts +137 -0
- package/build/src/HotAPI.d.ts.map +1 -0
- package/build/src/HotAPI.js +353 -0
- package/build/src/HotAPI.js.map +1 -0
- package/build/src/HotAgentAPI.d.ts +22 -0
- package/build/src/HotAgentAPI.d.ts.map +1 -0
- package/build/src/HotAgentAPI.js +85 -0
- package/build/src/HotAgentAPI.js.map +1 -0
- package/build/src/HotAgentRoute.d.ts +17 -0
- package/build/src/HotAgentRoute.d.ts.map +1 -0
- package/build/src/HotAgentRoute.js +109 -0
- package/build/src/HotAgentRoute.js.map +1 -0
- package/build/src/HotBuilder.d.ts +52 -0
- package/build/src/HotBuilder.d.ts.map +1 -0
- package/build/src/HotBuilder.js +242 -0
- package/build/src/HotBuilder.js.map +1 -0
- package/build/src/HotClient.d.ts +31 -0
- package/build/src/HotClient.d.ts.map +1 -0
- package/build/src/HotClient.js +19 -0
- package/build/src/HotClient.js.map +1 -0
- package/build/src/HotComponent.d.ts +118 -0
- package/build/src/HotComponent.d.ts.map +1 -0
- package/build/src/HotComponent.js +89 -0
- package/build/src/HotComponent.js.map +1 -0
- package/build/src/HotCreator.d.ts +88 -0
- package/build/src/HotCreator.d.ts.map +1 -0
- package/build/src/HotCreator.js +445 -0
- package/build/src/HotCreator.js.map +1 -0
- package/build/src/HotDB.d.ts +69 -0
- package/build/src/HotDB.d.ts.map +1 -0
- package/build/src/HotDB.js +29 -0
- package/build/src/HotDB.js.map +1 -0
- package/build/src/HotDBConnectionInterface.d.ts +40 -0
- package/build/src/HotDBConnectionInterface.d.ts.map +1 -0
- package/build/src/HotDBConnectionInterface.js +3 -0
- package/build/src/HotDBConnectionInterface.js.map +1 -0
- package/build/src/HotFile.d.ts +134 -0
- package/build/src/HotFile.d.ts.map +1 -0
- package/build/src/HotFile.js +454 -0
- package/build/src/HotFile.js.map +1 -0
- package/build/src/HotGenerator.d.ts +80 -0
- package/build/src/HotGenerator.d.ts.map +1 -0
- package/build/src/HotGenerator.js +342 -0
- package/build/src/HotGenerator.js.map +1 -0
- package/build/src/HotHTTPServer.d.ts +162 -0
- package/build/src/HotHTTPServer.d.ts.map +1 -0
- package/build/src/HotHTTPServer.js +863 -0
- package/build/src/HotHTTPServer.js.map +1 -0
- package/build/src/HotIO.d.ts +47 -0
- package/build/src/HotIO.d.ts.map +1 -0
- package/build/src/HotIO.js +232 -0
- package/build/src/HotIO.js.map +1 -0
- package/build/src/HotLog.d.ts +60 -0
- package/build/src/HotLog.d.ts.map +1 -0
- package/build/src/HotLog.js +126 -0
- package/build/src/HotLog.js.map +1 -0
- package/build/src/HotPage.d.ts +125 -0
- package/build/src/HotPage.d.ts.map +1 -0
- package/build/src/HotPage.js +178 -0
- package/build/src/HotPage.js.map +1 -0
- package/build/src/HotRoute.d.ts +82 -0
- package/build/src/HotRoute.d.ts.map +1 -0
- package/build/src/HotRoute.js +83 -0
- package/build/src/HotRoute.js.map +1 -0
- package/build/src/HotRouteMethod.d.ts +129 -0
- package/build/src/HotRouteMethod.d.ts.map +1 -0
- package/build/src/HotRouteMethod.js +84 -0
- package/build/src/HotRouteMethod.js.map +1 -0
- package/build/src/HotServer.d.ts +152 -0
- package/build/src/HotServer.d.ts.map +1 -0
- package/build/src/HotServer.js +109 -0
- package/build/src/HotServer.js.map +1 -0
- package/build/src/HotSetAsWeb.d.ts +2 -0
- package/build/src/HotSetAsWeb.d.ts.map +1 -0
- package/build/src/HotSetAsWeb.js +5 -0
- package/build/src/HotSetAsWeb.js.map +1 -0
- package/build/src/HotStaq.d.ts +603 -0
- package/build/src/HotStaq.d.ts.map +1 -0
- package/build/src/HotStaq.js +1260 -0
- package/build/src/HotStaq.js.map +1 -0
- package/build/src/HotStaqWeb.d.ts +18 -0
- package/build/src/HotStaqWeb.d.ts.map +1 -0
- package/build/src/HotStaqWeb.js +44 -0
- package/build/src/HotStaqWeb.js.map +1 -0
- package/build/src/HotTestDriver.d.ts +63 -0
- package/build/src/HotTestDriver.d.ts.map +1 -0
- package/build/src/HotTestDriver.js +187 -0
- package/build/src/HotTestDriver.js.map +1 -0
- package/build/src/HotTestElement.d.ts +71 -0
- package/build/src/HotTestElement.d.ts.map +1 -0
- package/build/src/HotTestElement.js +37 -0
- package/build/src/HotTestElement.js.map +1 -0
- package/build/src/HotTestMap.d.ts +83 -0
- package/build/src/HotTestMap.d.ts.map +1 -0
- package/build/src/HotTestMap.js +58 -0
- package/build/src/HotTestMap.js.map +1 -0
- package/build/src/HotTestSeleniumDriver.d.ts +86 -0
- package/build/src/HotTestSeleniumDriver.d.ts.map +1 -0
- package/build/src/HotTestSeleniumDriver.js +400 -0
- package/build/src/HotTestSeleniumDriver.js.map +1 -0
- package/build/src/HotTester.d.ts +188 -0
- package/build/src/HotTester.d.ts.map +1 -0
- package/build/src/HotTester.js +622 -0
- package/build/src/HotTester.js.map +1 -0
- package/build/src/HotTesterAPI.d.ts +15 -0
- package/build/src/HotTesterAPI.d.ts.map +1 -0
- package/build/src/HotTesterAPI.js +161 -0
- package/build/src/HotTesterAPI.js.map +1 -0
- package/build/src/HotTesterMocha.d.ts +50 -0
- package/build/src/HotTesterMocha.d.ts.map +1 -0
- package/build/src/HotTesterMocha.js +205 -0
- package/build/src/HotTesterMocha.js.map +1 -0
- package/build/src/HotTesterMochaSelenium.d.ts +70 -0
- package/build/src/HotTesterMochaSelenium.d.ts.map +1 -0
- package/build/src/HotTesterMochaSelenium.js +257 -0
- package/build/src/HotTesterMochaSelenium.js.map +1 -0
- package/build/src/HotTesterServer.d.ts +114 -0
- package/build/src/HotTesterServer.d.ts.map +1 -0
- package/build/src/HotTesterServer.js +575 -0
- package/build/src/HotTesterServer.js.map +1 -0
- package/build/src/api copy.d.ts +2 -0
- package/build/src/api copy.d.ts.map +1 -0
- package/build/src/api copy.js +153 -0
- package/build/src/api copy.js.map +1 -0
- package/build/src/api-web.d.ts +2 -0
- package/build/src/api-web.d.ts.map +1 -0
- package/build/src/api-web.js +45 -0
- package/build/src/api-web.js.map +1 -0
- package/build/src/api.d.ts +33 -0
- package/build/src/api.d.ts.map +1 -0
- package/build/src/api.js +78 -0
- package/build/src/api.js.map +1 -0
- package/build/src/cli.d.ts +2 -0
- package/build/src/cli.d.ts.map +1 -0
- package/build/src/cli.js +1040 -0
- package/build/src/cli.js.map +1 -0
- package/build/src/schemas/HotDBInflux.d.ts +63 -0
- package/build/src/schemas/HotDBInflux.d.ts.map +1 -0
- package/build/src/schemas/HotDBInflux.js +239 -0
- package/build/src/schemas/HotDBInflux.js.map +1 -0
- package/build/src/schemas/HotDBMigration.d.ts +19 -0
- package/build/src/schemas/HotDBMigration.d.ts.map +1 -0
- package/build/src/schemas/HotDBMigration.js +15 -0
- package/build/src/schemas/HotDBMigration.js.map +1 -0
- package/build/src/schemas/HotDBMySQL.d.ts +65 -0
- package/build/src/schemas/HotDBMySQL.d.ts.map +1 -0
- package/build/src/schemas/HotDBMySQL.js +387 -0
- package/build/src/schemas/HotDBMySQL.js.map +1 -0
- package/build/src/schemas/HotDBSchema.d.ts +15 -0
- package/build/src/schemas/HotDBSchema.d.ts.map +1 -0
- package/build/src/schemas/HotDBSchema.js +19 -0
- package/build/src/schemas/HotDBSchema.js.map +1 -0
- package/build/src/schemas/influx/InfluxSchema.d.ts +14 -0
- package/build/src/schemas/influx/InfluxSchema.d.ts.map +1 -0
- package/build/src/schemas/influx/InfluxSchema.js +33 -0
- package/build/src/schemas/influx/InfluxSchema.js.map +1 -0
- package/build/src/schemas/mysql/MySQLSchema.d.ts +39 -0
- package/build/src/schemas/mysql/MySQLSchema.d.ts.map +1 -0
- package/build/src/schemas/mysql/MySQLSchema.js +151 -0
- package/build/src/schemas/mysql/MySQLSchema.js.map +1 -0
- package/build/src/schemas/mysql/MySQLSchemaField.d.ts +168 -0
- package/build/src/schemas/mysql/MySQLSchemaField.d.ts.map +1 -0
- package/build/src/schemas/mysql/MySQLSchemaField.js +260 -0
- package/build/src/schemas/mysql/MySQLSchemaField.js.map +1 -0
- package/build/src/schemas/mysql/MySQLSchemaTable.d.ts +49 -0
- package/build/src/schemas/mysql/MySQLSchemaTable.d.ts.map +1 -0
- package/build/src/schemas/mysql/MySQLSchemaTable.js +310 -0
- package/build/src/schemas/mysql/MySQLSchemaTable.js.map +1 -0
- package/build-web/HotStaq.js +2 -0
- package/build-web/HotStaq.min.js +119 -0
- package/build-web/HotStaqTests_HelloWorldAPI.js +133 -0
- package/builder/docker/Dockerfile.linux.gen +42 -0
- package/builder/docker/README.md +36 -0
- package/builder/docker/app/start.sh +8 -0
- package/builder/docker/dockerignore +3 -0
- package/builder/docker/scripts/build.bat +11 -0
- package/builder/docker/scripts/build.sh +11 -0
- package/builder/docker/scripts/start-app.bat +7 -0
- package/builder/docker/scripts/start-app.sh +7 -0
- package/builder/docker/scripts/stop-app.bat +5 -0
- package/builder/docker/scripts/stop-app.sh +5 -0
- package/builder/docker-compose/docker-compose.gen.yaml +41 -0
- package/builder/docker-compose/env-skeleton +4 -0
- package/creator/project/.vscode/launch.json +59 -0
- package/creator/project/README.md +20 -0
- package/creator/project/gitignore +118 -0
- package/creator/project/npmignore +118 -0
- package/creator/public/api-test.hott +28 -0
- package/creator/public/index.hott +12 -0
- package/creator/ts/src/AppAPI.ts +30 -0
- package/creator/ts/src/HelloWorld.ts +39 -0
- package/creator/ts/src/WebExport.ts +7 -0
- package/creator/ts/tsconfig-web.json +73 -0
- package/creator/ts/tsconfig.json +73 -0
- package/creator/ts/webpack-api.config.js +57 -0
- package/dbstart.sh +19 -0
- package/dbstop.sh +4 -0
- package/docs/.nojekyll +1 -0
- package/docs/README.md +130 -0
- package/docs/classes/Hot.md +477 -0
- package/docs/classes/HotAPI.md +369 -0
- package/docs/classes/HotClient.md +95 -0
- package/docs/classes/HotComponent.md +279 -0
- package/docs/classes/HotDB.md +247 -0
- package/docs/classes/HotDBInflux.md +404 -0
- package/docs/classes/HotDBMigration.md +80 -0
- package/docs/classes/HotDBMySQL.md +310 -0
- package/docs/classes/HotDBSchema.md +51 -0
- package/docs/classes/HotFile.md +353 -0
- package/docs/classes/HotHTTPServer.md +700 -0
- package/docs/classes/HotLog.md +162 -0
- package/docs/classes/HotPage.md +357 -0
- package/docs/classes/HotRoute.md +312 -0
- package/docs/classes/HotRouteMethod.md +271 -0
- package/docs/classes/HotServer.md +311 -0
- package/docs/classes/HotStaq.md +1155 -0
- package/docs/classes/HotTestDestination.md +58 -0
- package/docs/classes/HotTestDriver.md +332 -0
- package/docs/classes/HotTestElement.md +88 -0
- package/docs/classes/HotTestElementOptions.md +71 -0
- package/docs/classes/HotTestMap.md +92 -0
- package/docs/classes/HotTestSeleniumDriver.md +542 -0
- package/docs/classes/HotTester.md +653 -0
- package/docs/classes/HotTesterAPI.md +493 -0
- package/docs/classes/HotTesterMocha.md +843 -0
- package/docs/classes/HotTesterMochaSelenium.md +896 -0
- package/docs/classes/HotTesterServer.md +633 -0
- package/docs/classes/InfluxSchema.md +74 -0
- package/docs/classes/MySQLSchema.md +199 -0
- package/docs/classes/MySQLSchemaField.md +330 -0
- package/docs/classes/MySQLSchemaTable.md +176 -0
- package/docs/enums/ConnectionStatus.md +43 -0
- package/docs/enums/DeveloperMode.md +38 -0
- package/docs/enums/EventExecutionType.md +43 -0
- package/docs/enums/HTTPMethod.md +32 -0
- package/docs/enums/HotDBGenerationType.md +30 -0
- package/docs/enums/HotLogLevel.md +88 -0
- package/docs/interfaces/HotDBConnectionInterface.md +116 -0
- package/docs/interfaces/HotDestination.md +62 -0
- package/docs/interfaces/HotSite.md +187 -0
- package/docs/interfaces/HotSiteMapPath.md +37 -0
- package/docs/interfaces/HotSiteRoute.md +79 -0
- package/docs/interfaces/HotStartOptions.md +115 -0
- package/docs/interfaces/HotTestPage.md +44 -0
- package/docs/interfaces/HotTestStop.md +62 -0
- package/docs/interfaces/IHotComponent.md +135 -0
- package/docs/interfaces/IHotStaq.md +118 -0
- package/docs/interfaces/IHotTestElement.md +54 -0
- package/docs/interfaces/IHotTestElementOptions.md +43 -0
- package/docs/interfaces/MySQLResults.md +43 -0
- package/docs/interfaces/MySQLSchemaFieldResult.md +75 -0
- package/docs/modules.md +182 -0
- package/package.json +65 -0
- package/selenium-start.sh +7 -0
- package/selenium-stop.sh +3 -0
- package/src/Hot.ts +319 -0
- package/src/HotAPI.ts +386 -0
- package/src/HotAgentAPI.ts +43 -0
- package/src/HotAgentRoute.ts +44 -0
- package/src/HotBuilder.ts +221 -0
- package/src/HotClient.ts +40 -0
- package/src/HotComponent.ts +158 -0
- package/src/HotCreator.ts +470 -0
- package/src/HotDB.ts +79 -0
- package/src/HotDBConnectionInterface.ts +40 -0
- package/src/HotFile.ts +617 -0
- package/src/HotGenerator.ts +446 -0
- package/src/HotHTTPServer.ts +954 -0
- package/src/HotIO.ts +160 -0
- package/src/HotLog.ts +158 -0
- package/src/HotPage.ts +206 -0
- package/src/HotRoute.ts +137 -0
- package/src/HotRouteMethod.ts +216 -0
- package/src/HotServer.ts +211 -0
- package/src/HotSetAsWeb.ts +3 -0
- package/src/HotStaq.ts +1881 -0
- package/src/HotTestDriver.ts +171 -0
- package/src/HotTestElement.ts +97 -0
- package/src/HotTestMap.ts +130 -0
- package/src/HotTestSeleniumDriver.ts +381 -0
- package/src/HotTester.ts +696 -0
- package/src/HotTesterAPI.ts +126 -0
- package/src/HotTesterMocha.ts +133 -0
- package/src/HotTesterMochaSelenium.ts +189 -0
- package/src/HotTesterServer.ts +551 -0
- package/src/api-web.ts +48 -0
- package/src/api.ts +103 -0
- package/src/cli.ts +1225 -0
- package/src/schemas/HotDBInflux.ts +211 -0
- package/src/schemas/HotDBMigration.ts +24 -0
- package/src/schemas/HotDBMySQL.ts +312 -0
- package/src/schemas/HotDBSchema.ts +21 -0
- package/src/schemas/influx/InfluxSchema.ts +19 -0
- package/src/schemas/mysql/MySQLSchema.ts +90 -0
- package/src/schemas/mysql/MySQLSchemaField.ts +408 -0
- package/src/schemas/mysql/MySQLSchemaTable.ts +353 -0
- package/temp/HotStaqWeb.ts +59 -0
- package/tsconfig-generator.json +17 -0
- package/tsconfig-web.json +74 -0
- package/tsconfig.json +73 -0
- package/webpack.config.generator.js +41 -0
- package/webpack.config.js +53 -0
- package/webpack.config.tests.js +56 -0
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
[hotstaq](../README.md) / [Modules](../modules.md) / HotTesterAPI
|
|
2
|
+
|
|
3
|
+
# Class: HotTesterAPI
|
|
4
|
+
|
|
5
|
+
## Hierarchy
|
|
6
|
+
|
|
7
|
+
- [`HotAPI`](HotAPI.md)
|
|
8
|
+
|
|
9
|
+
↳ **`HotTesterAPI`**
|
|
10
|
+
|
|
11
|
+
## Table of contents
|
|
12
|
+
|
|
13
|
+
### Constructors
|
|
14
|
+
|
|
15
|
+
- [constructor](HotTesterAPI.md#constructor)
|
|
16
|
+
|
|
17
|
+
### Properties
|
|
18
|
+
|
|
19
|
+
- [authCredentials](HotTesterAPI.md#authcredentials)
|
|
20
|
+
- [baseUrl](HotTesterAPI.md#baseurl)
|
|
21
|
+
- [connection](HotTesterAPI.md#connection)
|
|
22
|
+
- [createFunctions](HotTesterAPI.md#createfunctions)
|
|
23
|
+
- [db](HotTesterAPI.md#db)
|
|
24
|
+
- [executeEventsUsing](HotTesterAPI.md#executeeventsusing)
|
|
25
|
+
- [onPostRegister](HotTesterAPI.md#onpostregister)
|
|
26
|
+
- [onPreRegister](HotTesterAPI.md#onpreregister)
|
|
27
|
+
- [routes](HotTesterAPI.md#routes)
|
|
28
|
+
- [userAuth](HotTesterAPI.md#userauth)
|
|
29
|
+
|
|
30
|
+
### Methods
|
|
31
|
+
|
|
32
|
+
- [addRoute](HotTesterAPI.md#addroute)
|
|
33
|
+
- [executeTests](HotTesterAPI.md#executetests)
|
|
34
|
+
- [getDB](HotTesterAPI.md#getdb)
|
|
35
|
+
- [getDBSchema](HotTesterAPI.md#getdbschema)
|
|
36
|
+
- [makeCall](HotTesterAPI.md#makecall)
|
|
37
|
+
- [pageLoaded](HotTesterAPI.md#pageloaded)
|
|
38
|
+
- [registerRoute](HotTesterAPI.md#registerroute)
|
|
39
|
+
- [registerRoutes](HotTesterAPI.md#registerroutes)
|
|
40
|
+
- [setDBSchema](HotTesterAPI.md#setdbschema)
|
|
41
|
+
|
|
42
|
+
## Constructors
|
|
43
|
+
|
|
44
|
+
### constructor
|
|
45
|
+
|
|
46
|
+
• **new HotTesterAPI**(`baseUrl`, `connection?`, `db?`)
|
|
47
|
+
|
|
48
|
+
#### Parameters
|
|
49
|
+
|
|
50
|
+
| Name | Type | Default value |
|
|
51
|
+
| :------ | :------ | :------ |
|
|
52
|
+
| `baseUrl` | `string` | `undefined` |
|
|
53
|
+
| `connection` | [`HotServer`](HotServer.md) \| [`HotClient`](HotClient.md) | `null` |
|
|
54
|
+
| `db` | `any` | `null` |
|
|
55
|
+
|
|
56
|
+
#### Overrides
|
|
57
|
+
|
|
58
|
+
[HotAPI](HotAPI.md).[constructor](HotAPI.md#constructor)
|
|
59
|
+
|
|
60
|
+
#### Defined in
|
|
61
|
+
|
|
62
|
+
[HotTesterAPI.ts:11](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotTesterAPI.ts#L11)
|
|
63
|
+
|
|
64
|
+
## Properties
|
|
65
|
+
|
|
66
|
+
### authCredentials
|
|
67
|
+
|
|
68
|
+
• **authCredentials**: `any`
|
|
69
|
+
|
|
70
|
+
The authorization credentials to use throughout the application.
|
|
71
|
+
|
|
72
|
+
#### Inherited from
|
|
73
|
+
|
|
74
|
+
[HotAPI](HotAPI.md).[authCredentials](HotAPI.md#authcredentials)
|
|
75
|
+
|
|
76
|
+
#### Defined in
|
|
77
|
+
|
|
78
|
+
[HotAPI.ts:58](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L58)
|
|
79
|
+
|
|
80
|
+
___
|
|
81
|
+
|
|
82
|
+
### baseUrl
|
|
83
|
+
|
|
84
|
+
• **baseUrl**: `string`
|
|
85
|
+
|
|
86
|
+
The base url for the server.
|
|
87
|
+
|
|
88
|
+
#### Inherited from
|
|
89
|
+
|
|
90
|
+
[HotAPI](HotAPI.md).[baseUrl](HotAPI.md#baseurl)
|
|
91
|
+
|
|
92
|
+
#### Defined in
|
|
93
|
+
|
|
94
|
+
[HotAPI.ts:41](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L41)
|
|
95
|
+
|
|
96
|
+
___
|
|
97
|
+
|
|
98
|
+
### connection
|
|
99
|
+
|
|
100
|
+
• **connection**: [`HotServer`](HotServer.md) \| [`HotClient`](HotClient.md)
|
|
101
|
+
|
|
102
|
+
The server connection.
|
|
103
|
+
|
|
104
|
+
#### Inherited from
|
|
105
|
+
|
|
106
|
+
[HotAPI](HotAPI.md).[connection](HotAPI.md#connection)
|
|
107
|
+
|
|
108
|
+
#### Defined in
|
|
109
|
+
|
|
110
|
+
[HotAPI.ts:37](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L37)
|
|
111
|
+
|
|
112
|
+
___
|
|
113
|
+
|
|
114
|
+
### createFunctions
|
|
115
|
+
|
|
116
|
+
• **createFunctions**: `boolean`
|
|
117
|
+
|
|
118
|
+
If set, this will create the route variables and functions for
|
|
119
|
+
easy client/server calling.
|
|
120
|
+
|
|
121
|
+
#### Inherited from
|
|
122
|
+
|
|
123
|
+
[HotAPI](HotAPI.md).[createFunctions](HotAPI.md#createfunctions)
|
|
124
|
+
|
|
125
|
+
#### Defined in
|
|
126
|
+
|
|
127
|
+
[HotAPI.ts:46](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L46)
|
|
128
|
+
|
|
129
|
+
___
|
|
130
|
+
|
|
131
|
+
### db
|
|
132
|
+
|
|
133
|
+
• **db**: [`HotDB`](HotDB.md)<`any`, `any`, [`HotDBSchema`](HotDBSchema.md)\>
|
|
134
|
+
|
|
135
|
+
The database connection.
|
|
136
|
+
|
|
137
|
+
#### Inherited from
|
|
138
|
+
|
|
139
|
+
[HotAPI](HotAPI.md).[db](HotAPI.md#db)
|
|
140
|
+
|
|
141
|
+
#### Defined in
|
|
142
|
+
|
|
143
|
+
[HotAPI.ts:54](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L54)
|
|
144
|
+
|
|
145
|
+
___
|
|
146
|
+
|
|
147
|
+
### executeEventsUsing
|
|
148
|
+
|
|
149
|
+
• **executeEventsUsing**: [`EventExecutionType`](../enums/EventExecutionType.md)
|
|
150
|
+
|
|
151
|
+
The database connection.
|
|
152
|
+
|
|
153
|
+
#### Inherited from
|
|
154
|
+
|
|
155
|
+
[HotAPI](HotAPI.md).[executeEventsUsing](HotAPI.md#executeeventsusing)
|
|
156
|
+
|
|
157
|
+
#### Defined in
|
|
158
|
+
|
|
159
|
+
[HotAPI.ts:50](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L50)
|
|
160
|
+
|
|
161
|
+
___
|
|
162
|
+
|
|
163
|
+
### onPostRegister
|
|
164
|
+
|
|
165
|
+
• **onPostRegister**: () => `Promise`<`boolean`\>
|
|
166
|
+
|
|
167
|
+
#### Type declaration
|
|
168
|
+
|
|
169
|
+
▸ (): `Promise`<`boolean`\>
|
|
170
|
+
|
|
171
|
+
Executed when the API has finished registering routes. If
|
|
172
|
+
this function returns false, the server will not start.
|
|
173
|
+
|
|
174
|
+
##### Returns
|
|
175
|
+
|
|
176
|
+
`Promise`<`boolean`\>
|
|
177
|
+
|
|
178
|
+
#### Inherited from
|
|
179
|
+
|
|
180
|
+
[HotAPI](HotAPI.md).[onPostRegister](HotAPI.md#onpostregister)
|
|
181
|
+
|
|
182
|
+
#### Defined in
|
|
183
|
+
|
|
184
|
+
[HotAPI.ts:76](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L76)
|
|
185
|
+
|
|
186
|
+
___
|
|
187
|
+
|
|
188
|
+
### onPreRegister
|
|
189
|
+
|
|
190
|
+
• **onPreRegister**: () => `Promise`<`boolean`\>
|
|
191
|
+
|
|
192
|
+
#### Type declaration
|
|
193
|
+
|
|
194
|
+
▸ (): `Promise`<`boolean`\>
|
|
195
|
+
|
|
196
|
+
Executed when the API is about to start registering routes. If
|
|
197
|
+
this function returns false, the server will not start.
|
|
198
|
+
|
|
199
|
+
##### Returns
|
|
200
|
+
|
|
201
|
+
`Promise`<`boolean`\>
|
|
202
|
+
|
|
203
|
+
#### Inherited from
|
|
204
|
+
|
|
205
|
+
[HotAPI](HotAPI.md).[onPreRegister](HotAPI.md#onpreregister)
|
|
206
|
+
|
|
207
|
+
#### Defined in
|
|
208
|
+
|
|
209
|
+
[HotAPI.ts:71](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L71)
|
|
210
|
+
|
|
211
|
+
___
|
|
212
|
+
|
|
213
|
+
### routes
|
|
214
|
+
|
|
215
|
+
• **routes**: `Object`
|
|
216
|
+
|
|
217
|
+
The database connection.
|
|
218
|
+
|
|
219
|
+
#### Index signature
|
|
220
|
+
|
|
221
|
+
▪ [name: `string`]: [`HotRoute`](HotRoute.md)
|
|
222
|
+
|
|
223
|
+
#### Inherited from
|
|
224
|
+
|
|
225
|
+
[HotAPI](HotAPI.md).[routes](HotAPI.md#routes)
|
|
226
|
+
|
|
227
|
+
#### Defined in
|
|
228
|
+
|
|
229
|
+
[HotAPI.ts:66](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L66)
|
|
230
|
+
|
|
231
|
+
___
|
|
232
|
+
|
|
233
|
+
### userAuth
|
|
234
|
+
|
|
235
|
+
• **userAuth**: [`ServerAuthorizationFunction`](../modules.md#serverauthorizationfunction)
|
|
236
|
+
|
|
237
|
+
The function used for user authentication.
|
|
238
|
+
|
|
239
|
+
#### Inherited from
|
|
240
|
+
|
|
241
|
+
[HotAPI](HotAPI.md).[userAuth](HotAPI.md#userauth)
|
|
242
|
+
|
|
243
|
+
#### Defined in
|
|
244
|
+
|
|
245
|
+
[HotAPI.ts:62](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L62)
|
|
246
|
+
|
|
247
|
+
## Methods
|
|
248
|
+
|
|
249
|
+
### addRoute
|
|
250
|
+
|
|
251
|
+
▸ **addRoute**(`route`, `routeMethod?`, `executeFunction?`): `void`
|
|
252
|
+
|
|
253
|
+
Add a route. If this.createFunctions is set to true, this will take the incoming
|
|
254
|
+
route and create an object in this HotAPI object using the name of the route. If there's
|
|
255
|
+
any HotRouteMethods inside of the incoming HotRoute, it will create the methods
|
|
256
|
+
and attach them to the newly created HotRoute object.
|
|
257
|
+
|
|
258
|
+
Example:
|
|
259
|
+
```
|
|
260
|
+
export class Users extends HotRoute
|
|
261
|
+
{
|
|
262
|
+
constructor (api: FreeLightAPI)
|
|
263
|
+
{
|
|
264
|
+
super (api.connection, "user");
|
|
265
|
+
|
|
266
|
+
this.addMethod ("create", this._create, HTTPMethod.POST);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
protected async _create (req: any, res: any, authorizedValue: any, jsonObj: any, queryObj: any): Promise<any>
|
|
270
|
+
{
|
|
271
|
+
return (true);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
This in turn could be used like so:
|
|
277
|
+
```
|
|
278
|
+
Hot.API.user.create ({});
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Additionally it would create the endpoint: ```http://127.0.0.1:8080/v1/user/create```
|
|
282
|
+
|
|
283
|
+
#### Parameters
|
|
284
|
+
|
|
285
|
+
| Name | Type | Default value | Description |
|
|
286
|
+
| :------ | :------ | :------ | :------ |
|
|
287
|
+
| `route` | `string` \| [`HotRoute`](HotRoute.md) | `undefined` | The route to add. Can be either a full HotRoute object, or just the route's name. If a HotRoute object is supplied, the rest of the parameters will be ignored. |
|
|
288
|
+
| `routeMethod` | `string` \| [`HotRouteMethod`](HotRouteMethod.md) | `null` | The route's method to add. If the route parameter is a string, it will be interpreted as the route's name, and this will be the method added to the new route. |
|
|
289
|
+
| `executeFunction` | (`req`: `any`, `res`: `any`, `authorizedValue`: `any`, `jsonObj`: `any`, `queryObj`: `any`) => `Promise`<`any`\> | `null` | The function to execute when routeMethod is called by the API. |
|
|
290
|
+
|
|
291
|
+
#### Returns
|
|
292
|
+
|
|
293
|
+
`void`
|
|
294
|
+
|
|
295
|
+
#### Inherited from
|
|
296
|
+
|
|
297
|
+
[HotAPI](HotAPI.md).[addRoute](HotAPI.md#addroute)
|
|
298
|
+
|
|
299
|
+
#### Defined in
|
|
300
|
+
|
|
301
|
+
[HotAPI.ts:167](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L167)
|
|
302
|
+
|
|
303
|
+
___
|
|
304
|
+
|
|
305
|
+
### executeTests
|
|
306
|
+
|
|
307
|
+
▸ **executeTests**(`req`, `res`, `authorizedValue`, `jsonObj`, `queryObj`): `Promise`<`any`\>
|
|
308
|
+
|
|
309
|
+
Execute the tests for a page.
|
|
310
|
+
|
|
311
|
+
#### Parameters
|
|
312
|
+
|
|
313
|
+
| Name | Type |
|
|
314
|
+
| :------ | :------ |
|
|
315
|
+
| `req` | `any` |
|
|
316
|
+
| `res` | `any` |
|
|
317
|
+
| `authorizedValue` | `any` |
|
|
318
|
+
| `jsonObj` | `any` |
|
|
319
|
+
| `queryObj` | `any` |
|
|
320
|
+
|
|
321
|
+
#### Returns
|
|
322
|
+
|
|
323
|
+
`Promise`<`any`\>
|
|
324
|
+
|
|
325
|
+
#### Defined in
|
|
326
|
+
|
|
327
|
+
[HotTesterAPI.ts:104](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotTesterAPI.ts#L104)
|
|
328
|
+
|
|
329
|
+
___
|
|
330
|
+
|
|
331
|
+
### getDB
|
|
332
|
+
|
|
333
|
+
▸ **getDB**(): [`HotDB`](HotDB.md)<`any`, `any`, [`HotDBSchema`](HotDBSchema.md)\>
|
|
334
|
+
|
|
335
|
+
Get the database being used.
|
|
336
|
+
|
|
337
|
+
#### Returns
|
|
338
|
+
|
|
339
|
+
[`HotDB`](HotDB.md)<`any`, `any`, [`HotDBSchema`](HotDBSchema.md)\>
|
|
340
|
+
|
|
341
|
+
#### Inherited from
|
|
342
|
+
|
|
343
|
+
[HotAPI](HotAPI.md).[getDB](HotAPI.md#getdb)
|
|
344
|
+
|
|
345
|
+
#### Defined in
|
|
346
|
+
|
|
347
|
+
[HotAPI.ts:109](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L109)
|
|
348
|
+
|
|
349
|
+
___
|
|
350
|
+
|
|
351
|
+
### getDBSchema
|
|
352
|
+
|
|
353
|
+
▸ **getDBSchema**(): [`HotDBSchema`](HotDBSchema.md)
|
|
354
|
+
|
|
355
|
+
Get the database schema being used.
|
|
356
|
+
|
|
357
|
+
#### Returns
|
|
358
|
+
|
|
359
|
+
[`HotDBSchema`](HotDBSchema.md)
|
|
360
|
+
|
|
361
|
+
#### Inherited from
|
|
362
|
+
|
|
363
|
+
[HotAPI](HotAPI.md).[getDBSchema](HotAPI.md#getdbschema)
|
|
364
|
+
|
|
365
|
+
#### Defined in
|
|
366
|
+
|
|
367
|
+
[HotAPI.ts:120](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L120)
|
|
368
|
+
|
|
369
|
+
___
|
|
370
|
+
|
|
371
|
+
### makeCall
|
|
372
|
+
|
|
373
|
+
▸ **makeCall**(`route`, `data`, `httpMethod?`): `Promise`<`any`\>
|
|
374
|
+
|
|
375
|
+
Make a call to the API.
|
|
376
|
+
|
|
377
|
+
#### Parameters
|
|
378
|
+
|
|
379
|
+
| Name | Type | Default value |
|
|
380
|
+
| :------ | :------ | :------ |
|
|
381
|
+
| `route` | `string` | `undefined` |
|
|
382
|
+
| `data` | `any` | `undefined` |
|
|
383
|
+
| `httpMethod` | `string` | `"POST"` |
|
|
384
|
+
|
|
385
|
+
#### Returns
|
|
386
|
+
|
|
387
|
+
`Promise`<`any`\>
|
|
388
|
+
|
|
389
|
+
#### Inherited from
|
|
390
|
+
|
|
391
|
+
[HotAPI](HotAPI.md).[makeCall](HotAPI.md#makecall)
|
|
392
|
+
|
|
393
|
+
#### Defined in
|
|
394
|
+
|
|
395
|
+
[HotAPI.ts:343](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L343)
|
|
396
|
+
|
|
397
|
+
___
|
|
398
|
+
|
|
399
|
+
### pageLoaded
|
|
400
|
+
|
|
401
|
+
▸ **pageLoaded**(`req`, `res`, `authorizedValue`, `jsonObj`, `queryObj`): `Promise`<`any`\>
|
|
402
|
+
|
|
403
|
+
This is called when the page has finished loading in development mode.
|
|
404
|
+
|
|
405
|
+
#### Parameters
|
|
406
|
+
|
|
407
|
+
| Name | Type |
|
|
408
|
+
| :------ | :------ |
|
|
409
|
+
| `req` | `any` |
|
|
410
|
+
| `res` | `any` |
|
|
411
|
+
| `authorizedValue` | `any` |
|
|
412
|
+
| `jsonObj` | `any` |
|
|
413
|
+
| `queryObj` | `any` |
|
|
414
|
+
|
|
415
|
+
#### Returns
|
|
416
|
+
|
|
417
|
+
`Promise`<`any`\>
|
|
418
|
+
|
|
419
|
+
#### Defined in
|
|
420
|
+
|
|
421
|
+
[HotTesterAPI.ts:26](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotTesterAPI.ts#L26)
|
|
422
|
+
|
|
423
|
+
___
|
|
424
|
+
|
|
425
|
+
### registerRoute
|
|
426
|
+
|
|
427
|
+
▸ **registerRoute**(`route`): `Promise`<`void`\>
|
|
428
|
+
|
|
429
|
+
Register a route with the server.
|
|
430
|
+
|
|
431
|
+
#### Parameters
|
|
432
|
+
|
|
433
|
+
| Name | Type |
|
|
434
|
+
| :------ | :------ |
|
|
435
|
+
| `route` | [`HotRoute`](HotRoute.md) |
|
|
436
|
+
|
|
437
|
+
#### Returns
|
|
438
|
+
|
|
439
|
+
`Promise`<`void`\>
|
|
440
|
+
|
|
441
|
+
#### Inherited from
|
|
442
|
+
|
|
443
|
+
[HotAPI](HotAPI.md).[registerRoute](HotAPI.md#registerroute)
|
|
444
|
+
|
|
445
|
+
#### Defined in
|
|
446
|
+
|
|
447
|
+
[HotAPI.ts:321](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L321)
|
|
448
|
+
|
|
449
|
+
___
|
|
450
|
+
|
|
451
|
+
### registerRoutes
|
|
452
|
+
|
|
453
|
+
▸ **registerRoutes**(): `Promise`<`void`\>
|
|
454
|
+
|
|
455
|
+
Register all routes with the server.
|
|
456
|
+
|
|
457
|
+
#### Returns
|
|
458
|
+
|
|
459
|
+
`Promise`<`void`\>
|
|
460
|
+
|
|
461
|
+
#### Inherited from
|
|
462
|
+
|
|
463
|
+
[HotAPI](HotAPI.md).[registerRoutes](HotAPI.md#registerroutes)
|
|
464
|
+
|
|
465
|
+
#### Defined in
|
|
466
|
+
|
|
467
|
+
[HotAPI.ts:330](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L330)
|
|
468
|
+
|
|
469
|
+
___
|
|
470
|
+
|
|
471
|
+
### setDBSchema
|
|
472
|
+
|
|
473
|
+
▸ **setDBSchema**(`schema`): `void`
|
|
474
|
+
|
|
475
|
+
Set the database schema for use.
|
|
476
|
+
|
|
477
|
+
#### Parameters
|
|
478
|
+
|
|
479
|
+
| Name | Type |
|
|
480
|
+
| :------ | :------ |
|
|
481
|
+
| `schema` | [`HotDBSchema`](HotDBSchema.md) |
|
|
482
|
+
|
|
483
|
+
#### Returns
|
|
484
|
+
|
|
485
|
+
`void`
|
|
486
|
+
|
|
487
|
+
#### Inherited from
|
|
488
|
+
|
|
489
|
+
[HotAPI](HotAPI.md).[setDBSchema](HotAPI.md#setdbschema)
|
|
490
|
+
|
|
491
|
+
#### Defined in
|
|
492
|
+
|
|
493
|
+
[HotAPI.ts:95](https://github.com/OurFreeLight/HotStaq/blob/b031357/src/HotAPI.ts#L95)
|