be-components 1.2.7 → 1.2.8

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.
Files changed (123) hide show
  1. package/lib/commonjs/Competition/components/CompetitionCard.js +1 -1
  2. package/lib/commonjs/Competition/components/CompetitionCard.js.map +1 -1
  3. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +1 -1
  4. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -1
  5. package/lib/commonjs/CompetitionManager/api/index.js +577 -0
  6. package/lib/commonjs/CompetitionManager/api/index.js.map +1 -0
  7. package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js +439 -0
  8. package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js.map +1 -0
  9. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js +269 -0
  10. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js.map +1 -0
  11. package/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.js +142 -0
  12. package/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.js.map +1 -0
  13. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js +370 -0
  14. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -0
  15. package/lib/commonjs/CompetitionManager/components/MarketSelector.js +99 -0
  16. package/lib/commonjs/CompetitionManager/components/MarketSelector.js.map +1 -0
  17. package/lib/commonjs/CompetitionManager/index.js +188 -0
  18. package/lib/commonjs/CompetitionManager/index.js.map +1 -0
  19. package/lib/commonjs/Components/Dropdown.js +98 -0
  20. package/lib/commonjs/Components/Dropdown.js.map +1 -0
  21. package/lib/commonjs/Components/Icons.js +1 -1
  22. package/lib/commonjs/Components/Icons.js.map +1 -1
  23. package/lib/commonjs/Markets/api/index.js +28 -0
  24. package/lib/commonjs/Markets/api/index.js.map +1 -0
  25. package/lib/commonjs/Markets/components/MarketButton.js +25 -0
  26. package/lib/commonjs/Markets/components/MarketButton.js.map +1 -0
  27. package/lib/commonjs/Squares/api/index.js.map +1 -1
  28. package/lib/commonjs/Squares/components/PrizeCard.js +161 -0
  29. package/lib/commonjs/Squares/components/PrizeCard.js.map +1 -0
  30. package/lib/commonjs/Squares/components/SquareCard.js.map +1 -1
  31. package/lib/commonjs/Squares/index.js +10 -1
  32. package/lib/commonjs/Squares/index.js.map +1 -1
  33. package/lib/commonjs/constants/styles.js +10 -0
  34. package/lib/commonjs/constants/styles.js.map +1 -1
  35. package/lib/commonjs/index.js +7 -0
  36. package/lib/commonjs/index.js.map +1 -1
  37. package/lib/module/Competition/components/CompetitionCard.js +1 -1
  38. package/lib/module/Competition/components/CompetitionCard.js.map +1 -1
  39. package/lib/module/Competition/components/EnterCompetitionPrompt.js +1 -1
  40. package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -1
  41. package/lib/module/CompetitionManager/api/index.js +571 -0
  42. package/lib/module/CompetitionManager/api/index.js.map +1 -0
  43. package/lib/module/CompetitionManager/components/CompetitionContestsForm.js +434 -0
  44. package/lib/module/CompetitionManager/components/CompetitionContestsForm.js.map +1 -0
  45. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js +262 -0
  46. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js.map +1 -0
  47. package/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.js +135 -0
  48. package/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.js.map +1 -0
  49. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js +364 -0
  50. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -0
  51. package/lib/module/CompetitionManager/components/MarketSelector.js +92 -0
  52. package/lib/module/CompetitionManager/components/MarketSelector.js.map +1 -0
  53. package/lib/module/CompetitionManager/index.js +179 -0
  54. package/lib/module/CompetitionManager/index.js.map +1 -0
  55. package/lib/module/Components/Dropdown.js +89 -0
  56. package/lib/module/Components/Dropdown.js.map +1 -0
  57. package/lib/module/Components/Icons.js +1 -1
  58. package/lib/module/Components/Icons.js.map +1 -1
  59. package/lib/module/Markets/api/index.js +23 -0
  60. package/lib/module/Markets/api/index.js.map +1 -0
  61. package/lib/module/Markets/components/MarketButton.js +18 -0
  62. package/lib/module/Markets/components/MarketButton.js.map +1 -0
  63. package/lib/module/Squares/api/index.js.map +1 -1
  64. package/lib/module/Squares/components/PrizeCard.js +152 -0
  65. package/lib/module/Squares/components/PrizeCard.js.map +1 -0
  66. package/lib/module/Squares/components/SquareCard.js.map +1 -1
  67. package/lib/module/Squares/index.js +10 -1
  68. package/lib/module/Squares/index.js.map +1 -1
  69. package/lib/module/constants/styles.js +10 -0
  70. package/lib/module/constants/styles.js.map +1 -1
  71. package/lib/module/index.js +2 -1
  72. package/lib/module/index.js.map +1 -1
  73. package/lib/typescript/src/CompetitionManager/api/index.d.ts +109 -0
  74. package/lib/typescript/src/CompetitionManager/api/index.d.ts.map +1 -0
  75. package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts +23 -0
  76. package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -0
  77. package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts +10 -0
  78. package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -0
  79. package/lib/typescript/src/CompetitionManager/components/CompetitionMatchMarketCard.d.ts +17 -0
  80. package/lib/typescript/src/CompetitionManager/components/CompetitionMatchMarketCard.d.ts.map +1 -0
  81. package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts +13 -0
  82. package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -0
  83. package/lib/typescript/src/CompetitionManager/components/MarketSelector.d.ts +13 -0
  84. package/lib/typescript/src/CompetitionManager/components/MarketSelector.d.ts.map +1 -0
  85. package/lib/typescript/src/CompetitionManager/index.d.ts +8 -0
  86. package/lib/typescript/src/CompetitionManager/index.d.ts.map +1 -0
  87. package/lib/typescript/src/Components/Dropdown.d.ts +15 -0
  88. package/lib/typescript/src/Components/Dropdown.d.ts.map +1 -0
  89. package/lib/typescript/src/Markets/api/index.d.ts +7 -0
  90. package/lib/typescript/src/Markets/api/index.d.ts.map +1 -0
  91. package/lib/typescript/src/Markets/components/MarketButton.d.ts +11 -0
  92. package/lib/typescript/src/Markets/components/MarketButton.d.ts.map +1 -0
  93. package/lib/typescript/src/Squares/api/index.d.ts +2 -1
  94. package/lib/typescript/src/Squares/api/index.d.ts.map +1 -1
  95. package/lib/typescript/src/Squares/components/PrizeCard.d.ts +11 -0
  96. package/lib/typescript/src/Squares/components/PrizeCard.d.ts.map +1 -0
  97. package/lib/typescript/src/Squares/components/SquareCard.d.ts.map +1 -1
  98. package/lib/typescript/src/Squares/index.d.ts.map +1 -1
  99. package/lib/typescript/src/constants/styles.d.ts +10 -0
  100. package/lib/typescript/src/constants/styles.d.ts.map +1 -1
  101. package/lib/typescript/src/index.d.ts +2 -1
  102. package/lib/typescript/src/index.d.ts.map +1 -1
  103. package/package.json +1 -1
  104. package/src/Competition/components/CompetitionCard.tsx +1 -1
  105. package/src/Competition/components/EnterCompetitionPrompt.tsx +2 -2
  106. package/src/CompetitionManager/api/index.ts +484 -0
  107. package/src/CompetitionManager/components/CompetitionContestsForm.tsx +473 -0
  108. package/src/CompetitionManager/components/CompetitionInfoForm.tsx +171 -0
  109. package/src/CompetitionManager/components/CompetitionMatchMarketCard.tsx +155 -0
  110. package/src/CompetitionManager/components/CompetitionSettingsForm.tsx +229 -0
  111. package/src/CompetitionManager/components/MarketSelector.tsx +66 -0
  112. package/src/CompetitionManager/index.tsx +163 -0
  113. package/src/Components/Dropdown.tsx +78 -0
  114. package/src/Components/Icons.tsx +1 -1
  115. package/src/Markets/api/index.ts +18 -0
  116. package/src/Markets/components/MarketButton.tsx +24 -0
  117. package/src/Squares/api/index.ts +2 -2
  118. package/src/Squares/components/PrizeCard.tsx +90 -0
  119. package/src/Squares/components/SquareCard.tsx +0 -1
  120. package/src/Squares/index.tsx +12 -2
  121. package/src/constants/styles.ts +5 -0
  122. package/src/index.tsx +2 -0
  123. package/src/types.d.ts +26 -2
