@wrcb/cb-common 1.0.370 → 1.0.373
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/build/helpers/authHelper.js +2 -2
- package/build/middlewares/requireProvidedBusinessData.d.ts +2 -0
- package/build/middlewares/requireProvidedBusinessData.js +12 -0
- package/build/services/TenantDataService.d.ts +1 -1
- package/build/services/TenantDataService.js +1 -1
- package/build/types/userPayload.d.ts +1 -0
- package/package.json +1 -1
|
@@ -12,13 +12,13 @@ const country_1 = require("../types/country");
|
|
|
12
12
|
const tenant_1 = require("../types/tenant");
|
|
13
13
|
function signUpReturnCookie(id, overrides) {
|
|
14
14
|
// Build a JWT payload
|
|
15
|
-
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), tenant: tenant_1.Tenant.PoliticaBet, email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Consumer, language: country_1.Language.Português, country: country_1.Country.Brasil, isKycDone: true, isEmailVerified: false, isWhatsappVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false }, overrides // sobrescreve os valores padrão
|
|
15
|
+
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), tenant: tenant_1.Tenant.PoliticaBet, email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Consumer, language: country_1.Language.Português, country: country_1.Country.Brasil, isKycDone: true, isEmailVerified: false, isWhatsappVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false, isBusinessDataProvided: false }, overrides // sobrescreve os valores padrão
|
|
16
16
|
);
|
|
17
17
|
return buildCookie(payload);
|
|
18
18
|
}
|
|
19
19
|
function signUpReturnCookieAdmin(id, overrides) {
|
|
20
20
|
// Build a JWT payload
|
|
21
|
-
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), tenant: tenant_1.Tenant.PoliticaBet, 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, isWhatsappVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false }, overrides // sobrescreve os valores padrão
|
|
21
|
+
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), tenant: tenant_1.Tenant.PoliticaBet, 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, isWhatsappVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false, isBusinessDataProvided: false }, overrides // sobrescreve os valores padrão
|
|
22
22
|
);
|
|
23
23
|
return buildCookie(payload);
|
|
24
24
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.requireProvidedBusinessData = void 0;
|
|
4
|
+
const badRequestError_1 = require("../errors/badRequestError");
|
|
5
|
+
const requireProvidedBusinessData = (req, res, next) => {
|
|
6
|
+
var _a;
|
|
7
|
+
if (!((_a = req.currentUser) === null || _a === void 0 ? void 0 : _a.isBusinessDataProvided)) {
|
|
8
|
+
throw new badRequestError_1.BadRequestError('RequireProvidedBusinessData');
|
|
9
|
+
}
|
|
10
|
+
next();
|
|
11
|
+
};
|
|
12
|
+
exports.requireProvidedBusinessData = requireProvidedBusinessData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CouponType } from '../types/couponType';
|
|
2
2
|
import { Tenant } from '../types/tenant';
|
|
3
|
-
import { UserCategory } from '
|
|
3
|
+
import { UserCategory } from '../types/userCategory';
|
|
4
4
|
import { UserTags } from 'src/types/userTags';
|
|
5
5
|
import { ProductTypes } from 'src/types/productTypes';
|
|
6
6
|
export interface CategoryConfiguration {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TenantDataService = void 0;
|
|
4
4
|
const couponType_1 = require("../types/couponType");
|
|
5
5
|
const tenant_1 = require("../types/tenant");
|
|
6
|
-
const userCategory_1 = require("
|
|
6
|
+
const userCategory_1 = require("../types/userCategory");
|
|
7
7
|
const userTags_1 = require("src/types/userTags");
|
|
8
8
|
const productTypes_1 = require("src/types/productTypes");
|
|
9
9
|
class TenantDataService {
|