@rdyl/node-koa-controller 0.4.1 → 0.4.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/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- # 0.4.0 (2025-12-31)
1
+ ## 0.4.3 (2025-12-31)
2
2
 
3
3
 
4
4
 
@@ -39,28 +39,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.DocsHtml = exports.api_docs_path = void 0;
43
- exports.getDocsHtml = getDocsHtml;
42
+ exports.DocsHtml = void 0;
44
43
  var ejs_1 = __importDefault(require("ejs"));
45
44
  var path_1 = __importDefault(require("path"));
46
45
  var cache_1 = __importDefault(require("../cache"));
47
46
  var parse_1 = require("./parse");
48
- exports.api_docs_path = "/api-docs.html";
49
- function getDocsHtml() {
50
- return __awaiter(this, void 0, void 0, function () {
51
- var treeData;
52
- return __generator(this, function (_a) {
53
- switch (_a.label) {
54
- case 0:
55
- treeData = (0, parse_1.parseASTRoutes)(cache_1.default.routes);
56
- return [4 /*yield*/, ejs_1.default.renderFile(path_1.default.resolve(__dirname, "../docs/template.ejs"), {
57
- treeData: treeData,
58
- })];
59
- case 1: return [2 /*return*/, _a.sent()];
60
- }
61
- });
62
- });
63
- }
64
47
  exports.DocsHtml = {
65
48
  docs_path: "/api-docs.html",
66
49
  __html__: "",
@@ -71,7 +54,7 @@ exports.DocsHtml = {
71
54
  switch (_b.label) {
72
55
  case 0:
73
56
  treeData = (0, parse_1.parseASTRoutes)(cache_1.default.routes);
74
- if (!!this.__html__) return [3 /*break*/, 2];
57
+ if (!!exports.DocsHtml.__html__) return [3 /*break*/, 2];
75
58
  _a = exports.DocsHtml;
76
59
  return [4 /*yield*/, ejs_1.default.renderFile(path_1.default.resolve(__dirname, "./template.ejs"), {
77
60
  treeData: treeData,
package/dist/index.js CHANGED
@@ -96,13 +96,6 @@ function useApiController(app, opts) {
96
96
  port: port,
97
97
  prefix: prefix,
98
98
  ip: ip,
99
- running: function () {
100
- (0, utils_1.ServerLaunchLogs)({
101
- ip: ip,
102
- port: port,
103
- prefix: prefix,
104
- });
105
- },
106
99
  }];
107
100
  }
108
101
  });
package/dist/utils.js CHANGED
@@ -43,10 +43,7 @@ exports.Uri = void 0;
43
43
  exports.formatDateTime = formatDateTime;
44
44
  exports.getIPAdress = getIPAdress;
45
45
  exports.LogsHandler = LogsHandler;
46
- exports.ServerLaunchLogs = ServerLaunchLogs;
47
46
  var os_1 = __importDefault(require("os"));
48
- var path_1 = require("path");
49
- var boxen_1 = __importDefault(require("boxen"));
50
47
  var chalk_1 = __importDefault(require("chalk"));
51
48
  exports.Uri = {
52
49
  join: function (paths) {
@@ -142,16 +139,3 @@ function LogsHandler(ctx, next) {
142
139
  });
143
140
  });
144
141
  }
145
- function ServerLaunchLogs(config) {
146
- var port = config.port, prefix = config.prefix, ip = config.ip;
147
- var suffix = (0, path_1.join)(port.toString(), prefix);
148
- var env = process.env.NODE_ENV || "development";
149
- var messages = (0, boxen_1.default)(chalk_1.default.hex("#83FFE6")("\n ".concat(chalk_1.default.bold.hex("#FFA500")("🚀 Server started successfully!"), "\n\n ").concat(chalk_1.default.bold("Env:"), " ").concat(chalk_1.default.white(" " + env + " "), "\n\n ").concat(chalk_1.default.bold("Local:"), " ").concat(chalk_1.default.green("http://localhost:".concat(suffix)), "\n ").concat(chalk_1.default.bold("Network:"), " ").concat(chalk_1.default.green("http://".concat(ip, ":").concat(suffix)), "\n")), {
150
- padding: 0.5,
151
- margin: 0.5,
152
- borderStyle: "round",
153
- borderColor: "#5ED7FF",
154
- });
155
- console.clear();
156
- console.log(messages);
157
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdyl/node-koa-controller",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
@@ -22,7 +22,6 @@
22
22
  "@types/koa": "^2.15.0",
23
23
  "@types/koa-router": "^7.4.8",
24
24
  "@types/koa-static": "^4.0.4",
25
- "boxen": "^8.0.1",
26
25
  "chalk": "^5.4.1",
27
26
  "crypto-js": "^4.2.0",
28
27
  "ejs": "^3.1.10",
@@ -1,5 +1,3 @@
1
- export declare const api_docs_path = "/api-docs.html";
2
- export declare function getDocsHtml(): Promise<string>;
3
1
  export declare const DocsHtml: {
4
2
  docs_path: string;
5
3
  __html__: string;
package/types/meta.d.ts CHANGED
@@ -66,7 +66,6 @@ export interface SyncUseValue {
66
66
  prefix: string;
67
67
  whitelist: (string | RegExp)[];
68
68
  ip: string;
69
- running(): unknown;
70
69
  }
71
70
  export interface ASTCacheHandler {
72
71
  url: string;
package/types/utils.d.ts CHANGED
@@ -5,8 +5,3 @@ export declare const Uri: {
5
5
  export declare function formatDateTime(date?: Date, format?: string): string;
6
6
  export declare function getIPAdress(): string;
7
7
  export declare function LogsHandler(ctx: KoaCtx, next: () => Promise<any>): Promise<void>;
8
- export declare function ServerLaunchLogs(config: {
9
- port: number;
10
- prefix: string;
11
- ip: string;
12
- }): void;