@mtgame/core 2.0.6 → 2.0.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.
- package/esm2020/models/device-info.mjs +18 -0
- package/esm2020/models/public-api.mjs +2 -1
- package/esm2020/services/centrifugo.service.mjs +4 -1
- package/esm2020/services/device-info.service.mjs +44 -0
- package/esm2020/services/public-api.mjs +2 -1
- package/fesm2015/mtgame-core.mjs +56 -2
- package/fesm2015/mtgame-core.mjs.map +1 -1
- package/fesm2020/mtgame-core.mjs +60 -2
- package/fesm2020/mtgame-core.mjs.map +1 -1
- package/models/device-info.d.ts +15 -0
- package/models/public-api.d.ts +1 -0
- package/package.json +4 -2
- package/services/device-info.service.d.ts +9 -0
- package/services/public-api.d.ts +1 -0
package/fesm2020/mtgame-core.mjs
CHANGED
|
@@ -6,9 +6,11 @@ import * as i1 from '@angular/common/http';
|
|
|
6
6
|
import { HttpParams } from '@angular/common/http';
|
|
7
7
|
import { BehaviorSubject, Subject, ReplaySubject, of } from 'rxjs';
|
|
8
8
|
import { Centrifuge } from 'centrifuge';
|
|
9
|
+
import { UAParser } from 'ua-parser-js';
|
|
10
|
+
import * as FingerPrint from '@fingerprintjs/fingerprintjs';
|
|
11
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
9
12
|
import { captureException } from '@sentry/angular';
|
|
10
13
|
import { FormGroup } from '@angular/forms';
|
|
11
|
-
import { isPlatformBrowser } from '@angular/common';
|
|
12
14
|
|
|
13
15
|
class BaseModel {
|
|
14
16
|
constructor(data, fields) {
|
|
@@ -6737,6 +6739,21 @@ const OrganizationStatusesLocalization = {
|
|
|
6737
6739
|
[OrganizationStatuses.not_confirmed]: 'Не подтвержден'
|
|
6738
6740
|
};
|
|
6739
6741
|
|
|
6742
|
+
var DeviceTheme;
|
|
6743
|
+
(function (DeviceTheme) {
|
|
6744
|
+
DeviceTheme[DeviceTheme["light"] = 1] = "light";
|
|
6745
|
+
DeviceTheme[DeviceTheme["dark"] = 2] = "dark";
|
|
6746
|
+
})(DeviceTheme || (DeviceTheme = {}));
|
|
6747
|
+
let DeviceInfo = class DeviceInfo extends BaseModel {
|
|
6748
|
+
};
|
|
6749
|
+
DeviceInfo = __decorate([
|
|
6750
|
+
Model({
|
|
6751
|
+
relation: {
|
|
6752
|
+
theme: enumField(DeviceTheme),
|
|
6753
|
+
}
|
|
6754
|
+
})
|
|
6755
|
+
], DeviceInfo);
|
|
6756
|
+
|
|
6740
6757
|
var OrganizationBillStatuses;
|
|
6741
6758
|
(function (OrganizationBillStatuses) {
|
|
6742
6759
|
OrganizationBillStatuses[OrganizationBillStatuses["pending"] = 1] = "pending";
|
|
@@ -6900,7 +6917,10 @@ class CentrifugoService {
|
|
|
6900
6917
|
initializeEngine(config) {
|
|
6901
6918
|
this.centrifuge = new Centrifuge(config.url, {
|
|
6902
6919
|
token: config.token,
|
|
6920
|
+
debug: true,
|
|
6903
6921
|
});
|
|
6922
|
+
// @ts-ignore
|
|
6923
|
+
this.centrifuge._debugEnabled = false;
|
|
6904
6924
|
}
|
|
6905
6925
|
addEngineSubscription(channel) {
|
|
6906
6926
|
const sub = this.centrifuge.newSubscription(channel);
|
|
@@ -6941,6 +6961,44 @@ class BaseController {
|
|
|
6941
6961
|
}
|
|
6942
6962
|
}
|
|
6943
6963
|
|
|
6964
|
+
class DeviceInfoService {
|
|
6965
|
+
constructor(platform) {
|
|
6966
|
+
this.platform = platform;
|
|
6967
|
+
}
|
|
6968
|
+
async get() {
|
|
6969
|
+
const fp = await FingerPrint.load();
|
|
6970
|
+
const fingerprint = await fp.get();
|
|
6971
|
+
const parser = new UAParser(window.navigator.userAgent);
|
|
6972
|
+
return new DeviceInfo({
|
|
6973
|
+
deviceId: fingerprint.visitorId,
|
|
6974
|
+
osName: parser.getOS().name,
|
|
6975
|
+
osVersion: parser.getOS().version,
|
|
6976
|
+
browserName: parser.getBrowser().name,
|
|
6977
|
+
browserVersion: parser.getBrowser().version,
|
|
6978
|
+
device: null,
|
|
6979
|
+
...(isPlatformBrowser(this.platform)
|
|
6980
|
+
? {
|
|
6981
|
+
language: window.navigator.language,
|
|
6982
|
+
theme: window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
6983
|
+
? DeviceTheme.dark
|
|
6984
|
+
: window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches
|
|
6985
|
+
? DeviceTheme.light
|
|
6986
|
+
: null,
|
|
6987
|
+
}
|
|
6988
|
+
: {})
|
|
6989
|
+
});
|
|
6990
|
+
}
|
|
6991
|
+
}
|
|
6992
|
+
DeviceInfoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DeviceInfoService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6993
|
+
DeviceInfoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DeviceInfoService, providedIn: 'root' });
|
|
6994
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DeviceInfoService, decorators: [{
|
|
6995
|
+
type: Injectable,
|
|
6996
|
+
args: [{ providedIn: 'root' }]
|
|
6997
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
6998
|
+
type: Inject,
|
|
6999
|
+
args: [PLATFORM_ID]
|
|
7000
|
+
}] }]; } });
|
|
7001
|
+
|
|
6944
7002
|
class OldStorageEngineField {
|
|
6945
7003
|
constructor(defaultValue, model) {
|
|
6946
7004
|
this.model = model;
|
|
@@ -7372,5 +7430,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
7372
7430
|
* Generated bundle index. Do not edit.
|
|
7373
7431
|
*/
|
|
7374
7432
|
|
|
7375
|
-
export { Achievement, AchievementTypes, BannerLocation, BaseController, BaseModel, BaseService, BaseStatistic, BasketballCourtSides, BasketballCourtZones, BasketballGameApi, BasketballGameConfig, BasketballGameLog, BasketballGameLogTypeLocalization, BasketballGameLogTypes, BasketballGameStatistic, BasketballGameSubLogTypesLocalization, BasketballGameTeamStatistic, BasketballPenaltyTypes, BasketballProfile, BasketballStatistic, BasketballStatisticTypes, BasketballSubLogTypes, CONFIG_DATA, CentrifugoService, City, ConfigService, FAULT_LOG_TYPES, Feedback, FeedbackApi, File, FileApi, FileEngine, FootballGameApi, FootballGameConfig, FootballGameLog, FootballGameLogTypeLocalization, FootballGameLogTypes, FootballGameStatistic, FootballGameTeamStatistic, FootballProfile, FootballStatistic, FootballWorkFoot, FootballWorkFootLocalization, Game, GameAdditionalData, GameBaseApi, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameBill, GameBillStatusLocalization, GameBillStatuses, GameFootballPosition, GameFootballPositionLocalization, GameHandballPosition, GameHandballPositionLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameLogBase, GameResultTypes, GameRugbyPosition, GameRugbyPositionLocalization, GameStatisticBase, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameUserDisqualification, GameUserLimitationTypes, GameUserLimitations, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, GameWaterpoloPosition, GameWaterpoloPositionLocalization, GameWaterpoloPositionShortRuLocalization, GameWebsocket, HandballGameApi, HandballGameConfig, HandballGameLog, HandballGameLogTypeLocalization, HandballGameLogTypes, HandballGameStatistic, HandballGameTeamStatistic, HandballProfile, HandballStatistic, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyPenaltyTypes, HockeyProfile, HockeyStatistic, HockeyWorkHand, HockeyWorkHandLocalization, HttpCookieInterceptor, League, LeagueApi, LeagueBanner, LeagueCourt, LeagueDocument, LeagueFieldBase, LeagueFieldBaseValue, LeagueFieldTypes, LeagueNews, LeagueNewsApi, LeagueNewsType, LeaguePartner, LeaguePlayer, LeaguePlayerApi, LeaguePlayerField, LeaguePlayerFieldValue, LeaguePlaylist, LeagueTeamField, LocalStorageEngine, MediaApi, MediaItem, Model, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OldLocalStorageEngine, OldStorageEngine, OldStorageEngineField, OrgNotificationApi, Organization, OrganizationBill, OrganizationBillStatusLocalization, OrganizationBillStatuses, OrganizationStatistic, OrganizationStatuses, OrganizationStatusesLocalization, OrganizationTariff, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, PublicTeamApi, PublicUserApi, Qualification, QualificationLocalization, RUGBY_GAME_LOG_TYPE_POINTS, RUGBY_TEAM_LOG_TYPES, ReferenceApi, RugbyFoulGameStage, RugbyFoulGameStageLocalization, RugbyFoulSanctionLocalization, RugbyFoulSanctions, RugbyFoulType, RugbyGameApi, RugbyGameConfig, RugbyGameLog, RugbyGameLogTypeLocalization, RugbyGameLogTypes, RugbyGameStatistic, RugbyGameTeamStatistic, RugbyProfile, RugbyStatistic, RugbyStatisticTypes, SCORE_LOG_TYPES, Sport, SportTypes, Storage, StorageEngine, StorageEngineField, Store, Team, TeamAccess, TeamAchievement, TeamAdditionalData, TeamApi, TeamEvent, TeamEventApi, TeamEventInvite, TeamEventInviteStatuses, TeamEventTypeLocalization, TeamEventTypes, TeamInvite, TeamInviteExternal, TeamPermission, TeamPermissionTypes, TeamUser, TeamUserRole, TeamUserRoleLocalization, TeamsAndUsers, TimerTypes, Tournament, TournamentApi, TournamentDisqualification, TournamentDivision, TournamentEvent, TournamentEventTypes, TournamentGender, TournamentGroup, TournamentInvite, TournamentJoin1x1Data, TournamentJoin1x1Status, TournamentJoinApi, TournamentJoinData, TournamentJoinTeam, TournamentNews, TournamentRound, TournamentRoundApi, TournamentRoundSettings, TournamentRoundTeam, TournamentRoundTypes, TournamentSeason, TournamentSeasonApi, TournamentSeasonStatuses, TournamentSettings, TournamentStage, TournamentStageApi, TournamentStageStatuses, TournamentStageTeam, TournamentStatuses, TournamentTeam, TournamentTeamFieldValue, TournamentTeamUser, TournamentTeamUserInvite, TournamentTypes, UntilDestroy, User, UserAccess, UserApi, UserGender, UserPermission, UserPermissionTypes, UserProfile, VolleyballGameApi, VolleyballGameConfig, VolleyballGameLog, VolleyballGameLogType, VolleyballGameLogTypeLocalization, VolleyballGameStatistic, VolleyballGameTeamStatistic, VolleyballGameTypes, VolleyballProfile, VolleyballStatistic, VolleyballStatisticTypes, VolleyballWorkHand, VolleyballWorkHandLocalization, WaterpoloAdvantageTypes, WaterpoloGameApi, WaterpoloGameConfig, WaterpoloGameLog, WaterpoloGameLogTypeLocalization, WaterpoloGameLogTypes, WaterpoloGameStatistic, WaterpoloGameTeamStatistic, WaterpoloProfile, WaterpoloStatistic, WaterpoloWorkHand, WaterpoloWorkHandLocalization, WorkHand, WorkHandLocalization, _, addItemInArray, addItemsInArray, applyGameMediaFilters, applyGamesFilters, applyStatisticFilters, applyStatisticLeadersFilters, changeFavicons, componentDestroyed, dateField, dateTimeField, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, nestedModel, parseDate, patchItemInArray, toCamelCase, toJson, toUnderscore, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl };
|
|
7433
|
+
export { Achievement, AchievementTypes, BannerLocation, BaseController, BaseModel, BaseService, BaseStatistic, BasketballCourtSides, BasketballCourtZones, BasketballGameApi, BasketballGameConfig, BasketballGameLog, BasketballGameLogTypeLocalization, BasketballGameLogTypes, BasketballGameStatistic, BasketballGameSubLogTypesLocalization, BasketballGameTeamStatistic, BasketballPenaltyTypes, BasketballProfile, BasketballStatistic, BasketballStatisticTypes, BasketballSubLogTypes, CONFIG_DATA, CentrifugoService, City, ConfigService, DeviceInfo, DeviceInfoService, DeviceTheme, FAULT_LOG_TYPES, Feedback, FeedbackApi, File, FileApi, FileEngine, FootballGameApi, FootballGameConfig, FootballGameLog, FootballGameLogTypeLocalization, FootballGameLogTypes, FootballGameStatistic, FootballGameTeamStatistic, FootballProfile, FootballStatistic, FootballWorkFoot, FootballWorkFootLocalization, Game, GameAdditionalData, GameBaseApi, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameBill, GameBillStatusLocalization, GameBillStatuses, GameFootballPosition, GameFootballPositionLocalization, GameHandballPosition, GameHandballPositionLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameLogBase, GameResultTypes, GameRugbyPosition, GameRugbyPositionLocalization, GameStatisticBase, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameUserDisqualification, GameUserLimitationTypes, GameUserLimitations, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, GameWaterpoloPosition, GameWaterpoloPositionLocalization, GameWaterpoloPositionShortRuLocalization, GameWebsocket, HandballGameApi, HandballGameConfig, HandballGameLog, HandballGameLogTypeLocalization, HandballGameLogTypes, HandballGameStatistic, HandballGameTeamStatistic, HandballProfile, HandballStatistic, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyPenaltyTypes, HockeyProfile, HockeyStatistic, HockeyWorkHand, HockeyWorkHandLocalization, HttpCookieInterceptor, League, LeagueApi, LeagueBanner, LeagueCourt, LeagueDocument, LeagueFieldBase, LeagueFieldBaseValue, LeagueFieldTypes, LeagueNews, LeagueNewsApi, LeagueNewsType, LeaguePartner, LeaguePlayer, LeaguePlayerApi, LeaguePlayerField, LeaguePlayerFieldValue, LeaguePlaylist, LeagueTeamField, LocalStorageEngine, MediaApi, MediaItem, Model, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OldLocalStorageEngine, OldStorageEngine, OldStorageEngineField, OrgNotificationApi, Organization, OrganizationBill, OrganizationBillStatusLocalization, OrganizationBillStatuses, OrganizationStatistic, OrganizationStatuses, OrganizationStatusesLocalization, OrganizationTariff, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, PublicTeamApi, PublicUserApi, Qualification, QualificationLocalization, RUGBY_GAME_LOG_TYPE_POINTS, RUGBY_TEAM_LOG_TYPES, ReferenceApi, RugbyFoulGameStage, RugbyFoulGameStageLocalization, RugbyFoulSanctionLocalization, RugbyFoulSanctions, RugbyFoulType, RugbyGameApi, RugbyGameConfig, RugbyGameLog, RugbyGameLogTypeLocalization, RugbyGameLogTypes, RugbyGameStatistic, RugbyGameTeamStatistic, RugbyProfile, RugbyStatistic, RugbyStatisticTypes, SCORE_LOG_TYPES, Sport, SportTypes, Storage, StorageEngine, StorageEngineField, Store, Team, TeamAccess, TeamAchievement, TeamAdditionalData, TeamApi, TeamEvent, TeamEventApi, TeamEventInvite, TeamEventInviteStatuses, TeamEventTypeLocalization, TeamEventTypes, TeamInvite, TeamInviteExternal, TeamPermission, TeamPermissionTypes, TeamUser, TeamUserRole, TeamUserRoleLocalization, TeamsAndUsers, TimerTypes, Tournament, TournamentApi, TournamentDisqualification, TournamentDivision, TournamentEvent, TournamentEventTypes, TournamentGender, TournamentGroup, TournamentInvite, TournamentJoin1x1Data, TournamentJoin1x1Status, TournamentJoinApi, TournamentJoinData, TournamentJoinTeam, TournamentNews, TournamentRound, TournamentRoundApi, TournamentRoundSettings, TournamentRoundTeam, TournamentRoundTypes, TournamentSeason, TournamentSeasonApi, TournamentSeasonStatuses, TournamentSettings, TournamentStage, TournamentStageApi, TournamentStageStatuses, TournamentStageTeam, TournamentStatuses, TournamentTeam, TournamentTeamFieldValue, TournamentTeamUser, TournamentTeamUserInvite, TournamentTypes, UntilDestroy, User, UserAccess, UserApi, UserGender, UserPermission, UserPermissionTypes, UserProfile, VolleyballGameApi, VolleyballGameConfig, VolleyballGameLog, VolleyballGameLogType, VolleyballGameLogTypeLocalization, VolleyballGameStatistic, VolleyballGameTeamStatistic, VolleyballGameTypes, VolleyballProfile, VolleyballStatistic, VolleyballStatisticTypes, VolleyballWorkHand, VolleyballWorkHandLocalization, WaterpoloAdvantageTypes, WaterpoloGameApi, WaterpoloGameConfig, WaterpoloGameLog, WaterpoloGameLogTypeLocalization, WaterpoloGameLogTypes, WaterpoloGameStatistic, WaterpoloGameTeamStatistic, WaterpoloProfile, WaterpoloStatistic, WaterpoloWorkHand, WaterpoloWorkHandLocalization, WorkHand, WorkHandLocalization, _, addItemInArray, addItemsInArray, applyGameMediaFilters, applyGamesFilters, applyStatisticFilters, applyStatisticLeadersFilters, changeFavicons, componentDestroyed, dateField, dateTimeField, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, nestedModel, parseDate, patchItemInArray, toCamelCase, toJson, toUnderscore, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl };
|
|
7376
7434
|
//# sourceMappingURL=mtgame-core.mjs.map
|