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.
- package/.eslintignore +17 -0
- package/.eslintrc.js +11 -0
- package/.vscode/launch.json +199 -0
- package/.vscode/settings.json +2 -0
- package/.vscode/tasks.json +78 -0
- package/CONTRIBUTING.md +157 -0
- package/README.md +126 -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 +130 -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 +239 -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 +92 -0
- package/build/src/HotCreator.d.ts.map +1 -0
- package/build/src/HotCreator.js +465 -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/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 +39 -0
- package/build/src/HotIO.d.ts.map +1 -0
- package/build/src/HotIO.js +195 -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 +601 -0
- package/build/src/HotStaq.d.ts.map +1 -0
- package/build/src/HotStaq.js +1258 -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 +82 -0
- package/build/src/HotTestSeleniumDriver.d.ts.map +1 -0
- package/build/src/HotTestSeleniumDriver.js +398 -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 +623 -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.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 +935 -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 +125 -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 +128 -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 +1153 -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 +529 -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 +162 -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 +378 -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 +482 -0
- package/src/HotDB.ts +79 -0
- package/src/HotDBConnectionInterface.ts +40 -0
- package/src/HotFile.ts +617 -0
- package/src/HotHTTPServer.ts +954 -0
- package/src/HotIO.ts +128 -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 +1877 -0
- package/src/HotStaqWeb.ts +59 -0
- package/src/HotTestDriver.ts +172 -0
- package/src/HotTestElement.ts +97 -0
- package/src/HotTestMap.ts +130 -0
- package/src/HotTestSeleniumDriver.ts +374 -0
- package/src/HotTester.ts +697 -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.ts +102 -0
- package/src/cli.ts +1147 -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/tsconfig-web.json +74 -0
- package/tsconfig.json +73 -0
- package/webpack.config.js +51 -0
- package/webpack.config.tests.js +56 -0
|
@@ -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.call.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.call = 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;AAK/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,I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CAAC;;;;wBAIlC,MAAM,IAAE,CAAC;4BAGS,qBAAM,GAAG,CAAC,IAAI,EAAG,EAAA;;wBAAhC,OAAO,GAAQ,SAAiB;wBAEpC,sBAAO,CAAC,OAAO,CAAC,EAAC;;;;KACjB;IACF,aAAC;AAAD,CAAC,AAlWD,IAkWC;AAlWqB,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"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
+
function step(op) {
|
|
50
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
+
while (_) try {
|
|
52
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
53
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
+
switch (op[0]) {
|
|
55
|
+
case 0: case 1: t = op; break;
|
|
56
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
+
default:
|
|
60
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
+
if (t[2]) _.ops.pop();
|
|
65
|
+
_.trys.pop(); continue;
|
|
66
|
+
}
|
|
67
|
+
op = body.call(thisArg, _);
|
|
68
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
73
|
+
exports.HotAgentRoute = void 0;
|
|
74
|
+
var api_1 = require("./api");
|
|
75
|
+
var fs = __importStar(require("fs"));
|
|
76
|
+
var vm = __importStar(require("vm"));
|
|
77
|
+
/**
|
|
78
|
+
* Hello world route.
|
|
79
|
+
*/
|
|
80
|
+
var HotAgentRoute = /** @class */ (function (_super) {
|
|
81
|
+
__extends(HotAgentRoute, _super);
|
|
82
|
+
function HotAgentRoute(api) {
|
|
83
|
+
var _this = _super.call(this, api.connection, "agent") || this;
|
|
84
|
+
_this.thisApi = api;
|
|
85
|
+
_this.addMethod(new api_1.HotRouteMethod(_this, "execute", _this.execute, api_1.HTTPMethod.POST, api.userAuth));
|
|
86
|
+
return _this;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Execute a file.
|
|
90
|
+
*/
|
|
91
|
+
HotAgentRoute.prototype.execute = function (req, res, authorizedValue, jsonObj, queryObj) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
+
var cmd, data, foundCmd, cmdData;
|
|
94
|
+
return __generator(this, function (_a) {
|
|
95
|
+
cmd = api_1.HotStaq.getParam("cmd", jsonObj);
|
|
96
|
+
data = api_1.HotStaq.getParamDefault("data", jsonObj, undefined);
|
|
97
|
+
foundCmd = this.thisApi.commands[cmd];
|
|
98
|
+
if (foundCmd == null)
|
|
99
|
+
throw new Error("Command ".concat(cmd, " not found!"));
|
|
100
|
+
cmdData = fs.readFileSync(foundCmd).toString();
|
|
101
|
+
vm.runInNewContext(cmdData, data);
|
|
102
|
+
return [2 /*return*/, (true)];
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
return HotAgentRoute;
|
|
107
|
+
}(api_1.HotRoute));
|
|
108
|
+
exports.HotAgentRoute = HotAgentRoute;
|
|
109
|
+
//# sourceMappingURL=HotAgentRoute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotAgentRoute.js","sourceRoot":"","sources":["../../src/HotAgentRoute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAsE;AAGtE,qCAAyB;AACzB,qCAAyB;AAEzB;;GAEG;AACH;IAAmC,iCAAQ;IAO1C,uBAAa,GAAgB;QAA7B,YAEC,kBAAO,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,SAM/B;QAJM,KAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QAEzB,KAAI,CAAC,SAAS,CAAE,IAAI,oBAAc,CAAE,KAAI,EAAE,SAAS,EAAE,KAAI,CAAC,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