@nest-boot/auth 5.11.1 → 5.11.2
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/dist/auth.guard.js +4 -4
- package/dist/auth.guard.js.map +1 -1
- package/dist/auth.middleware.js.map +1 -1
- package/dist/auth.module.js.map +1 -1
- package/dist/auth.service.js.map +1 -1
- package/dist/decorators/current-user.decorator.d.ts +1 -0
- package/dist/decorators/current-user.decorator.js +10 -0
- package/dist/decorators/current-user.decorator.js.map +1 -0
- package/dist/entities/index.d.ts +2 -0
- package/dist/entities/index.js +19 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/personal-access-token.entity.d.ts +14 -0
- package/dist/entities/personal-access-token.entity.js +72 -0
- package/dist/entities/personal-access-token.entity.js.map +1 -0
- package/dist/entities/user.entity.d.ts +13 -0
- package/dist/entities/user.entity.js +68 -0
- package/dist/entities/user.entity.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/random-string.util.d.ts +6 -0
- package/dist/utils/random-string.util.js +27 -0
- package/dist/utils/random-string.util.js.map +1 -0
- package/package.json +18 -18
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.randomString = void 0;
|
|
7
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
+
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
9
|
+
/**
|
|
10
|
+
* Generates a random string of the specified length.
|
|
11
|
+
* @param length The length of the random string to generate.
|
|
12
|
+
* @returns The randomly generated string.
|
|
13
|
+
*/
|
|
14
|
+
function randomString(length) {
|
|
15
|
+
let result = "";
|
|
16
|
+
const byteSize = Math.ceil((length * 256) / characters.length);
|
|
17
|
+
const randomBytes = crypto_1.default.randomBytes(byteSize);
|
|
18
|
+
for (let i = 0; i < byteSize && result.length < length; i++) {
|
|
19
|
+
const randomByte = randomBytes[i];
|
|
20
|
+
if (randomByte < 256 - (256 % characters.length)) {
|
|
21
|
+
result += characters.charAt(randomByte % characters.length);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
exports.randomString = randomString;
|
|
27
|
+
//# sourceMappingURL=random-string.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random-string.util.js","sourceRoot":"","sources":["../../src/utils/random-string.util.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,MAAM,UAAU,GACd,gEAAgE,CAAC;AAEnE;;;;GAIG;AACH,SAAgB,YAAY,CAAC,MAAc;IACzC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAC/D,MAAM,WAAW,GAAG,gBAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAEjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5D,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,UAAU,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YACjD,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAbD,oCAaC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nest-boot/auth",
|
|
3
|
-
"version": "5.11.
|
|
3
|
+
"version": "5.11.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "d4rkcr0w <me@d4rkcr0w.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -13,25 +13,18 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "nest build",
|
|
18
|
-
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
19
|
-
"dev": "nest build --watch",
|
|
20
|
-
"lint": "eslint \"{src,test}/**/*.ts\" --fix",
|
|
21
|
-
"test": "jest"
|
|
22
|
-
},
|
|
23
16
|
"dependencies": {
|
|
24
17
|
"lodash": "^4.17.21",
|
|
25
18
|
"ms": "^2.1.3"
|
|
26
19
|
},
|
|
27
20
|
"devDependencies": {
|
|
28
21
|
"@mikro-orm/nestjs": "^5.2.1",
|
|
29
|
-
"@nest-boot/database": "5.
|
|
30
|
-
"@nest-boot/eslint-config": "5.
|
|
31
|
-
"@nest-boot/eslint-plugin": "5.
|
|
32
|
-
"@nest-boot/i18n": "5.
|
|
33
|
-
"@nest-boot/request-context": "5.
|
|
34
|
-
"@nest-boot/tsconfig": "5.
|
|
22
|
+
"@nest-boot/database": "^5.0.0",
|
|
23
|
+
"@nest-boot/eslint-config": "^5.0.0",
|
|
24
|
+
"@nest-boot/eslint-plugin": "^5.0.0",
|
|
25
|
+
"@nest-boot/i18n": "^5.0.0",
|
|
26
|
+
"@nest-boot/request-context": "^5.0.0",
|
|
27
|
+
"@nest-boot/tsconfig": "^5.0.0",
|
|
35
28
|
"@nestjs/common": "^10.2.5",
|
|
36
29
|
"@nestjs/config": "^3.1.1",
|
|
37
30
|
"@nestjs/core": "^10.2.5",
|
|
@@ -50,9 +43,9 @@
|
|
|
50
43
|
"peerDependencies": {
|
|
51
44
|
"@mikro-orm/core": "^5.0.0",
|
|
52
45
|
"@mikro-orm/nestjs": "^5.0.0",
|
|
53
|
-
"@nest-boot/database": "5.
|
|
54
|
-
"@nest-boot/i18n": "5.
|
|
55
|
-
"@nest-boot/request-context": "5.
|
|
46
|
+
"@nest-boot/database": "^5.0.0",
|
|
47
|
+
"@nest-boot/i18n": "^5.0.0",
|
|
48
|
+
"@nest-boot/request-context": "^5.0.0",
|
|
56
49
|
"@nestjs/common": "^10.0.0",
|
|
57
50
|
"@nestjs/core": "^10.0.0",
|
|
58
51
|
"express": "^4.0.0",
|
|
@@ -83,5 +76,12 @@
|
|
|
83
76
|
},
|
|
84
77
|
"volta": {
|
|
85
78
|
"extends": "../../package.json"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"build": "nest build",
|
|
82
|
+
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
83
|
+
"dev": "nest build --watch",
|
|
84
|
+
"lint": "eslint \"{src,test}/**/*.ts\" --fix",
|
|
85
|
+
"test": "jest"
|
|
86
86
|
}
|
|
87
|
-
}
|
|
87
|
+
}
|