@webtypen/webframez-core 0.0.39 → 0.0.41

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.
@@ -40,6 +40,22 @@ class ConsoleApplication {
40
40
  }));
41
41
  program.addCommand(consoleCommand);
42
42
  }
43
+ if (options && options.kernel && options.kernel.commands && options.kernel.commands.length > 0) {
44
+ for (let command of options.kernel.commands) {
45
+ if (!command.signature) {
46
+ continue;
47
+ }
48
+ const consoleCommand = new Command(command.signature);
49
+ if (command.description && command.description.trim() !== "") {
50
+ consoleCommand.description(command.description);
51
+ }
52
+ consoleCommand.action(() => __awaiter(this, void 0, void 0, function* () {
53
+ const service = yield new command();
54
+ return yield service.handle();
55
+ }));
56
+ program.addCommand(consoleCommand);
57
+ }
58
+ }
43
59
  program.parse();
44
60
  }
45
61
  }
@@ -247,6 +247,7 @@ class RouterFacade {
247
247
  rawHeaders: req.rawHeaders,
248
248
  url: req.url,
249
249
  method: req.method,
250
+ socket: req.socket,
250
251
  }
251
252
  : null;
252
253
  // Check-Middleware
package/lib/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from "./Config";
2
2
  export * from "./Functions/StringFunctions";
3
3
  export * from "./Functions/NumericFunctions";
4
+ export * from "./Commands/ConsoleCommand";
4
5
  export * from "./BaseKernelWeb";
5
6
  export * from "./BaseKernelConsole";
6
7
  export * from "./Controller/Controller";
package/lib/index.js CHANGED
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Config"), exports);
18
18
  __exportStar(require("./Functions/StringFunctions"), exports);
19
19
  __exportStar(require("./Functions/NumericFunctions"), exports);
20
+ __exportStar(require("./Commands/ConsoleCommand"), exports);
20
21
  __exportStar(require("./BaseKernelWeb"), exports);
21
22
  __exportStar(require("./BaseKernelConsole"), exports);
22
23
  __exportStar(require("./Controller/Controller"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",
@@ -3,36 +3,54 @@ import { Config } from "./Config";
3
3
  import { BuildFinishCommand } from "./Commands/BuildFinishCommand";
4
4
 
5
5
  export class ConsoleApplication {
6
- /**
7
- * Init the routes and start the http-server
8
- */
9
- boot(options?: any) {
10
- if (options && options.config) {
11
- for (let key in options.config) {
12
- Config.register(key, options.config[key]);
13
- }
14
- }
6
+ /**
7
+ * Init the routes and start the http-server
8
+ */
9
+ boot(options?: any) {
10
+ if (options && options.config) {
11
+ for (let key in options.config) {
12
+ Config.register(key, options.config[key]);
13
+ }
14
+ }
15
+
16
+ const program = new Command();
17
+ program.name("webframez console").description("CLI to some JavaScript string utilities").version("0.0.1");
15
18
 
16
- const program = new Command();
17
- program.name("webframez console").description("CLI to some JavaScript string utilities").version("0.0.1");
19
+ const systemCommands = [BuildFinishCommand];
20
+ for (let command of systemCommands) {
21
+ if (!command.signature) {
22
+ continue;
23
+ }
18
24
 
19
- const systemCommands = [BuildFinishCommand];
20
- for (let command of systemCommands) {
21
- if (!command.signature) {
22
- continue;
23
- }
25
+ const consoleCommand = new Command(command.signature);
26
+ if (command.description && command.description.trim() !== "") {
27
+ consoleCommand.description(command.description);
28
+ }
29
+ consoleCommand.action(async () => {
30
+ const service = await new command();
31
+ return await service.handle();
32
+ });
33
+ program.addCommand(consoleCommand);
34
+ }
24
35
 
25
- const consoleCommand = new Command(command.signature);
26
- if (command.description && command.description.trim() !== "") {
27
- consoleCommand.description(command.description);
28
- }
29
- consoleCommand.action(async () => {
30
- const service = await new command();
31
- return await service.handle();
32
- });
33
- program.addCommand(consoleCommand);
36
+ if (options && options.kernel && options.kernel.commands && options.kernel.commands.length > 0) {
37
+ for (let command of options.kernel.commands) {
38
+ if (!command.signature) {
39
+ continue;
34
40
  }
35
41
 
36
- program.parse();
42
+ const consoleCommand = new Command(command.signature);
43
+ if (command.description && command.description.trim() !== "") {
44
+ consoleCommand.description(command.description);
45
+ }
46
+ consoleCommand.action(async () => {
47
+ const service = await new command();
48
+ return await service.handle();
49
+ });
50
+ program.addCommand(consoleCommand);
51
+ }
37
52
  }
53
+
54
+ program.parse();
55
+ }
38
56
  }
@@ -287,6 +287,7 @@ class RouterFacade {
287
287
  rawHeaders: req.rawHeaders,
288
288
  url: req.url,
289
289
  method: req.method,
290
+ socket: req.socket,
290
291
  }
291
292
  : null;
292
293
 
package/src/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from "./Config";
2
2
  export * from "./Functions/StringFunctions";
3
3
  export * from "./Functions/NumericFunctions";
4
+ export * from "./Commands/ConsoleCommand";
4
5
  export * from "./BaseKernelWeb";
5
6
  export * from "./BaseKernelConsole";
6
7
  export * from "./Controller/Controller";