@midwayjs/core 3.4.4 → 3.4.6
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.
|
@@ -28,7 +28,7 @@ export declare abstract class DataSourceManager<T> {
|
|
|
28
28
|
abstract getName(): string;
|
|
29
29
|
protected abstract createDataSource(config: any, dataSourceName: string): Promise<T | void> | (T | void);
|
|
30
30
|
protected abstract checkConnected(dataSource: T): Promise<boolean>;
|
|
31
|
-
protected destroyDataSource(dataSource: T): Promise<void>;
|
|
31
|
+
protected abstract destroyDataSource(dataSource: T): Promise<void>;
|
|
32
32
|
stop(): Promise<void>;
|
|
33
33
|
}
|
|
34
34
|
export declare function globModels(globString: string, appDir: string): any[];
|
|
@@ -91,11 +91,11 @@ class DataSourceManager {
|
|
|
91
91
|
getDataSourceNameByModel(modelOrRepository) {
|
|
92
92
|
return this.modelMapping.get(modelOrRepository);
|
|
93
93
|
}
|
|
94
|
-
async destroyDataSource(dataSource) { }
|
|
95
94
|
async stop() {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
const arr = Array.from(this.dataSource.values());
|
|
96
|
+
await Promise.all(arr.map(dbh => {
|
|
97
|
+
return this.destroyDataSource(dbh);
|
|
98
|
+
}));
|
|
99
99
|
this.dataSource.clear();
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -30,6 +30,7 @@ let MidwayServerlessFunctionService = class MidwayServerlessFunctionService exte
|
|
|
30
30
|
for (const routerInfo of this.routes.values()) {
|
|
31
31
|
for (const info of routerInfo) {
|
|
32
32
|
if (info.requestMethod === 'all') {
|
|
33
|
+
info.functionTriggerMetadata = info.functionTriggerMetadata || {};
|
|
33
34
|
info.functionTriggerMetadata.method = [
|
|
34
35
|
'get',
|
|
35
36
|
'post',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/core",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.6",
|
|
4
4
|
"description": "midway core",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"midway-test-component": "*",
|
|
27
27
|
"mm": "3.2.0",
|
|
28
28
|
"raw-body": "2.5.1",
|
|
29
|
-
"sinon": "
|
|
29
|
+
"sinon": "14.0.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@midwayjs/decorator": "*"
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=12"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "36687482782bcf526efc2a4773c09e166820c1a8"
|
|
49
49
|
}
|