@nathapp/nestjs-common 1.0.1-rc.3 → 1.0.1-rc.5

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.
@@ -1,6 +1,2 @@
1
- import DbConfig from "./db.config";
2
- import MongoConfig from "./mongodb.config";
3
- import RedisConfig from "./redis.config";
4
- import RabbitMQConfig from "./rabbitmq.config";
5
1
  import JoiUtil, { JoiConfig } from "./utils/joi-util";
6
- export { DbConfig, MongoConfig, RedisConfig, RabbitMQConfig, JoiUtil, JoiConfig, };
2
+ export { JoiUtil, JoiConfig, };
@@ -1,13 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JoiUtil = exports.RabbitMQConfig = exports.RedisConfig = exports.MongoConfig = exports.DbConfig = void 0;
4
- const db_config_1 = require("./db.config");
5
- exports.DbConfig = db_config_1.default;
6
- const mongodb_config_1 = require("./mongodb.config");
7
- exports.MongoConfig = mongodb_config_1.default;
8
- const redis_config_1 = require("./redis.config");
9
- exports.RedisConfig = redis_config_1.default;
10
- const rabbitmq_config_1 = require("./rabbitmq.config");
11
- exports.RabbitMQConfig = rabbitmq_config_1.default;
3
+ exports.JoiUtil = void 0;
12
4
  const joi_util_1 = require("./utils/joi-util");
13
5
  exports.JoiUtil = joi_util_1.default;
@@ -1,5 +1,3 @@
1
1
  import { ClientInfo } from "./client-info.decorator";
2
2
  import { RealIP } from "./real-ip.decorator";
3
- import { Public } from "./is-public.decorator";
4
- import { RequiredPermission, PERMISSION_KEY } from "./permission.decorator";
5
- export { ClientInfo, RealIP, Public, PERMISSION_KEY, RequiredPermission };
3
+ export { ClientInfo, RealIP };
@@ -1,12 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RequiredPermission = exports.PERMISSION_KEY = exports.Public = exports.RealIP = exports.ClientInfo = void 0;
3
+ exports.RealIP = exports.ClientInfo = void 0;
4
4
  const client_info_decorator_1 = require("./client-info.decorator");
5
5
  Object.defineProperty(exports, "ClientInfo", { enumerable: true, get: function () { return client_info_decorator_1.ClientInfo; } });
6
6
  const real_ip_decorator_1 = require("./real-ip.decorator");
7
7
  Object.defineProperty(exports, "RealIP", { enumerable: true, get: function () { return real_ip_decorator_1.RealIP; } });
8
- const is_public_decorator_1 = require("./is-public.decorator");
9
- Object.defineProperty(exports, "Public", { enumerable: true, get: function () { return is_public_decorator_1.Public; } });
10
- const permission_decorator_1 = require("./permission.decorator");
11
- Object.defineProperty(exports, "RequiredPermission", { enumerable: true, get: function () { return permission_decorator_1.RequiredPermission; } });
12
- Object.defineProperty(exports, "PERMISSION_KEY", { enumerable: true, get: function () { return permission_decorator_1.PERMISSION_KEY; } });
@@ -3,6 +3,7 @@ export declare enum CommonExceptionCode {
3
3
  NOT_FOUND = 404,
4
4
  INTERNAL_ERROR = 501,
5
5
  USER_NOT_FOUND = 2018,
6
+ UNAUTHORIZED = 40000,
6
7
  FORBIDDEN_IP_NOT_MATCH = 40001,
7
8
  FORBIDDEN_BLACKLISTED = 40002,
8
9
  FORBIDDEN = 40003
@@ -7,6 +7,7 @@ var CommonExceptionCode;
7
7
  CommonExceptionCode[CommonExceptionCode["NOT_FOUND"] = 404] = "NOT_FOUND";
8
8
  CommonExceptionCode[CommonExceptionCode["INTERNAL_ERROR"] = 501] = "INTERNAL_ERROR";
9
9
  CommonExceptionCode[CommonExceptionCode["USER_NOT_FOUND"] = 2018] = "USER_NOT_FOUND";
10
+ CommonExceptionCode[CommonExceptionCode["UNAUTHORIZED"] = 40000] = "UNAUTHORIZED";
10
11
  CommonExceptionCode[CommonExceptionCode["FORBIDDEN_IP_NOT_MATCH"] = 40001] = "FORBIDDEN_IP_NOT_MATCH";
11
12
  CommonExceptionCode[CommonExceptionCode["FORBIDDEN_BLACKLISTED"] = 40002] = "FORBIDDEN_BLACKLISTED";
12
13
  CommonExceptionCode[CommonExceptionCode["FORBIDDEN"] = 40003] = "FORBIDDEN";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nathapp/nestjs-common",
3
- "version": "1.0.1-rc.3",
3
+ "version": "1.0.1-rc.5",
4
4
  "description": "NestJs Common Library",
5
5
  "scripts": {
6
6
  "build": "rimraf dist && tsc -p tsconfig.json",
@@ -1,2 +0,0 @@
1
- export declare const IS_PUBLIC_KEY = "isPublic";
2
- export declare const Public: () => import("@nestjs/common").CustomDecorator<string>;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Public = exports.IS_PUBLIC_KEY = void 0;
4
- const common_1 = require("@nestjs/common");
5
- exports.IS_PUBLIC_KEY = "isPublic";
6
- const Public = () => (0, common_1.SetMetadata)(exports.IS_PUBLIC_KEY, true);
7
- exports.Public = Public;
@@ -1,2 +0,0 @@
1
- export declare const PERMISSION_KEY = "PERMISSION";
2
- export declare const RequiredPermission: (permission: string) => import("@nestjs/common").CustomDecorator<string>;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RequiredPermission = exports.PERMISSION_KEY = void 0;
4
- const common_1 = require("@nestjs/common");
5
- exports.PERMISSION_KEY = "PERMISSION";
6
- const RequiredPermission = (permission) => (0, common_1.SetMetadata)(exports.PERMISSION_KEY, permission);
7
- exports.RequiredPermission = RequiredPermission;