@vnodes/auth 0.0.13 → 0.0.23
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 +3 -3
- package/bin/version.mjs +12 -0
- package/dist/index.d.ts +1 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -27
- package/dist/index.js.map +1 -0
- package/dist/lib/auth.d.ts +2 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +5 -0
- package/dist/lib/auth.js.map +1 -0
- package/package.json +19 -34
- package/assets/favicon.png +0 -0
- package/dist/auth.controller.d.ts +0 -16
- package/dist/auth.controller.d.ts.map +0 -1
- package/dist/auth.controller.js +0 -90
- package/dist/auth.module.d.ts +0 -3
- package/dist/auth.module.d.ts.map +0 -1
- package/dist/auth.module.js +0 -38
- package/dist/client/auth-client.module.d.ts +0 -3
- package/dist/client/auth-client.module.d.ts.map +0 -1
- package/dist/client/auth-client.module.js +0 -21
- package/dist/context/context.d.ts +0 -12
- package/dist/context/context.d.ts.map +0 -1
- package/dist/context/context.js +0 -19
- package/dist/dto/access-token.dto.d.ts +0 -5
- package/dist/dto/access-token.dto.d.ts.map +0 -1
- package/dist/dto/access-token.dto.js +0 -12
- package/dist/dto/can-activate-response-dto.d.ts +0 -5
- package/dist/dto/can-activate-response-dto.d.ts.map +0 -1
- package/dist/dto/can-activate-response-dto.js +0 -12
- package/dist/dto/can-activate.dto.d.ts +0 -6
- package/dist/dto/can-activate.dto.d.ts.map +0 -1
- package/dist/dto/can-activate.dto.js +0 -17
- package/dist/dto/email-otp-event.dto.d.ts +0 -6
- package/dist/dto/email-otp-event.dto.d.ts.map +0 -1
- package/dist/dto/email-otp-event.dto.js +0 -17
- package/dist/dto/forgot-password.dto.d.ts +0 -4
- package/dist/dto/forgot-password.dto.d.ts.map +0 -1
- package/dist/dto/forgot-password.dto.js +0 -9
- package/dist/dto/login-with-otp.dto.d.ts +0 -5
- package/dist/dto/login-with-otp.dto.d.ts.map +0 -1
- package/dist/dto/login-with-otp.dto.js +0 -14
- package/dist/dto/login.dto.d.ts +0 -5
- package/dist/dto/login.dto.d.ts.map +0 -1
- package/dist/dto/login.dto.js +0 -14
- package/dist/dto/message.dto.d.ts +0 -5
- package/dist/dto/message.dto.d.ts.map +0 -1
- package/dist/dto/message.dto.js +0 -12
- package/dist/dto/otp-response-dto.d.ts +0 -5
- package/dist/dto/otp-response-dto.d.ts.map +0 -1
- package/dist/dto/otp-response-dto.js +0 -12
- package/dist/dto/update-password-event.dto.d.ts +0 -5
- package/dist/dto/update-password-event.dto.d.ts.map +0 -1
- package/dist/dto/update-password-event.dto.js +0 -14
- package/dist/dto/update-password.dto.d.ts +0 -4
- package/dist/dto/update-password.dto.d.ts.map +0 -1
- package/dist/dto/update-password.dto.js +0 -9
- package/dist/guards/auth-client.guard.d.ts +0 -14
- package/dist/guards/auth-client.guard.d.ts.map +0 -1
- package/dist/guards/auth-client.guard.js +0 -64
- package/dist/guards/auth.guard.d.ts +0 -16
- package/dist/guards/auth.guard.d.ts.map +0 -1
- package/dist/guards/auth.guard.js +0 -71
- package/dist/providers/auth-client-options.provider.d.ts +0 -5
- package/dist/providers/auth-client-options.provider.d.ts.map +0 -1
- package/dist/providers/auth-client-options.provider.js +0 -21
- package/dist/services/auth-listener.service.d.ts +0 -10
- package/dist/services/auth-listener.service.d.ts.map +0 -1
- package/dist/services/auth-listener.service.js +0 -32
- package/dist/services/auth-user.service.d.ts +0 -28
- package/dist/services/auth-user.service.d.ts.map +0 -1
- package/dist/services/auth-user.service.js +0 -94
- package/dist/services/auth.service.d.ts +0 -48
- package/dist/services/auth.service.d.ts.map +0 -1
- package/dist/services/auth.service.js +0 -84
- package/dist/types/auth-client-options.d.ts +0 -6
- package/dist/types/auth-client-options.d.ts.map +0 -1
- package/dist/types/auth-client-options.js +0 -7
- package/dist/types/auth-request.d.ts +0 -8
- package/dist/types/auth-request.d.ts.map +0 -1
- package/dist/types/auth-request.js +0 -1
- package/dist/types/jwt-payload.d.ts +0 -6
- package/dist/types/jwt-payload.d.ts.map +0 -1
- package/dist/types/jwt-payload.js +0 -5
- package/dist/types/user-manager.d.ts +0 -67
- package/dist/types/user-manager.d.ts.map +0 -1
- package/dist/types/user-manager.js +0 -118
- package/dist/types/user.d.ts +0 -10
- package/dist/types/user.d.ts.map +0 -1
- package/dist/types/user.js +0 -17
package/README.md
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<img
|
|
8
|
+
<img srcset="./assets/favicon.png, https://vnodes.github.io/vnodes/libs/auth/assets/favicon.png" alt="Logo" width="200" height="200" style="border-radius: 100%"/>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
## @vnodes/auth
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
@vnodes/auth
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
@@ -32,4 +32,4 @@ If you find my open-source contributions or the **@vnodes/auth** project helpful
|
|
|
32
32
|
<a href="mailto:robert.brightline+vnodes-auth@gmail.com">
|
|
33
33
|
<img src="https://img.shields.io/badge/Email-D14836?style=for-the-badge&logo=gmail&logoColor=white" />
|
|
34
34
|
</a>
|
|
35
|
-
</p>
|
|
35
|
+
</p>
|
package/bin/version.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
const packageJsonPath = join(__dirname, '..', 'package.json');
|
|
10
|
+
const packageJson = readFileSync(packageJsonPath, { encoding: 'utf-8' });
|
|
11
|
+
const version = JSON.parse(packageJson).version;
|
|
12
|
+
console.log(version);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
export * from './auth.
|
|
2
|
-
export * from './auth.module.js';
|
|
3
|
-
export * from './client/auth-client.module.js';
|
|
4
|
-
export * from './context/context.js';
|
|
5
|
-
export * from './dto/access-token.dto.js';
|
|
6
|
-
export * from './dto/can-activate.dto.js';
|
|
7
|
-
export * from './dto/can-activate-response-dto.js';
|
|
8
|
-
export * from './dto/email-otp-event.dto.js';
|
|
9
|
-
export * from './dto/forgot-password.dto.js';
|
|
10
|
-
export * from './dto/login.dto.js';
|
|
11
|
-
export * from './dto/login-with-otp.dto.js';
|
|
12
|
-
export * from './dto/message.dto.js';
|
|
13
|
-
export * from './dto/otp-response-dto.js';
|
|
14
|
-
export * from './dto/update-password.dto.js';
|
|
15
|
-
export * from './dto/update-password-event.dto.js';
|
|
16
|
-
export * from './guards/auth.guard.js';
|
|
17
|
-
export * from './guards/auth-client.guard.js';
|
|
18
|
-
export * from './providers/auth-client-options.provider.js';
|
|
19
|
-
export * from './services/auth.service.js';
|
|
20
|
-
export * from './services/auth-listener.service.js';
|
|
21
|
-
export * from './services/auth-user.service.js';
|
|
22
|
-
export * from './types/auth-client-options.js';
|
|
23
|
-
export * from './types/auth-request.js';
|
|
24
|
-
export * from './types/jwt-payload.js';
|
|
25
|
-
export * from './types/user.js';
|
|
26
|
-
export * from './types/user-manager.js';
|
|
1
|
+
export * from './lib/auth.js';
|
|
27
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from './client/auth-client.module.js';
|
|
5
|
-
export * from './context/context.js';
|
|
6
|
-
export * from './dto/access-token.dto.js';
|
|
7
|
-
export * from './dto/can-activate.dto.js';
|
|
8
|
-
export * from './dto/can-activate-response-dto.js';
|
|
9
|
-
export * from './dto/email-otp-event.dto.js';
|
|
10
|
-
export * from './dto/forgot-password.dto.js';
|
|
11
|
-
export * from './dto/login.dto.js';
|
|
12
|
-
export * from './dto/login-with-otp.dto.js';
|
|
13
|
-
export * from './dto/message.dto.js';
|
|
14
|
-
export * from './dto/otp-response-dto.js';
|
|
15
|
-
export * from './dto/update-password.dto.js';
|
|
16
|
-
export * from './dto/update-password-event.dto.js';
|
|
17
|
-
export * from './guards/auth.guard.js';
|
|
18
|
-
export * from './guards/auth-client.guard.js';
|
|
19
|
-
export * from './providers/auth-client-options.provider.js';
|
|
20
|
-
export * from './services/auth.service.js';
|
|
21
|
-
export * from './services/auth-listener.service.js';
|
|
22
|
-
export * from './services/auth-user.service.js';
|
|
23
|
-
export * from './types/auth-client-options.js';
|
|
24
|
-
export * from './types/auth-request.js';
|
|
25
|
-
export * from './types/jwt-payload.js';
|
|
26
|
-
export * from './types/user.js';
|
|
27
|
-
export * from './types/user-manager.js';
|
|
1
|
+
export * from './lib/auth.js';
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './lib/auth.js';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,IAAI,MAAM,CAE7B"}
|
package/dist/lib/auth.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/auth.ts"],"sourcesContent":["export function auth(): string {\n return 'auth';\n}\n"],"names":["auth"],"mappings":"AAAA,OAAO,SAASA;IACZ,OAAO;AACX"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnodes/auth",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
},
|
|
3
|
+
"version": "0.0.23",
|
|
4
|
+
"description": "@vnodes/auth",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"auth"
|
|
7
|
+
],
|
|
9
8
|
"author": {
|
|
10
|
-
"email": "robert.brightline+vnodes-auth@gmail.com",
|
|
11
9
|
"name": "Robert Brightline",
|
|
12
|
-
"
|
|
10
|
+
"email": "robert.brightline+vnodes-auth@gmail.com",
|
|
11
|
+
"url": "https://vnodes.github.io/vnodes"
|
|
13
12
|
},
|
|
14
|
-
"
|
|
13
|
+
"homepage": "https://vnodes.github.io/vnodes/libs/auth",
|
|
15
14
|
"icon": "https://vnodes.github.io/vnodes/libs/auth/assets/favicon.png",
|
|
16
15
|
"funding": [
|
|
17
|
-
|
|
18
|
-
"type": "cashapp",
|
|
19
|
-
"url": "https://cash.app/$puqlib"
|
|
20
|
-
}
|
|
16
|
+
"https://cash.app/$puqlib"
|
|
21
17
|
],
|
|
22
|
-
"
|
|
18
|
+
"bin": {
|
|
19
|
+
"version": "./bin/version.mjs"
|
|
20
|
+
},
|
|
23
21
|
"type": "module",
|
|
24
22
|
"main": "./dist/index.js",
|
|
25
23
|
"module": "./dist/index.js",
|
|
@@ -34,35 +32,22 @@
|
|
|
34
32
|
}
|
|
35
33
|
},
|
|
36
34
|
"files": [
|
|
37
|
-
"assets",
|
|
38
35
|
"dist",
|
|
36
|
+
"bin",
|
|
39
37
|
"!**/*.tsbuildinfo"
|
|
40
38
|
],
|
|
41
39
|
"nx": {
|
|
42
40
|
"sourceRoot": "libs/auth/src",
|
|
41
|
+
"tags": [
|
|
42
|
+
"lib"
|
|
43
|
+
],
|
|
43
44
|
"targets": {
|
|
44
45
|
"build": {},
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"doc": {}
|
|
46
|
+
"doc": {},
|
|
47
|
+
"lint": {}
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@swc/helpers": "~0.5.
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"@nestjs/testing": "^11.1.13"
|
|
55
|
-
},
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"@nestjs/common": "^11.1.14",
|
|
58
|
-
"@nestjs/config": "^4.0.3",
|
|
59
|
-
"@nestjs/core": "^11.1.14",
|
|
60
|
-
"@nestjs/event-emitter": "^3.0.1",
|
|
61
|
-
"@nestjs/jwt": "^11.0.2",
|
|
62
|
-
"@nestjs/swagger": "^11.2.6",
|
|
63
|
-
"@nestjs/throttler": "^6.5.0",
|
|
64
|
-
"@vnodes/crypto": "0.0.13",
|
|
65
|
-
"@vnodes/metadata": "0.0.13",
|
|
66
|
-
"@vnodes/property": "0.0.13"
|
|
51
|
+
"@swc/helpers": "~0.5.18"
|
|
67
52
|
}
|
|
68
53
|
}
|
package/assets/favicon.png
DELETED
|
Binary file
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CanActivateDto } from './dto/can-activate.dto.js';
|
|
2
|
-
import { ForgotPasswordDto } from './dto/forgot-password.dto.js';
|
|
3
|
-
import { LoginDto } from './dto/login.dto.js';
|
|
4
|
-
import { UpdatePasswordDto } from './dto/update-password.dto.js';
|
|
5
|
-
import { AuthService } from './services/auth.service.js';
|
|
6
|
-
export declare class AuthController {
|
|
7
|
-
protected readonly authService: AuthService;
|
|
8
|
-
constructor(authService: AuthService);
|
|
9
|
-
login(body: LoginDto): Promise<import("./index.js").AccessTokenDto>;
|
|
10
|
-
logout(accessToken: string): import("./index.js").MessageDto;
|
|
11
|
-
forgotPassword(body: ForgotPasswordDto): import("./index.js").MessageDto;
|
|
12
|
-
updatePassword(uuid: string, body: UpdatePasswordDto): Promise<import("./index.js").MessageDto>;
|
|
13
|
-
profile(uuid: string): import("./index.js").UserManager;
|
|
14
|
-
canActivate(username: string, body: CanActivateDto): Promise<import("./index.js").CanActivateResponseDto>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=auth.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.controller.d.ts","sourceRoot":"","sources":["../src/auth.controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,qBAKa,cAAc;IACX,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW;gBAAxB,WAAW,EAAE,WAAW;IAIvD,KAAK,CAAS,IAAI,EAAE,QAAQ;IAK5B,MAAM,CAAgB,WAAW,EAAE,MAAM;IAMzC,cAAc,CAAS,IAAI,EAAE,iBAAiB;IAK9C,cAAc,CAAa,IAAI,EAAE,MAAM,EAAU,IAAI,EAAE,iBAAiB;IAKxE,OAAO,CAAa,IAAI,EAAE,MAAM;IAKhC,WAAW,CAAiB,QAAQ,EAAE,MAAM,EAAU,IAAI,EAAE,cAAc;CAG7E"}
|
package/dist/auth.controller.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
-
import { Body, Controller, Get, Post } from '@nestjs/common';
|
|
3
|
-
import { ApiBearerAuth } from '@nestjs/swagger';
|
|
4
|
-
import { Throttle } from '@nestjs/throttler';
|
|
5
|
-
import { ByPassAutorization, Public, ResourceName } from '@vnodes/metadata';
|
|
6
|
-
import { AccessToken, UserUsername, UserUuid } from './context/context.js';
|
|
7
|
-
import { CanActivateDto } from './dto/can-activate.dto.js';
|
|
8
|
-
import { ForgotPasswordDto } from './dto/forgot-password.dto.js';
|
|
9
|
-
import { LoginDto } from './dto/login.dto.js';
|
|
10
|
-
import { UpdatePasswordDto } from './dto/update-password.dto.js';
|
|
11
|
-
import { AuthService } from './services/auth.service.js';
|
|
12
|
-
let AuthController = class AuthController {
|
|
13
|
-
authService;
|
|
14
|
-
constructor(authService) {
|
|
15
|
-
this.authService = authService;
|
|
16
|
-
}
|
|
17
|
-
login(body) {
|
|
18
|
-
return this.authService.login(body);
|
|
19
|
-
}
|
|
20
|
-
logout(accessToken) {
|
|
21
|
-
return this.authService.logout(accessToken);
|
|
22
|
-
}
|
|
23
|
-
forgotPassword(body) {
|
|
24
|
-
return this.authService.forgotPassword(body);
|
|
25
|
-
}
|
|
26
|
-
updatePassword(uuid, body) {
|
|
27
|
-
return this.authService.updatePassword(uuid, body);
|
|
28
|
-
}
|
|
29
|
-
profile(uuid) {
|
|
30
|
-
return this.authService.profile(uuid);
|
|
31
|
-
}
|
|
32
|
-
canActivate(username, body) {
|
|
33
|
-
return this.authService.canActivate(username, body);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
__decorate([
|
|
37
|
-
Public(),
|
|
38
|
-
Post('login'),
|
|
39
|
-
__param(0, Body()),
|
|
40
|
-
__metadata("design:type", Function),
|
|
41
|
-
__metadata("design:paramtypes", [LoginDto]),
|
|
42
|
-
__metadata("design:returntype", void 0)
|
|
43
|
-
], AuthController.prototype, "login", null);
|
|
44
|
-
__decorate([
|
|
45
|
-
Post('logout'),
|
|
46
|
-
__param(0, AccessToken()),
|
|
47
|
-
__metadata("design:type", Function),
|
|
48
|
-
__metadata("design:paramtypes", [String]),
|
|
49
|
-
__metadata("design:returntype", void 0)
|
|
50
|
-
], AuthController.prototype, "logout", null);
|
|
51
|
-
__decorate([
|
|
52
|
-
Public(),
|
|
53
|
-
Post('forgot-password'),
|
|
54
|
-
__param(0, Body()),
|
|
55
|
-
__metadata("design:type", Function),
|
|
56
|
-
__metadata("design:paramtypes", [ForgotPasswordDto]),
|
|
57
|
-
__metadata("design:returntype", void 0)
|
|
58
|
-
], AuthController.prototype, "forgotPassword", null);
|
|
59
|
-
__decorate([
|
|
60
|
-
Post('update-password'),
|
|
61
|
-
__param(0, UserUuid()),
|
|
62
|
-
__param(1, Body()),
|
|
63
|
-
__metadata("design:type", Function),
|
|
64
|
-
__metadata("design:paramtypes", [String, UpdatePasswordDto]),
|
|
65
|
-
__metadata("design:returntype", void 0)
|
|
66
|
-
], AuthController.prototype, "updatePassword", null);
|
|
67
|
-
__decorate([
|
|
68
|
-
Get('profile'),
|
|
69
|
-
__param(0, UserUuid()),
|
|
70
|
-
__metadata("design:type", Function),
|
|
71
|
-
__metadata("design:paramtypes", [String]),
|
|
72
|
-
__metadata("design:returntype", void 0)
|
|
73
|
-
], AuthController.prototype, "profile", null);
|
|
74
|
-
__decorate([
|
|
75
|
-
Post('can-activate'),
|
|
76
|
-
__param(0, UserUsername()),
|
|
77
|
-
__param(1, Body()),
|
|
78
|
-
__metadata("design:type", Function),
|
|
79
|
-
__metadata("design:paramtypes", [String, CanActivateDto]),
|
|
80
|
-
__metadata("design:returntype", void 0)
|
|
81
|
-
], AuthController.prototype, "canActivate", null);
|
|
82
|
-
AuthController = __decorate([
|
|
83
|
-
ByPassAutorization(),
|
|
84
|
-
Throttle({ default: { limit: 6, ttl: 30_000 } }),
|
|
85
|
-
ResourceName('Auth'),
|
|
86
|
-
ApiBearerAuth(),
|
|
87
|
-
Controller('auth'),
|
|
88
|
-
__metadata("design:paramtypes", [AuthService])
|
|
89
|
-
], AuthController);
|
|
90
|
-
export { AuthController };
|
package/dist/auth.module.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../src/auth.module.ts"],"names":[],"mappings":"AAWA,qBAsBa,UAAU;CAAG"}
|
package/dist/auth.module.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { Module } from '@nestjs/common';
|
|
3
|
-
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
4
|
-
import { APP_GUARD } from '@nestjs/core';
|
|
5
|
-
import { EventEmitterModule } from '@nestjs/event-emitter';
|
|
6
|
-
import { JwtModule } from '@nestjs/jwt';
|
|
7
|
-
import { Env } from '@vnodes/metadata';
|
|
8
|
-
import { AuthController } from './auth.controller.js';
|
|
9
|
-
import { AuthGuard } from './guards/auth.guard.js';
|
|
10
|
-
import { AuthService } from './services/auth.service.js';
|
|
11
|
-
import { AuthUserService } from './services/auth-user.service.js';
|
|
12
|
-
let AuthModule = class AuthModule {
|
|
13
|
-
};
|
|
14
|
-
AuthModule = __decorate([
|
|
15
|
-
Module({
|
|
16
|
-
imports: [
|
|
17
|
-
EventEmitterModule,
|
|
18
|
-
JwtModule.registerAsync({
|
|
19
|
-
imports: [ConfigModule],
|
|
20
|
-
inject: [ConfigService],
|
|
21
|
-
useFactory(config) {
|
|
22
|
-
const secret = config.getOrThrow(Env.JWT_SECRET);
|
|
23
|
-
const expiresIn = config.getOrThrow(Env.JWT_EXPIRES_IN);
|
|
24
|
-
return {
|
|
25
|
-
secret,
|
|
26
|
-
signOptions: {
|
|
27
|
-
expiresIn,
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
}),
|
|
32
|
-
],
|
|
33
|
-
controllers: [AuthController],
|
|
34
|
-
providers: [AuthUserService, AuthService, { provide: APP_GUARD, useClass: AuthGuard }],
|
|
35
|
-
exports: [AuthUserService],
|
|
36
|
-
})
|
|
37
|
-
], AuthModule);
|
|
38
|
-
export { AuthModule };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth-client.module.d.ts","sourceRoot":"","sources":["../../src/client/auth-client.module.ts"],"names":[],"mappings":"AAMA,qBAUa,gBAAgB;CAAG"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { Module } from '@nestjs/common';
|
|
3
|
-
import { ConfigModule } from '@nestjs/config';
|
|
4
|
-
import { APP_GUARD } from '@nestjs/core';
|
|
5
|
-
import { AuthClientGuard } from '../guards/auth-client.guard.js';
|
|
6
|
-
import { provideAuthClientOptions } from '../providers/auth-client-options.provider.js';
|
|
7
|
-
let AuthClientModule = class AuthClientModule {
|
|
8
|
-
};
|
|
9
|
-
AuthClientModule = __decorate([
|
|
10
|
-
Module({
|
|
11
|
-
imports: [ConfigModule],
|
|
12
|
-
providers: [
|
|
13
|
-
provideAuthClientOptions(),
|
|
14
|
-
{
|
|
15
|
-
provide: APP_GUARD,
|
|
16
|
-
useClass: AuthClientGuard,
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
})
|
|
20
|
-
], AuthClientModule);
|
|
21
|
-
export { AuthClientModule };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { User } from '../types/user.js';
|
|
2
|
-
/**
|
|
3
|
-
* Get the user info {@link UserInfo} of the current session from the request
|
|
4
|
-
*/
|
|
5
|
-
export declare const UserInfo: (...dataOrPipes: (User | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
6
|
-
export declare const UserUuid: (...dataOrPipes: (User | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
7
|
-
export declare const UserUsername: (...dataOrPipes: (User | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
8
|
-
/**
|
|
9
|
-
* Get the access token of the current session from the request
|
|
10
|
-
*/
|
|
11
|
-
export declare const AccessToken: (...dataOrPipes: (string | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
12
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC;;GAEG;AACH,eAAO,MAAM,QAAQ,uLAEnB,CAAC;AAEH,eAAO,MAAM,QAAQ,uLAEnB,CAAC;AAEH,eAAO,MAAM,YAAY,uLAEvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW,yLAEtB,CAAC"}
|
package/dist/context/context.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createParamDecorator } from '@nestjs/common';
|
|
2
|
-
/**
|
|
3
|
-
* Get the user info {@link UserInfo} of the current session from the request
|
|
4
|
-
*/
|
|
5
|
-
export const UserInfo = createParamDecorator((_, context) => {
|
|
6
|
-
return context.switchToHttp().getRequest().user;
|
|
7
|
-
});
|
|
8
|
-
export const UserUuid = createParamDecorator((_, context) => {
|
|
9
|
-
return context.switchToHttp().getRequest().user.uuid;
|
|
10
|
-
});
|
|
11
|
-
export const UserUsername = createParamDecorator((_, context) => {
|
|
12
|
-
return context.switchToHttp().getRequest().user.username;
|
|
13
|
-
});
|
|
14
|
-
/**
|
|
15
|
-
* Get the access token of the current session from the request
|
|
16
|
-
*/
|
|
17
|
-
export const AccessToken = createParamDecorator((_, context) => {
|
|
18
|
-
return context.switchToHttp().getRequest().accessToken;
|
|
19
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"access-token.dto.d.ts","sourceRoot":"","sources":["../../src/dto/access-token.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,cAAc;IACf,KAAK,EAAE,MAAM,CAAC;gBAEV,GAAG,EAAE,cAAc;CAGlC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Prop } from '@vnodes/property';
|
|
3
|
-
export class AccessTokenDto {
|
|
4
|
-
token;
|
|
5
|
-
constructor(dto) {
|
|
6
|
-
Object.assign(this, dto);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
__decorate([
|
|
10
|
-
Prop(),
|
|
11
|
-
__metadata("design:type", String)
|
|
12
|
-
], AccessTokenDto.prototype, "token", void 0);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"can-activate-response-dto.d.ts","sourceRoot":"","sources":["../../src/dto/can-activate-response-dto.ts"],"names":[],"mappings":"AAEA,qBAAa,sBAAsB;IACvB,WAAW,EAAE,OAAO,CAAC;gBAEjB,IAAI,EAAE,sBAAsB;CAG3C"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Prop } from '@vnodes/property';
|
|
3
|
-
export class CanActivateResponseDto {
|
|
4
|
-
canActivate;
|
|
5
|
-
constructor(data) {
|
|
6
|
-
Object.assign(this, data);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
__decorate([
|
|
10
|
-
Prop(),
|
|
11
|
-
__metadata("design:type", Boolean)
|
|
12
|
-
], CanActivateResponseDto.prototype, "canActivate", void 0);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"can-activate.dto.d.ts","sourceRoot":"","sources":["../../src/dto/can-activate.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,cAAc;IACG,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;gBAC7C,IAAI,EAAE,cAAc;CAGnC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Prop } from '@vnodes/property';
|
|
3
|
-
export class CanActivateDto {
|
|
4
|
-
requiredRoles;
|
|
5
|
-
requiredPermissions;
|
|
6
|
-
constructor(data) {
|
|
7
|
-
Object.assign(this, data);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
__decorate([
|
|
11
|
-
Prop({ type: [String] }),
|
|
12
|
-
__metadata("design:type", Array)
|
|
13
|
-
], CanActivateDto.prototype, "requiredRoles", void 0);
|
|
14
|
-
__decorate([
|
|
15
|
-
Prop({ type: [String] }),
|
|
16
|
-
__metadata("design:type", Array)
|
|
17
|
-
], CanActivateDto.prototype, "requiredPermissions", void 0);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"email-otp-event.dto.d.ts","sourceRoot":"","sources":["../../src/dto/email-otp-event.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAgB;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;gBACR,IAAI,EAAE,gBAAgB;CAGrC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Prop } from '@vnodes/property';
|
|
3
|
-
export class EmailOtpEventDto {
|
|
4
|
-
username;
|
|
5
|
-
otp;
|
|
6
|
-
constructor(data) {
|
|
7
|
-
Object.assign(this, data);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
__decorate([
|
|
11
|
-
Prop(),
|
|
12
|
-
__metadata("design:type", String)
|
|
13
|
-
], EmailOtpEventDto.prototype, "username", void 0);
|
|
14
|
-
__decorate([
|
|
15
|
-
Prop(),
|
|
16
|
-
__metadata("design:type", String)
|
|
17
|
-
], EmailOtpEventDto.prototype, "otp", void 0);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forgot-password.dto.d.ts","sourceRoot":"","sources":["../../src/dto/forgot-password.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,iBAAiB;IACA,QAAQ,EAAE,MAAM,CAAC;CAC9C"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Prop } from '@vnodes/property';
|
|
3
|
-
export class ForgotPasswordDto {
|
|
4
|
-
username;
|
|
5
|
-
}
|
|
6
|
-
__decorate([
|
|
7
|
-
Prop({ required: true }),
|
|
8
|
-
__metadata("design:type", String)
|
|
9
|
-
], ForgotPasswordDto.prototype, "username", void 0);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login-with-otp.dto.d.ts","sourceRoot":"","sources":["../../src/dto/login-with-otp.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,eAAe;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACzC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Prop } from '@vnodes/property';
|
|
3
|
-
export class LoginWithOtpDto {
|
|
4
|
-
username;
|
|
5
|
-
otp;
|
|
6
|
-
}
|
|
7
|
-
__decorate([
|
|
8
|
-
Prop({ required: true }),
|
|
9
|
-
__metadata("design:type", String)
|
|
10
|
-
], LoginWithOtpDto.prototype, "username", void 0);
|
|
11
|
-
__decorate([
|
|
12
|
-
Prop({ required: true }),
|
|
13
|
-
__metadata("design:type", String)
|
|
14
|
-
], LoginWithOtpDto.prototype, "otp", void 0);
|
package/dist/dto/login.dto.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login.dto.d.ts","sourceRoot":"","sources":["../../src/dto/login.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAQ;IACS,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAC9C"}
|
package/dist/dto/login.dto.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Prop } from '@vnodes/property';
|
|
3
|
-
export class LoginDto {
|
|
4
|
-
username;
|
|
5
|
-
password;
|
|
6
|
-
}
|
|
7
|
-
__decorate([
|
|
8
|
-
Prop({ required: true }),
|
|
9
|
-
__metadata("design:type", String)
|
|
10
|
-
], LoginDto.prototype, "username", void 0);
|
|
11
|
-
__decorate([
|
|
12
|
-
Prop({ required: true }),
|
|
13
|
-
__metadata("design:type", String)
|
|
14
|
-
], LoginDto.prototype, "password", void 0);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.dto.d.ts","sourceRoot":"","sources":["../../src/dto/message.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;IACX,OAAO,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,UAAU;CAG/B"}
|