@wrcb/cb-common 1.0.571 → 1.0.573
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,16 +4,7 @@ import { UserCategory } from '../types/userCategory';
|
|
|
4
4
|
import { UserTags } from '../types/userTags';
|
|
5
5
|
import { ProductTypes } from '../types/productTypes';
|
|
6
6
|
import { MediaConfiguration } from '../storage/interfaces/MediaConfiguration';
|
|
7
|
-
|
|
8
|
-
Politics = "Politics",
|
|
9
|
-
Sports = "Sports",
|
|
10
|
-
Crypto = "Crypto",
|
|
11
|
-
PopCulture = "PopCulture",
|
|
12
|
-
Business = "Business",
|
|
13
|
-
Science = "Science",
|
|
14
|
-
Weather = "Weather",
|
|
15
|
-
Entertainment = "Entertainment"
|
|
16
|
-
}
|
|
7
|
+
import { PoliticaBetCategory } from 'src/types/politicaBetCategory';
|
|
17
8
|
export declare enum PoliticaBetTags {
|
|
18
9
|
Brazil = "Brazil",
|
|
19
10
|
USA = "USA",
|
|
@@ -41,7 +32,7 @@ export declare enum PoliticaBetTags {
|
|
|
41
32
|
TVShows = "TVShows",
|
|
42
33
|
Awards = "Awards",
|
|
43
34
|
Celebrities = "Celebrities",
|
|
44
|
-
|
|
35
|
+
StockCategory = "StockCategory",
|
|
45
36
|
Economy = "Economy",
|
|
46
37
|
Companies = "Companies",
|
|
47
38
|
Startups = "Startups",
|
|
@@ -83,7 +74,7 @@ export interface TenantData {
|
|
|
83
74
|
SOCIAL_YOUTUBE: string;
|
|
84
75
|
SOCIAL_INSTAGRAM: string;
|
|
85
76
|
SOCIAL_FACEBOOK: string;
|
|
86
|
-
USER_CATEGORIES_CONFIG: Partial<Record<UserCategory |
|
|
77
|
+
USER_CATEGORIES_CONFIG: Partial<Record<UserCategory | PoliticaBetCategory, CategoryConfiguration>>;
|
|
87
78
|
COUPONS_TYPE_ALLOWED_TO_BE_CREATED_BY_SELLER: CouponType[];
|
|
88
79
|
COUPONS_TYPE_ALLOWED_TO_BE_CREATED_BY_ADMIN: CouponType[];
|
|
89
80
|
EMAIL_HOST: string;
|
|
@@ -100,19 +91,19 @@ export interface TenantData {
|
|
|
100
91
|
export declare class TenantDataService {
|
|
101
92
|
private static tenantDataMap;
|
|
102
93
|
static getTenantData(tenant: Tenant): TenantData;
|
|
103
|
-
static getCategoriesForTenant(tenant: Tenant): (UserCategory |
|
|
104
|
-
static getCategoryConfig(tenant: Tenant, category: UserCategory |
|
|
105
|
-
static isTagAllowedForCategory(tenant: Tenant, category: UserCategory |
|
|
106
|
-
static isProductAllowedForCategory(tenant: Tenant, category: UserCategory |
|
|
107
|
-
static getTagsForCategory(tenant: Tenant, category: UserCategory |
|
|
108
|
-
static getProductsForCategory(tenant: Tenant, category: UserCategory |
|
|
94
|
+
static getCategoriesForTenant(tenant: Tenant): (UserCategory | PoliticaBetCategory)[];
|
|
95
|
+
static getCategoryConfig(tenant: Tenant, category: UserCategory | PoliticaBetCategory): CategoryConfiguration | undefined;
|
|
96
|
+
static isTagAllowedForCategory(tenant: Tenant, category: UserCategory | PoliticaBetCategory, tag: UserTags | PoliticaBetTags): boolean;
|
|
97
|
+
static isProductAllowedForCategory(tenant: Tenant, category: UserCategory | PoliticaBetCategory, product: ProductTypes): boolean;
|
|
98
|
+
static getTagsForCategory(tenant: Tenant, category: UserCategory | PoliticaBetCategory): (UserTags | PoliticaBetTags)[];
|
|
99
|
+
static getProductsForCategory(tenant: Tenant, category: UserCategory | PoliticaBetCategory): ProductTypes[];
|
|
109
100
|
static getAllProductsForTenant(tenant: Tenant): ProductTypes[];
|
|
110
101
|
static getAllTagsForTenant(tenant: Tenant): (UserTags | PoliticaBetTags)[];
|
|
111
|
-
static
|
|
112
|
-
static
|
|
113
|
-
static
|
|
102
|
+
static getPoliticaBetCategories(): PoliticaBetCategory[];
|
|
103
|
+
static isPoliticaBetCategory(category: string): category is PoliticaBetCategory;
|
|
104
|
+
static getPoliticaBetTagsForCategory(market: PoliticaBetCategory): PoliticaBetTags[];
|
|
114
105
|
static getAllPoliticaBetTags(): PoliticaBetTags[];
|
|
115
|
-
static
|
|
106
|
+
static getCategoriesForTag(tag: PoliticaBetTags): PoliticaBetCategory[];
|
|
116
107
|
static getRatingCriteria(tenant: Tenant): RatingCriteria | null;
|
|
117
108
|
static getAvailableCriteriaOptions(tenant: Tenant): string[];
|
|
118
109
|
static isRatingEnabledForTenant(tenant: Tenant): boolean;
|
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TenantDataService = exports.POLITICABET_ENTERTAINMENT_TAGS = exports.POLITICABET_WEATHER_TAGS = exports.POLITICABET_SCIENCE_TAGS = exports.POLITICABET_BUSINESS_TAGS = exports.POLITICABET_POPCULTURE_TAGS = exports.POLITICABET_CRYPTO_TAGS = exports.POLITICABET_SPORTS_TAGS = exports.POLITICABET_POLITICS_TAGS = exports.PoliticaBetTags =
|
|
3
|
+
exports.TenantDataService = exports.POLITICABET_ENTERTAINMENT_TAGS = exports.POLITICABET_WEATHER_TAGS = exports.POLITICABET_SCIENCE_TAGS = exports.POLITICABET_BUSINESS_TAGS = exports.POLITICABET_POPCULTURE_TAGS = exports.POLITICABET_CRYPTO_TAGS = exports.POLITICABET_SPORTS_TAGS = exports.POLITICABET_POLITICS_TAGS = exports.PoliticaBetTags = void 0;
|
|
4
4
|
const couponType_1 = require("../types/couponType");
|
|
5
5
|
const tenant_1 = require("../types/tenant");
|
|
6
6
|
const userCategory_1 = require("../types/userCategory");
|
|
7
7
|
const userTags_1 = require("../types/userTags");
|
|
8
8
|
const productTypes_1 = require("../types/productTypes");
|
|
9
|
+
const politicaBetCategory_1 = require("src/types/politicaBetCategory");
|
|
9
10
|
// ============================================
|
|
10
11
|
// POLITICABET - MARKETS E TAGS
|
|
11
12
|
// ============================================
|
|
12
|
-
// Markets (Categorias) do PoliticaBet
|
|
13
|
-
var PoliticaBetMarket;
|
|
14
|
-
(function (PoliticaBetMarket) {
|
|
15
|
-
PoliticaBetMarket["Politics"] = "Politics";
|
|
16
|
-
PoliticaBetMarket["Sports"] = "Sports";
|
|
17
|
-
PoliticaBetMarket["Crypto"] = "Crypto";
|
|
18
|
-
PoliticaBetMarket["PopCulture"] = "PopCulture";
|
|
19
|
-
PoliticaBetMarket["Business"] = "Business";
|
|
20
|
-
PoliticaBetMarket["Science"] = "Science";
|
|
21
|
-
PoliticaBetMarket["Weather"] = "Weather";
|
|
22
|
-
PoliticaBetMarket["Entertainment"] = "Entertainment";
|
|
23
|
-
})(PoliticaBetMarket || (exports.PoliticaBetMarket = PoliticaBetMarket = {}));
|
|
24
13
|
// Tags compartilhadas entre markets
|
|
25
14
|
var PoliticaBetTags;
|
|
26
15
|
(function (PoliticaBetTags) {
|
|
@@ -56,7 +45,7 @@ var PoliticaBetTags;
|
|
|
56
45
|
PoliticaBetTags["Awards"] = "Awards";
|
|
57
46
|
PoliticaBetTags["Celebrities"] = "Celebrities";
|
|
58
47
|
// Business
|
|
59
|
-
PoliticaBetTags["
|
|
48
|
+
PoliticaBetTags["StockCategory"] = "StockCategory";
|
|
60
49
|
PoliticaBetTags["Economy"] = "Economy";
|
|
61
50
|
PoliticaBetTags["Companies"] = "Companies";
|
|
62
51
|
PoliticaBetTags["Startups"] = "Startups";
|
|
@@ -74,7 +63,7 @@ var PoliticaBetTags;
|
|
|
74
63
|
PoliticaBetTags["Streaming"] = "Streaming";
|
|
75
64
|
PoliticaBetTags["SocialMedia"] = "SocialMedia";
|
|
76
65
|
})(PoliticaBetTags || (exports.PoliticaBetTags = PoliticaBetTags = {}));
|
|
77
|
-
// Mapeamento de tags permitidas por
|
|
66
|
+
// Mapeamento de tags permitidas por Category
|
|
78
67
|
exports.POLITICABET_POLITICS_TAGS = [
|
|
79
68
|
PoliticaBetTags.Brazil,
|
|
80
69
|
PoliticaBetTags.USA,
|
|
@@ -123,7 +112,7 @@ exports.POLITICABET_BUSINESS_TAGS = [
|
|
|
123
112
|
PoliticaBetTags.Europe,
|
|
124
113
|
PoliticaBetTags.Asia,
|
|
125
114
|
PoliticaBetTags.LatinAmerica,
|
|
126
|
-
PoliticaBetTags.
|
|
115
|
+
PoliticaBetTags.StockCategory,
|
|
127
116
|
PoliticaBetTags.Economy,
|
|
128
117
|
PoliticaBetTags.Companies,
|
|
129
118
|
PoliticaBetTags.Startups
|
|
@@ -205,32 +194,32 @@ class TenantDataService {
|
|
|
205
194
|
// ============================================
|
|
206
195
|
// MÉTODOS ESPECÍFICOS POLITICABET
|
|
207
196
|
// ============================================
|
|
208
|
-
static
|
|
209
|
-
return Object.values(
|
|
197
|
+
static getPoliticaBetCategories() {
|
|
198
|
+
return Object.values(politicaBetCategory_1.PoliticaBetCategory);
|
|
210
199
|
}
|
|
211
|
-
static
|
|
212
|
-
return Object.values(
|
|
200
|
+
static isPoliticaBetCategory(category) {
|
|
201
|
+
return Object.values(politicaBetCategory_1.PoliticaBetCategory).includes(category);
|
|
213
202
|
}
|
|
214
|
-
static
|
|
203
|
+
static getPoliticaBetTagsForCategory(market) {
|
|
215
204
|
const tagMap = {
|
|
216
|
-
[
|
|
217
|
-
[
|
|
218
|
-
[
|
|
219
|
-
[
|
|
220
|
-
[
|
|
221
|
-
[
|
|
222
|
-
[
|
|
223
|
-
[
|
|
205
|
+
[politicaBetCategory_1.PoliticaBetCategory.Politics]: exports.POLITICABET_POLITICS_TAGS,
|
|
206
|
+
[politicaBetCategory_1.PoliticaBetCategory.Sports]: exports.POLITICABET_SPORTS_TAGS,
|
|
207
|
+
[politicaBetCategory_1.PoliticaBetCategory.Crypto]: exports.POLITICABET_CRYPTO_TAGS,
|
|
208
|
+
[politicaBetCategory_1.PoliticaBetCategory.PopCulture]: exports.POLITICABET_POPCULTURE_TAGS,
|
|
209
|
+
[politicaBetCategory_1.PoliticaBetCategory.Business]: exports.POLITICABET_BUSINESS_TAGS,
|
|
210
|
+
[politicaBetCategory_1.PoliticaBetCategory.Science]: exports.POLITICABET_SCIENCE_TAGS,
|
|
211
|
+
[politicaBetCategory_1.PoliticaBetCategory.Weather]: exports.POLITICABET_WEATHER_TAGS,
|
|
212
|
+
[politicaBetCategory_1.PoliticaBetCategory.Entertainment]: exports.POLITICABET_ENTERTAINMENT_TAGS
|
|
224
213
|
};
|
|
225
214
|
return tagMap[market];
|
|
226
215
|
}
|
|
227
216
|
static getAllPoliticaBetTags() {
|
|
228
217
|
return Object.values(PoliticaBetTags);
|
|
229
218
|
}
|
|
230
|
-
static
|
|
219
|
+
static getCategoriesForTag(tag) {
|
|
231
220
|
const markets = [];
|
|
232
|
-
Object.values(
|
|
233
|
-
const tags = this.
|
|
221
|
+
Object.values(politicaBetCategory_1.PoliticaBetCategory).forEach(market => {
|
|
222
|
+
const tags = this.getPoliticaBetTagsForCategory(market);
|
|
234
223
|
if (tags.includes(tag)) {
|
|
235
224
|
markets.push(market);
|
|
236
225
|
}
|
|
@@ -298,35 +287,35 @@ TenantDataService.tenantDataMap = {
|
|
|
298
287
|
SOCIAL_INSTAGRAM: 'https://instagram.com/politicabet',
|
|
299
288
|
SOCIAL_FACEBOOK: 'https://facebook.com/politicabet',
|
|
300
289
|
USER_CATEGORIES_CONFIG: {
|
|
301
|
-
[
|
|
290
|
+
[politicaBetCategory_1.PoliticaBetCategory.Politics]: {
|
|
302
291
|
allowedTags: exports.POLITICABET_POLITICS_TAGS,
|
|
303
292
|
allowedProducts: [] // Sem produtos físicos, apenas predictions
|
|
304
293
|
},
|
|
305
|
-
[
|
|
294
|
+
[politicaBetCategory_1.PoliticaBetCategory.Sports]: {
|
|
306
295
|
allowedTags: exports.POLITICABET_SPORTS_TAGS,
|
|
307
296
|
allowedProducts: []
|
|
308
297
|
},
|
|
309
|
-
[
|
|
298
|
+
[politicaBetCategory_1.PoliticaBetCategory.Crypto]: {
|
|
310
299
|
allowedTags: exports.POLITICABET_CRYPTO_TAGS,
|
|
311
300
|
allowedProducts: []
|
|
312
301
|
},
|
|
313
|
-
[
|
|
302
|
+
[politicaBetCategory_1.PoliticaBetCategory.PopCulture]: {
|
|
314
303
|
allowedTags: exports.POLITICABET_POPCULTURE_TAGS,
|
|
315
304
|
allowedProducts: []
|
|
316
305
|
},
|
|
317
|
-
[
|
|
306
|
+
[politicaBetCategory_1.PoliticaBetCategory.Business]: {
|
|
318
307
|
allowedTags: exports.POLITICABET_BUSINESS_TAGS,
|
|
319
308
|
allowedProducts: []
|
|
320
309
|
},
|
|
321
|
-
[
|
|
310
|
+
[politicaBetCategory_1.PoliticaBetCategory.Science]: {
|
|
322
311
|
allowedTags: exports.POLITICABET_SCIENCE_TAGS,
|
|
323
312
|
allowedProducts: []
|
|
324
313
|
},
|
|
325
|
-
[
|
|
314
|
+
[politicaBetCategory_1.PoliticaBetCategory.Weather]: {
|
|
326
315
|
allowedTags: exports.POLITICABET_WEATHER_TAGS,
|
|
327
316
|
allowedProducts: []
|
|
328
317
|
},
|
|
329
|
-
[
|
|
318
|
+
[politicaBetCategory_1.PoliticaBetCategory.Entertainment]: {
|
|
330
319
|
allowedTags: exports.POLITICABET_ENTERTAINMENT_TAGS,
|
|
331
320
|
allowedProducts: []
|
|
332
321
|
}
|