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,137 @@
|
|
|
1
|
+
import { HotServer } from "./HotServer";
|
|
2
|
+
import { HotRoute } from "./HotRoute";
|
|
3
|
+
import { HotClient } from "./HotClient";
|
|
4
|
+
import { HotRouteMethod, ServerAuthorizationFunction } from "./HotRouteMethod";
|
|
5
|
+
import { HotDB } from "./HotDB";
|
|
6
|
+
import { HotDBSchema } from "./schemas/HotDBSchema";
|
|
7
|
+
/**
|
|
8
|
+
* The API to load.
|
|
9
|
+
*/
|
|
10
|
+
export declare type APItoLoad = {
|
|
11
|
+
exportedClassName: string;
|
|
12
|
+
path: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The type of object to use during event executions.
|
|
16
|
+
*/
|
|
17
|
+
export declare enum EventExecutionType {
|
|
18
|
+
HotRoute = 0,
|
|
19
|
+
HotMethod = 1,
|
|
20
|
+
HotAPI = 2
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The API to use.
|
|
24
|
+
*/
|
|
25
|
+
export declare abstract class HotAPI {
|
|
26
|
+
/**
|
|
27
|
+
* The server connection.
|
|
28
|
+
*/
|
|
29
|
+
connection: HotServer | HotClient;
|
|
30
|
+
/**
|
|
31
|
+
* The base url for the server.
|
|
32
|
+
*/
|
|
33
|
+
baseUrl: string;
|
|
34
|
+
/**
|
|
35
|
+
* If set, this will create the route variables and functions for
|
|
36
|
+
* easy client/server calling.
|
|
37
|
+
*/
|
|
38
|
+
createFunctions: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The database connection.
|
|
41
|
+
*/
|
|
42
|
+
executeEventsUsing: EventExecutionType;
|
|
43
|
+
/**
|
|
44
|
+
* The database connection.
|
|
45
|
+
*/
|
|
46
|
+
db: HotDB;
|
|
47
|
+
/**
|
|
48
|
+
* The authorization credentials to use throughout the application.
|
|
49
|
+
*/
|
|
50
|
+
authCredentials: any;
|
|
51
|
+
/**
|
|
52
|
+
* The function used for user authentication.
|
|
53
|
+
*/
|
|
54
|
+
userAuth: ServerAuthorizationFunction;
|
|
55
|
+
/**
|
|
56
|
+
* The database connection.
|
|
57
|
+
*/
|
|
58
|
+
routes: {
|
|
59
|
+
[name: string]: HotRoute;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Executed when the API is about to start registering routes. If
|
|
63
|
+
* this function returns false, the server will not start.
|
|
64
|
+
*/
|
|
65
|
+
onPreRegister: () => Promise<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* Executed when the API has finished registering routes. If
|
|
68
|
+
* this function returns false, the server will not start.
|
|
69
|
+
*/
|
|
70
|
+
onPostRegister: () => Promise<boolean>;
|
|
71
|
+
constructor(baseUrl: string, connection?: HotServer | HotClient, db?: HotDB);
|
|
72
|
+
/**
|
|
73
|
+
* Set the database schema for use.
|
|
74
|
+
*/
|
|
75
|
+
setDBSchema(schema: HotDBSchema): void;
|
|
76
|
+
/**
|
|
77
|
+
* Get the database being used.
|
|
78
|
+
*/
|
|
79
|
+
getDB(): HotDB;
|
|
80
|
+
/**
|
|
81
|
+
* Get the database schema being used.
|
|
82
|
+
*/
|
|
83
|
+
getDBSchema(): HotDBSchema;
|
|
84
|
+
/**
|
|
85
|
+
* Add a route. If this.createFunctions is set to true, this will take the incoming
|
|
86
|
+
* route and create an object in this HotAPI object using the name of the route. If there's
|
|
87
|
+
* any HotRouteMethods inside of the incoming HotRoute, it will create the methods
|
|
88
|
+
* and attach them to the newly created HotRoute object.
|
|
89
|
+
*
|
|
90
|
+
* Example:
|
|
91
|
+
* ```
|
|
92
|
+
* export class Users extends HotRoute
|
|
93
|
+
* {
|
|
94
|
+
* constructor (api: FreeLightAPI)
|
|
95
|
+
* {
|
|
96
|
+
* super (api.connection, "user");
|
|
97
|
+
*
|
|
98
|
+
* this.addMethod ("create", this._create, HTTPMethod.POST);
|
|
99
|
+
* }
|
|
100
|
+
*
|
|
101
|
+
* protected async _create (req: any, res: any, authorizedValue: any, jsonObj: any, queryObj: any): Promise<any>
|
|
102
|
+
* {
|
|
103
|
+
* return (true);
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* This in turn could be used like so:
|
|
109
|
+
* ```
|
|
110
|
+
* Hot.API.user.create ({});
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* Additionally it would create the endpoint: ```http://127.0.0.1:8080/v1/user/create```
|
|
114
|
+
*
|
|
115
|
+
* @param route The route to add. Can be either a full HotRoute object, or just
|
|
116
|
+
* the route's name. If a HotRoute object is supplied, the rest of the parameters
|
|
117
|
+
* will be ignored.
|
|
118
|
+
* @param routeMethod The route's method to add. If the route parameter is a string,
|
|
119
|
+
* it will be interpreted as the route's name, and this will be the method added to
|
|
120
|
+
* the new route.
|
|
121
|
+
* @param executeFunction The function to execute when routeMethod is called by the API.
|
|
122
|
+
*/
|
|
123
|
+
addRoute(route: HotRoute | string, routeMethod?: HotRouteMethod | string, executeFunction?: (req: any, res: any, authorizedValue: any, jsonObj: any, queryObj: any) => Promise<any>): void;
|
|
124
|
+
/**
|
|
125
|
+
* Register a route with the server.
|
|
126
|
+
*/
|
|
127
|
+
registerRoute(route: HotRoute): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Register all routes with the server.
|
|
130
|
+
*/
|
|
131
|
+
registerRoutes(): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Make a call to the API.
|
|
134
|
+
*/
|
|
135
|
+
makeCall(route: string, data: any, httpMethod?: string): Promise<any>;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=HotAPI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotAPI.d.ts","sourceRoot":"","sources":["../../src/HotAPI.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;GAEG;AACH,oBAAY,SAAS,GAAG;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;CACZ,CAAC;AAEH;;GAEG;AACH,oBAAY,kBAAkB;IAE7B,QAAQ,IAAA;IACR,SAAS,IAAA;IACT,MAAM,IAAA;CACN;AAED;;GAEG;AACH,8BAAsB,MAAM;IAE3B;;OAEG;IACH,UAAU,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,kBAAkB,EAAE,kBAAkB,CAAC;IACvC;;OAEG;IACH,EAAE,EAAE,KAAK,CAAC;IACV;;OAEG;IACH,eAAe,EAAE,GAAG,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,2BAA2B,CAAC;IACtC;;OAEG;IACH,MAAM,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAC;IACrC;;;OAGG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC;;;OAGG;IACH,cAAc,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;gBAE1B,OAAO,EAAE,MAAM,EAAE,UAAU,GAAE,SAAS,GAAG,SAAgB,EAAE,EAAE,GAAE,KAAY;IAcxF;;OAEG;IACH,WAAW,CAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAWvC;;OAEG;IACH,KAAK,IAAK,KAAK;IAQf;;OAEG;IACH,WAAW,IAAK,WAAW;IAQ3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,QAAQ,CACP,KAAK,EAAE,QAAQ,GAAG,MAAM,EACxB,WAAW,GAAE,cAAc,GAAG,MAAa,EAC3C,eAAe,GAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAQ,GAC5G,IAAI;IAmJR;;OAEG;IACG,aAAa,CAAE,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAMpD;;OAEG;IACG,cAAc,IAAK,OAAO,CAAC,IAAI,CAAC;IAUtC;;OAEG;IACG,QAAQ,CAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,GAAE,MAAe,GAAG,OAAO,CAAC,GAAG,CAAC;CA2CpF"}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.HotAPI = exports.EventExecutionType = void 0;
|
|
43
|
+
var cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
44
|
+
var HotServer_1 = require("./HotServer");
|
|
45
|
+
var HotRoute_1 = require("./HotRoute");
|
|
46
|
+
var HotRouteMethod_1 = require("./HotRouteMethod");
|
|
47
|
+
/**
|
|
48
|
+
* The type of object to use during event executions.
|
|
49
|
+
*/
|
|
50
|
+
var EventExecutionType;
|
|
51
|
+
(function (EventExecutionType) {
|
|
52
|
+
EventExecutionType[EventExecutionType["HotRoute"] = 0] = "HotRoute";
|
|
53
|
+
EventExecutionType[EventExecutionType["HotMethod"] = 1] = "HotMethod";
|
|
54
|
+
EventExecutionType[EventExecutionType["HotAPI"] = 2] = "HotAPI";
|
|
55
|
+
})(EventExecutionType = exports.EventExecutionType || (exports.EventExecutionType = {}));
|
|
56
|
+
/**
|
|
57
|
+
* The API to use.
|
|
58
|
+
*/
|
|
59
|
+
var HotAPI = /** @class */ (function () {
|
|
60
|
+
function HotAPI(baseUrl, connection, db) {
|
|
61
|
+
if (connection === void 0) { connection = null; }
|
|
62
|
+
if (db === void 0) { db = null; }
|
|
63
|
+
this.connection = connection;
|
|
64
|
+
this.baseUrl = baseUrl;
|
|
65
|
+
this.createFunctions = true;
|
|
66
|
+
this.executeEventsUsing = EventExecutionType.HotRoute;
|
|
67
|
+
this.db = db;
|
|
68
|
+
this.authCredentials = null;
|
|
69
|
+
this.userAuth = null;
|
|
70
|
+
this.routes = {};
|
|
71
|
+
this.onPreRegister = null;
|
|
72
|
+
this.onPostRegister = null;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Set the database schema for use.
|
|
76
|
+
*/
|
|
77
|
+
HotAPI.prototype.setDBSchema = function (schema) {
|
|
78
|
+
if (this.connection.api == null)
|
|
79
|
+
throw new Error("No API has been set!");
|
|
80
|
+
if (this.connection.api.db == null)
|
|
81
|
+
throw new Error("No database has been set for API base url ".concat(this.connection.api.baseUrl));
|
|
82
|
+
this.connection.api.db.schema = schema;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Get the database being used.
|
|
86
|
+
*/
|
|
87
|
+
HotAPI.prototype.getDB = function () {
|
|
88
|
+
if (this.connection.api.db == null)
|
|
89
|
+
throw new Error("No database has been set for API base url ".concat(this.connection.api.baseUrl));
|
|
90
|
+
return (this.connection.api.db);
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Get the database schema being used.
|
|
94
|
+
*/
|
|
95
|
+
HotAPI.prototype.getDBSchema = function () {
|
|
96
|
+
if (this.connection.api.db == null)
|
|
97
|
+
throw new Error("No database has been set for API base url ".concat(this.connection.api.baseUrl));
|
|
98
|
+
return (this.connection.api.db.schema);
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Add a route. If this.createFunctions is set to true, this will take the incoming
|
|
102
|
+
* route and create an object in this HotAPI object using the name of the route. If there's
|
|
103
|
+
* any HotRouteMethods inside of the incoming HotRoute, it will create the methods
|
|
104
|
+
* and attach them to the newly created HotRoute object.
|
|
105
|
+
*
|
|
106
|
+
* Example:
|
|
107
|
+
* ```
|
|
108
|
+
* export class Users extends HotRoute
|
|
109
|
+
* {
|
|
110
|
+
* constructor (api: FreeLightAPI)
|
|
111
|
+
* {
|
|
112
|
+
* super (api.connection, "user");
|
|
113
|
+
*
|
|
114
|
+
* this.addMethod ("create", this._create, HTTPMethod.POST);
|
|
115
|
+
* }
|
|
116
|
+
*
|
|
117
|
+
* protected async _create (req: any, res: any, authorizedValue: any, jsonObj: any, queryObj: any): Promise<any>
|
|
118
|
+
* {
|
|
119
|
+
* return (true);
|
|
120
|
+
* }
|
|
121
|
+
* }
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* This in turn could be used like so:
|
|
125
|
+
* ```
|
|
126
|
+
* Hot.API.user.create ({});
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
129
|
+
* Additionally it would create the endpoint: ```http://127.0.0.1:8080/v1/user/create```
|
|
130
|
+
*
|
|
131
|
+
* @param route The route to add. Can be either a full HotRoute object, or just
|
|
132
|
+
* the route's name. If a HotRoute object is supplied, the rest of the parameters
|
|
133
|
+
* will be ignored.
|
|
134
|
+
* @param routeMethod The route's method to add. If the route parameter is a string,
|
|
135
|
+
* it will be interpreted as the route's name, and this will be the method added to
|
|
136
|
+
* the new route.
|
|
137
|
+
* @param executeFunction The function to execute when routeMethod is called by the API.
|
|
138
|
+
*/
|
|
139
|
+
HotAPI.prototype.addRoute = function (route, routeMethod, executeFunction) {
|
|
140
|
+
var _this = this;
|
|
141
|
+
if (routeMethod === void 0) { routeMethod = null; }
|
|
142
|
+
if (executeFunction === void 0) { executeFunction = null; }
|
|
143
|
+
var routeName = "";
|
|
144
|
+
if (route instanceof HotRoute_1.HotRoute) {
|
|
145
|
+
routeName = route.route;
|
|
146
|
+
this.routes[route.route] = route;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
routeName = route;
|
|
150
|
+
if (this.routes[routeName] == null)
|
|
151
|
+
this.routes[routeName] = new HotRoute_1.HotRoute(this.connection, routeName);
|
|
152
|
+
if (routeMethod instanceof HotRouteMethod_1.HotRouteMethod)
|
|
153
|
+
this.routes[routeName].addMethod(routeMethod);
|
|
154
|
+
else {
|
|
155
|
+
this.routes[routeName].addMethod(new HotRouteMethod_1.HotRouteMethod(this.routes[routeName], routeMethod, executeFunction));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
this.routes[routeName].connection = this.connection;
|
|
159
|
+
// Create the route functions for the server/client.
|
|
160
|
+
if (this.createFunctions === true) {
|
|
161
|
+
// @ts-ignore
|
|
162
|
+
var newRoute = this[routeName];
|
|
163
|
+
if (newRoute == null)
|
|
164
|
+
newRoute = {};
|
|
165
|
+
var _loop_1 = function (iIdx) {
|
|
166
|
+
var currentRoute = this_1.routes[routeName];
|
|
167
|
+
var newRouteMethod = this_1.routes[routeName].methods[iIdx];
|
|
168
|
+
/*
|
|
169
|
+
/// @fixme Is this really necessary? A HTTP call is much more preferable,
|
|
170
|
+
/// especially for accruate testing.
|
|
171
|
+
if (this.connection instanceof HotServer)
|
|
172
|
+
{
|
|
173
|
+
if (newRouteMethod.onServerExecute != null)
|
|
174
|
+
newRoute[newRouteMethod.name] = newRouteMethod.onServerExecute;
|
|
175
|
+
}
|
|
176
|
+
else*/
|
|
177
|
+
{
|
|
178
|
+
/*
|
|
179
|
+
/// @fixme Is onClientExecute necessary? I'm thinking the dev can just simply create
|
|
180
|
+
/// their own function to call.
|
|
181
|
+
if (newRouteMethod.onClientExecute != null)
|
|
182
|
+
newRoute[newRouteMethod.name] = newRouteMethod.onClientExecute;
|
|
183
|
+
else
|
|
184
|
+
{*/
|
|
185
|
+
newRoute[newRouteMethod.name] = function (data) {
|
|
186
|
+
var httpMethod = newRouteMethod.type;
|
|
187
|
+
// Construct the url here. Base + route + route method
|
|
188
|
+
var routeStr = "";
|
|
189
|
+
if (currentRoute.version !== "")
|
|
190
|
+
routeStr += "/".concat(currentRoute.version);
|
|
191
|
+
if (currentRoute.route !== "")
|
|
192
|
+
routeStr += "/".concat(currentRoute.route);
|
|
193
|
+
if (newRouteMethod.name !== "")
|
|
194
|
+
routeStr += "/".concat(newRouteMethod.name);
|
|
195
|
+
var authCredentials = null;
|
|
196
|
+
// Getting the authorization credentials from the API is the lowest
|
|
197
|
+
// priority for getting credentials. The priorities are in this order:
|
|
198
|
+
// 1. HotRouteMethod
|
|
199
|
+
// 2. HotRoute
|
|
200
|
+
// 3. HotAPI
|
|
201
|
+
if (_this.authCredentials != null)
|
|
202
|
+
authCredentials = _this.authCredentials;
|
|
203
|
+
// Find the authorization credentials. Prioritize them when they're
|
|
204
|
+
// in the method. Only add the ones from the route if the ones from
|
|
205
|
+
// the method are missing.
|
|
206
|
+
if (newRouteMethod.authCredentials != null)
|
|
207
|
+
authCredentials = newRouteMethod.authCredentials;
|
|
208
|
+
else {
|
|
209
|
+
if (newRouteMethod.parentRoute.authCredentials != null)
|
|
210
|
+
authCredentials = newRouteMethod.parentRoute.authCredentials;
|
|
211
|
+
}
|
|
212
|
+
if (authCredentials == null) {
|
|
213
|
+
// @ts-ignore
|
|
214
|
+
if (typeof (Hot) !== "undefined") {
|
|
215
|
+
// @ts-ignore
|
|
216
|
+
if (Hot != null) {
|
|
217
|
+
// @ts-ignore
|
|
218
|
+
if (Hot.API != null) {
|
|
219
|
+
// @ts-ignore
|
|
220
|
+
if (Hot.API[currentRoute.route] != null) {
|
|
221
|
+
// @ts-ignore
|
|
222
|
+
if (Hot.API[currentRoute.route].authCredentials != null) {
|
|
223
|
+
// @ts-ignore
|
|
224
|
+
authCredentials = Hot.API[currentRoute.route].authCredentials;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (authCredentials != null) {
|
|
232
|
+
// Add the authorization credentials to the data being sent.
|
|
233
|
+
for (var key in authCredentials) {
|
|
234
|
+
var authCredential = authCredentials[key];
|
|
235
|
+
// Do not overwrite any existing keys in the data about
|
|
236
|
+
// to be sent.
|
|
237
|
+
if (data[key] == null)
|
|
238
|
+
data[key] = authCredential;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
var args = [routeStr, data, httpMethod];
|
|
242
|
+
return (_this.makeCall.apply(_this, args));
|
|
243
|
+
};
|
|
244
|
+
//}
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
var this_1 = this;
|
|
248
|
+
for (var iIdx = 0; iIdx < this.routes[routeName].methods.length; iIdx++) {
|
|
249
|
+
_loop_1(iIdx);
|
|
250
|
+
}
|
|
251
|
+
// @ts-ignore
|
|
252
|
+
this[routeName] = newRoute;
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* Register a route with the server.
|
|
257
|
+
*/
|
|
258
|
+
HotAPI.prototype.registerRoute = function (route) {
|
|
259
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
260
|
+
return __generator(this, function (_a) {
|
|
261
|
+
switch (_a.label) {
|
|
262
|
+
case 0:
|
|
263
|
+
if (!(this.connection instanceof HotServer_1.HotServer)) return [3 /*break*/, 2];
|
|
264
|
+
return [4 /*yield*/, this.connection.registerRoute(route)];
|
|
265
|
+
case 1:
|
|
266
|
+
_a.sent();
|
|
267
|
+
_a.label = 2;
|
|
268
|
+
case 2: return [2 /*return*/];
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Register all routes with the server.
|
|
275
|
+
*/
|
|
276
|
+
HotAPI.prototype.registerRoutes = function () {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
278
|
+
var _a, _b, _i, key, route;
|
|
279
|
+
return __generator(this, function (_c) {
|
|
280
|
+
switch (_c.label) {
|
|
281
|
+
case 0:
|
|
282
|
+
_a = [];
|
|
283
|
+
for (_b in this.routes)
|
|
284
|
+
_a.push(_b);
|
|
285
|
+
_i = 0;
|
|
286
|
+
_c.label = 1;
|
|
287
|
+
case 1:
|
|
288
|
+
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
289
|
+
key = _a[_i];
|
|
290
|
+
route = this.routes[key];
|
|
291
|
+
return [4 /*yield*/, this.registerRoute(route)];
|
|
292
|
+
case 2:
|
|
293
|
+
_c.sent();
|
|
294
|
+
_c.label = 3;
|
|
295
|
+
case 3:
|
|
296
|
+
_i++;
|
|
297
|
+
return [3 /*break*/, 1];
|
|
298
|
+
case 4: return [2 /*return*/];
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* Make a call to the API.
|
|
305
|
+
*/
|
|
306
|
+
HotAPI.prototype.makeCall = function (route, data, httpMethod) {
|
|
307
|
+
if (httpMethod === void 0) { httpMethod = "POST"; }
|
|
308
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
309
|
+
var url, fetchObj, res, ex_1, jsonObj;
|
|
310
|
+
return __generator(this, function (_a) {
|
|
311
|
+
switch (_a.label) {
|
|
312
|
+
case 0:
|
|
313
|
+
url = this.baseUrl;
|
|
314
|
+
if (url[(url.length - 1)] === "/")
|
|
315
|
+
url = url.substr(0, (url.length - 1));
|
|
316
|
+
if (route[0] !== "/")
|
|
317
|
+
url += "/";
|
|
318
|
+
url += route;
|
|
319
|
+
httpMethod = httpMethod.toUpperCase();
|
|
320
|
+
fetchObj = {
|
|
321
|
+
method: httpMethod,
|
|
322
|
+
headers: {
|
|
323
|
+
"Accept": "application/json",
|
|
324
|
+
"Content-Type": "application/json"
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
if ((httpMethod !== "GET") &&
|
|
328
|
+
(httpMethod !== "HEAD")) {
|
|
329
|
+
fetchObj["body"] = JSON.stringify(data);
|
|
330
|
+
}
|
|
331
|
+
res = null;
|
|
332
|
+
_a.label = 1;
|
|
333
|
+
case 1:
|
|
334
|
+
_a.trys.push([1, 3, , 4]);
|
|
335
|
+
return [4 /*yield*/, (0, cross_fetch_1.default)(url, fetchObj)];
|
|
336
|
+
case 2:
|
|
337
|
+
res = _a.sent();
|
|
338
|
+
return [3 /*break*/, 4];
|
|
339
|
+
case 3:
|
|
340
|
+
ex_1 = _a.sent();
|
|
341
|
+
throw ex_1;
|
|
342
|
+
case 4: return [4 /*yield*/, res.json()];
|
|
343
|
+
case 5:
|
|
344
|
+
jsonObj = _a.sent();
|
|
345
|
+
return [2 /*return*/, (jsonObj)];
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
return HotAPI;
|
|
351
|
+
}());
|
|
352
|
+
exports.HotAPI = HotAPI;
|
|
353
|
+
//# sourceMappingURL=HotAPI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotAPI.js","sourceRoot":"","sources":["../../src/HotAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAAgC;AAEhC,yCAAwC;AACxC,uCAAsC;AAEtC,mDAA+E;AAa/E;;GAEG;AACH,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAE7B,mEAAQ,CAAA;IACR,qEAAS,CAAA;IACT,+DAAM,CAAA;AACP,CAAC,EALW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAK7B;AAED;;GAEG;AACH;IA8CC,gBAAa,OAAe,EAAE,UAAwC,EAAE,EAAgB;QAA1D,2BAAA,EAAA,iBAAwC;QAAE,mBAAA,EAAA,SAAgB;QAEvF,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC,QAAQ,CAAC;QACtD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED;;OAEG;IAC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wBAAM"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HotAPI, HotServer, HotClient } from "./api";
|
|
2
|
+
/**
|
|
3
|
+
* The App's API and routes.
|
|
4
|
+
*/
|
|
5
|
+
export declare class HotAgentAPI extends HotAPI {
|
|
6
|
+
/**
|
|
7
|
+
* The key to use.
|
|
8
|
+
*/
|
|
9
|
+
key: string;
|
|
10
|
+
/**
|
|
11
|
+
* The secret key to use.
|
|
12
|
+
*/
|
|
13
|
+
secret: string;
|
|
14
|
+
/**
|
|
15
|
+
* The commands to execute.
|
|
16
|
+
*/
|
|
17
|
+
commands: {
|
|
18
|
+
[name: string]: string;
|
|
19
|
+
};
|
|
20
|
+
constructor(baseUrl: string, connection?: HotServer | HotClient, db?: any);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=HotAgentAPI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotAgentAPI.d.ts","sourceRoot":"","sources":["../../src/HotAgentAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD;;GAEG;AACH,qBAAa,WAAY,SAAQ,MAAM;IAEnC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;gBAE3B,OAAO,EAAE,MAAM,EAAE,UAAU,GAAE,SAAS,GAAG,SAAgB,EAAE,EAAE,GAAE,GAAU;CAqBtF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
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;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.HotAgentAPI = void 0;
|
|
55
|
+
var api_1 = require("./api");
|
|
56
|
+
var HotAgentRoute_1 = require("./HotAgentRoute");
|
|
57
|
+
/**
|
|
58
|
+
* The App's API and routes.
|
|
59
|
+
*/
|
|
60
|
+
var HotAgentAPI = /** @class */ (function (_super) {
|
|
61
|
+
__extends(HotAgentAPI, _super);
|
|
62
|
+
function HotAgentAPI(baseUrl, connection, db) {
|
|
63
|
+
if (connection === void 0) { connection = null; }
|
|
64
|
+
if (db === void 0) { db = null; }
|
|
65
|
+
var _this = _super.call(this, baseUrl, connection, db) || this;
|
|
66
|
+
_this.key = "";
|
|
67
|
+
_this.secret = "";
|
|
68
|
+
_this.commands = {};
|
|
69
|
+
_this.userAuth = function (req, res, jsonObj, queryObj) { return __awaiter(_this, void 0, void 0, function () {
|
|
70
|
+
var apiKey, apiSecret;
|
|
71
|
+
return __generator(this, function (_a) {
|
|
72
|
+
apiKey = jsonObj["key"];
|
|
73
|
+
apiSecret = jsonObj["secret"];
|
|
74
|
+
if ((apiKey !== this.key) && (apiSecret !== this.secret))
|
|
75
|
+
throw new Error("Incorrect API key or secret!");
|
|
76
|
+
return [2 /*return*/, (true)];
|
|
77
|
+
});
|
|
78
|
+
}); };
|
|
79
|
+
_this.addRoute(new HotAgentRoute_1.HotAgentRoute(_this));
|
|
80
|
+
return _this;
|
|
81
|
+
}
|
|
82
|
+
return HotAgentAPI;
|
|
83
|
+
}(api_1.HotAPI));
|
|
84
|
+
exports.HotAgentAPI = HotAgentAPI;
|
|
85
|
+
//# sourceMappingURL=HotAgentAPI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotAgentAPI.js","sourceRoot":"","sources":["../../src/HotAgentAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAqD;AACrD,iDAAgD;AAEhD;;GAEG;AACH;IAAiC,+BAAM;IAetC,qBAAa,OAAe,EAAE,UAAwC,EAAE,EAAc;QAAxD,2BAAA,EAAA,iBAAwC;QAAE,mBAAA,EAAA,SAAc;QAAtF,YAEC,kBAAM,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,SAkB9B;QAhBM,KAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,KAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,KAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QAEnB,KAAI,CAAC,QAAQ,GAAG,UAAO,GAAQ,EAAE,GAAQ,EAAE,OAAY,EAAE,QAAa;;;gBAExD,MAAM,GAAW,OAAO,CAAC,KAAK,CAAC,CAAC;gBAChC,SAAS,GAAW,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAE5C,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,MAAM,CAAC;oBACpD,MAAM,IAAI,KAAK,CAAE,8BAA8B,CAAC,CAAC;gBAErD,sBAAO,CAAC,IAAI,CAAC,EAAC;;aACjB,CAAC;QAEZ,KAAI,CAAC,QAAQ,CAAE,IAAI,6BAAa,CAAE,KAAI,CAAC,CAAC,CAAC;;IAC1C,CAAC;IACF,kBAAC;AAAD,CAAC,AApCD,CAAiC,YAAM,GAoCtC;AApCY,kCAAW"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HotRoute } from "./api";
|
|
2
|
+
import { HotAgentAPI } from "./HotAgentAPI";
|
|
3
|
+
/**
|
|
4
|
+
* Hello world route.
|
|
5
|
+
*/
|
|
6
|
+
export declare class HotAgentRoute extends HotRoute {
|
|
7
|
+
/**
|
|
8
|
+
* Helper to the parent API.
|
|
9
|
+
*/
|
|
10
|
+
thisApi: HotAgentAPI;
|
|
11
|
+
constructor(api: HotAgentAPI);
|
|
12
|
+
/**
|
|
13
|
+
* Execute a file.
|
|
14
|
+
*/
|
|
15
|
+
protected execute(req: any, res: any, authorizedValue: any, jsonObj: any, queryObj: any): Promise<any>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=HotAgentRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotAgentRoute.d.ts","sourceRoot":"","sources":["../../src/HotAgentRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAuC,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C;;GAEG;AACH,qBAAa,aAAc,SAAQ,QAAQ;IAEvC;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;gBAEX,GAAG,EAAE,WAAW;IAU7B;;OAEG;cACa,OAAO,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CAc7G"}
|