@smartico/public-api 0.0.10 → 0.0.12
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/dist/Core/CoreUtils.d.ts +4 -0
- package/dist/Core/index.d.ts +2 -1
- package/dist/SmarticoAPI.d.ts +2 -0
- package/dist/Tournaments/TournamentUtils.d.ts +9 -0
- package/dist/Tournaments/index.d.ts +2 -1
- package/dist/index.js +141 -53
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +130 -54
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Core/CoreUtils.ts +13 -0
- package/src/Core/index.ts +3 -1
- package/src/SmarticoAPI.ts +42 -5
- package/src/Tournaments/TournamentUtils.ts +64 -0
- package/src/Tournaments/index.ts +2 -0
package/dist/Core/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ActivityTypeLimited } from './ActivityTypeLimited';
|
|
2
|
+
import { CoreUtils } from './CoreUtils';
|
|
2
3
|
import { GetLabelInfoRequest } from './GetLabelInfoRequest';
|
|
3
4
|
import { GetLabelInfoResponse } from './GetLabelInfoResponse';
|
|
4
5
|
import { GetTranslationsRequest } from './GetTranslationsRequest';
|
|
@@ -6,4 +7,4 @@ import { GetTranslationsResponse } from './GetTranslationsResponse';
|
|
|
6
7
|
import { PublicLabelSettings } from './PublicLabelSettings';
|
|
7
8
|
import { ResponseIdentify } from './ResponseIdentify';
|
|
8
9
|
import { TranslationArea } from './TranslationArea';
|
|
9
|
-
export { GetTranslationsRequest, GetTranslationsResponse, GetLabelInfoRequest, GetLabelInfoResponse, TranslationArea, PublicLabelSettings, ResponseIdentify, ActivityTypeLimited };
|
|
10
|
+
export { GetTranslationsRequest, GetTranslationsResponse, GetLabelInfoRequest, GetLabelInfoResponse, TranslationArea, PublicLabelSettings, ResponseIdentify, ActivityTypeLimited, CoreUtils };
|
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { GetInboxMessagesResponse } from './Inbox';
|
|
|
8
8
|
import { GetStoreItemsResponse } from './Store';
|
|
9
9
|
import { GetAchievementMapResponse } from './Missions';
|
|
10
10
|
import { GetTournamentInfoResponse, GetTournamentsResponse } from './Tournaments';
|
|
11
|
+
import { GetLeaderBoardsResponse, LeaderBoardPeriodType } from "./Leaderboard";
|
|
11
12
|
interface IOptions {
|
|
12
13
|
logger?: ILogger;
|
|
13
14
|
logCIDs?: ClassId[];
|
|
@@ -40,5 +41,6 @@ declare class SmarticoAPI {
|
|
|
40
41
|
missionsGetItems(user_ext_id: string): Promise<GetAchievementMapResponse>;
|
|
41
42
|
tournamentsGetLobby(user_ext_id: string): Promise<GetTournamentsResponse>;
|
|
42
43
|
tournamentsGetInfo(user_ext_id: string, tournamentInstanceId: number): Promise<GetTournamentInfoResponse>;
|
|
44
|
+
leaderboardGet(user_ext_id: string, period_type_id: LeaderBoardPeriodType, prevPeriod?: boolean): Promise<GetLeaderBoardsResponse>;
|
|
43
45
|
}
|
|
44
46
|
export { SmarticoAPI, MessageSender };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Tournament } from "./Tournament";
|
|
2
|
+
export declare class TournamentUtils {
|
|
3
|
+
static isCanRegister: (tournament: Tournament) => boolean;
|
|
4
|
+
static isInProgress: (tournament: Tournament) => boolean;
|
|
5
|
+
static isActive: (tournament: Tournament) => boolean;
|
|
6
|
+
static isFinished: (tournament: Tournament) => boolean;
|
|
7
|
+
static isCancelled: (tournament: Tournament) => boolean;
|
|
8
|
+
static isUpcoming: (tournament: Tournament) => boolean;
|
|
9
|
+
}
|
|
@@ -13,4 +13,5 @@ import { TournamentRegistrationError } from "./TournamentRegistrationError";
|
|
|
13
13
|
import { TournamentRegistrationStatus } from "./TournamentRegistrationStatus";
|
|
14
14
|
import { TournamentRegistrationType } from "./TournamentRegistrationType";
|
|
15
15
|
import { TournamentType } from "./TournamentType";
|
|
16
|
-
|
|
16
|
+
import { TournamentUtils } from "./TournamentUtils";
|
|
17
|
+
export { GetTournamentInfoRequest, GetTournamentInfoResponse, GetTournamentsRequest, GetTournamentsResponse, Tournament, TournamentInstanceStatus, TournamentPlayer, TournamentPrize, TournamentPublicMeta, TournamentRegisterRequest, TournamentRegisterResponse, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationType, TournamentType, TournamentUtils };
|
package/dist/index.js
CHANGED
|
@@ -334,6 +334,64 @@ var OCache = /*#__PURE__*/function () {
|
|
|
334
334
|
}();
|
|
335
335
|
OCache.cache = {};
|
|
336
336
|
|
|
337
|
+
exports.ActivityTypeLimited = void 0;
|
|
338
|
+
(function (ActivityTypeLimited) {
|
|
339
|
+
ActivityTypeLimited[ActivityTypeLimited["DoNothing"] = 8] = "DoNothing";
|
|
340
|
+
ActivityTypeLimited[ActivityTypeLimited["Points"] = 12] = "Points";
|
|
341
|
+
ActivityTypeLimited[ActivityTypeLimited["Popup"] = 30] = "Popup";
|
|
342
|
+
ActivityTypeLimited[ActivityTypeLimited["Inbox"] = 31] = "Inbox";
|
|
343
|
+
ActivityTypeLimited[ActivityTypeLimited["Bonus"] = 100] = "Bonus";
|
|
344
|
+
})(exports.ActivityTypeLimited || (exports.ActivityTypeLimited = {}));
|
|
345
|
+
|
|
346
|
+
var CoreUtils = function CoreUtils() {};
|
|
347
|
+
CoreUtils.avatarUrl = function (avatar_id, avatarDomain) {
|
|
348
|
+
if (!(avatar_id && avatar_id.startsWith('http'))) {
|
|
349
|
+
return avatarDomain + '/avatar/' + avatar_id;
|
|
350
|
+
} else {
|
|
351
|
+
return avatar_id;
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
exports.PublicLabelSettings = void 0;
|
|
356
|
+
(function (PublicLabelSettings) {
|
|
357
|
+
PublicLabelSettings["FCM_SENDER_ID"] = "FCM_SENDER_ID";
|
|
358
|
+
PublicLabelSettings["PUBLIC_API_URL"] = "PUBLIC_API_URL";
|
|
359
|
+
PublicLabelSettings["FCM_SW_URL"] = "FCM_SW_URL";
|
|
360
|
+
PublicLabelSettings["RECORDING_ENABLED_FOR_ALL_USERS"] = "RECORDING_ENABLED_FOR_ALL_USERS";
|
|
361
|
+
PublicLabelSettings["JS_INJECTION"] = "JS_INJECTION";
|
|
362
|
+
PublicLabelSettings["GAMIFICATION_UI_MAIN"] = "GAMIFICATION_UI_MAIN";
|
|
363
|
+
PublicLabelSettings["GAMIFICATION_UI_WIDGET"] = "GAMIFICATION_UI_WIDGET";
|
|
364
|
+
PublicLabelSettings["GAMIFICATION_UI_MINI_GAME"] = "GAMIFICATION_UI_MINI_GAME";
|
|
365
|
+
PublicLabelSettings["GAMIFICATION_UI_SETTINGS"] = "GAMIFICATION_UI_SETTINGS";
|
|
366
|
+
PublicLabelSettings["GAMIFICATION_UI_MAIN_TEST"] = "GAMIFICATION_UI_MAIN_TEST";
|
|
367
|
+
PublicLabelSettings["GAMIFICATION_UI_WIDGET_TEST"] = "GAMIFICATION_UI_WIDGET_TEST";
|
|
368
|
+
PublicLabelSettings["GAMIFICATION_UI_SETTINGS_TEST"] = "GAMIFICATION_UI_SETTINGS_TEST";
|
|
369
|
+
PublicLabelSettings["FRONT_END_ALLOWED_LANGUAGES"] = "FRONT_END_ALLOWED_LANGUAGES";
|
|
370
|
+
PublicLabelSettings["FRONT_END_ALLOW_DOMAINS"] = "FRONT_END_ALLOW_DOMAINS";
|
|
371
|
+
PublicLabelSettings["DELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS"] = "DELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS";
|
|
372
|
+
PublicLabelSettings["SHADOW_LABEL_PUBLIC_KEY"] = "SHADOW_LABEL_PUBLIC_KEY";
|
|
373
|
+
PublicLabelSettings["DYNAMIC_IMAGE_DOMAIN"] = "DYNAMIC_IMAGE_DOMAIN";
|
|
374
|
+
PublicLabelSettings["GAMIFICATION_UI_LEVEL_ENABLED"] = "GAMIFICATION_UI_LEVEL_ENABLED";
|
|
375
|
+
PublicLabelSettings["GAMIFICATION_UI_LEVEL_IMAGE_MOB"] = "GAMIFICATION_UI_LEVEL_IMAGE_MOB";
|
|
376
|
+
PublicLabelSettings["GAMIFICATION_UI_LEVEL_IMAGE_DESK"] = "GAMIFICATION_UI_LEVEL_IMAGE_DESK";
|
|
377
|
+
PublicLabelSettings["GAMIFICATION_LEVELS_LOGIC2"] = "GAMIFICATION_LEVELS_LOGIC2";
|
|
378
|
+
PublicLabelSettings["AVATAR_CUSTOM_IMAGE_MAX_ID"] = "AVATAR_CUSTOM_IMAGE_MAX_ID";
|
|
379
|
+
PublicLabelSettings["AVATAR_CUSTOM_IMAGE_FOLDER"] = "AVATAR_CUSTOM_IMAGE_FOLDER";
|
|
380
|
+
PublicLabelSettings["RETENTION_GAMES_CUSTOMER_ID"] = "RETENTION_GAMES_CUSTOMER_ID";
|
|
381
|
+
PublicLabelSettings["GAMIFICATION_SHOW_POWERED_BY"] = "GAMIFICATION_SHOW_POWERED_BY";
|
|
382
|
+
PublicLabelSettings["_system_leader_board_mask_username"] = "_system_leader_board_mask_username";
|
|
383
|
+
})(exports.PublicLabelSettings || (exports.PublicLabelSettings = {}));
|
|
384
|
+
|
|
385
|
+
exports.TranslationArea = void 0;
|
|
386
|
+
(function (TranslationArea) {
|
|
387
|
+
TranslationArea[TranslationArea["Casino"] = 1] = "Casino";
|
|
388
|
+
TranslationArea[TranslationArea["Gamification"] = 2] = "Gamification";
|
|
389
|
+
TranslationArea[TranslationArea["Trading"] = 3] = "Trading";
|
|
390
|
+
TranslationArea[TranslationArea["Archived"] = 4] = "Archived";
|
|
391
|
+
TranslationArea[TranslationArea["Affiliation"] = 5] = "Affiliation";
|
|
392
|
+
TranslationArea[TranslationArea["RetentionGames"] = 6] = "RetentionGames";
|
|
393
|
+
})(exports.TranslationArea || (exports.TranslationArea = {}));
|
|
394
|
+
|
|
337
395
|
function _catch(body, recover) {
|
|
338
396
|
try {
|
|
339
397
|
var result = body();
|
|
@@ -547,9 +605,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
547
605
|
request_id: IntUtils.uuid() // AA: do we need request_id?
|
|
548
606
|
});
|
|
549
607
|
return Promise.resolve(_this5.send(message, exports.ClassId.IDENTIFY_RESPONSE)).then(function (r) {
|
|
550
|
-
|
|
551
|
-
r.avatar_id = _this5.avatarDomain + '/avatar/' + r.avatar_id;
|
|
552
|
-
}
|
|
608
|
+
r.avatar_id = CoreUtils.avatarUrl(r.avatar_id, _this5.avatarDomain);
|
|
553
609
|
return r;
|
|
554
610
|
});
|
|
555
611
|
} catch (e) {
|
|
@@ -666,7 +722,45 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
666
722
|
var message = _this13.buildMessage(user_ext_id, exports.ClassId.GET_TOURNAMENT_INFO_REQUEST, {
|
|
667
723
|
tournamentInstanceId: tournamentInstanceId
|
|
668
724
|
});
|
|
669
|
-
return Promise.resolve(_this13.send(message))
|
|
725
|
+
return Promise.resolve(_this13.send(message)).then(function (response) {
|
|
726
|
+
var _response$userPositio, _response$tournamentI;
|
|
727
|
+
if ((_response$userPositio = response.userPosition) != null && _response$userPositio.avatar_id) {
|
|
728
|
+
response.userPosition.avatar_url = CoreUtils.avatarUrl(response.userPosition.avatar_url, _this13.avatarDomain);
|
|
729
|
+
}
|
|
730
|
+
if ((_response$tournamentI = response.tournamentInfo.players) != null && _response$tournamentI.length) {
|
|
731
|
+
response.tournamentInfo.players.forEach(function (p) {
|
|
732
|
+
p.avatar_url = CoreUtils.avatarUrl(p.avatar_url, _this13.avatarDomain);
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
return response;
|
|
736
|
+
});
|
|
737
|
+
} catch (e) {
|
|
738
|
+
return Promise.reject(e);
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
_proto.leaderboardGet = function leaderboardGet(user_ext_id, period_type_id, prevPeriod) {
|
|
742
|
+
if (prevPeriod === void 0) {
|
|
743
|
+
prevPeriod = false;
|
|
744
|
+
}
|
|
745
|
+
try {
|
|
746
|
+
var _this14 = this;
|
|
747
|
+
var message = _this14.buildMessage(user_ext_id, exports.ClassId.GET_LEADERS_BOARD_REQUEST, {
|
|
748
|
+
period_type_id: period_type_id,
|
|
749
|
+
snapshot_offset: prevPeriod ? 1 : 0,
|
|
750
|
+
include_users: true
|
|
751
|
+
});
|
|
752
|
+
return Promise.resolve(_this14.send(message)).then(function (response) {
|
|
753
|
+
var _response$map$period_, _response$map$period_2, _response$map$period_3, _response$map$period_4;
|
|
754
|
+
if ((_response$map$period_ = response.map[period_type_id]) != null && (_response$map$period_2 = _response$map$period_.userPosition) != null && _response$map$period_2.avatar_id) {
|
|
755
|
+
response.map[period_type_id].userPosition.avatar_url = CoreUtils.avatarUrl(response.map[period_type_id].userPosition.avatar_id, _this14.avatarDomain);
|
|
756
|
+
}
|
|
757
|
+
if ((_response$map$period_3 = response.map[period_type_id]) != null && (_response$map$period_4 = _response$map$period_3.positions) != null && _response$map$period_4.length) {
|
|
758
|
+
response.map[period_type_id].positions.forEach(function (p) {
|
|
759
|
+
p.avatar_url = CoreUtils.avatarUrl(p.avatar_id, _this14.avatarDomain);
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
return response;
|
|
763
|
+
});
|
|
670
764
|
} catch (e) {
|
|
671
765
|
return Promise.reject(e);
|
|
672
766
|
}
|
|
@@ -674,55 +768,6 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
674
768
|
return SmarticoAPI;
|
|
675
769
|
}();
|
|
676
770
|
|
|
677
|
-
exports.ActivityTypeLimited = void 0;
|
|
678
|
-
(function (ActivityTypeLimited) {
|
|
679
|
-
ActivityTypeLimited[ActivityTypeLimited["DoNothing"] = 8] = "DoNothing";
|
|
680
|
-
ActivityTypeLimited[ActivityTypeLimited["Points"] = 12] = "Points";
|
|
681
|
-
ActivityTypeLimited[ActivityTypeLimited["Popup"] = 30] = "Popup";
|
|
682
|
-
ActivityTypeLimited[ActivityTypeLimited["Inbox"] = 31] = "Inbox";
|
|
683
|
-
ActivityTypeLimited[ActivityTypeLimited["Bonus"] = 100] = "Bonus";
|
|
684
|
-
})(exports.ActivityTypeLimited || (exports.ActivityTypeLimited = {}));
|
|
685
|
-
|
|
686
|
-
exports.PublicLabelSettings = void 0;
|
|
687
|
-
(function (PublicLabelSettings) {
|
|
688
|
-
PublicLabelSettings["FCM_SENDER_ID"] = "FCM_SENDER_ID";
|
|
689
|
-
PublicLabelSettings["PUBLIC_API_URL"] = "PUBLIC_API_URL";
|
|
690
|
-
PublicLabelSettings["FCM_SW_URL"] = "FCM_SW_URL";
|
|
691
|
-
PublicLabelSettings["RECORDING_ENABLED_FOR_ALL_USERS"] = "RECORDING_ENABLED_FOR_ALL_USERS";
|
|
692
|
-
PublicLabelSettings["JS_INJECTION"] = "JS_INJECTION";
|
|
693
|
-
PublicLabelSettings["GAMIFICATION_UI_MAIN"] = "GAMIFICATION_UI_MAIN";
|
|
694
|
-
PublicLabelSettings["GAMIFICATION_UI_WIDGET"] = "GAMIFICATION_UI_WIDGET";
|
|
695
|
-
PublicLabelSettings["GAMIFICATION_UI_MINI_GAME"] = "GAMIFICATION_UI_MINI_GAME";
|
|
696
|
-
PublicLabelSettings["GAMIFICATION_UI_SETTINGS"] = "GAMIFICATION_UI_SETTINGS";
|
|
697
|
-
PublicLabelSettings["GAMIFICATION_UI_MAIN_TEST"] = "GAMIFICATION_UI_MAIN_TEST";
|
|
698
|
-
PublicLabelSettings["GAMIFICATION_UI_WIDGET_TEST"] = "GAMIFICATION_UI_WIDGET_TEST";
|
|
699
|
-
PublicLabelSettings["GAMIFICATION_UI_SETTINGS_TEST"] = "GAMIFICATION_UI_SETTINGS_TEST";
|
|
700
|
-
PublicLabelSettings["FRONT_END_ALLOWED_LANGUAGES"] = "FRONT_END_ALLOWED_LANGUAGES";
|
|
701
|
-
PublicLabelSettings["FRONT_END_ALLOW_DOMAINS"] = "FRONT_END_ALLOW_DOMAINS";
|
|
702
|
-
PublicLabelSettings["DELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS"] = "DELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS";
|
|
703
|
-
PublicLabelSettings["SHADOW_LABEL_PUBLIC_KEY"] = "SHADOW_LABEL_PUBLIC_KEY";
|
|
704
|
-
PublicLabelSettings["DYNAMIC_IMAGE_DOMAIN"] = "DYNAMIC_IMAGE_DOMAIN";
|
|
705
|
-
PublicLabelSettings["GAMIFICATION_UI_LEVEL_ENABLED"] = "GAMIFICATION_UI_LEVEL_ENABLED";
|
|
706
|
-
PublicLabelSettings["GAMIFICATION_UI_LEVEL_IMAGE_MOB"] = "GAMIFICATION_UI_LEVEL_IMAGE_MOB";
|
|
707
|
-
PublicLabelSettings["GAMIFICATION_UI_LEVEL_IMAGE_DESK"] = "GAMIFICATION_UI_LEVEL_IMAGE_DESK";
|
|
708
|
-
PublicLabelSettings["GAMIFICATION_LEVELS_LOGIC2"] = "GAMIFICATION_LEVELS_LOGIC2";
|
|
709
|
-
PublicLabelSettings["AVATAR_CUSTOM_IMAGE_MAX_ID"] = "AVATAR_CUSTOM_IMAGE_MAX_ID";
|
|
710
|
-
PublicLabelSettings["AVATAR_CUSTOM_IMAGE_FOLDER"] = "AVATAR_CUSTOM_IMAGE_FOLDER";
|
|
711
|
-
PublicLabelSettings["RETENTION_GAMES_CUSTOMER_ID"] = "RETENTION_GAMES_CUSTOMER_ID";
|
|
712
|
-
PublicLabelSettings["GAMIFICATION_SHOW_POWERED_BY"] = "GAMIFICATION_SHOW_POWERED_BY";
|
|
713
|
-
PublicLabelSettings["_system_leader_board_mask_username"] = "_system_leader_board_mask_username";
|
|
714
|
-
})(exports.PublicLabelSettings || (exports.PublicLabelSettings = {}));
|
|
715
|
-
|
|
716
|
-
exports.TranslationArea = void 0;
|
|
717
|
-
(function (TranslationArea) {
|
|
718
|
-
TranslationArea[TranslationArea["Casino"] = 1] = "Casino";
|
|
719
|
-
TranslationArea[TranslationArea["Gamification"] = 2] = "Gamification";
|
|
720
|
-
TranslationArea[TranslationArea["Trading"] = 3] = "Trading";
|
|
721
|
-
TranslationArea[TranslationArea["Archived"] = 4] = "Archived";
|
|
722
|
-
TranslationArea[TranslationArea["Affiliation"] = 5] = "Affiliation";
|
|
723
|
-
TranslationArea[TranslationArea["RetentionGames"] = 6] = "RetentionGames";
|
|
724
|
-
})(exports.TranslationArea || (exports.TranslationArea = {}));
|
|
725
|
-
|
|
726
771
|
exports.InboxMessageType = void 0;
|
|
727
772
|
(function (InboxMessageType) {
|
|
728
773
|
InboxMessageType[InboxMessageType["Custom"] = 0] = "Custom";
|
|
@@ -836,9 +881,52 @@ exports.TournamentType = void 0;
|
|
|
836
881
|
TournamentType[TournamentType["TEST"] = 3] = "TEST";
|
|
837
882
|
})(exports.TournamentType || (exports.TournamentType = {}));
|
|
838
883
|
|
|
884
|
+
var TournamentUtils = function TournamentUtils() {};
|
|
885
|
+
TournamentUtils.isCanRegister = function (tournament) {
|
|
886
|
+
if (tournament) {
|
|
887
|
+
if (tournament.tournamentRegistrationStatus === exports.TournamentRegistrationStatus.QUALIFIED_PENDING_REGISTRATION) {
|
|
888
|
+
return true;
|
|
889
|
+
}
|
|
890
|
+
return !tournament.isUserRegistered && (tournament.playersMaxCount !== tournament.registrationCount || tournament.playersMaxCount === null || tournament.playersMaxCount === 0) && tournament.registrationType !== exports.TournamentRegistrationType.AUTO && (tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.REGISTER || tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.STARTED && tournament.allowLateRegistration);
|
|
891
|
+
}
|
|
892
|
+
return false;
|
|
893
|
+
};
|
|
894
|
+
TournamentUtils.isInProgress = function (tournament) {
|
|
895
|
+
if (tournament) {
|
|
896
|
+
return tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.STARTED;
|
|
897
|
+
}
|
|
898
|
+
return false;
|
|
899
|
+
};
|
|
900
|
+
TournamentUtils.isActive = function (tournament) {
|
|
901
|
+
if (tournament) {
|
|
902
|
+
return tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.PUBLISHED || tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.REGISTER || tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.STARTED;
|
|
903
|
+
}
|
|
904
|
+
return false;
|
|
905
|
+
};
|
|
906
|
+
TournamentUtils.isFinished = function (tournament) {
|
|
907
|
+
if (tournament) {
|
|
908
|
+
return tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.FINISHED || tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.CANCELLED || tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.FINALIZING;
|
|
909
|
+
}
|
|
910
|
+
return false;
|
|
911
|
+
};
|
|
912
|
+
TournamentUtils.isCancelled = function (tournament) {
|
|
913
|
+
if (tournament) {
|
|
914
|
+
return tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.CANCELLED;
|
|
915
|
+
}
|
|
916
|
+
return false;
|
|
917
|
+
};
|
|
918
|
+
TournamentUtils.isUpcoming = function (tournament) {
|
|
919
|
+
if (tournament) {
|
|
920
|
+
return tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.PUBLISHED || tournament.tournamentInstanceStatus === exports.TournamentInstanceStatus.REGISTER;
|
|
921
|
+
}
|
|
922
|
+
return false;
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
exports.CoreUtils = CoreUtils;
|
|
839
926
|
exports.SAWBuyInTypeName = SAWBuyInTypeName;
|
|
840
927
|
exports.SAWGameTypeName = SAWGameTypeName;
|
|
841
928
|
exports.SAWUtils = SAWUtils;
|
|
842
929
|
exports.SAWWinSoundFiles = SAWWinSoundFiles;
|
|
843
930
|
exports.SmarticoAPI = SmarticoAPI;
|
|
931
|
+
exports.TournamentUtils = TournamentUtils;
|
|
844
932
|
//# sourceMappingURL=index.js.map
|