@opexa/portal-sdk 0.59.48 → 0.59.49

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.
@@ -1,12 +1,4 @@
1
- // src/utils/gql.ts
2
- function gql(strings, ...values) {
3
- let result = "";
4
- for (const [index, string] of strings.entries()) {
5
- const value = values.at(index) ?? "";
6
- result = `${result}${string}${value}`;
7
- }
8
- return result.trim();
9
- }
1
+ import { gql, statusCodeToOperationError, callIfFn } from './chunk-WVFSGB7Y.js';
10
2
 
11
3
  // src/services/queries.ts
12
4
  var FILE_FRAGMENT = gql`
@@ -3251,6 +3243,34 @@ var WALLET_GAMES_QUERY = gql`
3251
3243
  }
3252
3244
  }
3253
3245
  `;
3246
+ var PLATFORM_GAMES_QUERY = gql`
3247
+ query PlatformGames($first: Int, $after: Cursor, $filter: _GameFilterInput) {
3248
+ _games(first: $first, after: $after, filter: $filter) {
3249
+ totalCount
3250
+ pageInfo {
3251
+ hasNextPage
3252
+ endCursor
3253
+ }
3254
+ edges {
3255
+ cursor
3256
+ node {
3257
+ ... on _Game {
3258
+ id
3259
+ reference
3260
+ name
3261
+ displayName
3262
+ type
3263
+ provider
3264
+ status
3265
+ hidden
3266
+ hasFreeBet
3267
+ hasJackpot
3268
+ }
3269
+ }
3270
+ }
3271
+ }
3272
+ }
3273
+ `;
3254
3274
  var GOOGLE_CLIEND_ID_QUERY = gql`
3255
3275
  query GoogleClientId {
3256
3276
  googleClientId
@@ -4258,24 +4278,6 @@ var AccountService = class {
4258
4278
  }
4259
4279
  };
4260
4280
 
4261
- // src/utils/status-code-to-operation-error.ts
4262
- function statusCodeToOperationError(value, message) {
4263
- const e = ERROR_MAP[value] ? ERROR_MAP[value] : ERROR_MAP[500];
4264
- return {
4265
- name: e.name,
4266
- message: message ?? e.message
4267
- };
4268
- }
4269
- var ERROR_MAP = {
4270
- 400: { name: "HttpBadRequest", message: "Bad Request" },
4271
- 401: { name: "HttpUnauthorized", message: "Unauthorized" },
4272
- 403: { name: "HttpForbidden", message: "Forbidden" },
4273
- 404: { name: "HttpNotFound", message: "Not Found" },
4274
- 408: { name: "HttpRequestTimeout", message: "Request Timeout" },
4275
- 429: { name: "HttpTooManyRequests", message: "Too Many Requests" },
4276
- 500: { name: "HttpInternalServerError", message: "Internal Server Error" }
4277
- };
4278
-
4279
4281
  // src/services/auth.service.ts
4280
4282
  var AuthService = class {
4281
4283
  url;
@@ -4561,18 +4563,6 @@ var AuthService = class {
4561
4563
  }
4562
4564
  };
4563
4565
 
4564
- // src/utils/call-if-fn.ts
4565
- function isFunction(value) {
4566
- return typeof value === "function";
4567
- }
4568
- function callIfFn(value, ...args) {
4569
- if (isFunction(value)) {
4570
- return value(...args);
4571
- } else {
4572
- return value;
4573
- }
4574
- }
4575
-
4576
4566
  // src/services/cms-portal.service.ts
4577
4567
  var CmsPortalService = class {
4578
4568
  config;
@@ -6178,6 +6168,23 @@ var WalletService = class {
6178
6168
  data: res.data.games
6179
6169
  };
6180
6170
  }
6171
+ async platformGames(variables) {
6172
+ const res = await this.client.request(PLATFORM_GAMES_QUERY, variables);
6173
+ if (!res.ok) return res;
6174
+ if (!res.data._games) {
6175
+ return {
6176
+ ok: false,
6177
+ error: {
6178
+ name: "UnknownError",
6179
+ message: "Something went wrong."
6180
+ }
6181
+ };
6182
+ }
6183
+ return {
6184
+ ok: true,
6185
+ data: res.data._games
6186
+ };
6187
+ }
6181
6188
  async cabinetWithdrawal(variables) {
6182
6189
  const res = await this.client.request(CABINET_WITHDRAWAL_QUERY, variables);
6183
6190
  return res.ok ? { ok: res.ok, data: res.data.node } : res;
@@ -6232,6 +6239,6 @@ var ExtensionService = class {
6232
6239
  }
6233
6240
  };
6234
6241
 
6235
- export { AccountService, AuthService, CmsPortalService, ExtensionService, FileService, GameService, PortalService, ReportService, TriggerService, WalletService, callIfFn, statusCodeToOperationError };
6236
- //# sourceMappingURL=chunk-TFG2D5CR.js.map
6237
- //# sourceMappingURL=chunk-TFG2D5CR.js.map
6242
+ export { AccountService, AuthService, CmsPortalService, ExtensionService, FileService, GameService, PortalService, ReportService, TriggerService, WalletService };
6243
+ //# sourceMappingURL=chunk-EWOIQLLS.js.map
6244
+ //# sourceMappingURL=chunk-EWOIQLLS.js.map