@opexa/portal-sdk 0.35.7 → 0.35.9

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/index.cjs CHANGED
@@ -2074,6 +2074,40 @@ var GOOGLE_CLIEND_ID_QUERY = gql`
2074
2074
  googleClientId
2075
2075
  }
2076
2076
  `;
2077
+ var TOURNAMENTS_QUERY = gql`
2078
+ query Tournaments($first: Int, $after: Cursor, $filter: TournamentFilterInput) {
2079
+ tournaments(first: $first, after: $after, filter: $filter) {
2080
+ totalCount
2081
+ pageInfo {
2082
+ hasNextPage
2083
+ endCursor
2084
+ }
2085
+ edges {
2086
+ node {
2087
+ ... on MultiplierTournament {
2088
+ id
2089
+ type
2090
+ name
2091
+ winnersCount
2092
+ status
2093
+ reward
2094
+ activationStartDateTime
2095
+ activationEndDateTime
2096
+ topPayouts {
2097
+ id
2098
+ multiplier
2099
+ amount
2100
+ member {
2101
+ id
2102
+ name
2103
+ }
2104
+ }
2105
+ }
2106
+ }
2107
+ }
2108
+ }
2109
+ }
2110
+ `;
2077
2111
 
2078
2112
  // src/services/utils.ts
2079
2113
  function createOperationError(code) {
@@ -3171,6 +3205,17 @@ var ReportService = class {
3171
3205
  data: res.data.jackpotPayouts
3172
3206
  };
3173
3207
  }
3208
+ async tournaments(variables) {
3209
+ const res = await this.client.request(
3210
+ TOURNAMENTS_QUERY,
3211
+ variables
3212
+ );
3213
+ if (!res.ok) return res;
3214
+ return {
3215
+ ok: true,
3216
+ data: res.data.tournaments
3217
+ };
3218
+ }
3174
3219
  };
3175
3220
 
3176
3221
  // src/services/trigger.service.ts
@@ -5031,7 +5076,8 @@ var Transformer = class {
5031
5076
  quest: this.quest.bind(this),
5032
5077
  topWin: this.topWin.bind(this),
5033
5078
  jackpots: this.jackpots.bind(this),
5034
- jackpotPayouts: this.jackpotPayouts.bind(this)
5079
+ jackpotPayouts: this.jackpotPayouts.bind(this),
5080
+ tournaments: this.tournaments.bind(this)
5035
5081
  };
5036
5082
  }
5037
5083
  site(data) {
@@ -5853,6 +5899,34 @@ var Transformer = class {
5853
5899
  amount: parseDecimal(data.amount, 0)
5854
5900
  };
5855
5901
  }
5902
+ tournamentsLeaderboard(data) {
5903
+ return {
5904
+ id: data.id,
5905
+ username: data.username,
5906
+ multiplier: parseDecimal(data.multiplier, 0),
5907
+ dateTimeCreated: data.dateTimeCreated
5908
+ };
5909
+ }
5910
+ tournaments(data) {
5911
+ return {
5912
+ id: data.id,
5913
+ type: data.type,
5914
+ name: data.name,
5915
+ winnersCount: parseDecimal(data.winnersCount, 0),
5916
+ status: data.status,
5917
+ activationEndDateTime: new Date(data.activationEndDateTime),
5918
+ activationStartDateTime: new Date(data.activationStartDateTime),
5919
+ topPayouts: {
5920
+ id: data.topPayouts.id,
5921
+ multiplier: parseDecimal(data.topPayouts.multiplier, 0),
5922
+ amount: parseDecimal(data.topPayouts.amount, 0),
5923
+ member: {
5924
+ id: data.topPayouts.member.id,
5925
+ name: data.topPayouts.member.name
5926
+ }
5927
+ }
5928
+ };
5929
+ }
5856
5930
  };
5857
5931
 
5858
5932
  // src/sdk/sdk.ts
@@ -7418,6 +7492,27 @@ var Sdk = class {
7418
7492
  }
7419
7493
  };
7420
7494
  }
7495
+ /*
7496
+ *=============================================
7497
+ * TOURNAMENTS
7498
+ *=============================================
7499
+ */
7500
+ async tournaments(input) {
7501
+ const res = await this.reportService.tournaments(input);
7502
+ if (!res.ok) return res;
7503
+ return {
7504
+ ok: true,
7505
+ data: {
7506
+ tournaments: res.data.edges.map(({ cursor, node }) => ({
7507
+ ...this.transformer.transform.tournaments(node),
7508
+ cursor
7509
+ })),
7510
+ hasNextPage: res.data.pageInfo.hasNextPage,
7511
+ totalCount: res.data.totalCount,
7512
+ endCursor: res.data.pageInfo.endCursor ?? undefined
7513
+ }
7514
+ };
7515
+ }
7421
7516
  /*
7422
7517
  *=============================================
7423
7518
  * FCM/FIREBASE