@midwayjs/info 3.20.5 → 4.0.0-beta.1

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.
@@ -22,11 +22,12 @@ let InfoConfiguration = class InfoConfiguration {
22
22
  });
23
23
  }
24
24
  };
25
+ exports.InfoConfiguration = InfoConfiguration;
25
26
  __decorate([
26
27
  (0, core_1.Inject)(),
27
28
  __metadata("design:type", core_1.MidwayApplicationManager)
28
29
  ], InfoConfiguration.prototype, "applicationManager", void 0);
29
- InfoConfiguration = __decorate([
30
+ exports.InfoConfiguration = InfoConfiguration = __decorate([
30
31
  (0, core_1.Configuration)({
31
32
  namespace: 'info',
32
33
  importConfigs: [
@@ -36,5 +37,4 @@ InfoConfiguration = __decorate([
36
37
  ],
37
38
  })
38
39
  ], InfoConfiguration);
39
- exports.InfoConfiguration = InfoConfiguration;
40
40
  //# sourceMappingURL=configuration.js.map
@@ -193,13 +193,12 @@ let InfoService = class InfoService {
193
193
  };
194
194
  }
195
195
  midwayService() {
196
- var _a;
197
196
  const info = {};
198
- if ((_a = this.container) === null || _a === void 0 ? void 0 : _a.registry) {
197
+ if (this.container?.registry) {
199
198
  for (const item of this.container.registry) {
200
199
  const [key, value] = item;
201
- const name = value ? (value === null || value === void 0 ? void 0 : value.name) || value : typeof value;
202
- info[key] = `${(value === null || value === void 0 ? void 0 : value.namespace) ? `${value === null || value === void 0 ? void 0 : value.namespace}:` : ''}${name}${(value === null || value === void 0 ? void 0 : value.scope) ? ` [${value === null || value === void 0 ? void 0 : value.scope}]` : ''}`;
200
+ const name = value ? value?.name || value : typeof value;
201
+ info[key] = `${value?.namespace ? `${value?.namespace}:` : ''}${name}${value?.scope ? ` [${value?.scope}]` : ''}`;
203
202
  }
204
203
  }
205
204
  return {
@@ -264,6 +263,7 @@ let InfoService = class InfoService {
264
263
  return '';
265
264
  }
266
265
  };
266
+ exports.InfoService = InfoService;
267
267
  __decorate([
268
268
  (0, core_1.Inject)(),
269
269
  __metadata("design:type", core_2.MidwayInformationService)
@@ -298,9 +298,8 @@ __decorate([
298
298
  __metadata("design:paramtypes", []),
299
299
  __metadata("design:returntype", Promise)
300
300
  ], InfoService.prototype, "init", null);
301
- InfoService = __decorate([
301
+ exports.InfoService = InfoService = __decorate([
302
302
  (0, core_1.Provide)(),
303
303
  (0, core_1.Scope)(core_1.ScopeEnum.Singleton)
304
304
  ], InfoService);
305
- exports.InfoService = InfoService;
306
305
  //# sourceMappingURL=infoService.js.map
package/dist/interface.js CHANGED
@@ -15,5 +15,5 @@ var InfoType;
15
15
  InfoType["DEPENDENCIES"] = "Dependencies";
16
16
  InfoType["MIDWAY_SERVICE"] = "Midway Service";
17
17
  InfoType["MIDWAY_CONFIG"] = "Midway Config";
18
- })(InfoType = exports.InfoType || (exports.InfoType = {}));
18
+ })(InfoType || (exports.InfoType = InfoType = {}));
19
19
  //# sourceMappingURL=interface.js.map
@@ -14,7 +14,7 @@ const core_1 = require("@midwayjs/core");
14
14
  const infoService_1 = require("../infoService");
15
15
  let InfoMiddleware = class InfoMiddleware {
16
16
  resolve(app) {
17
- if (app.getFrameworkType() === core_1.MidwayFrameworkType.WEB_EXPRESS) {
17
+ if ('express' === app.getNamespace()) {
18
18
  return async (req, res, next) => {
19
19
  if (req.path === this.infoPath) {
20
20
  // return html
@@ -40,6 +40,7 @@ let InfoMiddleware = class InfoMiddleware {
40
40
  return 'info';
41
41
  }
42
42
  };
43
+ exports.InfoMiddleware = InfoMiddleware;
43
44
  __decorate([
44
45
  (0, core_1.Config)('info.infoPath'),
45
46
  __metadata("design:type", String)
@@ -48,8 +49,7 @@ __decorate([
48
49
  (0, core_1.Inject)(),
49
50
  __metadata("design:type", infoService_1.InfoService)
50
51
  ], InfoMiddleware.prototype, "infoService", void 0);
51
- InfoMiddleware = __decorate([
52
+ exports.InfoMiddleware = InfoMiddleware = __decorate([
52
53
  (0, core_1.Middleware)()
53
54
  ], InfoMiddleware);
54
- exports.InfoMiddleware = InfoMiddleware;
55
55
  //# sourceMappingURL=info.middleware.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midwayjs/info",
3
3
  "description": "midway info",
4
- "version": "3.20.5",
4
+ "version": "4.0.0-beta.1",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
7
7
  "files": [
@@ -13,12 +13,10 @@
13
13
  "picomatch": "2.3.1"
14
14
  },
15
15
  "devDependencies": {
16
- "@midwayjs/core": "^3.20.4",
17
- "@midwayjs/express": "^3.20.4",
18
- "@midwayjs/koa": "^3.20.5",
19
- "@midwayjs/mock": "^3.20.4",
20
- "@midwayjs/serverless-fc-starter": "^3.20.4",
21
- "@midwayjs/serverless-scf-starter": "^3.20.0"
16
+ "@midwayjs/core": "^4.0.0-beta.1",
17
+ "@midwayjs/express": "^4.0.0-beta.1",
18
+ "@midwayjs/koa": "^4.0.0-beta.1",
19
+ "@midwayjs/mock": "^4.0.0-beta.1"
22
20
  },
23
21
  "keywords": [
24
22
  "midway"
@@ -27,8 +25,8 @@
27
25
  "license": "MIT",
28
26
  "scripts": {
29
27
  "build": "tsc",
30
- "test": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand",
31
- "cov": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand --coverage --forceExit",
28
+ "test": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand",
29
+ "cov": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand --coverage --forceExit",
32
30
  "ci": "npm run test",
33
31
  "lint": "mwts check"
34
32
  },
@@ -39,5 +37,5 @@
39
37
  "type": "git",
40
38
  "url": "https://github.com/midwayjs/midway.git"
41
39
  },
42
- "gitHead": "7ce57281bd3ef5d18dc50b47ff9bffb8a27c071e"
40
+ "gitHead": "832961ec3aff123c033197d8c00cb2bc9bad7ff8"
43
41
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2013 - Now midwayjs
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.