@midwayjs/faas 4.0.0-beta.7 → 4.0.0-beta.8

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,9 @@ const core_1 = require("@midwayjs/core");
14
14
  const framework_1 = require("./framework");
15
15
  const DefaultConfig = require("./config.default");
16
16
  let FaaSConfiguration = class FaaSConfiguration {
17
+ framework;
18
+ decoratorService;
19
+ applicationContext;
17
20
  async init() {
18
21
  this.decoratorService.registerPropertyHandler(core_1.PLUGIN_KEY, (key, meta, target) => {
19
22
  return (target?.[core_1.REQUEST_OBJ_CTX_KEY]?.[key] ||
@@ -1,6 +1,5 @@
1
- /// <reference types="node" />
2
1
  import { Context, IFaaSConfigurationOptions, Application, NextFunction, HandlerOptions, HttpResponseFormat, wrapHttpRequestOptions } from './interface';
3
- import { BaseFramework, CommonMiddlewareUnion, ContextMiddlewareManager, FunctionMiddleware, IMidwayBootstrapOptions, MidwayEnvironmentService, MidwayMiddlewareService, RouterInfo } from '@midwayjs/core';
2
+ import { BaseFramework, CommonMiddlewareUnion, ContextMiddlewareManager, FunctionMiddleware, IMidwayBootstrapOptions, RouterInfo } from '@midwayjs/core';
4
3
  import { LoggerOptions } from '@midwayjs/logger';
5
4
  import * as http from 'http';
6
5
  export declare class MidwayFaaSFramework extends BaseFramework<Application, Context, IFaaSConfigurationOptions> {
@@ -19,8 +18,6 @@ export declare class MidwayFaaSFramework extends BaseFramework<Application, Cont
19
18
  protected eventMiddlewareManager: ContextMiddlewareManager<Context, unknown, unknown>;
20
19
  private legacyVersion;
21
20
  private loadedFunction;
22
- environmentService: MidwayEnvironmentService;
23
- middlewareService: MidwayMiddlewareService<Context, any>;
24
21
  configure(options: IFaaSConfigurationOptions): any;
25
22
  isEnable(): boolean;
26
23
  applicationInitialize(options: IMidwayBootstrapOptions): Promise<void>;
package/dist/framework.js CHANGED
@@ -5,9 +5,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
8
  Object.defineProperty(exports, "__esModule", { value: true });
12
9
  exports.MidwayFaaSFramework = void 0;
13
10
  const core_1 = require("@midwayjs/core");
@@ -19,18 +16,19 @@ const debug = (0, util_1.debuglog)('midway:debug');
19
16
  const { isAnyArrayBuffer, isUint8Array } = util_1.types;
20
17
  const LOCK_KEY = '_faas_starter_start_key';
21
18
  let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework {
22
- constructor() {
23
- super(...arguments);
24
- this.defaultHandlerMethod = 'handler';
25
- this.funMappingStore = new Map();
26
- this.lock = new simple_lock_1.default();
27
- this.isReplaceLogger = process.env['MIDWAY_SERVERLESS_REPLACE_LOGGER'] === 'true';
28
- this.developmentRun = false;
29
- this.httpMiddlewareManager = this.createMiddlewareManager();
30
- this.eventMiddlewareManager = this.createMiddlewareManager();
31
- this.legacyVersion = false;
32
- this.loadedFunction = false;
33
- }
19
+ defaultHandlerMethod = 'handler';
20
+ funMappingStore = new Map();
21
+ lock = new simple_lock_1.default();
22
+ isReplaceLogger = process.env['MIDWAY_SERVERLESS_REPLACE_LOGGER'] === 'true';
23
+ developmentRun = false;
24
+ server;
25
+ respond;
26
+ applicationAdapter;
27
+ serverlessFunctionService;
28
+ httpMiddlewareManager = this.createMiddlewareManager();
29
+ eventMiddlewareManager = this.createMiddlewareManager();
30
+ legacyVersion = false;
31
+ loadedFunction = false;
34
32
  configure(options) {
35
33
  const faasConfig = this.configService.getConfiguration('faas') ?? {};
36
34
  if (options || faasConfig['developmentRun']) {
@@ -436,14 +434,6 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
436
434
  }
437
435
  };
438
436
  exports.MidwayFaaSFramework = MidwayFaaSFramework;
439
- __decorate([
440
- (0, core_1.Inject)(),
441
- __metadata("design:type", core_1.MidwayEnvironmentService)
442
- ], MidwayFaaSFramework.prototype, "environmentService", void 0);
443
- __decorate([
444
- (0, core_1.Inject)(),
445
- __metadata("design:type", core_1.MidwayMiddlewareService)
446
- ], MidwayFaaSFramework.prototype, "middlewareService", void 0);
447
437
  exports.MidwayFaaSFramework = MidwayFaaSFramework = __decorate([
448
438
  (0, core_1.Framework)()
449
439
  ], MidwayFaaSFramework);
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { MidwayRequestContainer, IMidwayApplication, IConfigurationOptions, IMidwayContext, NextFunction as BaseNextFunction, CommonMiddlewareUnion, ContextMiddlewareManager, IMidwayBootstrapOptions, ObjectIdentifier, ILogger } from '@midwayjs/core';
3
2
  import { Application as ServerlessHttpApplication, HttpResponseOptions } from '@midwayjs/serverless-http-parser';
4
3
  import type { Cookies } from '@midwayjs/cookies';
package/dist/starter.js CHANGED
@@ -5,9 +5,13 @@ const core_1 = require("@midwayjs/core");
5
5
  const path_1 = require("path");
6
6
  const core_2 = require("@midwayjs/core");
7
7
  class AbstractBootstrapStarter {
8
+ options;
9
+ applicationContext;
10
+ framework;
8
11
  constructor(options = {}) {
9
12
  this.options = options;
10
13
  }
14
+ startedExports;
11
15
  getApplicationContext() {
12
16
  return this.applicationContext;
13
17
  }
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@midwayjs/faas",
3
- "version": "4.0.0-beta.7",
3
+ "version": "4.0.0-beta.8",
4
4
  "description": "Midway Framework for FaaS (Function as a Service)",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
7
7
  "dependencies": {
8
- "@midwayjs/core": "^4.0.0-beta.7",
9
- "@midwayjs/serverless-http-parser": "^4.0.0-beta.7",
8
+ "@midwayjs/core": "^4.0.0-beta.8",
9
+ "@midwayjs/serverless-http-parser": "^4.0.0-beta.8",
10
10
  "@midwayjs/simple-lock": "^1.1.4"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@midwayjs/cookies": "^1.0.2",
14
14
  "@midwayjs/logger": "^3.0.0",
15
- "@midwayjs/mock": "^4.0.0-beta.7",
15
+ "@midwayjs/mock": "^4.0.0-beta.8",
16
16
  "mm": "3.4.0"
17
17
  },
18
18
  "engines": {
@@ -44,5 +44,5 @@
44
44
  "url": "git@github.com:midwayjs/midway.git"
45
45
  },
46
46
  "license": "MIT",
47
- "gitHead": "6a221788112b4d998b3958e0a275579f42816c59"
47
+ "gitHead": "355e55949fdd132b0bdcb4830222a0a027e92ded"
48
48
  }