@wrcb/cb-common 1.0.280 → 1.0.281

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.
@@ -11,13 +11,13 @@ const userRole_1 = require("../types/userRole");
11
11
  const country_1 = require("../types/country");
12
12
  function signUpReturnCookie(id, overrides) {
13
13
  // Build a JWT payload
14
- const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.User, language: country_1.Language.Português, country: country_1.Country.Brasil, isKycDone: true, isEmailVerified: false, isPhoneNumberVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false }, overrides // sobrescreve os valores padrão
14
+ const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.User, language: country_1.Language.Português, country: country_1.Country.Brasil, isKycDone: true, isEmailVerified: false, isWhatsappNumberVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false }, overrides // sobrescreve os valores padrão
15
15
  );
16
16
  return buildCookie(payload);
17
17
  }
18
18
  function signUpReturnCookieAdmin(id, overrides) {
19
19
  // Build a JWT payload
20
- const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Admin, isKycDone: true, language: country_1.Language.Português, country: country_1.Country.Brasil, isEmailVerified: false, isPhoneNumberVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false }, overrides // sobrescreve os valores padrão
20
+ const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Admin, isKycDone: true, language: country_1.Language.Português, country: country_1.Country.Brasil, isEmailVerified: false, isWhatsappNumberVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false }, overrides // sobrescreve os valores padrão
21
21
  );
22
22
  return buildCookie(payload);
23
23
  }
@@ -4,7 +4,7 @@ exports.requireVerifiedPhoneNumber = void 0;
4
4
  const badRequestError_1 = require("../errors/badRequestError");
5
5
  const requireVerifiedPhoneNumber = (req, res, next) => {
6
6
  var _a;
7
- if (!((_a = req.currentUser) === null || _a === void 0 ? void 0 : _a.isPhoneNumberVerified)) {
7
+ if (!((_a = req.currentUser) === null || _a === void 0 ? void 0 : _a.isWhatsappNumberVerified)) {
8
8
  throw new badRequestError_1.BadRequestError('RequireVerifiedPhoneNumber');
9
9
  }
10
10
  next();
@@ -4,7 +4,7 @@ exports.requireVerifiedWhatsappNumber = void 0;
4
4
  const badRequestError_1 = require("../errors/badRequestError");
5
5
  const requireVerifiedWhatsappNumber = (req, res, next) => {
6
6
  var _a;
7
- if (!((_a = req.currentUser) === null || _a === void 0 ? void 0 : _a.isPhoneNumberVerified)) {
7
+ if (!((_a = req.currentUser) === null || _a === void 0 ? void 0 : _a.isWhatsappNumberVerified)) {
8
8
  throw new badRequestError_1.BadRequestError('RequireVerifiedWhatsappNumber');
9
9
  }
10
10
  next();
@@ -5,7 +5,7 @@ export interface UserPayload {
5
5
  nickName: string;
6
6
  isKycDone: boolean;
7
7
  isEmailVerified: boolean;
8
- isPhoneNumberVerified: boolean;
8
+ isWhatsappNumberVerified: boolean;
9
9
  isPersonalDataProvided: boolean;
10
10
  isAddressDataProvided: boolean;
11
11
  language: Language;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrcb/cb-common",
3
- "version": "1.0.280",
3
+ "version": "1.0.281",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",