@midwayjs/express 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.
@@ -17,6 +17,9 @@ const cookieParser = require("cookie-parser");
17
17
  const DefaultConfig = require("./config/config.default");
18
18
  const framework_1 = require("./framework");
19
19
  let ExpressConfiguration = class ExpressConfiguration {
20
+ decoratorService;
21
+ expressFramework;
22
+ configService;
20
23
  init() {
21
24
  this.decoratorService.registerParameterHandler(core_1.WEB_ROUTER_PARAM_KEY, options => {
22
25
  return (0, core_1.extractExpressLikeValue)(options.metadata.type, options.metadata.propertyData, options.originParamType)(options.originArgs[0], options.originArgs[1], options.originArgs[2]);
@@ -1,10 +1,8 @@
1
- /// <reference types="node" />
2
1
  import { BaseFramework, IMidwayBootstrapOptions, MiddlewareRespond, RouterInfo } from '@midwayjs/core';
3
2
  import { IMidwayExpressApplication, IMidwayExpressConfigurationOptions, Context } from './interface';
4
3
  import type { IRouter, IRouterHandler, Response, NextFunction } from 'express';
5
4
  import { Server } from 'net';
6
5
  export declare class MidwayExpressFramework extends BaseFramework<IMidwayExpressApplication, Context, IMidwayExpressConfigurationOptions, Response, NextFunction> {
7
- app: IMidwayExpressApplication;
8
6
  private server;
9
7
  private expressMiddlewareService;
10
8
  private webRouterService;
package/dist/framework.js CHANGED
@@ -14,6 +14,9 @@ const util_1 = require("util");
14
14
  const util_2 = require("./util");
15
15
  const debug = (0, util_1.debuglog)('midway:debug');
16
16
  let MidwayExpressFramework = class MidwayExpressFramework extends core_1.BaseFramework {
17
+ server;
18
+ expressMiddlewareService;
19
+ webRouterService;
17
20
  configure() {
18
21
  return this.configService.getConfiguration('express');
19
22
  }
@@ -1,6 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- /// <reference types="node" />
4
1
  import { CommonMiddlewareUnion, ContextMiddlewareManager, FunctionMiddleware, IConfigurationOptions, IMiddleware, IMidwayApplication, IMidwayContext } from '@midwayjs/core';
5
2
  import { Application as ExpressApplication, NextFunction as ExpressNextFunction, Request as ExpressRequest, Response as ExpressResponse } from 'express';
6
3
  import { ListenOptions } from 'net';
@@ -9,7 +9,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.wrapMiddleware = exports.MidwayExpressMiddlewareService = exports.wrapAsyncHandler = void 0;
12
+ exports.MidwayExpressMiddlewareService = void 0;
13
+ exports.wrapAsyncHandler = wrapAsyncHandler;
14
+ exports.wrapMiddleware = wrapMiddleware;
13
15
  const core_1 = require("@midwayjs/core");
14
16
  const util_1 = require("./util");
15
17
  function wrapAsyncHandler(fn) {
@@ -24,8 +26,8 @@ function wrapAsyncHandler(fn) {
24
26
  return fn;
25
27
  }
26
28
  }
27
- exports.wrapAsyncHandler = wrapAsyncHandler;
28
29
  let MidwayExpressMiddlewareService = class MidwayExpressMiddlewareService {
30
+ applicationContext;
29
31
  constructor(applicationContext) {
30
32
  this.applicationContext = applicationContext;
31
33
  }
@@ -139,5 +141,4 @@ function wrapMiddleware(mw, options) {
139
141
  fn._name = mw._name + 'middlewareWrapper';
140
142
  return fn;
141
143
  }
142
- exports.wrapMiddleware = wrapMiddleware;
143
144
  //# sourceMappingURL=middlewareService.js.map
package/dist/util.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFreePort = exports.sendData = void 0;
3
+ exports.sendData = sendData;
4
+ exports.getFreePort = getFreePort;
4
5
  const net_1 = require("net");
5
6
  function sendData(res, data) {
6
7
  if (typeof data === 'number') {
@@ -10,7 +11,6 @@ function sendData(res, data) {
10
11
  res.status(res.statusCode).send(data);
11
12
  }
12
13
  }
13
- exports.sendData = sendData;
14
14
  async function getFreePort() {
15
15
  return new Promise((resolve, reject) => {
16
16
  const server = (0, net_1.createServer)();
@@ -26,5 +26,4 @@ async function getFreePort() {
26
26
  });
27
27
  });
28
28
  }
29
- exports.getFreePort = getFreePort;
30
29
  //# sourceMappingURL=util.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/express",
3
- "version": "4.0.0-beta.7",
3
+ "version": "4.0.0-beta.9",
4
4
  "description": "Midway Web Framework for Express",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
@@ -24,17 +24,17 @@
24
24
  ],
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@midwayjs/core": "^4.0.0-beta.7",
28
- "@midwayjs/mock": "^4.0.0-beta.7",
27
+ "@midwayjs/core": "^4.0.0-beta.9",
28
+ "@midwayjs/mock": "^4.0.0-beta.9",
29
29
  "@types/body-parser": "1.19.6",
30
- "@types/express": "4.17.24",
31
- "fs-extra": "11.3.0"
30
+ "@types/express": "4.17.25",
31
+ "fs-extra": "11.3.2"
32
32
  },
33
33
  "dependencies": {
34
- "@midwayjs/express-session": "^4.0.0-beta.7",
35
- "body-parser": "1.20.3",
34
+ "@midwayjs/express-session": "^4.0.0-beta.9",
35
+ "body-parser": "2.2.1",
36
36
  "cookie-parser": "^1.4.6",
37
- "express": "4.21.2"
37
+ "express": "4.22.1"
38
38
  },
39
39
  "author": "Harry Chen <czy88840616@gmail.com>",
40
40
  "repository": {
@@ -44,5 +44,5 @@
44
44
  "engines": {
45
45
  "node": ">=20"
46
46
  },
47
- "gitHead": "6a221788112b4d998b3958e0a275579f42816c59"
47
+ "gitHead": "771e83974ef9f3d78c296e4ee0c8c68db44f6b31"
48
48
  }