@midwayjs/info 4.0.0-beta.7 → 4.0.0-beta.9

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.
@@ -14,6 +14,7 @@ const core_1 = require("@midwayjs/core");
14
14
  const info_middleware_1 = require("./middleware/info.middleware");
15
15
  const DefaultConfig = require("./config.default");
16
16
  let InfoConfiguration = class InfoConfiguration {
17
+ applicationManager;
17
18
  async onReady() {
18
19
  this.applicationManager
19
20
  .getApplications(['koa', 'faas', 'express', 'egg'])
@@ -18,6 +18,14 @@ const os_1 = require("os");
18
18
  const path_1 = require("path");
19
19
  const pm = require("picomatch");
20
20
  let InfoService = class InfoService {
21
+ midwayInformationService;
22
+ configService;
23
+ environment;
24
+ titleConfig;
25
+ defaultHiddenKey;
26
+ ignoreKey;
27
+ secretMatchList;
28
+ container;
21
29
  async init() {
22
30
  this.secretMatchList = Array.from(new Set(this.defaultHiddenKey)).map(pattern => {
23
31
  return pm(pattern);
@@ -13,6 +13,8 @@ exports.InfoMiddleware = void 0;
13
13
  const core_1 = require("@midwayjs/core");
14
14
  const infoService_1 = require("../infoService");
15
15
  let InfoMiddleware = class InfoMiddleware {
16
+ infoPath;
17
+ infoService;
16
18
  resolve(app) {
17
19
  if ('express' === app.getNamespace()) {
18
20
  return async (req, res, next) => {
package/dist/utils.js CHANGED
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.safeContent = exports.renderToHtml = exports.bitToMB = exports.safeRequire = void 0;
3
+ exports.safeRequire = safeRequire;
4
+ exports.bitToMB = bitToMB;
5
+ exports.renderToHtml = renderToHtml;
6
+ exports.safeContent = safeContent;
4
7
  const fs_1 = require("fs");
5
8
  function safeRequire(mod, defaultValue) {
6
9
  try {
@@ -13,11 +16,9 @@ function safeRequire(mod, defaultValue) {
13
16
  return defaultValue;
14
17
  }
15
18
  }
16
- exports.safeRequire = safeRequire;
17
19
  function bitToMB(bit) {
18
20
  return Number((bit || 0) / 1024 / 1024).toFixed(2) + ' MB';
19
21
  }
20
- exports.bitToMB = bitToMB;
21
22
  function renderToHtml(infoList, title) {
22
23
  let html = `<div style="padding: 24px; font-size: 36px;background: #9999cb;font-weight: bold;">${title}</div>`;
23
24
  html += infoList
@@ -37,7 +38,6 @@ function renderToHtml(infoList, title) {
37
38
  .infoValue {vertical-align: top;background:#d8d8d8;padding: 12px;word-break:break-all;}
38
39
  </style><div style="margin: 24px auto;max-width: 720px;min-width: 440px;">${html}</div>`;
39
40
  }
40
- exports.renderToHtml = renderToHtml;
41
41
  function safeContent(value = '') {
42
42
  if (value.length < 3) {
43
43
  return '*'.repeat(value.length);
@@ -55,5 +55,4 @@ function safeContent(value = '') {
55
55
  return value.slice(0, 3) + '*'.repeat(value.length - 6) + value.slice(-3);
56
56
  }
57
57
  }
58
- exports.safeContent = safeContent;
59
58
  //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midwayjs/info",
3
3
  "description": "midway info",
4
- "version": "4.0.0-beta.7",
4
+ "version": "4.0.0-beta.9",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
7
7
  "files": [
@@ -13,10 +13,10 @@
13
13
  "picomatch": "2.3.1"
14
14
  },
15
15
  "devDependencies": {
16
- "@midwayjs/core": "^4.0.0-beta.7",
17
- "@midwayjs/express": "^4.0.0-beta.7",
18
- "@midwayjs/koa": "^4.0.0-beta.7",
19
- "@midwayjs/mock": "^4.0.0-beta.7"
16
+ "@midwayjs/core": "^4.0.0-beta.9",
17
+ "@midwayjs/express": "^4.0.0-beta.9",
18
+ "@midwayjs/koa": "^4.0.0-beta.9",
19
+ "@midwayjs/mock": "^4.0.0-beta.9"
20
20
  },
21
21
  "keywords": [
22
22
  "midway"
@@ -37,5 +37,5 @@
37
37
  "type": "git",
38
38
  "url": "https://github.com/midwayjs/midway.git"
39
39
  },
40
- "gitHead": "6a221788112b4d998b3958e0a275579f42816c59"
40
+ "gitHead": "771e83974ef9f3d78c296e4ee0c8c68db44f6b31"
41
41
  }