@smartsoft001/auth-shell-nestjs 1.1.90 → 2.68.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/.eslintrc.json +26 -0
- package/README.md +57 -2
- package/jest.config.ts +26 -0
- package/package.json +3 -36
- package/project.json +37 -0
- package/src/index.ts +2 -0
- package/src/lib/controllers/token/token.controller.ts +18 -0
- package/src/lib/nestjs.module.ts +73 -0
- package/tsconfig.json +13 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.spec.json +20 -0
- package/src/index.d.ts +0 -2
- package/src/index.js +0 -6
- package/src/index.js.map +0 -1
- package/src/lib/controllers/token/token.controller.d.ts +0 -8
- package/src/lib/controllers/token/token.controller.js +0 -27
- package/src/lib/controllers/token/token.controller.js.map +0 -1
- package/src/lib/nestjs.module.d.ts +0 -12
- package/src/lib/nestjs.module.js +0 -79
- package/src/lib/nestjs.module.js.map +0 -1
- package/test-setup.js +0 -1
- package/test-setup.js.map +0 -1
- /package/{test-setup.d.ts → test-setup.ts} +0 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["../../../../.eslintrc.json"],
|
|
3
|
+
"ignorePatterns": ["!**/*"],
|
|
4
|
+
"rules": {
|
|
5
|
+
"import/order": "off"
|
|
6
|
+
},
|
|
7
|
+
"overrides": [
|
|
8
|
+
{
|
|
9
|
+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
10
|
+
"rules": {}
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"files": ["*.ts", "*.tsx"],
|
|
14
|
+
"rules": {}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"files": ["*.js", "*.jsx"],
|
|
18
|
+
"rules": {}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"files": "package.json",
|
|
22
|
+
"parser": "jsonc-eslint-parser",
|
|
23
|
+
"rules": {}
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
package/README.md
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
|
-
# auth-shell-nestjs
|
|
1
|
+
# @smartsoft001/auth-shell-nestjs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
`npm i @smartsoft001/auth-shell-nestjs`
|
|
6
|
+
|
|
7
|
+
## Modules
|
|
8
|
+
|
|
9
|
+
### AuthShellNestjsModule
|
|
10
|
+
|
|
11
|
+
<table>
|
|
12
|
+
<thead>
|
|
13
|
+
<tr>
|
|
14
|
+
<td>Method</td>
|
|
15
|
+
<td>Description</td>
|
|
16
|
+
</tr>
|
|
17
|
+
</thead>
|
|
18
|
+
<tr>
|
|
19
|
+
<td>forRoot(options: { tokenConfig: TokenConfig })</td>
|
|
20
|
+
<td>Configures the auth module with JWT, Passport, and TypeORM integration</td>
|
|
21
|
+
</tr>
|
|
22
|
+
</table>
|
|
23
|
+
|
|
24
|
+
### Configuration Options
|
|
25
|
+
|
|
26
|
+
<table>
|
|
27
|
+
<thead>
|
|
28
|
+
<tr>
|
|
29
|
+
<td>Property</td>
|
|
30
|
+
<td>Description</td>
|
|
31
|
+
</tr>
|
|
32
|
+
</thead>
|
|
33
|
+
<tr>
|
|
34
|
+
<td>tokenConfig.secretOrPrivateKey</td>
|
|
35
|
+
<td>JWT secret key for token signing</td>
|
|
36
|
+
</tr>
|
|
37
|
+
<tr>
|
|
38
|
+
<td>tokenConfig.expiredIn</td>
|
|
39
|
+
<td>Token expiration time</td>
|
|
40
|
+
</tr>
|
|
41
|
+
</table>
|
|
42
|
+
|
|
43
|
+
## Controllers
|
|
44
|
+
|
|
45
|
+
### TokenController
|
|
46
|
+
|
|
47
|
+
<table>
|
|
48
|
+
<thead>
|
|
49
|
+
<tr>
|
|
50
|
+
<td>Endpoint</td>
|
|
51
|
+
<td>Description</td>
|
|
52
|
+
</tr>
|
|
53
|
+
</thead>
|
|
54
|
+
<tr>
|
|
55
|
+
<td>POST /token</td>
|
|
56
|
+
<td>Creates authentication tokens supporting password, refresh token, Facebook, and Google grant types</td>
|
|
57
|
+
</tr>
|
|
58
|
+
</table>
|
|
4
59
|
|
|
5
60
|
## Running unit tests
|
|
6
61
|
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
export default {
|
|
3
|
+
displayName: 'auth-shell-nestjs',
|
|
4
|
+
preset: '../../../../jest.preset.js',
|
|
5
|
+
testEnvironment: 'node',
|
|
6
|
+
transform: {
|
|
7
|
+
'^.+\\.[tj]sx?$': [
|
|
8
|
+
'ts-jest',
|
|
9
|
+
{
|
|
10
|
+
tsConfig: '<rootDir>/tsconfig.spec.json',
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
|
15
|
+
coverageDirectory: '../../../../coverage/packages/auth/shell/nestjs',
|
|
16
|
+
/* TODO: Update to latest Jest snapshotFormat
|
|
17
|
+
* By default Nx has kept the older style of Jest Snapshot formats
|
|
18
|
+
* to prevent breaking of any existing tests with snapshots.
|
|
19
|
+
* It's recommend you update to the latest format.
|
|
20
|
+
* You can do this by removing snapshotFormat property
|
|
21
|
+
* and running tests with --update-snapshot flag.
|
|
22
|
+
* Example: From within the project directory, run "nx test --update-snapshot"
|
|
23
|
+
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
|
|
24
|
+
*/
|
|
25
|
+
snapshotFormat: { escapeString: true, printBasicPrototype: true },
|
|
26
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartsoft001/auth-shell-nestjs",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Utils
|
|
3
|
+
"version": "2.68.0",
|
|
4
|
+
"description": "Utils for authorization",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/emiljuchnikowski/smartsoft.git"
|
|
@@ -12,38 +12,5 @@
|
|
|
12
12
|
"nestjs"
|
|
13
13
|
],
|
|
14
14
|
"author": "Emil Juchnikowski",
|
|
15
|
-
"license": "MIT"
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@angular/common": "16.1.3",
|
|
18
|
-
"@angular/core": "16.1.3",
|
|
19
|
-
"@angular/platform-browser-dynamic": "16.1.3",
|
|
20
|
-
"@nestjs/axios": "3.0.0",
|
|
21
|
-
"@nestjs/common": "^10.0.5",
|
|
22
|
-
"@nestjs/core": "^10.0.5",
|
|
23
|
-
"@nestjs/jwt": "^10.1.0",
|
|
24
|
-
"@nestjs/passport": "^10.0.0",
|
|
25
|
-
"@nestjs/typeorm": "^10.0.0",
|
|
26
|
-
"express": "4.18.2",
|
|
27
|
-
"flatted": "^3.2.4",
|
|
28
|
-
"guid-typescript": "1.0.9",
|
|
29
|
-
"lodash": "^4.17.20",
|
|
30
|
-
"md5": "2.3.0",
|
|
31
|
-
"reflect-metadata": "0.1.13",
|
|
32
|
-
"rxjs": "7.8.1",
|
|
33
|
-
"typeorm": "0.3.17"
|
|
34
|
-
},
|
|
35
|
-
"peerDependencies": {
|
|
36
|
-
"@smartsoft001/auth-domain": "1.1.90",
|
|
37
|
-
"@smartsoft001/auth-shell-app-services": "1.1.90",
|
|
38
|
-
"@smartsoft001/domain-core": "1.1.90",
|
|
39
|
-
"@smartsoft001/fb": "1.1.90",
|
|
40
|
-
"@smartsoft001/google": "1.1.90",
|
|
41
|
-
"@smartsoft001/models": "1.1.90",
|
|
42
|
-
"@smartsoft001/users": "1.1.90",
|
|
43
|
-
"@smartsoft001/utils": "1.1.90",
|
|
44
|
-
"util": "0.12.5",
|
|
45
|
-
"tslib": "2.5.3"
|
|
46
|
-
},
|
|
47
|
-
"main": "./src/index.js",
|
|
48
|
-
"types": "./src/index.d.ts"
|
|
15
|
+
"license": "MIT"
|
|
49
16
|
}
|
package/project.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "auth-shell-nestjs",
|
|
3
|
+
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "packages/auth/shell/nestjs/src",
|
|
5
|
+
"projectType": "library",
|
|
6
|
+
"targets": {
|
|
7
|
+
"lint": {
|
|
8
|
+
"executor": "@nx/eslint:lint",
|
|
9
|
+
"outputs": ["{options.outputFile}"],
|
|
10
|
+
"options": {
|
|
11
|
+
"lintFilePatterns": [
|
|
12
|
+
"packages/auth/shell/nestjs/**/*.{ts,tsx,js,jsx}",
|
|
13
|
+
"packages/auth/shell/nestjs/package.json"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"test": {
|
|
18
|
+
"executor": "@nx/jest:jest",
|
|
19
|
+
"outputs": ["{workspaceRoot}/coverage/packages/auth/shell/nestjs"],
|
|
20
|
+
"options": {
|
|
21
|
+
"jestConfig": "packages/auth/shell/nestjs/jest.config.ts"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"build": {
|
|
25
|
+
"executor": "@nx/esbuild:esbuild",
|
|
26
|
+
"outputs": ["{options.outputPath}"],
|
|
27
|
+
"options": {
|
|
28
|
+
"outputPath": "dist/packages/auth/shell/nestjs",
|
|
29
|
+
"tsConfig": "packages/auth/shell/nestjs/tsconfig.lib.json",
|
|
30
|
+
"packageJson": "packages/auth/shell/nestjs/package.json",
|
|
31
|
+
"main": "packages/auth/shell/nestjs/src/index.ts",
|
|
32
|
+
"assets": ["packages/auth/shell/nestjs/*.md"]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"tags": ["scope:auth", "type:shell"]
|
|
37
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Body, Controller, Post, Req } from '@nestjs/common';
|
|
2
|
+
import { IAuthToken, IAuthTokenRequest } from '@smartsoft001/auth-domain';
|
|
3
|
+
import { AuthService } from '@smartsoft001/auth-shell-app-services';
|
|
4
|
+
import { Request } from 'express';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@Controller('token')
|
|
8
|
+
export class TokenController {
|
|
9
|
+
constructor(private readonly service: AuthService) {}
|
|
10
|
+
|
|
11
|
+
@Post()
|
|
12
|
+
create(
|
|
13
|
+
@Body() req: IAuthTokenRequest,
|
|
14
|
+
@Req() httpReq: Request,
|
|
15
|
+
): Promise<IAuthToken> {
|
|
16
|
+
return this.service.create(req, httpReq);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { HttpModule } from '@nestjs/axios';
|
|
2
|
+
import { DynamicModule, Module } from '@nestjs/common';
|
|
3
|
+
import { JwtModule } from '@nestjs/jwt';
|
|
4
|
+
import { PassportModule } from '@nestjs/passport';
|
|
5
|
+
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
6
|
+
import {
|
|
7
|
+
DOMAIN_SERVICES,
|
|
8
|
+
ENTITIES,
|
|
9
|
+
TokenConfig,
|
|
10
|
+
} from '@smartsoft001/auth-domain';
|
|
11
|
+
import { AuthService } from '@smartsoft001/auth-shell-app-services';
|
|
12
|
+
import { FbService } from '@smartsoft001/fb';
|
|
13
|
+
import { GoogleService } from '@smartsoft001/google';
|
|
14
|
+
|
|
15
|
+
import { TokenController } from './controllers/token/token.controller';
|
|
16
|
+
|
|
17
|
+
@Module({})
|
|
18
|
+
export class AuthShellNestjsModule {
|
|
19
|
+
static forRoot(options: { tokenConfig: TokenConfig }): DynamicModule {
|
|
20
|
+
return {
|
|
21
|
+
module: AuthShellNestjsModule,
|
|
22
|
+
controllers: [TokenController],
|
|
23
|
+
providers: [
|
|
24
|
+
{ provide: TokenConfig, useValue: options.tokenConfig },
|
|
25
|
+
AuthService,
|
|
26
|
+
FbService,
|
|
27
|
+
GoogleService,
|
|
28
|
+
...DOMAIN_SERVICES,
|
|
29
|
+
],
|
|
30
|
+
imports: [
|
|
31
|
+
HttpModule,
|
|
32
|
+
TypeOrmModule.forFeature(ENTITIES),
|
|
33
|
+
PassportModule.register({ defaultStrategy: 'jwt', session: false }),
|
|
34
|
+
JwtModule.register({
|
|
35
|
+
secret: options.tokenConfig.secretOrPrivateKey,
|
|
36
|
+
signOptions: {
|
|
37
|
+
expiresIn: options.tokenConfig.expiredIn,
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
],
|
|
41
|
+
exports: [FbService, GoogleService],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@Module({})
|
|
47
|
+
export class AuthShellNestjsCoreModule {
|
|
48
|
+
static forRoot(options: { tokenConfig: TokenConfig }): DynamicModule {
|
|
49
|
+
return {
|
|
50
|
+
module: AuthShellNestjsModule,
|
|
51
|
+
providers: [
|
|
52
|
+
{ provide: TokenConfig, useValue: options.tokenConfig },
|
|
53
|
+
AuthService,
|
|
54
|
+
...DOMAIN_SERVICES,
|
|
55
|
+
],
|
|
56
|
+
exports: [
|
|
57
|
+
AuthService,
|
|
58
|
+
...DOMAIN_SERVICES,
|
|
59
|
+
{ provide: TokenConfig, useValue: options.tokenConfig },
|
|
60
|
+
],
|
|
61
|
+
imports: [
|
|
62
|
+
TypeOrmModule.forFeature(ENTITIES),
|
|
63
|
+
PassportModule.register({ defaultStrategy: 'jwt', session: false }),
|
|
64
|
+
JwtModule.register({
|
|
65
|
+
secret: options.tokenConfig.secretOrPrivateKey,
|
|
66
|
+
signOptions: {
|
|
67
|
+
expiresIn: options.tokenConfig.expiredIn,
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"outDir": "../../../../dist/out-tsc",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"types": ["node"]
|
|
8
|
+
},
|
|
9
|
+
"exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"],
|
|
10
|
+
"include": ["**/*.ts"]
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "../../../../dist/out-tsc",
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"types": ["jest", "node"]
|
|
7
|
+
},
|
|
8
|
+
"include": [
|
|
9
|
+
"**/*.spec.ts",
|
|
10
|
+
"**/*.test.ts",
|
|
11
|
+
"**/*.spec.tsx",
|
|
12
|
+
"**/*.test.tsx",
|
|
13
|
+
"**/*.spec.js",
|
|
14
|
+
"**/*.test.js",
|
|
15
|
+
"**/*.spec.jsx",
|
|
16
|
+
"**/*.test.jsx",
|
|
17
|
+
"**/*.d.ts",
|
|
18
|
+
"jest.config.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
package/src/index.d.ts
DELETED
package/src/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./lib/controllers/token/token.controller"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./lib/nestjs.module"), exports);
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/auth/shell/nestjs/src/index.ts"],"names":[],"mappings":";;;AAAA,mFAAyD;AACzD,8DAAoC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Request } from "express";
|
|
2
|
-
import { AuthService } from "@smartsoft001/auth-shell-app-services";
|
|
3
|
-
import { IAuthToken, IAuthTokenRequest } from "@smartsoft001/auth-domain";
|
|
4
|
-
export declare class TokenController {
|
|
5
|
-
private readonly service;
|
|
6
|
-
constructor(service: AuthService);
|
|
7
|
-
create(req: IAuthTokenRequest, httpReq: Request): Promise<IAuthToken>;
|
|
8
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TokenController = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const common_1 = require("@nestjs/common");
|
|
6
|
-
const auth_shell_app_services_1 = require("@smartsoft001/auth-shell-app-services");
|
|
7
|
-
let TokenController = exports.TokenController = class TokenController {
|
|
8
|
-
constructor(service) {
|
|
9
|
-
this.service = service;
|
|
10
|
-
}
|
|
11
|
-
create(req, httpReq) {
|
|
12
|
-
return this.service.create(req, httpReq);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
tslib_1.__decorate([
|
|
16
|
-
(0, common_1.Post)(),
|
|
17
|
-
tslib_1.__param(0, (0, common_1.Body)()),
|
|
18
|
-
tslib_1.__param(1, (0, common_1.Req)()),
|
|
19
|
-
tslib_1.__metadata("design:type", Function),
|
|
20
|
-
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
21
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
22
|
-
], TokenController.prototype, "create", null);
|
|
23
|
-
exports.TokenController = TokenController = tslib_1.__decorate([
|
|
24
|
-
(0, common_1.Controller)('token'),
|
|
25
|
-
tslib_1.__metadata("design:paramtypes", [auth_shell_app_services_1.AuthService])
|
|
26
|
-
], TokenController);
|
|
27
|
-
//# sourceMappingURL=token.controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token.controller.js","sourceRoot":"","sources":["../../../../../../../../../libs/auth/shell/nestjs/src/lib/controllers/token/token.controller.ts"],"names":[],"mappings":";;;;AAAA,2CAA2D;AAG3D,mFAAkE;AAI3D,IAAM,eAAe,6BAArB,MAAM,eAAe;IACxB,YAA6B,OAAoB;QAApB,YAAO,GAAP,OAAO,CAAa;IAAI,CAAC;IAGtD,MAAM,CAAS,GAAsB,EAAS,OAAgB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CACJ,CAAA;AAHG;IADC,IAAA,aAAI,GAAE;IACC,mBAAA,IAAA,aAAI,GAAE,CAAA;IAA0B,mBAAA,IAAA,YAAG,GAAE,CAAA;;;;6CAE5C;0BANQ,eAAe;IAD3B,IAAA,mBAAU,EAAC,OAAO,CAAC;6CAEsB,qCAAW;GADxC,eAAe,CAO3B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from "@nestjs/common";
|
|
2
|
-
import { TokenConfig } from "@smartsoft001/auth-domain";
|
|
3
|
-
export declare class AuthShellNestjsModule {
|
|
4
|
-
static forRoot(options: {
|
|
5
|
-
tokenConfig: TokenConfig;
|
|
6
|
-
}): DynamicModule;
|
|
7
|
-
}
|
|
8
|
-
export declare class AuthShellNestjsCoreModule {
|
|
9
|
-
static forRoot(options: {
|
|
10
|
-
tokenConfig: TokenConfig;
|
|
11
|
-
}): DynamicModule;
|
|
12
|
-
}
|
package/src/lib/nestjs.module.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var AuthShellNestjsModule_1;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.AuthShellNestjsCoreModule = exports.AuthShellNestjsModule = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const common_1 = require("@nestjs/common");
|
|
7
|
-
const axios_1 = require("@nestjs/axios");
|
|
8
|
-
const passport_1 = require("@nestjs/passport");
|
|
9
|
-
const jwt_1 = require("@nestjs/jwt");
|
|
10
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
11
|
-
const token_controller_1 = require("./controllers/token/token.controller");
|
|
12
|
-
const auth_domain_1 = require("@smartsoft001/auth-domain");
|
|
13
|
-
const auth_shell_app_services_1 = require("@smartsoft001/auth-shell-app-services");
|
|
14
|
-
const fb_1 = require("@smartsoft001/fb");
|
|
15
|
-
const google_1 = require("@smartsoft001/google");
|
|
16
|
-
let AuthShellNestjsModule = exports.AuthShellNestjsModule = AuthShellNestjsModule_1 = class AuthShellNestjsModule {
|
|
17
|
-
static forRoot(options) {
|
|
18
|
-
return {
|
|
19
|
-
module: AuthShellNestjsModule_1,
|
|
20
|
-
controllers: [token_controller_1.TokenController],
|
|
21
|
-
providers: [
|
|
22
|
-
{ provide: auth_domain_1.TokenConfig, useValue: options.tokenConfig },
|
|
23
|
-
auth_shell_app_services_1.AuthService,
|
|
24
|
-
fb_1.FbService,
|
|
25
|
-
google_1.GoogleService,
|
|
26
|
-
...auth_domain_1.DOMAIN_SERVICES,
|
|
27
|
-
],
|
|
28
|
-
imports: [
|
|
29
|
-
axios_1.HttpModule,
|
|
30
|
-
typeorm_1.TypeOrmModule.forFeature(auth_domain_1.ENTITIES),
|
|
31
|
-
passport_1.PassportModule.register({ defaultStrategy: 'jwt', session: false }),
|
|
32
|
-
jwt_1.JwtModule.register({
|
|
33
|
-
secret: options.tokenConfig.secretOrPrivateKey,
|
|
34
|
-
signOptions: {
|
|
35
|
-
expiresIn: options.tokenConfig.expiredIn
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
],
|
|
39
|
-
exports: [
|
|
40
|
-
fb_1.FbService,
|
|
41
|
-
google_1.GoogleService,
|
|
42
|
-
]
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
exports.AuthShellNestjsModule = AuthShellNestjsModule = AuthShellNestjsModule_1 = tslib_1.__decorate([
|
|
47
|
-
(0, common_1.Module)({})
|
|
48
|
-
], AuthShellNestjsModule);
|
|
49
|
-
let AuthShellNestjsCoreModule = exports.AuthShellNestjsCoreModule = class AuthShellNestjsCoreModule {
|
|
50
|
-
static forRoot(options) {
|
|
51
|
-
return {
|
|
52
|
-
module: AuthShellNestjsModule,
|
|
53
|
-
providers: [
|
|
54
|
-
{ provide: auth_domain_1.TokenConfig, useValue: options.tokenConfig },
|
|
55
|
-
auth_shell_app_services_1.AuthService,
|
|
56
|
-
...auth_domain_1.DOMAIN_SERVICES,
|
|
57
|
-
],
|
|
58
|
-
exports: [
|
|
59
|
-
auth_shell_app_services_1.AuthService,
|
|
60
|
-
...auth_domain_1.DOMAIN_SERVICES,
|
|
61
|
-
{ provide: auth_domain_1.TokenConfig, useValue: options.tokenConfig },
|
|
62
|
-
],
|
|
63
|
-
imports: [
|
|
64
|
-
typeorm_1.TypeOrmModule.forFeature(auth_domain_1.ENTITIES),
|
|
65
|
-
passport_1.PassportModule.register({ defaultStrategy: 'jwt', session: false }),
|
|
66
|
-
jwt_1.JwtModule.register({
|
|
67
|
-
secret: options.tokenConfig.secretOrPrivateKey,
|
|
68
|
-
signOptions: {
|
|
69
|
-
expiresIn: options.tokenConfig.expiredIn
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
]
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
exports.AuthShellNestjsCoreModule = AuthShellNestjsCoreModule = tslib_1.__decorate([
|
|
77
|
-
(0, common_1.Module)({})
|
|
78
|
-
], AuthShellNestjsCoreModule);
|
|
79
|
-
//# sourceMappingURL=nestjs.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nestjs.module.js","sourceRoot":"","sources":["../../../../../../../libs/auth/shell/nestjs/src/lib/nestjs.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAqD;AACrD,yCAA2C;AAC3C,+CAAgD;AAChD,qCAAsC;AACtC,6CAAgD;AAEhD,2EAAqE;AACrE,2DAAiF;AACjF,mFAAkE;AAClE,yCAA2C;AAC3C,iDAAmD;AAG5C,IAAM,qBAAqB,6DAA3B,MAAM,qBAAqB;IAC9B,MAAM,CAAC,OAAO,CAAC,OAEd;QACG,OAAO;YACH,MAAM,EAAE,uBAAqB;YAC7B,WAAW,EAAE,CAAE,kCAAe,CAAE;YAChC,SAAS,EAAE;gBACP,EAAE,OAAO,EAAE,yBAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,WAAW,EAAE;gBACvD,qCAAW;gBACX,cAAS;gBACT,sBAAa;gBACb,GAAG,6BAAe;aACrB;YACD,OAAO,EAAE;gBACL,kBAAU;gBACV,uBAAa,CAAC,UAAU,CAAC,sBAAQ,CAAC;gBAClC,yBAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;gBACnE,eAAS,CAAC,QAAQ,CAAC;oBACf,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,kBAAkB;oBAC9C,WAAW,EAAE;wBACT,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS;qBAC3C;iBACJ,CAAC;aACL;YACD,OAAO,EAAE;gBACL,cAAS;gBACT,sBAAa;aAChB;SACJ,CAAA;IACL,CAAC;CACJ,CAAA;gCA/BY,qBAAqB;IADjC,IAAA,eAAM,EAAC,EAAG,CAAC;GACC,qBAAqB,CA+BjC;AAGM,IAAM,yBAAyB,uCAA/B,MAAM,yBAAyB;IAClC,MAAM,CAAC,OAAO,CAAC,OAEd;QACG,OAAO;YACH,MAAM,EAAE,qBAAqB;YAC7B,SAAS,EAAE;gBACP,EAAE,OAAO,EAAE,yBAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,WAAW,EAAE;gBACvD,qCAAW;gBACX,GAAG,6BAAe;aACrB;YACD,OAAO,EAAE;gBACL,qCAAW;gBACX,GAAG,6BAAe;gBAClB,EAAE,OAAO,EAAE,yBAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,WAAW,EAAE;aAC1D;YACD,OAAO,EAAE;gBACL,uBAAa,CAAC,UAAU,CAAC,sBAAQ,CAAC;gBAClC,yBAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;gBACnE,eAAS,CAAC,QAAQ,CAAC;oBACf,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,kBAAkB;oBAC9C,WAAW,EAAE;wBACT,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS;qBAC3C;iBACJ,CAAC;aACL;SACJ,CAAA;IACL,CAAC;CACJ,CAAA;oCA5BY,yBAAyB;IADrC,IAAA,eAAM,EAAC,EAAG,CAAC;GACC,yBAAyB,CA4BrC"}
|
package/test-setup.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=test-setup.js.map
|
package/test-setup.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-setup.js","sourceRoot":"","sources":["../../../../../libs/auth/shell/nestjs/test-setup.ts"],"names":[],"mappings":""}
|
|
File without changes
|