@opexa/portal-sdk 0.59.80 → 0.59.83
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/{chunk-CBF46HKK.js → chunk-IT7ND6PF.js} +94 -4
- package/dist/chunk-IT7ND6PF.js.map +1 -0
- package/dist/index.cjs +167 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +76 -9
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +92 -2
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +6 -4
- package/dist/services/index.d.ts +6 -4
- package/dist/services/index.js +1 -1
- package/dist/{types-CLOj9j8f.d.cts → types-BBo3Cpm5.d.cts} +54 -1
- package/dist/{types-vlbILiF3.d.ts → types-D67kK6qx.d.ts} +54 -1
- package/package.json +1 -1
- package/dist/chunk-CBF46HKK.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -3438,6 +3438,75 @@ var PLATFORM_GAMES_QUERY = gql`
|
|
|
3438
3438
|
}
|
|
3439
3439
|
}
|
|
3440
3440
|
`;
|
|
3441
|
+
var GAME_GROUPS_QUERY = gql`
|
|
3442
|
+
query GameGroups(
|
|
3443
|
+
$first: Int
|
|
3444
|
+
$after: Cursor
|
|
3445
|
+
$filter: GameGroupFilterInput
|
|
3446
|
+
$sort: GameGroupSortInput
|
|
3447
|
+
$limit: Int,
|
|
3448
|
+
$offset: Int,
|
|
3449
|
+
) {
|
|
3450
|
+
gameGroups(first: $first, after: $after, filter: $filter, sort: $sort) {
|
|
3451
|
+
totalCount
|
|
3452
|
+
pageInfo {
|
|
3453
|
+
hasNextPage
|
|
3454
|
+
endCursor
|
|
3455
|
+
}
|
|
3456
|
+
edges {
|
|
3457
|
+
cursor
|
|
3458
|
+
node {
|
|
3459
|
+
... on GameGroup {
|
|
3460
|
+
id
|
|
3461
|
+
name
|
|
3462
|
+
|
|
3463
|
+
games(limit: $limit, offset: $offset) {
|
|
3464
|
+
id
|
|
3465
|
+
reference
|
|
3466
|
+
name
|
|
3467
|
+
displayName
|
|
3468
|
+
type
|
|
3469
|
+
provider
|
|
3470
|
+
|
|
3471
|
+
status
|
|
3472
|
+
hidden
|
|
3473
|
+
hasFreeBet
|
|
3474
|
+
hasJackpot
|
|
3475
|
+
image
|
|
3476
|
+
}
|
|
3477
|
+
dateTimeLastUpdated
|
|
3478
|
+
dateTimeCreated
|
|
3479
|
+
}
|
|
3480
|
+
}
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
`;
|
|
3485
|
+
var GAME_GROUP_QUERY = gql`
|
|
3486
|
+
query GameGroup($id: ObjectId!) {
|
|
3487
|
+
node(id: $id) {
|
|
3488
|
+
... on GameGroup {
|
|
3489
|
+
id
|
|
3490
|
+
name
|
|
3491
|
+
games {
|
|
3492
|
+
id
|
|
3493
|
+
reference
|
|
3494
|
+
name
|
|
3495
|
+
displayName
|
|
3496
|
+
type
|
|
3497
|
+
provider
|
|
3498
|
+
status
|
|
3499
|
+
hidden
|
|
3500
|
+
hasFreeBet
|
|
3501
|
+
hasJackpot
|
|
3502
|
+
image
|
|
3503
|
+
}
|
|
3504
|
+
dateTimeLastUpdated
|
|
3505
|
+
dateTimeCreated
|
|
3506
|
+
}
|
|
3507
|
+
}
|
|
3508
|
+
}
|
|
3509
|
+
`;
|
|
3441
3510
|
var GOOGLE_CLIEND_ID_QUERY = gql`
|
|
3442
3511
|
query GoogleClientId {
|
|
3443
3512
|
googleClientId
|
|
@@ -4727,7 +4796,7 @@ var AuthService = class {
|
|
|
4727
4796
|
return true;
|
|
4728
4797
|
}
|
|
4729
4798
|
}
|
|
4730
|
-
async sendVerificationCode(input) {
|
|
4799
|
+
async sendVerificationCode(input, version = 1) {
|
|
4731
4800
|
if (input.channel === "EMAIL")
|
|
4732
4801
|
throw new Error("Email channel is not yet supported");
|
|
4733
4802
|
function getErrorCode(message) {
|
|
@@ -4743,7 +4812,7 @@ var AuthService = class {
|
|
|
4743
4812
|
}
|
|
4744
4813
|
}
|
|
4745
4814
|
try {
|
|
4746
|
-
const res = await fetch(`${this.url}/otps`, {
|
|
4815
|
+
const res = await fetch(`${this.url}${version !== 1 ? `/v${version}/otps` : "/otps"}`, {
|
|
4747
4816
|
method: "POST",
|
|
4748
4817
|
headers: this.headers,
|
|
4749
4818
|
body: JSON.stringify(input)
|
|
@@ -6555,6 +6624,27 @@ var WalletService = class {
|
|
|
6555
6624
|
ok: true
|
|
6556
6625
|
};
|
|
6557
6626
|
}
|
|
6627
|
+
async gameGroups(variables) {
|
|
6628
|
+
const res = await this.client.request(GAME_GROUPS_QUERY, variables);
|
|
6629
|
+
if (!res.ok) return res;
|
|
6630
|
+
if (!res.data.gameGroups) {
|
|
6631
|
+
return {
|
|
6632
|
+
ok: false,
|
|
6633
|
+
error: {
|
|
6634
|
+
name: "UnknownError",
|
|
6635
|
+
message: "Something went wrong."
|
|
6636
|
+
}
|
|
6637
|
+
};
|
|
6638
|
+
}
|
|
6639
|
+
return {
|
|
6640
|
+
ok: true,
|
|
6641
|
+
data: res.data.gameGroups
|
|
6642
|
+
};
|
|
6643
|
+
}
|
|
6644
|
+
async gameGroup(variables) {
|
|
6645
|
+
const res = await this.client.request(GAME_GROUP_QUERY, variables);
|
|
6646
|
+
return res.ok ? { ok: res.ok, data: res.data.node } : res;
|
|
6647
|
+
}
|
|
6558
6648
|
};
|
|
6559
6649
|
|
|
6560
6650
|
// src/services/extension.service.ts
|
|
@@ -7508,6 +7598,14 @@ var SessionManagerCookie = class {
|
|
|
7508
7598
|
this.logger.warn("'client cookies' is not available on the server.");
|
|
7509
7599
|
return true;
|
|
7510
7600
|
}
|
|
7601
|
+
const val = cookies__default.default.get(this.storageKey);
|
|
7602
|
+
if (val) {
|
|
7603
|
+
try {
|
|
7604
|
+
const stored = JSON.parse(val);
|
|
7605
|
+
if (stored.version === 4) return await this.verifyV4();
|
|
7606
|
+
} catch {
|
|
7607
|
+
}
|
|
7608
|
+
}
|
|
7511
7609
|
const s = await this.get();
|
|
7512
7610
|
if (s.error?.name === "InvalidTokenError") return false;
|
|
7513
7611
|
if (s.error?.name === "SessionExpiredError") return false;
|
|
@@ -7519,6 +7617,18 @@ var SessionManagerCookie = class {
|
|
|
7519
7617
|
}
|
|
7520
7618
|
return v;
|
|
7521
7619
|
}
|
|
7620
|
+
async verifyV4() {
|
|
7621
|
+
if (!this.v4AccessToken || !this.v4AccessTokenExpiresAt || isAfter(/* @__PURE__ */ new Date(), new Date(this.v4AccessTokenExpiresAt))) {
|
|
7622
|
+
return true;
|
|
7623
|
+
}
|
|
7624
|
+
const v = await this.authService.verifySession(this.v4AccessToken);
|
|
7625
|
+
if (!v) {
|
|
7626
|
+
cookies__default.default.remove(this.storageKey);
|
|
7627
|
+
this.v4AccessToken = null;
|
|
7628
|
+
this.v4AccessTokenExpiresAt = null;
|
|
7629
|
+
}
|
|
7630
|
+
return v;
|
|
7631
|
+
}
|
|
7522
7632
|
get onMaya() {
|
|
7523
7633
|
if (this.isServer) {
|
|
7524
7634
|
this.logger.warn("'client cookies' is not available on the server.");
|
|
@@ -7955,6 +8065,14 @@ var SessionManager = class {
|
|
|
7955
8065
|
this.logger.warn("'localStorage' is not available on the server.");
|
|
7956
8066
|
return true;
|
|
7957
8067
|
}
|
|
8068
|
+
const val = localStorage.getItem(this.storageKey);
|
|
8069
|
+
if (val) {
|
|
8070
|
+
try {
|
|
8071
|
+
const stored = JSON.parse(val);
|
|
8072
|
+
if (stored.version === 4) return await this.verifyV4();
|
|
8073
|
+
} catch {
|
|
8074
|
+
}
|
|
8075
|
+
}
|
|
7958
8076
|
const s = await this.get();
|
|
7959
8077
|
if (s.error?.name === "InvalidTokenError") return false;
|
|
7960
8078
|
if (s.error?.name === "SessionExpiredError") return false;
|
|
@@ -7966,6 +8084,18 @@ var SessionManager = class {
|
|
|
7966
8084
|
}
|
|
7967
8085
|
return v;
|
|
7968
8086
|
}
|
|
8087
|
+
async verifyV4() {
|
|
8088
|
+
if (!this.v4AccessToken || !this.v4AccessTokenExpiresAt || isAfter(/* @__PURE__ */ new Date(), new Date(this.v4AccessTokenExpiresAt))) {
|
|
8089
|
+
return true;
|
|
8090
|
+
}
|
|
8091
|
+
const v = await this.authService.verifySession(this.v4AccessToken);
|
|
8092
|
+
if (!v) {
|
|
8093
|
+
localStorage.removeItem(this.storageKey);
|
|
8094
|
+
this.v4AccessToken = null;
|
|
8095
|
+
this.v4AccessTokenExpiresAt = null;
|
|
8096
|
+
}
|
|
8097
|
+
return v;
|
|
8098
|
+
}
|
|
7969
8099
|
get onMaya() {
|
|
7970
8100
|
if (this.isServer) {
|
|
7971
8101
|
this.logger.warn("'localStorage' is not available on the server.");
|
|
@@ -10764,15 +10894,18 @@ var Sdk = class {
|
|
|
10764
10894
|
}
|
|
10765
10895
|
});
|
|
10766
10896
|
}
|
|
10767
|
-
async sendVerificationCode__next(input) {
|
|
10897
|
+
async sendVerificationCode__next(input, version = 1) {
|
|
10768
10898
|
if (input.type === "SMS") {
|
|
10769
|
-
return this.authService.sendVerificationCode(
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
10899
|
+
return this.authService.sendVerificationCode(
|
|
10900
|
+
{
|
|
10901
|
+
channel: "SMS",
|
|
10902
|
+
recipient: addAreaCode(input.mobileNumber, await this.locale),
|
|
10903
|
+
...input.strict && {
|
|
10904
|
+
verificationType: "MEMBER"
|
|
10905
|
+
}
|
|
10906
|
+
},
|
|
10907
|
+
version
|
|
10908
|
+
);
|
|
10776
10909
|
}
|
|
10777
10910
|
throw new Error("'Email' verification code is not yet supported");
|
|
10778
10911
|
}
|
|
@@ -11607,6 +11740,30 @@ var Sdk = class {
|
|
|
11607
11740
|
}
|
|
11608
11741
|
};
|
|
11609
11742
|
}
|
|
11743
|
+
async gameGroups(input) {
|
|
11744
|
+
const res = await this.walletService.gameGroups(input);
|
|
11745
|
+
if (!res.ok) return res;
|
|
11746
|
+
return {
|
|
11747
|
+
ok: true,
|
|
11748
|
+
data: {
|
|
11749
|
+
gameGroups: res.data.edges.map(({ cursor, node }) => ({
|
|
11750
|
+
...node,
|
|
11751
|
+
cursor
|
|
11752
|
+
})),
|
|
11753
|
+
totalCount: res.data.totalCount,
|
|
11754
|
+
hasNextPage: res.data.pageInfo.hasNextPage,
|
|
11755
|
+
endCursor: res.data.pageInfo.endCursor ?? void 0
|
|
11756
|
+
}
|
|
11757
|
+
};
|
|
11758
|
+
}
|
|
11759
|
+
async gameGroup(input) {
|
|
11760
|
+
const res = await this.walletService.gameGroup(input);
|
|
11761
|
+
if (!res.ok) return res;
|
|
11762
|
+
return {
|
|
11763
|
+
ok: true,
|
|
11764
|
+
data: res.data ?? null
|
|
11765
|
+
};
|
|
11766
|
+
}
|
|
11610
11767
|
async games__next(input) {
|
|
11611
11768
|
const res = await this.cmsPortalService.games__next(input);
|
|
11612
11769
|
if (!res.ok) return res;
|