@midwayjs/faas 3.3.6-beta.2 → 3.3.6-beta.3
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.
- package/dist/framework.d.ts +2 -2
- package/dist/framework.js +3 -5
- package/dist/interface.d.ts +0 -7
- package/dist/interface.js +0 -6
- package/package.json +1 -1
package/dist/framework.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { FaaSContext, IFaaSConfigurationOptions, IMidwayFaaSApplication
|
|
2
|
+
import { FaaSContext, IFaaSConfigurationOptions, IMidwayFaaSApplication } from './interface';
|
|
3
3
|
import { BaseFramework, ContextMiddlewareManager, FunctionMiddleware, IMidwayBootstrapOptions, MidwayEnvironmentService, MidwayFrameworkType, MidwayMiddlewareService, RouterInfo } from '@midwayjs/core';
|
|
4
4
|
import { LoggerOptions } from '@midwayjs/logger';
|
|
5
5
|
import * as http from 'http';
|
|
@@ -23,7 +23,7 @@ export declare class MidwayFaaSFramework extends BaseFramework<IMidwayFaaSApplic
|
|
|
23
23
|
applicationInitialize(options: IMidwayBootstrapOptions): Promise<void>;
|
|
24
24
|
run(): Promise<void>;
|
|
25
25
|
getFrameworkType(): MidwayFrameworkType;
|
|
26
|
-
handleInvokeWrapper(handlerMapping: string
|
|
26
|
+
handleInvokeWrapper(handlerMapping: string): (...args: any[]) => Promise<any>;
|
|
27
27
|
/**
|
|
28
28
|
* @deprecated
|
|
29
29
|
* @param middlewareId
|
package/dist/framework.js
CHANGED
|
@@ -10,7 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createModuleServerlessFramework = exports.MidwayFaaSFramework = void 0;
|
|
13
|
-
const interface_1 = require("./interface");
|
|
14
13
|
const core_1 = require("@midwayjs/core");
|
|
15
14
|
const decorator_1 = require("@midwayjs/decorator");
|
|
16
15
|
const simple_lock_1 = require("@midwayjs/simple-lock");
|
|
@@ -122,7 +121,7 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
122
121
|
getFrameworkType() {
|
|
123
122
|
return core_1.MidwayFrameworkType.FAAS;
|
|
124
123
|
}
|
|
125
|
-
handleInvokeWrapper(handlerMapping
|
|
124
|
+
handleInvokeWrapper(handlerMapping) {
|
|
126
125
|
let funOptions = this.funMappingStore.get(handlerMapping);
|
|
127
126
|
return async (...args) => {
|
|
128
127
|
var _a, _b;
|
|
@@ -130,9 +129,8 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
130
129
|
throw new Error('first parameter must be function context');
|
|
131
130
|
}
|
|
132
131
|
const event = args[0];
|
|
133
|
-
const isLegacyMode =
|
|
134
|
-
const isHttpFunction =
|
|
135
|
-
event.constructor.name === 'IncomingMessage' ||
|
|
132
|
+
const isLegacyMode = event.originContext && event.originEvent;
|
|
133
|
+
const isHttpFunction = event.constructor.name === 'IncomingMessage' ||
|
|
136
134
|
event.constructor.name === 'EventEmitter' ||
|
|
137
135
|
!!(event.headers && event.get);
|
|
138
136
|
if (!funOptions && isHttpFunction) {
|
package/dist/interface.d.ts
CHANGED
|
@@ -53,11 +53,4 @@ export interface IFaaSConfigurationOptions extends IConfigurationOptions {
|
|
|
53
53
|
export interface IWebMiddleware {
|
|
54
54
|
resolve(): FaaSMiddleware;
|
|
55
55
|
}
|
|
56
|
-
export declare enum TRIGGER_TYPE_ENUM {
|
|
57
|
-
HTTP = "http",
|
|
58
|
-
Event = "event"
|
|
59
|
-
}
|
|
60
|
-
export interface InvokeOptions {
|
|
61
|
-
triggerType: TRIGGER_TYPE_ENUM;
|
|
62
|
-
}
|
|
63
56
|
//# sourceMappingURL=interface.d.ts.map
|
package/dist/interface.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TRIGGER_TYPE_ENUM = void 0;
|
|
4
|
-
var TRIGGER_TYPE_ENUM;
|
|
5
|
-
(function (TRIGGER_TYPE_ENUM) {
|
|
6
|
-
TRIGGER_TYPE_ENUM["HTTP"] = "http";
|
|
7
|
-
TRIGGER_TYPE_ENUM["Event"] = "event";
|
|
8
|
-
})(TRIGGER_TYPE_ENUM = exports.TRIGGER_TYPE_ENUM || (exports.TRIGGER_TYPE_ENUM = {}));
|
|
9
3
|
//# sourceMappingURL=interface.js.map
|