@mtgame/core 0.1.94 → 0.1.95

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,6 +4,11 @@ import { TeamUser } from '../models/team-user';
4
4
  import { TournamentTeamUserInvite } from '../models/tournament-team-user-invite';
5
5
  import { TournamentInvite } from '../models/tournament-invite';
6
6
  import { ConfigService } from '../services/config.service';
7
+ export declare enum TournamentJoin1x1Status {
8
+ not_sent = 1,
9
+ invite_sent = 2,
10
+ in_tournament = 3
11
+ }
7
12
  export declare class TournamentJoinApi {
8
13
  private httpClient;
9
14
  private configService;
@@ -11,4 +16,6 @@ export declare class TournamentJoinApi {
11
16
  getTeamsForJoin(tournamentId: number): Promise<TournamentJoinTeam[]>;
12
17
  getTeamUsers(teamId: number): Promise<TeamUser[]>;
13
18
  joinTournament(tournamentId: number, teamId: number, invites: TournamentTeamUserInvite[]): Promise<TournamentInvite>;
19
+ join1x1Tournament(tournamentId: number): Promise<TournamentInvite>;
20
+ join1x1TournamentStatus(tournamentId: number): Promise<TournamentJoin1x1Status>;
14
21
  }
@@ -776,6 +776,7 @@
776
776
  SportTypes[SportTypes["rugby"] = 15] = "rugby";
777
777
  SportTypes[SportTypes["rugby7"] = 16] = "rugby7";
778
778
  SportTypes[SportTypes["rugby15"] = 17] = "rugby15";
779
+ SportTypes[SportTypes["basketball_1x1"] = 18] = "basketball_1x1";
779
780
  })(exports.SportTypes || (exports.SportTypes = {}));
780
781
  exports.Sport = /** @class */ (function (_super) {
781
782
  __extends(Sport, _super);
@@ -791,6 +792,9 @@
791
792
  Sport.prototype.isStreetball = function () {
792
793
  return this.id === exports.SportTypes.streetball;
793
794
  };
795
+ Sport.prototype.isBasketball1x1 = function () {
796
+ return this.id === exports.SportTypes.basketball_1x1;
797
+ };
794
798
  Sport.prototype.isVolleyball = function () {
795
799
  return this.id === exports.SportTypes.volleyball || this.parentId === exports.SportTypes.volleyball;
796
800
  };
@@ -8813,6 +8817,12 @@
8813
8817
  })
8814
8818
  ], exports.TournamentJoinTeam);
8815
8819
 
8820
+ exports.TournamentJoin1x1Status = void 0;
8821
+ (function (TournamentJoin1x1Status) {
8822
+ TournamentJoin1x1Status[TournamentJoin1x1Status["not_sent"] = 1] = "not_sent";
8823
+ TournamentJoin1x1Status[TournamentJoin1x1Status["invite_sent"] = 2] = "invite_sent";
8824
+ TournamentJoin1x1Status[TournamentJoin1x1Status["in_tournament"] = 3] = "in_tournament";
8825
+ })(exports.TournamentJoin1x1Status || (exports.TournamentJoin1x1Status = {}));
8816
8826
  var TournamentJoinApi = /** @class */ (function () {
8817
8827
  function TournamentJoinApi(httpClient, configService) {
8818
8828
  this.httpClient = httpClient;
@@ -8848,6 +8858,24 @@
8848
8858
  });
8849
8859
  });
8850
8860
  };
8861
+ TournamentJoinApi.prototype.join1x1Tournament = function (tournamentId) {
8862
+ return __awaiter(this, void 0, void 0, function () {
8863
+ return __generator(this, function (_a) {
8864
+ return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/join_1x1/", {})
8865
+ .pipe(operators.map(function (data) { return exports.TournamentInvite.toFront(data); }))
8866
+ .toPromise()];
8867
+ });
8868
+ });
8869
+ };
8870
+ TournamentJoinApi.prototype.join1x1TournamentStatus = function (tournamentId) {
8871
+ return __awaiter(this, void 0, void 0, function () {
8872
+ return __generator(this, function (_a) {
8873
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/join_1x1_status/")
8874
+ .pipe(operators.map(function (data) { return exports.TournamentJoin1x1Status[data.status]; }))
8875
+ .toPromise()];
8876
+ });
8877
+ });
8878
+ };
8851
8879
  return TournamentJoinApi;
8852
8880
  }());
8853
8881
  TournamentJoinApi.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function TournamentJoinApi_Factory() { return new TournamentJoinApi(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(ConfigService)); }, token: TournamentJoinApi, providedIn: "root" });