@eggjs/session 4.0.0 → 4.0.1

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 CHANGED
@@ -41,19 +41,19 @@ egg-session support external store, you can store your sessions in redis, memcac
41
41
 
42
42
  For example, if you want to store session in redis, you must:
43
43
 
44
- 1. Dependent [egg-redis](https://github.com/eggjs/egg-redis)
44
+ 1. Dependent [@eggjs/redis](https://github.com/eggjs/redis)
45
45
 
46
46
  ```bash
47
- npm i --save egg-redis
47
+ npm i --save @eggjs/redis
48
48
  ```
49
49
 
50
- 2. Import egg-redis as a plugin and set the configuration
50
+ 2. Import `@eggjs/redis` as a plugin and set the configuration
51
51
 
52
52
  ```js
53
53
  // config/plugin.js
54
54
  exports.redis = {
55
55
  enable: true,
56
- package: 'egg-redis',
56
+ package: '@eggjs/redis',
57
57
  };
58
58
  ```
59
59
 
@@ -1,6 +1,11 @@
1
1
  import type { SessionConfig } from './config/config.default.js';
2
+ import type { SessionStoreOrAppSessionStoreClass, SessionStore } from './app/extend/application.js';
2
3
  declare module '@eggjs/core' {
3
4
  interface EggAppConfig {
4
5
  session: SessionConfig;
5
6
  }
7
+ interface EggCore {
8
+ set sessionStore(store: SessionStoreOrAppSessionStoreClass | null | undefined);
9
+ get sessionStore(): SessionStore | undefined;
10
+ }
6
11
  }
@@ -1,6 +1,11 @@
1
1
  import type { SessionConfig } from './config/config.default.js';
2
+ import type { SessionStoreOrAppSessionStoreClass, SessionStore } from './app/extend/application.js';
2
3
  declare module '@eggjs/core' {
3
4
  interface EggAppConfig {
4
5
  session: SessionConfig;
5
6
  }
7
+ interface EggCore {
8
+ set sessionStore(store: SessionStoreOrAppSessionStoreClass | null | undefined);
9
+ get sessionStore(): SessionStore | undefined;
10
+ }
6
11
  }
package/dist/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@eggjs/session",
3
- "version": "4.0.0"
3
+ "version": "4.0.1"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eggjs/session",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -29,7 +29,7 @@
29
29
  "node": ">= 18.19.0"
30
30
  },
31
31
  "dependencies": {
32
- "@eggjs/core": "^6.2.13",
32
+ "@eggjs/core": "^6.3.1",
33
33
  "koa-session": "^7.0.2",
34
34
  "zod": "^3.24.1"
35
35
  },
@@ -37,12 +37,12 @@
37
37
  "@arethetypeswrong/cli": "^0.17.1",
38
38
  "@eggjs/bin": "7",
39
39
  "@eggjs/mock": "^6.0.5",
40
+ "@eggjs/redis": "^3.0.0",
40
41
  "@eggjs/supertest": "^8.2.0",
41
42
  "@eggjs/tsconfig": "1",
42
43
  "@types/mocha": "10",
43
44
  "@types/node": "22",
44
- "egg": "^4.0.1",
45
- "egg-redis": "^2.6.0",
45
+ "egg": "^4.0.3",
46
46
  "eslint": "8",
47
47
  "eslint-config-egg": "14",
48
48
  "rimraf": "6",
package/src/types.ts CHANGED
@@ -1,8 +1,15 @@
1
1
  import type { SessionConfig } from './config/config.default.js';
2
+ import type { SessionStoreOrAppSessionStoreClass, SessionStore } from './app/extend/application.js';
2
3
 
3
4
  declare module '@eggjs/core' {
4
5
  // add EggAppConfig overrides types
5
6
  interface EggAppConfig {
6
7
  session: SessionConfig;
7
8
  }
9
+
10
+ interface EggCore {
11
+ // add EggCore instance property
12
+ set sessionStore(store: SessionStoreOrAppSessionStoreClass | null | undefined);
13
+ get sessionStore(): SessionStore | undefined;
14
+ }
8
15
  }