@wrcb/cb-common 1.0.431 → 1.0.433

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.
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.isValidMongoId = isValidMongoId;
7
- const server_1 = require("@wrcb/cb-common/server");
7
+ const badRequestError_1 = require("../errors/badRequestError");
8
8
  const mongoose_1 = __importDefault(require("mongoose"));
9
9
  function isValidMongoId(id) {
10
10
  if (!mongoose_1.default.Types.ObjectId.isValid(id)) {
11
- throw new server_1.BadRequestError('InvalidFeedPostId');
11
+ throw new badRequestError_1.BadRequestError('InvalidFeedPostId');
12
12
  }
13
13
  return true;
14
14
  }
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isValidTenant = isValidTenant;
4
- const cb_common_1 = require("@wrcb/cb-common");
5
- const server_1 = require("@wrcb/cb-common/server");
4
+ const badRequestError_1 = require("../errors/badRequestError");
5
+ const tenant_1 = require("../types/tenant");
6
6
  function isValidTenant(tenant) {
7
7
  // Verificar se tenant existe e é string
8
8
  if (!tenant || typeof tenant !== 'string') {
9
- throw new server_1.BadRequestError('TenantRequired');
9
+ throw new badRequestError_1.BadRequestError('TenantRequired');
10
10
  }
11
11
  // Verificar se é um tenant válido
12
- if (!Object.values(cb_common_1.Tenant).includes(tenant)) {
13
- throw new server_1.BadRequestError('InvalidTenant');
12
+ if (!Object.values(tenant_1.Tenant).includes(tenant)) {
13
+ throw new badRequestError_1.BadRequestError('InvalidTenant');
14
14
  }
15
15
  return true;
16
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrcb/cb-common",
3
- "version": "1.0.431",
3
+ "version": "1.0.433",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",