@midwayjs/mock 3.7.3 → 3.9.0

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.
Files changed (2) hide show
  1. package/dist/creator.js +3 -5
  2. package/package.json +6 -6
package/dist/creator.js CHANGED
@@ -147,7 +147,7 @@ async function close(app, options) {
147
147
  }
148
148
  exports.close = close;
149
149
  async function createFunctionApp(baseDir = process.cwd(), options = {}, customFrameworkModule) {
150
- var _a, _b, _c;
150
+ var _a, _b, _c, _d;
151
151
  let starterName;
152
152
  if (!options.starter) {
153
153
  // load yaml
@@ -196,7 +196,7 @@ async function createFunctionApp(baseDir = process.cwd(), options = {}, customFr
196
196
  const appManager = appCtx.get(core_1.MidwayApplicationManager);
197
197
  const app = appManager.getApplication(core_1.MidwayFrameworkType.FAAS);
198
198
  const faasConfig = (_b = configService.getConfiguration('faas')) !== null && _b !== void 0 ? _b : {};
199
- const customPort = (_c = process.env.MIDWAY_HTTP_PORT) !== null && _c !== void 0 ? _c : faasConfig['port'];
199
+ const customPort = (_d = (_c = process.env.MIDWAY_HTTP_PORT) !== null && _c !== void 0 ? _c : faasConfig['port']) !== null && _d !== void 0 ? _d : options['port'];
200
200
  app.callback2 = () => {
201
201
  // mock a real http server response for local dev
202
202
  return async (req, res) => {
@@ -213,10 +213,8 @@ async function createFunctionApp(baseDir = process.cwd(), options = {}, customFr
213
213
  }
214
214
  const ctx = await framework.wrapHttpRequest(req);
215
215
  // create event and invoke
216
- const result = await framework.getTriggerFunction(ctx, url.pathname, {
216
+ const result = await framework.invokeTriggerFunction(ctx, url.pathname, {
217
217
  isHttpFunction: true,
218
- originEvent: req,
219
- originContext: {},
220
218
  });
221
219
  const { statusCode, headers, body } = result;
222
220
  if (res.headersSent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/mock",
3
- "version": "3.7.3",
3
+ "version": "3.9.0",
4
4
  "description": "create your test app from midway framework",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index.d.ts",
@@ -27,17 +27,17 @@
27
27
  },
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@midwayjs/core": "^3.7.0",
30
+ "@midwayjs/core": "^3.9.0",
31
31
  "@midwayjs/logger": "^2.15.0",
32
32
  "@types/amqplib": "0.8.2",
33
33
  "amqplib": "0.10.3",
34
- "kafkajs": "2.2.2",
34
+ "kafkajs": "2.2.3",
35
35
  "socket.io": "4.5.3",
36
36
  "socket.io-client": "4.5.3",
37
37
  "ws": "8.10.0"
38
38
  },
39
39
  "dependencies": {
40
- "@midwayjs/async-hooks-context-manager": "^3.7.0",
40
+ "@midwayjs/async-hooks-context-manager": "^3.9.0",
41
41
  "@types/superagent": "4.1.14",
42
42
  "@types/supertest": "2.0.12",
43
43
  "fs-extra": "10.0.1",
@@ -48,7 +48,7 @@
48
48
  "author": "Harry Chen <czy88840616@gmail.com>",
49
49
  "repository": {
50
50
  "type": "git",
51
- "url": "http://github.com/midwayjs/midway.git"
51
+ "url": "https://github.com/midwayjs/midway.git"
52
52
  },
53
- "gitHead": "8e6c830bca52818e0086873b542423d16e609aef"
53
+ "gitHead": "5f6603d2c9606fc6fc7ece71f956e89e394efeee"
54
54
  }