@midwayjs/express-session 3.5.3 → 3.6.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.
- package/README.md +1 -1
- package/dist/configuration.js +3 -4
- package/dist/middleware/session.js +5 -6
- package/dist/store.js +3 -3
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ You can use compatible session store [here](https://github.com/expressjs/session
|
|
|
44
44
|
Let's give an example for [memorystore](https://github.com/roccomuso/memorystore).
|
|
45
45
|
|
|
46
46
|
```ts
|
|
47
|
-
import { Configuration, Inject } from '@midwayjs/
|
|
47
|
+
import { Configuration, Inject } from '@midwayjs/core';
|
|
48
48
|
import * as session from '@midwayjs/express-session';
|
|
49
49
|
import MemoryStore = require('memorystore');
|
|
50
50
|
|
package/dist/configuration.js
CHANGED
|
@@ -10,10 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SessionConfiguration = void 0;
|
|
13
|
-
const
|
|
13
|
+
const core_1 = require("@midwayjs/core");
|
|
14
14
|
const DefaultConfig = require("./config/config.default");
|
|
15
15
|
const session_1 = require("./middleware/session");
|
|
16
|
-
const core_1 = require("@midwayjs/core");
|
|
17
16
|
let SessionConfiguration = class SessionConfiguration {
|
|
18
17
|
async onReady() {
|
|
19
18
|
this.applicationManager.getApplications(['express']).forEach(app => {
|
|
@@ -22,11 +21,11 @@ let SessionConfiguration = class SessionConfiguration {
|
|
|
22
21
|
}
|
|
23
22
|
};
|
|
24
23
|
__decorate([
|
|
25
|
-
(0,
|
|
24
|
+
(0, core_1.Inject)(),
|
|
26
25
|
__metadata("design:type", core_1.MidwayApplicationManager)
|
|
27
26
|
], SessionConfiguration.prototype, "applicationManager", void 0);
|
|
28
27
|
SessionConfiguration = __decorate([
|
|
29
|
-
(0,
|
|
28
|
+
(0, core_1.Configuration)({
|
|
30
29
|
namespace: 'session',
|
|
31
30
|
importConfigs: [
|
|
32
31
|
{
|
|
@@ -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.SessionMiddleware = void 0;
|
|
13
|
-
const decorator_1 = require("@midwayjs/decorator");
|
|
14
13
|
const core_1 = require("@midwayjs/core");
|
|
15
14
|
const session = require("express-session");
|
|
16
15
|
const cookieSession = require("cookie-session");
|
|
@@ -47,23 +46,23 @@ let SessionMiddleware = class SessionMiddleware {
|
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
48
|
__decorate([
|
|
50
|
-
(0,
|
|
49
|
+
(0, core_1.Config)('session'),
|
|
51
50
|
__metadata("design:type", Object)
|
|
52
51
|
], SessionMiddleware.prototype, "sessionConfig", void 0);
|
|
53
52
|
__decorate([
|
|
54
|
-
(0,
|
|
53
|
+
(0, core_1.Logger)(),
|
|
55
54
|
__metadata("design:type", Object)
|
|
56
55
|
], SessionMiddleware.prototype, "logger", void 0);
|
|
57
56
|
__decorate([
|
|
58
|
-
(0,
|
|
57
|
+
(0, core_1.Inject)(),
|
|
59
58
|
__metadata("design:type", store_1.SessionStoreManager)
|
|
60
59
|
], SessionMiddleware.prototype, "sessionStoreManager", void 0);
|
|
61
60
|
__decorate([
|
|
62
|
-
(0,
|
|
61
|
+
(0, core_1.Inject)(),
|
|
63
62
|
__metadata("design:type", core_1.MidwayConfigService)
|
|
64
63
|
], SessionMiddleware.prototype, "configService", void 0);
|
|
65
64
|
SessionMiddleware = __decorate([
|
|
66
|
-
(0,
|
|
65
|
+
(0, core_1.Middleware)()
|
|
67
66
|
], SessionMiddleware);
|
|
68
67
|
exports.SessionMiddleware = SessionMiddleware;
|
|
69
68
|
//# sourceMappingURL=session.js.map
|
package/dist/store.js
CHANGED
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.SessionStoreManager = void 0;
|
|
10
|
-
const
|
|
10
|
+
const core_1 = require("@midwayjs/core");
|
|
11
11
|
let SessionStoreManager = class SessionStoreManager {
|
|
12
12
|
setSessionStore(sessionStore, options) {
|
|
13
13
|
this.sessionStoreClz = sessionStore;
|
|
@@ -21,8 +21,8 @@ let SessionStoreManager = class SessionStoreManager {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
SessionStoreManager = __decorate([
|
|
24
|
-
(0,
|
|
25
|
-
(0,
|
|
24
|
+
(0, core_1.Provide)(),
|
|
25
|
+
(0, core_1.Scope)(core_1.ScopeEnum.Singleton)
|
|
26
26
|
], SessionStoreManager);
|
|
27
27
|
exports.SessionStoreManager = SessionStoreManager;
|
|
28
28
|
//# sourceMappingURL=store.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/express-session",
|
|
3
3
|
"description": "midway session component for express",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.6.0",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -10,9 +10,8 @@
|
|
|
10
10
|
"index.d.ts"
|
|
11
11
|
],
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@midwayjs/core": "^3.
|
|
14
|
-
"@midwayjs/
|
|
15
|
-
"@midwayjs/mock": "^3.5.3",
|
|
13
|
+
"@midwayjs/core": "^3.6.0",
|
|
14
|
+
"@midwayjs/mock": "^3.6.0",
|
|
16
15
|
"@types/express-session": "1.17.5",
|
|
17
16
|
"memorystore": "1.6.7"
|
|
18
17
|
},
|
|
@@ -42,5 +41,5 @@
|
|
|
42
41
|
"type": "git",
|
|
43
42
|
"url": "https://github.com/midwayjs/midway.git"
|
|
44
43
|
},
|
|
45
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "22643b0e8519766bb7c68b975930199fc136336e"
|
|
46
45
|
}
|