@@ -0,0 +1,577 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ManagePlayerPicksApi = exports.ManageCompetitionResultApi = exports.ManageCompetitionPlayerApi = exports.ManageCompetitionMatchApi = exports.ManageCompetitionHelpers = exports.ManageCompetitionApi = exports.IN_PROGRESS_STATUSES = exports.FINALIZED_STATUSES = void 0;
7
+ var _axios = _interopRequireDefault(require("axios"));
8
+ var _ApiOverrides = require("../../ApiOverrides");
9
+ var _momentMini = _interopRequireDefault(require("moment-mini"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ let AUTH_SVC_API = '';
12
+ let TP_SVC_API = '';
13
+ let EVENT_SVC_API = '';
14
+ let MK_SVC_API = '';
15
+ const ManageCompetitionApi = exports.ManageCompetitionApi = {
16
+ setEnvironment: () => {
17
+ const endpoints = _ApiOverrides.APIOverrides.getEndpoints();
18
+ TP_SVC_API = endpoints['TP_SVC_API'];
19
+ EVENT_SVC_API = endpoints['EVENT_SVC_API'];
20
+ MK_SVC_API = endpoints['MK_SVC_API'];
21
+ AUTH_SVC_API = endpoints['AUTH_SVC_API'];
22
+ },
23
+ getPlayersByPlayerIds: async player_ids => {
24
+ const resp = await _axios.default.post(`${AUTH_SVC_API}/v1/players/bulk/get`, {
25
+ player_ids
26
+ });
27
+ return resp.data.players;
28
+ },
29
+ getLeagues: async () => {
30
+ const resp = await _axios.default.get(`${EVENT_SVC_API}/v1/leagues?status=active`);
31
+ return resp.data.leagues;
32
+ },
33
+ getMarkets: async () => {
34
+ const resp = await _axios.default.get(`${MK_SVC_API}/v1/markets/all`);
35
+ return resp.data.markets;
36
+ },
37
+ getLeagueById: async league_id => {
38
+ const resp = await _axios.default.get(`${EVENT_SVC_API}/v1/leagues/league/${league_id}`);
39
+ return resp.data.league;
40
+ },
41
+ getCompetitionsByCompanyId: async (company_id, offset, status) => {
42
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/competitions/company/${company_id}?offset=${offset}&status=${status}`);
43
+ return resp.data.competitions;
44
+ },
45
+ getCompetitionById: async competition_id => {
46
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/competitions/competition/${competition_id}`);
47
+ return resp.data.competition;
48
+ },
49
+ getCompetitionMatchesByCompetitionId: async competition_id => {
50
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/competitions/matches/${competition_id}`);
51
+ return {
52
+ competition_matches: resp.data.competition_matches,
53
+ competition_match_markets: resp.data.competition_match_markets
54
+ };
55
+ },
56
+ getEnteredCompetitions: async () => {
57
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/competitions/entered`);
58
+ return resp.data;
59
+ },
60
+ getCompetitionsBySeasonId: async competition_season_id => {
61
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/competitions/season/${competition_season_id}`);
62
+ return resp.data.competitions;
63
+ },
64
+ getPublicCompetitions: async offset => {
65
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/competitions/all?offset=${offset}&status=scheduled`);
66
+ return resp.data.competitions;
67
+ },
68
+ getActiveSponsoredCompetitions: async sponsor_id => {
69
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/competitions/sponsored/${sponsor_id}`);
70
+ return resp.data.competitions;
71
+ },
72
+ getCompetitionOptions: async () => {
73
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/competitions/options`);
74
+ return resp.data;
75
+ },
76
+ getMyDetails: async () => {
77
+ const resp = await _axios.default.get(`${AUTH_SVC_API}/v1/players/player/me`);
78
+ return resp.data.player;
79
+ },
80
+ getMyReferralCode: async () => {
81
+ const resp = await _axios.default.get(`${AUTH_SVC_API}/v1/promos/referral/me`);
82
+ return resp.data;
83
+ },
84
+ getMyBalance: async () => {
85
+ const resp = await _axios.default.get(`${AUTH_SVC_API}/v1/players/player/balance/me`);
86
+ return resp.data.player_balance;
87
+ },
88
+ createCompetition: async (company_id, sponsor_id) => {
89
+ const resp = await _axios.default.post(`${TP_SVC_API}/v2/competitions/competition/create`, {
90
+ company_id,
91
+ sponsor_id
92
+ });
93
+ return resp.data.competition;
94
+ },
95
+ updateCompetition: async competition => {
96
+ const resp = await _axios.default.post(`${TP_SVC_API}/v2/competitions/competition/update`, {
97
+ competition
98
+ });
99
+ return resp.data.competition;
100
+ },
101
+ activateCompetition: async competition_id => {
102
+ const resp = await _axios.default.post(`${TP_SVC_API}/v2/competitions/competition/activate`, {
103
+ competition_id
104
+ });
105
+ return resp.data.competition;
106
+ },
107
+ pauseCompetition: async competition_id => {
108
+ const resp = await _axios.default.post(`${TP_SVC_API}/v2/competitions/competition/pause`, {
109
+ competition_id
110
+ });
111
+ return resp.data.competition;
112
+ },
113
+ resumeCompetition: async competition_id => {
114
+ const resp = await _axios.default.post(`${TP_SVC_API}/v2/competitions/competition/resume`, {
115
+ competition_id
116
+ });
117
+ console.log(resp.data);
118
+ return resp.data.competition;
119
+ },
120
+ getCompetitionStatsByCompanyId: async company_id => {
121
+ const resp = await _axios.default.get(`${TP_SVC_API}/v2/competitions/stats/company/${company_id}`);
122
+ console.log(resp.data);
123
+ return resp.data;
124
+ },
125
+ getCompetitionStatsByCompetitionId: async competition_id => {
126
+ const resp = await _axios.default.get(`${TP_SVC_API}/v2/competitions/stats/competition/${competition_id}`);
127
+ console.log(resp.data);
128
+ return resp.data.competition_stats;
129
+ },
130
+ getCompetitionSummaries: async competition_id => {
131
+ const resp = await _axios.default.get(`${TP_SVC_API}/v2/competitions/summaries/${competition_id}`);
132
+ return resp.data.competition_summaries;
133
+ },
134
+ exportCometitionLeaders: async competition_id => {
135
+ try {
136
+ const resp = await _axios.default.get(`${TP_SVC_API}/v2/competitions/export/competition/${competition_id}`);
137
+ return resp.data;
138
+ } catch (e) {
139
+ return undefined;
140
+ }
141
+ },
142
+ exportCometitionData: async (competition_id, event_id, event_type) => {
143
+ try {
144
+ const resp = await _axios.default.get(`${TP_SVC_API}/v2/competitions/export/matches/${competition_id}?event_id=${event_id}&event_type=${event_type}`);
145
+ console.log(resp.data);
146
+ return resp.data;
147
+ } catch (e) {
148
+ return undefined;
149
+ }
150
+ }
151
+ };
152
+ const ManageCompetitionMatchApi = exports.ManageCompetitionMatchApi = {
153
+ getCompetitionMatchesByCompetitionId: async competition_id => {
154
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/competitions/matches/${competition_id}`);
155
+ return resp.data;
156
+ },
157
+ getEventsByEventIds: async event_ids => {
158
+ const resp = await _axios.default.post(`${EVENT_SVC_API}/v1/events/bulk/get`, {
159
+ attribute: 'event_id',
160
+ values: event_ids
161
+ });
162
+ return resp.data.events;
163
+ },
164
+ getMatchesByMatchIds: async match_ids => {
165
+ const resp = await _axios.default.post(`${EVENT_SVC_API}/v1/matches/bulk/get`, {
166
+ attribute: 'match_id',
167
+ values: match_ids
168
+ });
169
+ return resp.data.matches;
170
+ },
171
+ getAthletesByIds: async athlete_ids => {
172
+ const resp = await _axios.default.post(`${EVENT_SVC_API}/v1/athletes/bulk/get`, {
173
+ attribute: 'athlete_id',
174
+ values: athlete_ids
175
+ });
176
+ return resp.data.athletes;
177
+ },
178
+ getTournamentsByTournamentIds: async tournament_ids => {
179
+ const resp = await _axios.default.post(`${EVENT_SVC_API}/v1/tournaments/bulk/get`, {
180
+ attribute: 'event_id',
181
+ values: tournament_ids
182
+ });
183
+ return resp.data.tournaments;
184
+ },
185
+ getTeamsByIds: async team_ids => {
186
+ const resp = await _axios.default.post(`${EVENT_SVC_API}/v1/teams/bulk/get`, {
187
+ attribute: 'team_id',
188
+ values: team_ids
189
+ });
190
+ return resp.data.teams;
191
+ },
192
+ getExoticsByIds: async exotic_ids => {
193
+ const resp = await _axios.default.post(`${EVENT_SVC_API}/v1/exotics/bulk/get`, {
194
+ attribute: 'exotic_id',
195
+ values: exotic_ids
196
+ });
197
+ return resp.data.athletes;
198
+ }
199
+ };
200
+ const ManageCompetitionPlayerApi = exports.ManageCompetitionPlayerApi = {
201
+ getCompetitionPlayersByCompetition: async (competition_id, offset, status) => {
202
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/competitions/players/${competition_id}?offset=${offset}&status=${status}`);
203
+ return resp.data.competition_players;
204
+ },
205
+ joinCompetition: async competition_player => {
206
+ const resp = await _axios.default.post(`${TP_SVC_API}/v1/competitions/player/join`, {
207
+ competition_player
208
+ });
209
+ return resp.data;
210
+ },
211
+ leaveCompetition: async competition_player => {
212
+ const resp = await _axios.default.post(`${TP_SVC_API}/v1/competitions/player/leave`, {
213
+ competition_player
214
+ });
215
+ return resp.data;
216
+ },
217
+ rejectCompetition: async competition_player => {
218
+ const resp = await _axios.default.post(`${TP_SVC_API}/v1/competitions/player/leave`, {
219
+ competition_player
220
+ });
221
+ return resp.data.competition_player;
222
+ }
223
+ };
224
+ const ManagePlayerPicksApi = exports.ManagePlayerPicksApi = {
225
+ getPlayerPicksByCompetition: async (competition_id, player_id, offset) => {
226
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/picks/competition/${competition_id}?player_id=${player_id}&offset=${offset}`);
227
+ return resp.data.player_picks;
228
+ },
229
+ createPlayerPick: async player_pick => {
230
+ const resp = await _axios.default.post(`${TP_SVC_API}/v1/picks/pick/create`, {
231
+ player_pick
232
+ });
233
+ return resp.data;
234
+ },
235
+ removePlayerPick: async player_pick_id => {
236
+ const resp = await _axios.default.post(`${TP_SVC_API}/v1/picks/pick/remove`, {
237
+ player_pick_id
238
+ });
239
+ return resp.data;
240
+ }
241
+ };
242
+ const ManageCompetitionResultApi = exports.ManageCompetitionResultApi = {
243
+ getResultsByCompetition: async (competition_id, offset, player_id_override) => {
244
+ const resp = await _axios.default.get(`${TP_SVC_API}/v1/results/competition/${competition_id}?offset=${offset}&player_id=${player_id_override}`);
245
+ return resp.data;
246
+ }
247
+ };
248
+ const ManageCompetitionHelpers = exports.ManageCompetitionHelpers = {
249
+ createCompetitionMatchFromEventId: (event_id, event_type) => {
250
+ return {
251
+ competition_match_id: '',
252
+ competition_id: '',
253
+ event_id,
254
+ event_type,
255
+ status: 'inprogress',
256
+ create_datetime: '',
257
+ last_update_datetime: '',
258
+ match_type: 'event'
259
+ };
260
+ },
261
+ createCompetitionMatchMarketFromTrade: trade => {
262
+ return {
263
+ competition_match_market_id: '',
264
+ competition_match_id: '',
265
+ event_id: trade.event_id,
266
+ event_type: trade.event_type,
267
+ odds: trade.odds,
268
+ side: trade.side,
269
+ probability: trade.probability,
270
+ create_datetime: '',
271
+ last_update_datetime: '',
272
+ market_id: trade.market_id,
273
+ var_1: trade.var_1,
274
+ side_id: trade.side_id,
275
+ status: 'pending'
276
+ };
277
+ },
278
+ /*
279
+ createEmptyCompetitionMatchMarkets :(competition_match_id:string, market:MarketProps, event:EventProps, side_type?:string, side_id?:string):CompetitionMatchMarketProps[] => {
280
+
281
+ let cmms:CompetitionMatchMarketProps[] = []
282
+ let id_source = //market.side_options[0].id_source
283
+
284
+
285
+
286
+ market.side_options.map(so => {
287
+ side_type = id_source
288
+ if(id_source == 'side'){
289
+ side_id = so.side
290
+ } else {
291
+ switch(id_source){
292
+ case 'team':
293
+ if(market.level == 'event'){
294
+ side_id = event[so.side]?.team_id
295
+ } //Otherwise, we better be given an id!
296
+ break
297
+ default: break
298
+ }
299
+ }
300
+
301
+ if(!side_id){ return }
302
+
303
+ cmms.push({
304
+ competition_match_id,
305
+ competition_match_market_id: '',
306
+ market_id: market.market_id,
307
+ side: so.side,
308
+ side_id,
309
+ side_type,
310
+ create_datetime: '',
311
+ last_update_datetime: '',
312
+ var_1: 0,
313
+ odds: 100,
314
+ probability: 0.5,
315
+ status: 'error'
316
+ })
317
+ })
318
+
319
+ return cmms
320
+ },
321
+ */
322
+ createEmptyCompetitionMatchMarket: (market, side_id) => {
323
+ return {
324
+ competition_match_id: '',
325
+ competition_match_market_id: '',
326
+ market_id: market.market_id,
327
+ side: market.trade_side,
328
+ side_id,
329
+ create_datetime: '',
330
+ last_update_datetime: '',
331
+ var_1: 0,
332
+ odds: 100,
333
+ probability: 0.5,
334
+ status: 'error'
335
+ };
336
+ },
337
+ /**
338
+ * Takes an odds value and converts to a string with the + - and fixes to a supplied decimal value
339
+ * @param odds
340
+ * @param decimal
341
+ * @returns
342
+ */
343
+ getOddsLabel: (odds, decimal) => {
344
+ if (!odds) {
345
+ return '';
346
+ }
347
+ if (odds > 0) {
348
+ return `+${odds.toFixed(decimal ?? 0)}`;
349
+ }
350
+ return odds.toFixed(decimal ?? 0);
351
+ },
352
+ getVar1Label: (var_1, market) => {
353
+ if (market.type === 'Spread') {
354
+ if (var_1 >= 0) {
355
+ return `+${var_1}`;
356
+ }
357
+ }
358
+ return `${var_1}`;
359
+ },
360
+ calcProbabilityFromOdds: odds => {
361
+ let prob;
362
+ if (odds < 0) {
363
+ odds = Math.abs(odds);
364
+ prob = odds / (odds + 100) * 100;
365
+ return prob / 100;
366
+ } else {
367
+ prob = 100 / (odds + 100) * 100;
368
+ return prob / 100;
369
+ }
370
+ },
371
+ calcAmericanOddsFromProbability: probability => {
372
+ let p = probability * 100; //Convert to whole number
373
+ if (p === 100) {
374
+ return -9999;
375
+ }
376
+ if (p === 0) {
377
+ return 9999;
378
+ }
379
+ if (p === 50) {
380
+ return 100;
381
+ }
382
+ let odds;
383
+ if (p < 50) {
384
+ odds = 100 / (p / 100) - 100;
385
+ return odds;
386
+ }
387
+ odds = p / (1 - p / 100) * -1;
388
+ return odds;
389
+ },
390
+ /*
391
+ getEmptyCompetition : ():CompetitionProps => {
392
+ return {
393
+ competition_id: '',
394
+ competition_name:'',
395
+ competition_description:'',
396
+ buy_in: 0,
397
+ admin_id:'',
398
+ image: { url: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1635988385/be_notify_icon_nqplfc.png' },
399
+ ticket_revenue:0,
400
+ tickets_sold:0,
401
+ available_tickets:10,
402
+ market_ids: [],
403
+ market_type: 'FOR_MONEY',
404
+ status: 'scheduled',
405
+ create_datetime:'',
406
+ last_update_datetime: '',
407
+ competition_type_id: '1',
408
+ competition_result_type_id:'1',
409
+ scheduled_datetime: '',
410
+ entered: false,
411
+ max_pick_count: 0,
412
+ leagues: [],
413
+ invite_only: false,
414
+ length_type: 'event',
415
+ competition_code: '',
416
+ initial_balance: 1000,
417
+ end_datetime: moment().add(1, 'week')
418
+ }
419
+ },
420
+ */
421
+ /*
422
+ getStartTimeOptions :(competition:CompetitionProps, competition_matches:CompetitionMatchProps[], competition_match_markets:CompetitionMatchMarketProps[], events:EventProps[]) => {
423
+ if(!competition){ return [] }
424
+ if(events.length == 0){ return [] }
425
+ let included_events = events.filter(e => competition_matches.map(cm => cm.event_id.toString()).includes(e.event_id.toString())).sort((a,b) => moment(b.scheduled_datetime).unix() - moment(a.scheduled_datetime).unix())
426
+
427
+ let start_time_options:{ start_time:string, label:string }[] = []
428
+ let earliest_event = included_events[included_events.length - 1]
429
+ start_time_options.push({ label:'Start time of the earliest contest', start_time: earliest_event.scheduled_datetime })
430
+ let picks_available = competition.max_pick_count
431
+ let done = false;
432
+ included_events.map(e => {
433
+ if(done){ return }
434
+ let event_matches = competition_matches.filter(cm => cm.event_id == e.event_id)
435
+ let event_markets = competition_match_markets.filter(cmm => event_matches.map(cm => cm.competition_match_id.toString()).includes(cmm.competition_match_id.toString()))
436
+ let pick_options = event_markets.length / 2
437
+ if(picks_available - pick_options <= 0){
438
+ if(e.scheduled_datetime != earliest_event.scheduled_datetime){
439
+ start_time_options.push({ label: 'Latest start time possible based on max picks', start_time: e.scheduled_datetime })
440
+ }
441
+ done = true
442
+ }
443
+ picks_available -= pick_options
444
+ })
445
+
446
+ return start_time_options
447
+ },
448
+ */
449
+ isCompetitionInfoValid: c => {
450
+ if (!c) {
451
+ return false;
452
+ }
453
+ if (!c.competition_name) {
454
+ return false;
455
+ }
456
+ if (!c.competition_description) {
457
+ return false;
458
+ }
459
+ //if(!c.competition_type_id){ return false }
460
+ //if(!c.competition_result_type_id){ return false }
461
+ //if(isNaN(c.buy_in) || c.buy_in < 0){ return false }
462
+ //if(isNaN(c.available_tickets) || c.available_tickets < 1){ return false }
463
+ return true;
464
+ },
465
+ isCompetitionSettingsValid: (c, ct, cr) => {
466
+ if (!c || !ct) {
467
+ return false;
468
+ }
469
+ if (!c.competition_type_id) {
470
+ return false;
471
+ }
472
+ if (!c.competition_result_type_id) {
473
+ return false;
474
+ }
475
+ if (isNaN(c.buy_in) || parseInt(c.buy_in) < 0) {
476
+ return false;
477
+ }
478
+ if (isNaN(c.available_tickets) || parseInt(c.available_tickets) < 1) {
479
+ return false;
480
+ }
481
+ if (cr.type == 'outpace' && !c.pacer_id) {
482
+ return false;
483
+ }
484
+ return true;
485
+ },
486
+ isContestSettingsValid: (c, competition_type, competition_result_type) => {
487
+ if (!c) {
488
+ return false;
489
+ }
490
+ if (isNaN(c.available_tickets)) {
491
+ return false;
492
+ }
493
+ if (isNaN(c.max_pick_count)) {
494
+ return false;
495
+ }
496
+ if (isNaN(c.initial_balance)) {
497
+ return false;
498
+ }
499
+ if (!competition_type) {
500
+ return false;
501
+ }
502
+ if (!competition_result_type) {
503
+ return false;
504
+ }
505
+ if (competition_type.type == 'pick' && c.max_pick_count < 1) {
506
+ return false;
507
+ }
508
+ if (!c.scheduled_datetime) {
509
+ return false;
510
+ }
511
+ if ((0, _momentMini.default)(c.scheduled_datetime).isBefore((0, _momentMini.default)())) {
512
+ return false;
513
+ }
514
+ if (c.length_type == 'time') {
515
+ if (!c.end_datetime) {
516
+ return false;
517
+ }
518
+ if ((0, _momentMini.default)(c.end_datetime).isBefore((0, _momentMini.default)())) {
519
+ return false;
520
+ }
521
+ }
522
+ return true;
523
+ //This will be a beast
524
+ },
525
+ isContestsValid: (competition, competition_matches, competition_match_markets, events) => {
526
+ let valid = true;
527
+ competition_matches.map(cm => {
528
+ if (valid == false) {
529
+ return;
530
+ }
531
+ let event = events.find(e => e.event_id == cm.event_id);
532
+ if (!event) {
533
+ valid = false;
534
+ return;
535
+ }
536
+ if (competition.status == 'pending' && (0, _momentMini.default)().isAfter(event.scheduled_datetime)) {
537
+ valid = false;
538
+ return;
539
+ }
540
+ let match_markets = competition_match_markets.filter(cmm => cmm.competition_match_id == cm.competition_match_id);
541
+ if (match_markets.length == 0) {
542
+ valid = false;
543
+ }
544
+ if (match_markets.length % 2 != 0) {
545
+ valid = false;
546
+ } //INVALUD
547
+ });
548
+ return valid;
549
+ },
550
+ formatPlace: place => {
551
+ switch (place) {
552
+ case 1:
553
+ return `1st`;
554
+ case 2:
555
+ return '2nd';
556
+ case 3:
557
+ return '3rd';
558
+ case 4:
559
+ return '4th';
560
+ case 5:
561
+ return '5th';
562
+ case 6:
563
+ return '6th';
564
+ case 7:
565
+ return '7th';
566
+ case 8:
567
+ return '8th';
568
+ case 9:
569
+ return '9th';
570
+ default:
571
+ return `${place}`;
572
+ }
573
+ }
574
+ };
575
+ const FINALIZED_STATUSES = exports.FINALIZED_STATUSES = ['closed', 'complete', 'cancelled', 'unnecessary', 'postponed', 'suspended'];
576
+ const IN_PROGRESS_STATUSES = exports.IN_PROGRESS_STATUSES = ['inprogress', 'halftime', 'intermission'];
577
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_axios","_interopRequireDefault","require","_ApiOverrides","_momentMini","obj","__esModule","default","AUTH_SVC_API","TP_SVC_API","EVENT_SVC_API","MK_SVC_API","ManageCompetitionApi","exports","setEnvironment","endpoints","APIOverrides","getEndpoints","getPlayersByPlayerIds","player_ids","resp","axios","post","data","players","getLeagues","get","leagues","getMarkets","markets","getLeagueById","league_id","league","getCompetitionsByCompanyId","company_id","offset","status","competitions","getCompetitionById","competition_id","competition","getCompetitionMatchesByCompetitionId","competition_matches","competition_match_markets","getEnteredCompetitions","getCompetitionsBySeasonId","competition_season_id","getPublicCompetitions","getActiveSponsoredCompetitions","sponsor_id","getCompetitionOptions","getMyDetails","player","getMyReferralCode","getMyBalance","player_balance","createCompetition","updateCompetition","activateCompetition","pauseCompetition","resumeCompetition","console","log","getCompetitionStatsByCompanyId","getCompetitionStatsByCompetitionId","competition_stats","getCompetitionSummaries","competition_summaries","exportCometitionLeaders","e","undefined","exportCometitionData","event_id","event_type","ManageCompetitionMatchApi","getEventsByEventIds","event_ids","attribute","values","events","getMatchesByMatchIds","match_ids","matches","getAthletesByIds","athlete_ids","athletes","getTournamentsByTournamentIds","tournament_ids","tournaments","getTeamsByIds","team_ids","teams","getExoticsByIds","exotic_ids","ManageCompetitionPlayerApi","getCompetitionPlayersByCompetition","competition_players","joinCompetition","competition_player","leaveCompetition","rejectCompetition","ManagePlayerPicksApi","getPlayerPicksByCompetition","player_id","player_picks","createPlayerPick","player_pick","removePlayerPick","player_pick_id","ManageCompetitionResultApi","getResultsByCompetition","player_id_override","ManageCompetitionHelpers","createCompetitionMatchFromEventId","competition_match_id","create_datetime","last_update_datetime","match_type","createCompetitionMatchMarketFromTrade","trade","competition_match_market_id","odds","side","probability","market_id","var_1","side_id","createEmptyCompetitionMatchMarket","market","trade_side","getOddsLabel","decimal","toFixed","getVar1Label","type","calcProbabilityFromOdds","prob","Math","abs","calcAmericanOddsFromProbability","p","isCompetitionInfoValid","c","competition_name","competition_description","isCompetitionSettingsValid","ct","cr","competition_type_id","competition_result_type_id","isNaN","buy_in","parseInt","available_tickets","pacer_id","isContestSettingsValid","competition_type","competition_result_type","max_pick_count","initial_balance","scheduled_datetime","moment","isBefore","length_type","end_datetime","isContestsValid","valid","map","cm","event","find","isAfter","match_markets","filter","cmm","length","formatPlace","place","FINALIZED_STATUSES","IN_PROGRESS_STATUSES"],"sourceRoot":"../../../../src","sources":["CompetitionManager/api/index.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAiC,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,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