@xnestjs/redisess 0.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/LICENSE +21 -0
- package/README.md +3 -0
- package/cjs/index.js +7 -0
- package/cjs/package.json +3 -0
- package/cjs/redisess-core.module.js +110 -0
- package/cjs/redisess.constants.js +5 -0
- package/cjs/redisess.decorators.js +7 -0
- package/cjs/redisess.interface.js +2 -0
- package/cjs/redisess.module.js +25 -0
- package/cjs/redisess.utils.js +12 -0
- package/esm/index.d.ts +4 -0
- package/esm/index.js +4 -0
- package/esm/redisess-core.module.d.ts +14 -0
- package/esm/redisess-core.module.js +107 -0
- package/esm/redisess.constants.d.ts +2 -0
- package/esm/redisess.constants.js +2 -0
- package/esm/redisess.decorators.d.ts +1 -0
- package/esm/redisess.decorators.js +3 -0
- package/esm/redisess.interface.d.ts +21 -0
- package/esm/redisess.interface.js +1 -0
- package/esm/redisess.module.d.ts +6 -0
- package/esm/redisess.module.js +22 -0
- package/esm/redisess.utils.d.ts +3 -0
- package/esm/redisess.utils.js +8 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Panates
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/cjs/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./redisess.decorators.js"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./redisess.interface.js"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./redisess.module.js"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./redisess.utils.js"), exports);
|
package/cjs/package.json
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var RedisessCoreModule_1;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.RedisessCoreModule = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const crypto = tslib_1.__importStar(require("crypto"));
|
|
7
|
+
const redisess_1 = require("redisess");
|
|
8
|
+
const common_1 = require("@nestjs/common");
|
|
9
|
+
const core_1 = require("@nestjs/core");
|
|
10
|
+
const redisess_constants_js_1 = require("./redisess.constants.js");
|
|
11
|
+
const redisess_utils_js_1 = require("./redisess.utils.js");
|
|
12
|
+
let RedisessCoreModule = RedisessCoreModule_1 = class RedisessCoreModule {
|
|
13
|
+
options;
|
|
14
|
+
moduleRef;
|
|
15
|
+
constructor(options, moduleRef) {
|
|
16
|
+
this.options = options;
|
|
17
|
+
this.moduleRef = moduleRef;
|
|
18
|
+
}
|
|
19
|
+
static forRoot(options) {
|
|
20
|
+
const optionsProvider = {
|
|
21
|
+
provide: redisess_constants_js_1.REDISESS_MODULE_OPTIONS,
|
|
22
|
+
useValue: options
|
|
23
|
+
};
|
|
24
|
+
const connectionProvider = {
|
|
25
|
+
provide: (0, redisess_utils_js_1.getSessionManagerToken)(options.name),
|
|
26
|
+
useFactory: () => this.createSessionManager(options)
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
module: RedisessCoreModule_1,
|
|
30
|
+
providers: [connectionProvider, optionsProvider],
|
|
31
|
+
exports: [connectionProvider]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static forRootAsync(asyncOptions) {
|
|
35
|
+
const connectionProvider = {
|
|
36
|
+
provide: (0, redisess_utils_js_1.getSessionManagerToken)(asyncOptions.name),
|
|
37
|
+
inject: [redisess_constants_js_1.REDISESS_MODULE_OPTIONS],
|
|
38
|
+
useFactory: async (oOptions) => {
|
|
39
|
+
const name = asyncOptions.name || oOptions.name;
|
|
40
|
+
return this.createSessionManager({
|
|
41
|
+
...oOptions,
|
|
42
|
+
name
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const asyncProviders = this.createAsyncProviders(asyncOptions);
|
|
47
|
+
return {
|
|
48
|
+
module: RedisessCoreModule_1,
|
|
49
|
+
imports: asyncOptions.imports,
|
|
50
|
+
providers: [
|
|
51
|
+
...asyncProviders,
|
|
52
|
+
connectionProvider,
|
|
53
|
+
{
|
|
54
|
+
provide: redisess_constants_js_1.REDISESS_MODULE_TOKEN,
|
|
55
|
+
useValue: crypto.randomUUID()
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
exports: [connectionProvider]
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async onApplicationShutdown() {
|
|
62
|
+
const sessionManager = this.moduleRef.get((0, redisess_utils_js_1.getSessionManagerToken)(this.options.name));
|
|
63
|
+
if (sessionManager)
|
|
64
|
+
sessionManager.quit();
|
|
65
|
+
}
|
|
66
|
+
static createAsyncProviders(asyncOptions) {
|
|
67
|
+
if (asyncOptions.useExisting || asyncOptions.useFactory)
|
|
68
|
+
return [this.createAsyncOptionsProvider(asyncOptions)];
|
|
69
|
+
if (asyncOptions.useClass)
|
|
70
|
+
return [
|
|
71
|
+
this.createAsyncOptionsProvider(asyncOptions),
|
|
72
|
+
{
|
|
73
|
+
provide: asyncOptions.useClass,
|
|
74
|
+
useClass: asyncOptions.useClass
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');
|
|
78
|
+
}
|
|
79
|
+
static createAsyncOptionsProvider(asyncOptions) {
|
|
80
|
+
if (asyncOptions.useFactory) {
|
|
81
|
+
return {
|
|
82
|
+
provide: redisess_constants_js_1.REDISESS_MODULE_OPTIONS,
|
|
83
|
+
useFactory: asyncOptions.useFactory,
|
|
84
|
+
inject: asyncOptions.inject || []
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const useClass = asyncOptions.useClass || asyncOptions.useExisting;
|
|
88
|
+
if (useClass) {
|
|
89
|
+
return {
|
|
90
|
+
provide: redisess_constants_js_1.REDISESS_MODULE_OPTIONS,
|
|
91
|
+
useFactory: (optionsFactory) => optionsFactory.createOptions(asyncOptions.name),
|
|
92
|
+
inject: [useClass]
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');
|
|
96
|
+
}
|
|
97
|
+
static async createSessionManager(options) {
|
|
98
|
+
const opts = { ...options };
|
|
99
|
+
delete opts.client;
|
|
100
|
+
delete opts.name;
|
|
101
|
+
return new redisess_1.SessionManager(options.client, opts);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
RedisessCoreModule = RedisessCoreModule_1 = tslib_1.__decorate([
|
|
105
|
+
(0, common_1.Global)(),
|
|
106
|
+
(0, common_1.Module)({}),
|
|
107
|
+
tslib_1.__param(0, (0, common_1.Inject)(redisess_constants_js_1.REDISESS_MODULE_OPTIONS)),
|
|
108
|
+
tslib_1.__metadata("design:paramtypes", [Object, core_1.ModuleRef])
|
|
109
|
+
], RedisessCoreModule);
|
|
110
|
+
exports.RedisessCoreModule = RedisessCoreModule;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REDISESS_MODULE_TOKEN = exports.REDISESS_MODULE_OPTIONS = void 0;
|
|
4
|
+
exports.REDISESS_MODULE_OPTIONS = Symbol('REDISESS_MODULE_OPTIONS');
|
|
5
|
+
exports.REDISESS_MODULE_TOKEN = Symbol('REDISESS_MODULE_ID');
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InjectSessionManager = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const redisess_utils_js_1 = require("./redisess.utils.js");
|
|
6
|
+
const InjectSessionManager = (name) => (0, common_1.Inject)((0, redisess_utils_js_1.getSessionManagerToken)(name));
|
|
7
|
+
exports.InjectSessionManager = InjectSessionManager;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var RedisessModule_1;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.RedisessModule = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
const redisess_core_module_js_1 = require("./redisess-core.module.js");
|
|
8
|
+
let RedisessModule = RedisessModule_1 = class RedisessModule {
|
|
9
|
+
static forRoot(options) {
|
|
10
|
+
return {
|
|
11
|
+
module: RedisessModule_1,
|
|
12
|
+
imports: [redisess_core_module_js_1.RedisessCoreModule.forRoot(options)]
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
static forRootAsync(options) {
|
|
16
|
+
return {
|
|
17
|
+
module: RedisessModule_1,
|
|
18
|
+
imports: [redisess_core_module_js_1.RedisessCoreModule.forRootAsync(options)]
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
RedisessModule = RedisessModule_1 = tslib_1.__decorate([
|
|
23
|
+
(0, common_1.Module)({})
|
|
24
|
+
], RedisessModule);
|
|
25
|
+
exports.RedisessModule = RedisessModule;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSessionManagerToken = void 0;
|
|
4
|
+
const redisess_1 = require("redisess");
|
|
5
|
+
function getSessionManagerToken(name) {
|
|
6
|
+
if (!name)
|
|
7
|
+
return redisess_1.SessionManager;
|
|
8
|
+
if (typeof name === 'symbol' || typeof name === 'function')
|
|
9
|
+
return name;
|
|
10
|
+
return `${name}_SessionManager`;
|
|
11
|
+
}
|
|
12
|
+
exports.getSessionManagerToken = getSessionManagerToken;
|
package/esm/index.d.ts
ADDED
package/esm/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DynamicModule, OnApplicationShutdown } from '@nestjs/common';
|
|
2
|
+
import { ModuleRef } from '@nestjs/core';
|
|
3
|
+
import { RedisesModuleAsyncOptions, RedisessModuleOptions } from './redisess.interface.js';
|
|
4
|
+
export declare class RedisessCoreModule implements OnApplicationShutdown {
|
|
5
|
+
private readonly options;
|
|
6
|
+
private readonly moduleRef;
|
|
7
|
+
constructor(options: RedisessModuleOptions, moduleRef: ModuleRef);
|
|
8
|
+
static forRoot(options: RedisessModuleOptions): DynamicModule;
|
|
9
|
+
static forRootAsync(asyncOptions: RedisesModuleAsyncOptions): DynamicModule;
|
|
10
|
+
onApplicationShutdown(): Promise<void>;
|
|
11
|
+
private static createAsyncProviders;
|
|
12
|
+
private static createAsyncOptionsProvider;
|
|
13
|
+
private static createSessionManager;
|
|
14
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
var RedisessCoreModule_1;
|
|
2
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
3
|
+
import * as crypto from 'crypto';
|
|
4
|
+
import { SessionManager } from 'redisess';
|
|
5
|
+
import { Global, Inject, Module } from '@nestjs/common';
|
|
6
|
+
import { ModuleRef } from '@nestjs/core';
|
|
7
|
+
import { REDISESS_MODULE_OPTIONS, REDISESS_MODULE_TOKEN } from './redisess.constants.js';
|
|
8
|
+
import { getSessionManagerToken } from './redisess.utils.js';
|
|
9
|
+
let RedisessCoreModule = RedisessCoreModule_1 = class RedisessCoreModule {
|
|
10
|
+
options;
|
|
11
|
+
moduleRef;
|
|
12
|
+
constructor(options, moduleRef) {
|
|
13
|
+
this.options = options;
|
|
14
|
+
this.moduleRef = moduleRef;
|
|
15
|
+
}
|
|
16
|
+
static forRoot(options) {
|
|
17
|
+
const optionsProvider = {
|
|
18
|
+
provide: REDISESS_MODULE_OPTIONS,
|
|
19
|
+
useValue: options
|
|
20
|
+
};
|
|
21
|
+
const connectionProvider = {
|
|
22
|
+
provide: getSessionManagerToken(options.name),
|
|
23
|
+
useFactory: () => this.createSessionManager(options)
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
module: RedisessCoreModule_1,
|
|
27
|
+
providers: [connectionProvider, optionsProvider],
|
|
28
|
+
exports: [connectionProvider]
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
static forRootAsync(asyncOptions) {
|
|
32
|
+
const connectionProvider = {
|
|
33
|
+
provide: getSessionManagerToken(asyncOptions.name),
|
|
34
|
+
inject: [REDISESS_MODULE_OPTIONS],
|
|
35
|
+
useFactory: async (oOptions) => {
|
|
36
|
+
const name = asyncOptions.name || oOptions.name;
|
|
37
|
+
return this.createSessionManager({
|
|
38
|
+
...oOptions,
|
|
39
|
+
name
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const asyncProviders = this.createAsyncProviders(asyncOptions);
|
|
44
|
+
return {
|
|
45
|
+
module: RedisessCoreModule_1,
|
|
46
|
+
imports: asyncOptions.imports,
|
|
47
|
+
providers: [
|
|
48
|
+
...asyncProviders,
|
|
49
|
+
connectionProvider,
|
|
50
|
+
{
|
|
51
|
+
provide: REDISESS_MODULE_TOKEN,
|
|
52
|
+
useValue: crypto.randomUUID()
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
exports: [connectionProvider]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
async onApplicationShutdown() {
|
|
59
|
+
const sessionManager = this.moduleRef.get(getSessionManagerToken(this.options.name));
|
|
60
|
+
if (sessionManager)
|
|
61
|
+
sessionManager.quit();
|
|
62
|
+
}
|
|
63
|
+
static createAsyncProviders(asyncOptions) {
|
|
64
|
+
if (asyncOptions.useExisting || asyncOptions.useFactory)
|
|
65
|
+
return [this.createAsyncOptionsProvider(asyncOptions)];
|
|
66
|
+
if (asyncOptions.useClass)
|
|
67
|
+
return [
|
|
68
|
+
this.createAsyncOptionsProvider(asyncOptions),
|
|
69
|
+
{
|
|
70
|
+
provide: asyncOptions.useClass,
|
|
71
|
+
useClass: asyncOptions.useClass
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');
|
|
75
|
+
}
|
|
76
|
+
static createAsyncOptionsProvider(asyncOptions) {
|
|
77
|
+
if (asyncOptions.useFactory) {
|
|
78
|
+
return {
|
|
79
|
+
provide: REDISESS_MODULE_OPTIONS,
|
|
80
|
+
useFactory: asyncOptions.useFactory,
|
|
81
|
+
inject: asyncOptions.inject || []
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const useClass = asyncOptions.useClass || asyncOptions.useExisting;
|
|
85
|
+
if (useClass) {
|
|
86
|
+
return {
|
|
87
|
+
provide: REDISESS_MODULE_OPTIONS,
|
|
88
|
+
useFactory: (optionsFactory) => optionsFactory.createOptions(asyncOptions.name),
|
|
89
|
+
inject: [useClass]
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');
|
|
93
|
+
}
|
|
94
|
+
static async createSessionManager(options) {
|
|
95
|
+
const opts = { ...options };
|
|
96
|
+
delete opts.client;
|
|
97
|
+
delete opts.name;
|
|
98
|
+
return new SessionManager(options.client, opts);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
RedisessCoreModule = RedisessCoreModule_1 = __decorate([
|
|
102
|
+
Global(),
|
|
103
|
+
Module({}),
|
|
104
|
+
__param(0, Inject(REDISESS_MODULE_OPTIONS)),
|
|
105
|
+
__metadata("design:paramtypes", [Object, ModuleRef])
|
|
106
|
+
], RedisessCoreModule);
|
|
107
|
+
export { RedisessCoreModule };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const InjectSessionManager: (name?: string) => ParameterDecorator;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Redis from 'ioredis';
|
|
2
|
+
import { SessionManager } from 'redisess';
|
|
3
|
+
import { Type } from '@nestjs/common';
|
|
4
|
+
import { ModuleMetadata } from '@nestjs/common/interfaces';
|
|
5
|
+
export interface RedisessModuleOptions extends SessionManager.Options {
|
|
6
|
+
/**
|
|
7
|
+
* Connection name
|
|
8
|
+
*/
|
|
9
|
+
name?: string;
|
|
10
|
+
client: Redis;
|
|
11
|
+
}
|
|
12
|
+
export interface RedisessModuleOptionsFactory {
|
|
13
|
+
createOptions(connectionName?: string): Promise<RedisessModuleOptions> | RedisessModuleOptions;
|
|
14
|
+
}
|
|
15
|
+
export interface RedisesModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
16
|
+
name?: string;
|
|
17
|
+
useExisting?: Type<RedisessModuleOptionsFactory>;
|
|
18
|
+
useClass?: Type<RedisessModuleOptionsFactory>;
|
|
19
|
+
useFactory?: (...args: any[]) => Promise<RedisessModuleOptions> | RedisessModuleOptions;
|
|
20
|
+
inject?: any[];
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { RedisesModuleAsyncOptions, RedisessModuleOptions } from './redisess.interface.js';
|
|
3
|
+
export declare class RedisessModule {
|
|
4
|
+
static forRoot(options: RedisessModuleOptions): DynamicModule;
|
|
5
|
+
static forRootAsync(options: RedisesModuleAsyncOptions): DynamicModule;
|
|
6
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var RedisessModule_1;
|
|
2
|
+
import { __decorate } from "tslib";
|
|
3
|
+
import { Module } from '@nestjs/common';
|
|
4
|
+
import { RedisessCoreModule } from './redisess-core.module.js';
|
|
5
|
+
let RedisessModule = RedisessModule_1 = class RedisessModule {
|
|
6
|
+
static forRoot(options) {
|
|
7
|
+
return {
|
|
8
|
+
module: RedisessModule_1,
|
|
9
|
+
imports: [RedisessCoreModule.forRoot(options)]
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
static forRootAsync(options) {
|
|
13
|
+
return {
|
|
14
|
+
module: RedisessModule_1,
|
|
15
|
+
imports: [RedisessCoreModule.forRootAsync(options)]
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
RedisessModule = RedisessModule_1 = __decorate([
|
|
20
|
+
Module({})
|
|
21
|
+
], RedisessModule);
|
|
22
|
+
export { RedisessModule };
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xnestjs/redisess",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "NestJS extension library for redisess",
|
|
5
|
+
"author": "Panates",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"compile": "tsc",
|
|
9
|
+
"prebuild": "npm run lint && npm run clean",
|
|
10
|
+
"build": "npm run build:cjs && npm run build:esm",
|
|
11
|
+
"build:cjs": "tsc -b tsconfig-build-cjs.json",
|
|
12
|
+
"build:esm": "tsc -b tsconfig-build-esm.json",
|
|
13
|
+
"postbuild": "cp README.md package.json ../../LICENSE ../../build/redisess && cp ../../package.cjs.json ../../build/redisess/cjs/package.json",
|
|
14
|
+
"lint": "eslint .",
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"cover": "jest --collect-coverage",
|
|
17
|
+
"clean": "npm run clean:src && npm run clean:dist && npm run clean:cover",
|
|
18
|
+
"clean:src": "ts-cleanup -s src --all",
|
|
19
|
+
"clean:dist": "rimraf ../../build/redisess",
|
|
20
|
+
"clean:cover": "rimraf ../../coverage/redisess"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@nestjs/common": "^9.0.11",
|
|
24
|
+
"@nestjs/core": "^9.0.11",
|
|
25
|
+
"@nestjs/testing": "^9.0.11"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@nestjs/common": ">=7.4.0",
|
|
29
|
+
"redisess": "^2.1.0"
|
|
30
|
+
},
|
|
31
|
+
"type": "module",
|
|
32
|
+
"main": "cjs/index.js",
|
|
33
|
+
"module": "esm/index.js",
|
|
34
|
+
"types": "esm/index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"require": "./cjs/index.js",
|
|
38
|
+
"default": "./esm/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./cjs": "./cjs/index.js",
|
|
41
|
+
"./esm": "./esm/index.js"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=16.0",
|
|
45
|
+
"npm": ">=7.0.0"
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"bin/",
|
|
49
|
+
"cjs/",
|
|
50
|
+
"esm/",
|
|
51
|
+
"LICENSE",
|
|
52
|
+
"README.md"
|
|
53
|
+
],
|
|
54
|
+
"keywords": [
|
|
55
|
+
"nestjs",
|
|
56
|
+
"redisess",
|
|
57
|
+
"session",
|
|
58
|
+
"manager",
|
|
59
|
+
"redis"
|
|
60
|
+
]
|
|
61
|
+
}
|