@toeichust/common 1.0.3 → 2.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/dist/constants/swagger.constant.d.ts +1 -1
- package/dist/constants/swagger.constant.js +1 -1
- package/dist/constants/swagger.constant.js.map +1 -1
- package/dist/modules/auth/decorators/auth.decorator.js +3 -2
- package/dist/modules/auth/decorators/auth.decorator.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +21 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const SWAGGER_DOCS_PATH = "docs";
|
|
2
|
-
export declare const SWAGGER_AUTH_KEY = "
|
|
2
|
+
export declare const SWAGGER_AUTH_KEY = "Bearer";
|
|
3
3
|
export declare const SWAGGER_UI_CDN = "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.15.5";
|
|
4
4
|
export declare const SWAGGER_CUSTOM_FAVICON = "https://avatars.githubusercontent.com/u/251744857?s=400&u=018acf9b463484b3c43dacc69db8320a0655afba&v=4";
|
|
5
5
|
export declare const SWAGGER_DESCRIPTION: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SWAGGER_DESCRIPTION = exports.SWAGGER_CUSTOM_FAVICON = exports.SWAGGER_UI_CDN = exports.SWAGGER_AUTH_KEY = exports.SWAGGER_DOCS_PATH = void 0;
|
|
4
4
|
exports.SWAGGER_DOCS_PATH = 'docs';
|
|
5
|
-
exports.SWAGGER_AUTH_KEY = '
|
|
5
|
+
exports.SWAGGER_AUTH_KEY = 'Bearer';
|
|
6
6
|
exports.SWAGGER_UI_CDN = 'https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.15.5';
|
|
7
7
|
exports.SWAGGER_CUSTOM_FAVICON = 'https://avatars.githubusercontent.com/u/251744857?s=400&u=018acf9b463484b3c43dacc69db8320a0655afba&v=4';
|
|
8
8
|
exports.SWAGGER_DESCRIPTION = `<table border="0">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swagger.constant.js","sourceRoot":"","sources":["../../src/constants/swagger.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,MAAM,CAAC;AAC3B,QAAA,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"swagger.constant.js","sourceRoot":"","sources":["../../src/constants/swagger.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,MAAM,CAAC;AAC3B,QAAA,gBAAgB,GAAG,QAAQ,CAAC;AAC5B,QAAA,cAAc,GACzB,0DAA0D,CAAC;AAChD,QAAA,sBAAsB,GACjC,wGAAwG,CAAC;AAC9F,QAAA,mBAAmB,GAAG;;;;;mCAKA,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,cAAc;0CACnC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,cAAc;;;;wBAI5D,yBAAiB;wBACjB,yBAAiB;;;;kBAIvB,8BAAsB;;;SAG/B,CAAC"}
|
|
@@ -3,13 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Auth = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const swagger_1 = require("@nestjs/swagger");
|
|
6
|
+
const swagger_constant_1 = require("../../../constants/swagger.constant");
|
|
6
7
|
const auth_constant_1 = require("../constants/auth.constant");
|
|
7
8
|
const user_role_enum_1 = require("../enums/user-role.enum");
|
|
8
9
|
const jwt_auth_guard_1 = require("../guards/jwt-auth.guard");
|
|
9
10
|
const roles_guard_1 = require("../guards/roles.guard");
|
|
10
11
|
exports.Auth = {
|
|
11
12
|
Public: () => (0, common_1.applyDecorators)((0, common_1.SetMetadata)(auth_constant_1.IS_PUBLIC_KEY, true)),
|
|
12
|
-
User: () => (0, common_1.applyDecorators)((0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard), (0, swagger_1.ApiBearerAuth)(), (0, swagger_1.ApiUnauthorizedResponse)({ description: 'Unauthorized' })),
|
|
13
|
-
Admin: () => (0, common_1.applyDecorators)((0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard), (0, common_1.SetMetadata)(auth_constant_1.ROLES_KEY, [user_role_enum_1.UserRole.ADMIN]), (0, swagger_1.ApiBearerAuth)(), (0, swagger_1.ApiUnauthorizedResponse)({ description: 'Unauthorized' }), (0, swagger_1.ApiForbiddenResponse)({ description: 'Forbidden - Requires Admin role' })),
|
|
13
|
+
User: () => (0, common_1.applyDecorators)((0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard), (0, swagger_1.ApiBearerAuth)(swagger_constant_1.SWAGGER_AUTH_KEY), (0, swagger_1.ApiUnauthorizedResponse)({ description: 'Unauthorized' })),
|
|
14
|
+
Admin: () => (0, common_1.applyDecorators)((0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard), (0, common_1.SetMetadata)(auth_constant_1.ROLES_KEY, [user_role_enum_1.UserRole.ADMIN]), (0, swagger_1.ApiBearerAuth)(swagger_constant_1.SWAGGER_AUTH_KEY), (0, swagger_1.ApiUnauthorizedResponse)({ description: 'Unauthorized' }), (0, swagger_1.ApiForbiddenResponse)({ description: 'Forbidden - Requires Admin role' })),
|
|
14
15
|
};
|
|
15
16
|
//# sourceMappingURL=auth.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.decorator.js","sourceRoot":"","sources":["../../../../src/modules/auth/decorators/auth.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAyE;AACzE,6CAIyB;AACzB,8DAAsE;AACtE,4DAAmD;AACnD,6DAAwD;AACxD,uDAAmD;AAEtC,QAAA,IAAI,GAAG;IAClB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAA,wBAAe,EAAC,IAAA,oBAAW,EAAC,6BAAa,EAAE,IAAI,CAAC,CAAC;IAE/D,IAAI,EAAE,GAAG,EAAE,CACT,IAAA,wBAAe,EACb,IAAA,kBAAS,EAAC,6BAAY,CAAC,EACvB,IAAA,uBAAa,
|
|
1
|
+
{"version":3,"file":"auth.decorator.js","sourceRoot":"","sources":["../../../../src/modules/auth/decorators/auth.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAyE;AACzE,6CAIyB;AACzB,0EAAuE;AACvE,8DAAsE;AACtE,4DAAmD;AACnD,6DAAwD;AACxD,uDAAmD;AAEtC,QAAA,IAAI,GAAG;IAClB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAA,wBAAe,EAAC,IAAA,oBAAW,EAAC,6BAAa,EAAE,IAAI,CAAC,CAAC;IAE/D,IAAI,EAAE,GAAG,EAAE,CACT,IAAA,wBAAe,EACb,IAAA,kBAAS,EAAC,6BAAY,CAAC,EACvB,IAAA,uBAAa,EAAC,mCAAgB,CAAC,EAC/B,IAAA,iCAAuB,EAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CACzD;IAEH,KAAK,EAAE,GAAG,EAAE,CACV,IAAA,wBAAe,EACb,IAAA,kBAAS,EAAC,6BAAY,EAAE,wBAAU,CAAC,EACnC,IAAA,oBAAW,EAAC,yBAAS,EAAE,CAAC,yBAAQ,CAAC,KAAK,CAAC,CAAC,EACxC,IAAA,uBAAa,EAAC,mCAAgB,CAAC,EAC/B,IAAA,iCAAuB,EAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,EACxD,IAAA,8BAAoB,EAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC,CACzE;CACJ,CAAC"}
|