@mtgame/core 0.2.95 → 0.2.98

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.
@@ -0,0 +1,16 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Team } from '../models/team';
3
+ import { ConfigService } from '../services/config.service';
4
+ interface LeagueTeamFilters {
5
+ tournament_id?: number;
6
+ tournament_season_id?: number;
7
+ query?: string;
8
+ }
9
+ export declare class LeagueTeamApi {
10
+ private httpClient;
11
+ private configService;
12
+ constructor(httpClient: HttpClient, configService: ConfigService);
13
+ getLeagueTeams(filters?: LeagueTeamFilters): Promise<Team[]>;
14
+ getLeagueTeam(teamId: number): Promise<Team>;
15
+ }
16
+ export {};
@@ -8,6 +8,7 @@ export * from './handball-game-api';
8
8
  export * from './league-api';
9
9
  export * from './league-news-api';
10
10
  export * from './league-player-api';
11
+ export * from './league-team-api';
11
12
  export * from './media-api';
12
13
  export * from './notification-api';
13
14
  export * from './notification-base-api';
@@ -8798,6 +8798,49 @@
8798
8798
  { type: ConfigService }
8799
8799
  ]; };
8800
8800
 
8801
+ var LeagueTeamApi = /** @class */ (function () {
8802
+ function LeagueTeamApi(httpClient, configService) {
8803
+ this.httpClient = httpClient;
8804
+ this.configService = configService;
8805
+ }
8806
+ LeagueTeamApi.prototype.getLeagueTeams = function (filters) {
8807
+ return __awaiter(this, void 0, void 0, function () {
8808
+ var params;
8809
+ return __generator(this, function (_a) {
8810
+ params = new i1.HttpParams();
8811
+ if (filters) {
8812
+ if (filters.tournament_id) {
8813
+ params = params.set('tournament_id', filters.tournament_id);
8814
+ }
8815
+ if (filters.tournament_season_id) {
8816
+ params = params.set('tournament_season_id', filters.tournament_season_id);
8817
+ }
8818
+ if (filters.query) {
8819
+ params = params.set('query', filters.query);
8820
+ }
8821
+ }
8822
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league_team/", { params: params }).pipe(operators.map(function (response) { return response.map(function (item) { return exports.Team.toFront(item); }); })).toPromise()];
8823
+ });
8824
+ });
8825
+ };
8826
+ LeagueTeamApi.prototype.getLeagueTeam = function (teamId) {
8827
+ return __awaiter(this, void 0, void 0, function () {
8828
+ return __generator(this, function (_a) {
8829
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league_team/" + teamId + "/").pipe(operators.map(function (response) { return exports.Team.toFront(response); })).toPromise()];
8830
+ });
8831
+ });
8832
+ };
8833
+ return LeagueTeamApi;
8834
+ }());
8835
+ LeagueTeamApi.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LeagueTeamApi_Factory() { return new LeagueTeamApi(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(ConfigService)); }, token: LeagueTeamApi, providedIn: "root" });
8836
+ LeagueTeamApi.decorators = [
8837
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
8838
+ ];
8839
+ LeagueTeamApi.ctorParameters = function () { return [
8840
+ { type: i1.HttpClient },
8841
+ { type: ConfigService }
8842
+ ]; };
8843
+
8801
8844
  var MediaApi = /** @class */ (function () {
8802
8845
  function MediaApi(httpClient, configService) {
8803
8846
  this.httpClient = httpClient;
@@ -15103,6 +15146,7 @@
15103
15146
  exports.LeagueFieldBaseValue = LeagueFieldBaseValue;
15104
15147
  exports.LeagueNewsApi = LeagueNewsApi;
15105
15148
  exports.LeaguePlayerApi = LeaguePlayerApi;
15149
+ exports.LeagueTeamApi = LeagueTeamApi;
15106
15150
  exports.LocalStorageEngine = LocalStorageEngine;
15107
15151
  exports.MODEL_MAPPING_FIELDS_KEY = MODEL_MAPPING_FIELDS_KEY;
15108
15152
  exports.MODEL_RELATION_KEY = MODEL_RELATION_KEY;