@opexa/portal-sdk 0.59.106 → 0.59.109
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/README.md +1705 -1634
- package/dist/{chunk-7APXFZ5G.js → chunk-5WRVWQBT.js} +3 -3
- package/dist/chunk-5WRVWQBT.js.map +1 -0
- package/dist/{chunk-LKPG4XPL.js → chunk-K6UZEYMR.js} +82 -7
- package/dist/chunk-K6UZEYMR.js.map +1 -0
- package/dist/{chunk-WVFSGB7Y.js → chunk-ROBGEUSE.js} +2 -2
- package/dist/chunk-ROBGEUSE.js.map +1 -0
- package/dist/index.cjs +89 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +79 -4
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +7 -5
- package/dist/services/index.d.ts +7 -5
- package/dist/services/index.js +2 -2
- package/dist/{types-CeTBCI47.d.cts → types-B_6SgrP-.d.cts} +24 -2
- package/dist/{types-C3JOzrUa.d.ts → types-D80A3vyd.d.ts} +24 -2
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-7APXFZ5G.js.map +0 -1
- package/dist/chunk-LKPG4XPL.js.map +0 -1
- package/dist/chunk-WVFSGB7Y.js.map +0 -1
|
@@ -39,5 +39,5 @@ function callIfFn(value, ...args) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export { callIfFn, gql, statusCodeToOperationError };
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-ROBGEUSE.js.map
|
|
43
|
+
//# sourceMappingURL=chunk-ROBGEUSE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/gql.ts","../src/ut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uBAAA;AAClD,CAAA;;;ACtBA,SAAS,WACR,KAAA,EACuC;AACvC,EAAA,OAAO,OAAO,KAAA,KAAU,UAAA;AACzB;AAEO,SAAS,QAAA,CACf,UACG,IAAA,EACF;AACD,EAAA,IAAI,UAAA,CAAyB,KAAK,CAAA,EAAG;AACpC,IAAA,OAAO,KAAA,CAAM,GAAG,IAAI,CAAA;AAAA,EACrB,CAAA,MAAO;AACN,IAAA,OAAO,KAAA;AAAA,EACR;AACD","file":"chunk-ROBGEUSE.js","sourcesContent":["export function gql(strings: TemplateStringsArray, ...values: unknown[]) {\n\tlet result = '';\n\n\tfor (const [index, string] of strings.entries()) {\n\t\tconst value = values.at(index) ?? '';\n\n\t\tresult = `${result}${string}${value}`;\n\t}\n\n\treturn result.trim();\n}\n","import type { HttpError, OperationError } from '../types/index.js';\n\nexport function statusCodeToOperationError(\n\tvalue: number,\n\tmessage?: string,\n): OperationError<HttpError> {\n\tconst e = ERROR_MAP[value] ? ERROR_MAP[value] : ERROR_MAP[500];\n\n\treturn {\n\t\tname: e.name,\n\t\tmessage: message ?? e.message,\n\t};\n}\n\nconst ERROR_MAP: Record<number, OperationError<HttpError>> = {\n\t400: { name: 'HttpBadRequest', message: 'Bad Request' },\n\t401: { name: 'HttpUnauthorized', message: 'Unauthorized' },\n\t403: { name: 'HttpForbidden', message: 'Forbidden' },\n\t404: { name: 'HttpNotFound', message: 'Not Found' },\n\t408: { name: 'HttpRequestTimeout', message: 'Request Timeout' },\n\t429: { name: 'HttpTooManyRequests', message: 'Too Many Requests' },\n\t500: { name: 'HttpInternalServerError', message: 'Internal Server Error' },\n};\n","function isFunction<Return, Args = never>(\n\tvalue: unknown | ((...args: Args[]) => Return),\n): value is (...args: Args[]) => Return {\n\treturn typeof value === 'function';\n}\n\nexport function callIfFn<Return, Args = never>(\n\tvalue: Return | ((...args: Args[]) => Return),\n\t...args: Args[]\n) {\n\tif (isFunction<Return, Args>(value)) {\n\t\treturn value(...args);\n\t} else {\n\t\treturn value;\n\t}\n}\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -3434,7 +3434,7 @@ var WALLET_GAMES_QUERY = gql`
|
|
|
3434
3434
|
}
|
|
3435
3435
|
}
|
|
3436
3436
|
`;
|
|
3437
|
-
var
|
|
3437
|
+
var _GAMES_NEXT_QUERY = gql`
|
|
3438
3438
|
query PlatformGames($first: Int, $after: Cursor, $filter: _GameFilterInput) {
|
|
3439
3439
|
_games(first: $first, after: $after, filter: $filter) {
|
|
3440
3440
|
totalCount
|
|
@@ -3456,12 +3456,65 @@ var PLATFORM_GAMES_QUERY = gql`
|
|
|
3456
3456
|
hidden
|
|
3457
3457
|
hasFreeBet
|
|
3458
3458
|
hasJackpot
|
|
3459
|
+
image
|
|
3460
|
+
groups {
|
|
3461
|
+
id
|
|
3462
|
+
name
|
|
3463
|
+
}
|
|
3459
3464
|
}
|
|
3460
3465
|
}
|
|
3461
3466
|
}
|
|
3462
3467
|
}
|
|
3463
3468
|
}
|
|
3464
3469
|
`;
|
|
3470
|
+
var _GAMES_NEXT_QUERY__STAGING = gql`
|
|
3471
|
+
query PlatformGames($first: Int, $after: Cursor, $filter: _GameFilterInput) {
|
|
3472
|
+
_games(first: $first, after: $after, filter: $filter) {
|
|
3473
|
+
totalCount
|
|
3474
|
+
pageInfo {
|
|
3475
|
+
hasNextPage
|
|
3476
|
+
endCursor
|
|
3477
|
+
}
|
|
3478
|
+
edges {
|
|
3479
|
+
cursor
|
|
3480
|
+
node {
|
|
3481
|
+
... on _Game {
|
|
3482
|
+
id
|
|
3483
|
+
reference
|
|
3484
|
+
name
|
|
3485
|
+
displayName
|
|
3486
|
+
type
|
|
3487
|
+
provider
|
|
3488
|
+
status
|
|
3489
|
+
hidden
|
|
3490
|
+
hasFreeBet
|
|
3491
|
+
hasJackpot
|
|
3492
|
+
returnToPlayer
|
|
3493
|
+
minimumBet
|
|
3494
|
+
maximumBet
|
|
3495
|
+
image
|
|
3496
|
+
groups {
|
|
3497
|
+
id
|
|
3498
|
+
name
|
|
3499
|
+
}
|
|
3500
|
+
}
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3505
|
+
`;
|
|
3506
|
+
var WALLET_GAMES_BY_NAME_QUERY = gql`
|
|
3507
|
+
query WalletGamesByName(
|
|
3508
|
+
$search: String!
|
|
3509
|
+
$first: Int
|
|
3510
|
+
$filter: _GameFilterInput
|
|
3511
|
+
) {
|
|
3512
|
+
_gamesByName(search: $search, first: $first, filter: $filter) {
|
|
3513
|
+
id
|
|
3514
|
+
name
|
|
3515
|
+
}
|
|
3516
|
+
}
|
|
3517
|
+
`;
|
|
3465
3518
|
var GAME_GROUPS_QUERY = gql`
|
|
3466
3519
|
query GameGroups(
|
|
3467
3520
|
$first: Int
|
|
@@ -5984,8 +6037,10 @@ var TriggerService = class {
|
|
|
5984
6037
|
// src/services/wallet.service.ts
|
|
5985
6038
|
var WalletService = class {
|
|
5986
6039
|
client;
|
|
5987
|
-
|
|
6040
|
+
environment;
|
|
6041
|
+
constructor(client, environment = "development") {
|
|
5988
6042
|
this.client = client;
|
|
6043
|
+
this.environment = environment;
|
|
5989
6044
|
}
|
|
5990
6045
|
async promos() {
|
|
5991
6046
|
const res = await this.client.request(PROMOS_QUERY, void 0);
|
|
@@ -6885,8 +6940,11 @@ var WalletService = class {
|
|
|
6885
6940
|
data: res.data.games
|
|
6886
6941
|
};
|
|
6887
6942
|
}
|
|
6888
|
-
async
|
|
6889
|
-
const res = await this.client.request(
|
|
6943
|
+
async _games(variables) {
|
|
6944
|
+
const res = await this.client.request(
|
|
6945
|
+
this.environment === "production" ? _GAMES_NEXT_QUERY : _GAMES_NEXT_QUERY__STAGING,
|
|
6946
|
+
variables
|
|
6947
|
+
);
|
|
6890
6948
|
if (!res.ok) return res;
|
|
6891
6949
|
if (!res.data._games) {
|
|
6892
6950
|
return {
|
|
@@ -6902,6 +6960,23 @@ var WalletService = class {
|
|
|
6902
6960
|
data: res.data._games
|
|
6903
6961
|
};
|
|
6904
6962
|
}
|
|
6963
|
+
async _gamesByName(variables) {
|
|
6964
|
+
const res = await this.client.request(WALLET_GAMES_BY_NAME_QUERY, variables);
|
|
6965
|
+
if (!res.ok) return res;
|
|
6966
|
+
if (!res.data._gamesByName) {
|
|
6967
|
+
return {
|
|
6968
|
+
ok: false,
|
|
6969
|
+
error: {
|
|
6970
|
+
name: "UnknownError",
|
|
6971
|
+
message: "Something went wrong."
|
|
6972
|
+
}
|
|
6973
|
+
};
|
|
6974
|
+
}
|
|
6975
|
+
return {
|
|
6976
|
+
ok: true,
|
|
6977
|
+
data: res.data._gamesByName
|
|
6978
|
+
};
|
|
6979
|
+
}
|
|
6905
6980
|
async cabinetWithdrawal(variables) {
|
|
6906
6981
|
const res = await this.client.request(CABINET_WITHDRAWAL_QUERY, variables);
|
|
6907
6982
|
return res.ok ? { ok: res.ok, data: res.data.node } : res;
|
|
@@ -10513,7 +10588,8 @@ var Sdk = class {
|
|
|
10513
10588
|
new GraphQLClient(fileUrl, graphqlClientConfig)
|
|
10514
10589
|
);
|
|
10515
10590
|
const walletService = new WalletService(
|
|
10516
|
-
new GraphQLClient(walletUrl, graphqlClientConfig)
|
|
10591
|
+
new GraphQLClient(walletUrl, graphqlClientConfig),
|
|
10592
|
+
environment
|
|
10517
10593
|
);
|
|
10518
10594
|
const accountService = new AccountService(
|
|
10519
10595
|
new GraphQLClient(accountUrl, graphqlClientConfig),
|
|
@@ -12222,7 +12298,7 @@ var Sdk = class {
|
|
|
12222
12298
|
}
|
|
12223
12299
|
};
|
|
12224
12300
|
}
|
|
12225
|
-
async
|
|
12301
|
+
async __games__next(input) {
|
|
12226
12302
|
let variables;
|
|
12227
12303
|
if (input) {
|
|
12228
12304
|
const { search, ...rest } = input;
|
|
@@ -12237,7 +12313,7 @@ var Sdk = class {
|
|
|
12237
12313
|
}
|
|
12238
12314
|
};
|
|
12239
12315
|
}
|
|
12240
|
-
const res = await this.walletService.
|
|
12316
|
+
const res = await this.walletService._games(variables);
|
|
12241
12317
|
if (!res.ok) return res;
|
|
12242
12318
|
return {
|
|
12243
12319
|
ok: true,
|
|
@@ -13244,7 +13320,12 @@ var NEW_GAME_PROVIDERS = [
|
|
|
13244
13320
|
"ONEAPI_SUPERBULLGAMING",
|
|
13245
13321
|
"SIMPLEPLAY",
|
|
13246
13322
|
"SEXYCASINO",
|
|
13247
|
-
"PRAGMATICPLAY_DIRECT"
|
|
13323
|
+
"PRAGMATICPLAY_DIRECT",
|
|
13324
|
+
"VIBRA",
|
|
13325
|
+
"VIBRA_GOLDEN_SPINS",
|
|
13326
|
+
"VIBRA_SPINOCCHIO",
|
|
13327
|
+
"VIBRA_RUVI_BET",
|
|
13328
|
+
"VIBRA_AQUA_GAMING"
|
|
13248
13329
|
];
|
|
13249
13330
|
var ENDPOINTS = {
|
|
13250
13331
|
development: {
|