@opexa/portal-sdk 0.9.0 → 0.10.1
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 +231 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -12
- package/dist/index.d.ts +16 -12
- package/dist/index.js +231 -144
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -2437,10 +2437,10 @@ var AuthService = class {
|
|
|
2437
2437
|
headers.set("Authorization", `Token ${input.token}`);
|
|
2438
2438
|
}
|
|
2439
2439
|
if (input.type === "CABINET") {
|
|
2440
|
-
headers.set("Authorization", `
|
|
2440
|
+
headers.set("Authorization", `Opexa-Cabinet-Token ${input.token}`);
|
|
2441
2441
|
}
|
|
2442
|
-
if (input.type === "
|
|
2443
|
-
headers.set("Authorization", `
|
|
2442
|
+
if (input.type === "SINGLE_USE_TOKEN") {
|
|
2443
|
+
headers.set("Authorization", `Single-Use-Token ${input.token}`);
|
|
2444
2444
|
}
|
|
2445
2445
|
if (input.reCAPTCHAResponse) {
|
|
2446
2446
|
headers.set("google-recaptcha-response", input.reCAPTCHAResponse);
|
|
@@ -2642,7 +2642,7 @@ var AuthService = class {
|
|
|
2642
2642
|
};
|
|
2643
2643
|
}
|
|
2644
2644
|
}
|
|
2645
|
-
async
|
|
2645
|
+
async createSingleUseToken(accessToken) {
|
|
2646
2646
|
const headers = new Headers(this.headers);
|
|
2647
2647
|
headers.append("Authorization", `Bearer ${accessToken}`);
|
|
2648
2648
|
try {
|
|
@@ -4044,6 +4044,71 @@ async function sha256(input) {
|
|
|
4044
4044
|
return hashHex;
|
|
4045
4045
|
}
|
|
4046
4046
|
|
|
4047
|
+
// src/utils/add-days.ts
|
|
4048
|
+
function addDays(date, days) {
|
|
4049
|
+
const result = cloneDate(date);
|
|
4050
|
+
result.setDate(result.getDate() + days);
|
|
4051
|
+
return result;
|
|
4052
|
+
}
|
|
4053
|
+
|
|
4054
|
+
// src/utils/sub-minutes.ts
|
|
4055
|
+
function subMinutes(date, minutes) {
|
|
4056
|
+
const result = cloneDate(date);
|
|
4057
|
+
result.setMinutes(result.getMinutes() - minutes);
|
|
4058
|
+
return result;
|
|
4059
|
+
}
|
|
4060
|
+
|
|
4061
|
+
// src/sdk/ad-manager.ts
|
|
4062
|
+
var AD_CLICK_ID_STORAGE_KEY = "sdk/ad-click-id";
|
|
4063
|
+
var AdManager = class {
|
|
4064
|
+
logger;
|
|
4065
|
+
constructor(config) {
|
|
4066
|
+
this.logger = config.logger;
|
|
4067
|
+
}
|
|
4068
|
+
set clickId(value) {
|
|
4069
|
+
if (this.isServer) {
|
|
4070
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
4071
|
+
return;
|
|
4072
|
+
}
|
|
4073
|
+
if (value === null) {
|
|
4074
|
+
localStorage.removeItem(AD_CLICK_ID_STORAGE_KEY);
|
|
4075
|
+
return;
|
|
4076
|
+
}
|
|
4077
|
+
const n = /* @__PURE__ */ new Date();
|
|
4078
|
+
const o = JSON.stringify({
|
|
4079
|
+
value,
|
|
4080
|
+
expiresAt: subMinutes(addDays(n, 30), 2).getTime()
|
|
4081
|
+
});
|
|
4082
|
+
localStorage.setItem(AD_CLICK_ID_STORAGE_KEY, o);
|
|
4083
|
+
}
|
|
4084
|
+
get clickId() {
|
|
4085
|
+
if (this.isServer) {
|
|
4086
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
4087
|
+
return null;
|
|
4088
|
+
}
|
|
4089
|
+
const v = localStorage.getItem(AD_CLICK_ID_STORAGE_KEY);
|
|
4090
|
+
if (!v) return null;
|
|
4091
|
+
try {
|
|
4092
|
+
const o = JSON.parse(v);
|
|
4093
|
+
if (!o.value) return null;
|
|
4094
|
+
if (!o.expiresAt) return null;
|
|
4095
|
+
const d = new Date(o.expiresAt);
|
|
4096
|
+
const n = /* @__PURE__ */ new Date();
|
|
4097
|
+
if (isAfter(n, d)) {
|
|
4098
|
+
localStorage.removeItem(AD_CLICK_ID_STORAGE_KEY);
|
|
4099
|
+
return null;
|
|
4100
|
+
}
|
|
4101
|
+
return o.value;
|
|
4102
|
+
} catch {
|
|
4103
|
+
localStorage.removeItem(AD_CLICK_ID_STORAGE_KEY);
|
|
4104
|
+
return null;
|
|
4105
|
+
}
|
|
4106
|
+
}
|
|
4107
|
+
get isServer() {
|
|
4108
|
+
return typeof window === "undefined";
|
|
4109
|
+
}
|
|
4110
|
+
};
|
|
4111
|
+
|
|
4047
4112
|
// src/sdk/logger.ts
|
|
4048
4113
|
var Logger = class {
|
|
4049
4114
|
enabled;
|
|
@@ -4064,13 +4129,6 @@ var Logger = class {
|
|
|
4064
4129
|
}
|
|
4065
4130
|
};
|
|
4066
4131
|
|
|
4067
|
-
// src/utils/add-days.ts
|
|
4068
|
-
function addDays(date, days) {
|
|
4069
|
-
const result = cloneDate(date);
|
|
4070
|
-
result.setDate(result.getDate() + days);
|
|
4071
|
-
return result;
|
|
4072
|
-
}
|
|
4073
|
-
|
|
4074
4132
|
// src/utils/sleep.ts
|
|
4075
4133
|
function sleep(ms) {
|
|
4076
4134
|
return new Promise((resolve) => {
|
|
@@ -4102,13 +4160,6 @@ function pollable(func, config) {
|
|
|
4102
4160
|
};
|
|
4103
4161
|
}
|
|
4104
4162
|
|
|
4105
|
-
// src/utils/sub-minutes.ts
|
|
4106
|
-
function subMinutes(date, minutes) {
|
|
4107
|
-
const result = cloneDate(date);
|
|
4108
|
-
result.setMinutes(result.getMinutes() - minutes);
|
|
4109
|
-
return result;
|
|
4110
|
-
}
|
|
4111
|
-
|
|
4112
4163
|
// src/sdk/session-manager.ts
|
|
4113
4164
|
var SessionManager = class {
|
|
4114
4165
|
logger;
|
|
@@ -4119,9 +4170,7 @@ var SessionManager = class {
|
|
|
4119
4170
|
constructor(config) {
|
|
4120
4171
|
this.authService = config.authService;
|
|
4121
4172
|
this.walletService = config.walletService;
|
|
4122
|
-
this.logger =
|
|
4123
|
-
enabled: config.logs ?? false
|
|
4124
|
-
});
|
|
4173
|
+
this.logger = config.logger;
|
|
4125
4174
|
}
|
|
4126
4175
|
get refreshing() {
|
|
4127
4176
|
return this._refreshing;
|
|
@@ -5351,6 +5400,7 @@ var Sdk = class {
|
|
|
5351
5400
|
portalService;
|
|
5352
5401
|
triggerService;
|
|
5353
5402
|
sessionManager;
|
|
5403
|
+
adManager;
|
|
5354
5404
|
transformer;
|
|
5355
5405
|
logger;
|
|
5356
5406
|
cache;
|
|
@@ -5364,10 +5414,11 @@ var Sdk = class {
|
|
|
5364
5414
|
logs
|
|
5365
5415
|
} = config;
|
|
5366
5416
|
const production = environment === "production";
|
|
5367
|
-
|
|
5368
|
-
this.logger = new Logger({
|
|
5417
|
+
const logger = new Logger({
|
|
5369
5418
|
enabled: logs ?? false
|
|
5370
5419
|
});
|
|
5420
|
+
const adManager = new AdManager({ logger });
|
|
5421
|
+
const transformer = new Transformer();
|
|
5371
5422
|
const authUrl = ENDPOINTS[environment].auth;
|
|
5372
5423
|
const walletUrl = ENDPOINTS[environment].wallet;
|
|
5373
5424
|
const reportUrl = ENDPOINTS[environment].report;
|
|
@@ -5383,7 +5434,11 @@ var Sdk = class {
|
|
|
5383
5434
|
platform: sitePlatform
|
|
5384
5435
|
});
|
|
5385
5436
|
const graphqlClientConfig = {
|
|
5386
|
-
middlewares: [
|
|
5437
|
+
middlewares: [
|
|
5438
|
+
/**/
|
|
5439
|
+
this.authMiddleware,
|
|
5440
|
+
this.miscMiddleware
|
|
5441
|
+
],
|
|
5387
5442
|
fetchOptions: {
|
|
5388
5443
|
headers: {
|
|
5389
5444
|
Role: "MEMBER",
|
|
@@ -5411,10 +5466,13 @@ var Sdk = class {
|
|
|
5411
5466
|
}
|
|
5412
5467
|
});
|
|
5413
5468
|
const sessionManager = new SessionManager({
|
|
5414
|
-
|
|
5469
|
+
logger,
|
|
5415
5470
|
authService,
|
|
5416
5471
|
walletService
|
|
5417
5472
|
});
|
|
5473
|
+
this.logger = logger;
|
|
5474
|
+
this.adManager = adManager;
|
|
5475
|
+
this.transformer = transformer;
|
|
5418
5476
|
this.authService = authService;
|
|
5419
5477
|
this.gameService = gameService;
|
|
5420
5478
|
this.fileService = fileService;
|
|
@@ -5427,20 +5485,29 @@ var Sdk = class {
|
|
|
5427
5485
|
this.cmsPortalService = cmsPortalService;
|
|
5428
5486
|
this.cache = new Cache();
|
|
5429
5487
|
}
|
|
5430
|
-
|
|
5488
|
+
/*
|
|
5489
|
+
*=============================================
|
|
5490
|
+
* ADS
|
|
5491
|
+
*=============================================
|
|
5492
|
+
*/
|
|
5493
|
+
set adClickId(value) {
|
|
5494
|
+
this.adManager.clickId = value;
|
|
5495
|
+
}
|
|
5496
|
+
get adClickId() {
|
|
5497
|
+
return this.adManager.clickId;
|
|
5498
|
+
}
|
|
5499
|
+
get miscMiddleware() {
|
|
5431
5500
|
return async (request) => {
|
|
5432
|
-
this.
|
|
5433
|
-
|
|
5434
|
-
if (res.data) {
|
|
5435
|
-
request.headers.append("Authorization", `Bearer ${res.data.accessToken}`);
|
|
5436
|
-
this.logger.info("Session found");
|
|
5437
|
-
this.logger.success("Added 'Authorization' header");
|
|
5438
|
-
} else {
|
|
5439
|
-
this.logger.info("No session found");
|
|
5440
|
-
}
|
|
5501
|
+
const adClickId = this.adManager.clickId;
|
|
5502
|
+
if (adClickId) request.headers.append("Ad-Click-Id", adClickId);
|
|
5441
5503
|
return request;
|
|
5442
5504
|
};
|
|
5443
5505
|
}
|
|
5506
|
+
/*
|
|
5507
|
+
*=============================================
|
|
5508
|
+
* LOCALE
|
|
5509
|
+
*=============================================
|
|
5510
|
+
*/
|
|
5444
5511
|
get locale() {
|
|
5445
5512
|
return new Promise((resolve) => {
|
|
5446
5513
|
const cacheKey = "locale";
|
|
@@ -5457,6 +5524,25 @@ var Sdk = class {
|
|
|
5457
5524
|
});
|
|
5458
5525
|
});
|
|
5459
5526
|
}
|
|
5527
|
+
/*
|
|
5528
|
+
*=============================================
|
|
5529
|
+
* AUTH
|
|
5530
|
+
*=============================================
|
|
5531
|
+
*/
|
|
5532
|
+
get authMiddleware() {
|
|
5533
|
+
return async (request) => {
|
|
5534
|
+
this.logger.info("Checking for session");
|
|
5535
|
+
const res = await this.sessionManager.get();
|
|
5536
|
+
if (res.data) {
|
|
5537
|
+
request.headers.append("Authorization", `Bearer ${res.data.accessToken}`);
|
|
5538
|
+
this.logger.info("Session found");
|
|
5539
|
+
this.logger.success("Added 'Authorization' header");
|
|
5540
|
+
} else {
|
|
5541
|
+
this.logger.info("No session found");
|
|
5542
|
+
}
|
|
5543
|
+
return request;
|
|
5544
|
+
};
|
|
5545
|
+
}
|
|
5460
5546
|
async signIn(input) {
|
|
5461
5547
|
if (input.type === "TOKEN") {
|
|
5462
5548
|
console.warn("'TOKEN (signIn)' is deprecated. Please use 'SOCIALS' instead.");
|
|
@@ -5508,9 +5594,9 @@ var Sdk = class {
|
|
|
5508
5594
|
});
|
|
5509
5595
|
return res.ok ? { ok: true } : res;
|
|
5510
5596
|
}
|
|
5511
|
-
case "
|
|
5597
|
+
case "SINGLE_USE_TOKEN": {
|
|
5512
5598
|
const res = await this.sessionManager.create({
|
|
5513
|
-
type: "
|
|
5599
|
+
type: "SINGLE_USE_TOKEN",
|
|
5514
5600
|
token: input.token
|
|
5515
5601
|
});
|
|
5516
5602
|
return res.ok ? { ok: true } : res;
|
|
@@ -5542,6 +5628,7 @@ var Sdk = class {
|
|
|
5542
5628
|
}
|
|
5543
5629
|
}
|
|
5544
5630
|
async signOut() {
|
|
5631
|
+
this.adManager.clickId = null;
|
|
5545
5632
|
await this.sessionManager.destroy();
|
|
5546
5633
|
}
|
|
5547
5634
|
watchSession(input) {
|
|
@@ -5577,7 +5664,7 @@ var Sdk = class {
|
|
|
5577
5664
|
async validateMayaSession() {
|
|
5578
5665
|
return await this.walletService.validateMayaSession();
|
|
5579
5666
|
}
|
|
5580
|
-
async
|
|
5667
|
+
async createSingleUseToken() {
|
|
5581
5668
|
const res0 = await this.sessionManager.get();
|
|
5582
5669
|
if (!res0.ok || !res0.data) {
|
|
5583
5670
|
return {
|
|
@@ -5588,15 +5675,15 @@ var Sdk = class {
|
|
|
5588
5675
|
}
|
|
5589
5676
|
};
|
|
5590
5677
|
}
|
|
5591
|
-
const res1 = await this.authService.
|
|
5678
|
+
const res1 = await this.authService.createSingleUseToken(res0.data.accessToken);
|
|
5592
5679
|
if (!res1.ok) return res1;
|
|
5593
5680
|
return { ok: true, data: res1.data.token };
|
|
5594
5681
|
}
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5682
|
+
/*
|
|
5683
|
+
*=============================================
|
|
5684
|
+
* SITE
|
|
5685
|
+
*=============================================
|
|
5686
|
+
*/
|
|
5600
5687
|
async site() {
|
|
5601
5688
|
const res = await this.cmsPortalService.self();
|
|
5602
5689
|
if (!res.ok) return res;
|
|
@@ -5605,11 +5692,11 @@ var Sdk = class {
|
|
|
5605
5692
|
data: this.transformer.transform.site(res.data)
|
|
5606
5693
|
};
|
|
5607
5694
|
}
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5695
|
+
/*
|
|
5696
|
+
*=============================================
|
|
5697
|
+
* PLATFORM
|
|
5698
|
+
*=============================================
|
|
5699
|
+
*/
|
|
5613
5700
|
/** @deprecated */
|
|
5614
5701
|
async platform() {
|
|
5615
5702
|
console.warn("'platform' is deprecated. Please use 'platform__next' instead.");
|
|
@@ -5636,11 +5723,11 @@ var Sdk = class {
|
|
|
5636
5723
|
data: this.transformer.transform.paymentSettings(res.data)
|
|
5637
5724
|
};
|
|
5638
5725
|
}
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5726
|
+
/*
|
|
5727
|
+
*=============================================
|
|
5728
|
+
* ACCOUNT
|
|
5729
|
+
*=============================================
|
|
5730
|
+
*/
|
|
5644
5731
|
async account() {
|
|
5645
5732
|
const r = await this.accountService.memberAccount();
|
|
5646
5733
|
if (!r.ok) return r;
|
|
@@ -5851,11 +5938,11 @@ var Sdk = class {
|
|
|
5851
5938
|
data: res.data ? this.transformer.transform.wallet(res.data) : null
|
|
5852
5939
|
};
|
|
5853
5940
|
}
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5941
|
+
/*
|
|
5942
|
+
*=============================================
|
|
5943
|
+
* ANNOUNCEMENT
|
|
5944
|
+
*=============================================
|
|
5945
|
+
*/
|
|
5859
5946
|
async announcements(input) {
|
|
5860
5947
|
const res = await this.accountService.announcements({
|
|
5861
5948
|
...input,
|
|
@@ -5880,11 +5967,11 @@ var Sdk = class {
|
|
|
5880
5967
|
}
|
|
5881
5968
|
};
|
|
5882
5969
|
}
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5970
|
+
/*
|
|
5971
|
+
*=============================================
|
|
5972
|
+
* WITHDRAWAL
|
|
5973
|
+
*=============================================
|
|
5974
|
+
*/
|
|
5888
5975
|
async createWithdrawal(input) {
|
|
5889
5976
|
const id = input.id ?? objectId.ObjectId.generate(ObjectType.Withdrawal).toString();
|
|
5890
5977
|
if (input.type === "BANK") {
|
|
@@ -5999,11 +6086,11 @@ var Sdk = class {
|
|
|
5999
6086
|
data: res.data.map(this.transformer.transform.instapayBank)
|
|
6000
6087
|
};
|
|
6001
6088
|
}
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6089
|
+
/*
|
|
6090
|
+
*=============================================
|
|
6091
|
+
* DEPOSIT
|
|
6092
|
+
*=============================================
|
|
6093
|
+
*/
|
|
6007
6094
|
async createDeposit(input) {
|
|
6008
6095
|
const id = input.id ?? objectId.ObjectId.generate(ObjectType.Deposit).toString();
|
|
6009
6096
|
if (input.type === "MAYA") {
|
|
@@ -6125,11 +6212,11 @@ var Sdk = class {
|
|
|
6125
6212
|
throw new Error(`Unsupported input type: '${input.type}'`);
|
|
6126
6213
|
}
|
|
6127
6214
|
}
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6215
|
+
/*
|
|
6216
|
+
*=============================================
|
|
6217
|
+
* BET RECORD
|
|
6218
|
+
*=============================================
|
|
6219
|
+
*/
|
|
6133
6220
|
async betRecords(input) {
|
|
6134
6221
|
const res0 = await this.reportService.betRecords({
|
|
6135
6222
|
...input,
|
|
@@ -6225,11 +6312,11 @@ var Sdk = class {
|
|
|
6225
6312
|
})
|
|
6226
6313
|
};
|
|
6227
6314
|
}
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6315
|
+
/*
|
|
6316
|
+
*=============================================
|
|
6317
|
+
* TRANSACTION
|
|
6318
|
+
*=============================================
|
|
6319
|
+
*/
|
|
6233
6320
|
async transactionRecords(input) {
|
|
6234
6321
|
const res = await this.reportService.transactionRecords(input);
|
|
6235
6322
|
if (!res.ok) return res;
|
|
@@ -6246,11 +6333,11 @@ var Sdk = class {
|
|
|
6246
6333
|
}
|
|
6247
6334
|
};
|
|
6248
6335
|
}
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6336
|
+
/*
|
|
6337
|
+
*=============================================
|
|
6338
|
+
* PROMO
|
|
6339
|
+
*=============================================
|
|
6340
|
+
*/
|
|
6254
6341
|
async promos() {
|
|
6255
6342
|
const res = await this.walletService.promos();
|
|
6256
6343
|
if (!res.ok) return res;
|
|
@@ -6315,11 +6402,11 @@ var Sdk = class {
|
|
|
6315
6402
|
data: this.transformer.transform.promoByCode(res.data)
|
|
6316
6403
|
};
|
|
6317
6404
|
}
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6405
|
+
/*
|
|
6406
|
+
*=============================================
|
|
6407
|
+
* GAME
|
|
6408
|
+
*=============================================
|
|
6409
|
+
*/
|
|
6323
6410
|
async game(id) {
|
|
6324
6411
|
const res = await this.cmsPortalService.game(id);
|
|
6325
6412
|
if (!res.ok) return res;
|
|
@@ -6499,11 +6586,11 @@ var Sdk = class {
|
|
|
6499
6586
|
}).filter(Boolean) ?? []
|
|
6500
6587
|
};
|
|
6501
6588
|
}
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6589
|
+
/*
|
|
6590
|
+
*=============================================
|
|
6591
|
+
* FILE
|
|
6592
|
+
*=============================================
|
|
6593
|
+
*/
|
|
6507
6594
|
async file(id) {
|
|
6508
6595
|
const res = await this.fileService.file({ id });
|
|
6509
6596
|
if (!res.ok) return res;
|
|
@@ -6522,11 +6609,11 @@ var Sdk = class {
|
|
|
6522
6609
|
});
|
|
6523
6610
|
return res.ok ? { ok: true, data: { id } } : res;
|
|
6524
6611
|
}
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6612
|
+
/*
|
|
6613
|
+
*=============================================
|
|
6614
|
+
* POINTS
|
|
6615
|
+
*=============================================
|
|
6616
|
+
*/
|
|
6530
6617
|
async pointsWallet() {
|
|
6531
6618
|
const res = await this.walletService.pointsWallet();
|
|
6532
6619
|
if (!res.ok) return res;
|
|
@@ -6558,11 +6645,11 @@ var Sdk = class {
|
|
|
6558
6645
|
}
|
|
6559
6646
|
};
|
|
6560
6647
|
}
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6648
|
+
/*
|
|
6649
|
+
*=============================================
|
|
6650
|
+
* ACTIVITY RECORD
|
|
6651
|
+
*=============================================
|
|
6652
|
+
*/
|
|
6566
6653
|
async activityRecords(input) {
|
|
6567
6654
|
const res = await this.reportService.activityRecords(input);
|
|
6568
6655
|
if (!res.ok) return res;
|
|
@@ -6579,11 +6666,11 @@ var Sdk = class {
|
|
|
6579
6666
|
}
|
|
6580
6667
|
};
|
|
6581
6668
|
}
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6669
|
+
/*
|
|
6670
|
+
*=============================================
|
|
6671
|
+
* REFERRAL
|
|
6672
|
+
*=============================================
|
|
6673
|
+
*/
|
|
6587
6674
|
async referralCode() {
|
|
6588
6675
|
const res = await this.accountService.referralCode();
|
|
6589
6676
|
if (!res.ok) return res;
|
|
@@ -6643,11 +6730,11 @@ var Sdk = class {
|
|
|
6643
6730
|
data: res.data ? this.transformer.transform.pointsClubSettings(res.data) : null
|
|
6644
6731
|
};
|
|
6645
6732
|
}
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6733
|
+
/*
|
|
6734
|
+
*=============================================
|
|
6735
|
+
* MESSAGES
|
|
6736
|
+
*=============================================
|
|
6737
|
+
*/
|
|
6651
6738
|
async messages(input) {
|
|
6652
6739
|
const res = await this.triggerService.messages(input);
|
|
6653
6740
|
if (!res.ok) return res;
|
|
@@ -6676,11 +6763,11 @@ var Sdk = class {
|
|
|
6676
6763
|
async claimReward(id) {
|
|
6677
6764
|
return await this.triggerService.claimReward({ id });
|
|
6678
6765
|
}
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6766
|
+
/*
|
|
6767
|
+
*=============================================
|
|
6768
|
+
* ONBOARDING
|
|
6769
|
+
*=============================================
|
|
6770
|
+
*/
|
|
6684
6771
|
async onboardingStatus() {
|
|
6685
6772
|
const res = await this.portalService.onboardingStatus();
|
|
6686
6773
|
if (!res.ok) return res;
|
|
@@ -6700,11 +6787,11 @@ var Sdk = class {
|
|
|
6700
6787
|
async skipOnboarding() {
|
|
6701
6788
|
return await this.portalService.skipOnboarding();
|
|
6702
6789
|
}
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6790
|
+
/*
|
|
6791
|
+
*=============================================
|
|
6792
|
+
* QUEST
|
|
6793
|
+
*=============================================
|
|
6794
|
+
*/
|
|
6708
6795
|
async availableQuests() {
|
|
6709
6796
|
const res = await this.triggerService.availableQuests();
|
|
6710
6797
|
if (!res.ok) return res;
|
|
@@ -6716,11 +6803,11 @@ var Sdk = class {
|
|
|
6716
6803
|
async checkInDailyQuest(id) {
|
|
6717
6804
|
return await this.triggerService.checkInDailyQuest({ input: { id } });
|
|
6718
6805
|
}
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
|
|
6806
|
+
/*
|
|
6807
|
+
*=============================================
|
|
6808
|
+
* TOP WINS
|
|
6809
|
+
*=============================================
|
|
6810
|
+
*/
|
|
6724
6811
|
async topWins() {
|
|
6725
6812
|
const res = await this.portalService.topWins();
|
|
6726
6813
|
if (!res.ok) return res;
|
|
@@ -6729,11 +6816,11 @@ var Sdk = class {
|
|
|
6729
6816
|
data: res.data.map(this.transformer.transform.topWin)
|
|
6730
6817
|
};
|
|
6731
6818
|
}
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6819
|
+
/*
|
|
6820
|
+
*=============================================
|
|
6821
|
+
* JACKPOT
|
|
6822
|
+
*=============================================
|
|
6823
|
+
*/
|
|
6737
6824
|
async jackpots(input) {
|
|
6738
6825
|
const res = await this.reportService.jackpots(input);
|
|
6739
6826
|
if (!res.ok) return res;
|
|
@@ -6766,22 +6853,22 @@ var Sdk = class {
|
|
|
6766
6853
|
}
|
|
6767
6854
|
};
|
|
6768
6855
|
}
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6856
|
+
/*
|
|
6857
|
+
*=============================================
|
|
6858
|
+
* FCM/FIREBASE
|
|
6859
|
+
*=============================================
|
|
6860
|
+
*/
|
|
6774
6861
|
async registerFCMDevice(input) {
|
|
6775
6862
|
return await this.triggerService.registerFCMDevice({ input });
|
|
6776
6863
|
}
|
|
6777
6864
|
async unregisterFCMDevice(input) {
|
|
6778
6865
|
return await this.triggerService.unregisterFCMDevice({ input });
|
|
6779
6866
|
}
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6867
|
+
/*
|
|
6868
|
+
*=============================================
|
|
6869
|
+
* UTILS
|
|
6870
|
+
*=============================================
|
|
6871
|
+
*/
|
|
6785
6872
|
formatYmd(date) {
|
|
6786
6873
|
const ensure2Digits = (n) => n.toString().padStart(2, "0");
|
|
6787
6874
|
const y = date.getFullYear();
|