@opexa/portal-sdk 0.54.5 → 0.54.7
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 +427 -155
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +427 -155
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1797,6 +1797,22 @@ var REGISTER_MAYA_MEMBER_ACCOUNT_MUTATION = gql`
|
|
|
1797
1797
|
}
|
|
1798
1798
|
}
|
|
1799
1799
|
`;
|
|
1800
|
+
var REGISTER_AGENT_ACCOUNT_MUTATION = gql`
|
|
1801
|
+
mutation RegisterAgentAccount($input: RegisterAgentAccountInput!) {
|
|
1802
|
+
registerAgentAccount(input: $input) {
|
|
1803
|
+
__typename
|
|
1804
|
+
... on AccountNameNotAvailableError {
|
|
1805
|
+
message
|
|
1806
|
+
}
|
|
1807
|
+
... on EmailAddressNotAvailableError {
|
|
1808
|
+
message
|
|
1809
|
+
}
|
|
1810
|
+
... on MobileNumberNotAvailableError {
|
|
1811
|
+
message
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
`;
|
|
1800
1816
|
var UPDATE_MEMBER_ACCOUNT_MUTATION = gql`
|
|
1801
1817
|
mutation UpdateMemberAccount($input: UpdateMemberAccountInput!) {
|
|
1802
1818
|
updateMemberAccount(input: $input) {
|
|
@@ -3103,11 +3119,14 @@ var AccountService = class {
|
|
|
3103
3119
|
};
|
|
3104
3120
|
}
|
|
3105
3121
|
async registerMemberAccount(variables) {
|
|
3106
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
3122
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
3107
3123
|
const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_MUTATION, others, {
|
|
3108
3124
|
headers: {
|
|
3109
3125
|
...reCAPTCHAResponse && {
|
|
3110
3126
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
3127
|
+
},
|
|
3128
|
+
...domain && {
|
|
3129
|
+
Domain: domain
|
|
3111
3130
|
}
|
|
3112
3131
|
}
|
|
3113
3132
|
});
|
|
@@ -3123,7 +3142,7 @@ var AccountService = class {
|
|
|
3123
3142
|
};
|
|
3124
3143
|
}
|
|
3125
3144
|
async registerMemberAccountViaMobile(variables) {
|
|
3126
|
-
const { reCAPTCHAResponse, testPass, ...others } = variables;
|
|
3145
|
+
const { reCAPTCHAResponse, domain, testPass, ...others } = variables;
|
|
3127
3146
|
const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_VIA_MOBILE_MUTATION, others, {
|
|
3128
3147
|
headers: {
|
|
3129
3148
|
...reCAPTCHAResponse && {
|
|
@@ -3131,6 +3150,9 @@ var AccountService = class {
|
|
|
3131
3150
|
},
|
|
3132
3151
|
...testPass && {
|
|
3133
3152
|
"test-pass": testPass
|
|
3153
|
+
},
|
|
3154
|
+
...domain && {
|
|
3155
|
+
Domain: domain
|
|
3134
3156
|
}
|
|
3135
3157
|
}
|
|
3136
3158
|
});
|
|
@@ -3148,11 +3170,14 @@ var AccountService = class {
|
|
|
3148
3170
|
};
|
|
3149
3171
|
}
|
|
3150
3172
|
async registerMemberAccount__next(variables) {
|
|
3151
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
3173
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
3152
3174
|
const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_MUTATION__NEXT, others, {
|
|
3153
3175
|
headers: {
|
|
3154
3176
|
...reCAPTCHAResponse && {
|
|
3155
3177
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
3178
|
+
},
|
|
3179
|
+
...domain && {
|
|
3180
|
+
Domain: domain
|
|
3156
3181
|
}
|
|
3157
3182
|
}
|
|
3158
3183
|
});
|
|
@@ -3168,10 +3193,14 @@ var AccountService = class {
|
|
|
3168
3193
|
};
|
|
3169
3194
|
}
|
|
3170
3195
|
async registerMemberAccountByName(variables) {
|
|
3171
|
-
const
|
|
3196
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
3197
|
+
const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_BY_NAME_MUTATION, others, {
|
|
3172
3198
|
headers: {
|
|
3173
|
-
...
|
|
3174
|
-
"google-recaptcha-response":
|
|
3199
|
+
...reCAPTCHAResponse && {
|
|
3200
|
+
"google-recaptcha-response": reCAPTCHAResponse
|
|
3201
|
+
},
|
|
3202
|
+
...domain && {
|
|
3203
|
+
Domain: domain
|
|
3175
3204
|
}
|
|
3176
3205
|
}
|
|
3177
3206
|
});
|
|
@@ -3392,7 +3421,14 @@ var AccountService = class {
|
|
|
3392
3421
|
};
|
|
3393
3422
|
}
|
|
3394
3423
|
async registerMayaMemberAccount(variables) {
|
|
3395
|
-
const
|
|
3424
|
+
const { domain, ...others } = variables;
|
|
3425
|
+
const res = await this.client.request(REGISTER_MAYA_MEMBER_ACCOUNT_MUTATION, others, {
|
|
3426
|
+
headers: {
|
|
3427
|
+
...domain && {
|
|
3428
|
+
Domain: domain
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
});
|
|
3396
3432
|
if (!res.ok) return res;
|
|
3397
3433
|
if (res.data.registerMayaMemberAccount) {
|
|
3398
3434
|
return {
|
|
@@ -3434,7 +3470,7 @@ var AccountService = class {
|
|
|
3434
3470
|
return res.ok ? { ok: true, data: res.data.pointsClubSettings } : res;
|
|
3435
3471
|
}
|
|
3436
3472
|
async registerMemberAccountByMobileNumber(variables) {
|
|
3437
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
3473
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
3438
3474
|
const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER_MUTATION, others, {
|
|
3439
3475
|
headers: {
|
|
3440
3476
|
...variables.reCAPTCHAResponse && {
|
|
@@ -3442,6 +3478,9 @@ var AccountService = class {
|
|
|
3442
3478
|
},
|
|
3443
3479
|
...variables.testPass && {
|
|
3444
3480
|
"test-pass": "true"
|
|
3481
|
+
},
|
|
3482
|
+
...domain && {
|
|
3483
|
+
Domain: domain
|
|
3445
3484
|
}
|
|
3446
3485
|
}
|
|
3447
3486
|
});
|
|
@@ -3478,6 +3517,19 @@ var AccountService = class {
|
|
|
3478
3517
|
data: res.data.requireFirstDeposit
|
|
3479
3518
|
};
|
|
3480
3519
|
}
|
|
3520
|
+
async registerAgentAccount(variables) {
|
|
3521
|
+
const res = await this.client.request(REGISTER_AGENT_ACCOUNT_MUTATION, variables);
|
|
3522
|
+
if (!res.ok) return res;
|
|
3523
|
+
if (res.data?.registerAgentAccount) {
|
|
3524
|
+
return {
|
|
3525
|
+
ok: false,
|
|
3526
|
+
error: createOperationError(
|
|
3527
|
+
res.data.registerAgentAccount.__typename
|
|
3528
|
+
)
|
|
3529
|
+
};
|
|
3530
|
+
}
|
|
3531
|
+
return { ok: true };
|
|
3532
|
+
}
|
|
3481
3533
|
};
|
|
3482
3534
|
|
|
3483
3535
|
// src/utils/status-code-to-operation-error.ts
|
|
@@ -4063,7 +4115,14 @@ var GameService = class {
|
|
|
4063
4115
|
};
|
|
4064
4116
|
}
|
|
4065
4117
|
async createGameSession(variables) {
|
|
4066
|
-
const
|
|
4118
|
+
const { domain, ...others } = variables;
|
|
4119
|
+
const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, others, {
|
|
4120
|
+
headers: {
|
|
4121
|
+
...domain && {
|
|
4122
|
+
Domain: domain
|
|
4123
|
+
}
|
|
4124
|
+
}
|
|
4125
|
+
});
|
|
4067
4126
|
if (!res.ok) return res;
|
|
4068
4127
|
if (res.data.createGameSession) {
|
|
4069
4128
|
return {
|
|
@@ -4480,11 +4539,14 @@ var WalletService = class {
|
|
|
4480
4539
|
return res.ok ? { ok: res.ok, data: res.data.node } : res;
|
|
4481
4540
|
}
|
|
4482
4541
|
async createGCashDeposit(variables) {
|
|
4483
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4542
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4484
4543
|
const res = await this.client.request(CREATE_GCASH_DEPOSIT_MUTATION, others, {
|
|
4485
4544
|
headers: {
|
|
4486
4545
|
...reCAPTCHAResponse && {
|
|
4487
4546
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4547
|
+
},
|
|
4548
|
+
...domain && {
|
|
4549
|
+
Domain: domain
|
|
4488
4550
|
}
|
|
4489
4551
|
}
|
|
4490
4552
|
});
|
|
@@ -4500,11 +4562,14 @@ var WalletService = class {
|
|
|
4500
4562
|
};
|
|
4501
4563
|
}
|
|
4502
4564
|
async createGCashWebpayDeposit(variables) {
|
|
4503
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4565
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4504
4566
|
const res = await this.client.request(CREATE_GCASH_WEBPAY_DEPOSIT_MUTATION, others, {
|
|
4505
4567
|
headers: {
|
|
4506
4568
|
...reCAPTCHAResponse && {
|
|
4507
4569
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4570
|
+
},
|
|
4571
|
+
...domain && {
|
|
4572
|
+
Domain: domain
|
|
4508
4573
|
}
|
|
4509
4574
|
}
|
|
4510
4575
|
});
|
|
@@ -4522,11 +4587,14 @@ var WalletService = class {
|
|
|
4522
4587
|
};
|
|
4523
4588
|
}
|
|
4524
4589
|
async createMayaWebpayDeposit(variables) {
|
|
4525
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4590
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4526
4591
|
const res = await this.client.request(CREATE_MAYA_WEBPAY_DEPOSIT_MUTATION, others, {
|
|
4527
4592
|
headers: {
|
|
4528
4593
|
...reCAPTCHAResponse && {
|
|
4529
4594
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4595
|
+
},
|
|
4596
|
+
...domain && {
|
|
4597
|
+
Domain: domain
|
|
4530
4598
|
}
|
|
4531
4599
|
}
|
|
4532
4600
|
});
|
|
@@ -4544,11 +4612,14 @@ var WalletService = class {
|
|
|
4544
4612
|
};
|
|
4545
4613
|
}
|
|
4546
4614
|
async createMayaDeposit(variables) {
|
|
4547
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4615
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4548
4616
|
const res = await this.client.request(CREATE_MAYA_DEPOSIT_MUTATION, others, {
|
|
4549
4617
|
headers: {
|
|
4550
4618
|
...reCAPTCHAResponse && {
|
|
4551
4619
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4620
|
+
},
|
|
4621
|
+
...domain && {
|
|
4622
|
+
Domain: domain
|
|
4552
4623
|
}
|
|
4553
4624
|
}
|
|
4554
4625
|
});
|
|
@@ -4564,7 +4635,14 @@ var WalletService = class {
|
|
|
4564
4635
|
};
|
|
4565
4636
|
}
|
|
4566
4637
|
async createTestDeposit(variables) {
|
|
4567
|
-
const
|
|
4638
|
+
const { domain, ...others } = variables;
|
|
4639
|
+
const res = await this.client.request(CREATE_TEST_DEPOSIT_MUTATION, others, {
|
|
4640
|
+
headers: {
|
|
4641
|
+
...domain && {
|
|
4642
|
+
Domain: domain
|
|
4643
|
+
}
|
|
4644
|
+
}
|
|
4645
|
+
});
|
|
4568
4646
|
if (!res.ok) return res;
|
|
4569
4647
|
if (res.data.createTestDeposit) {
|
|
4570
4648
|
return {
|
|
@@ -4577,11 +4655,14 @@ var WalletService = class {
|
|
|
4577
4655
|
};
|
|
4578
4656
|
}
|
|
4579
4657
|
async createAIOQRPHDeposit(variables) {
|
|
4580
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4658
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4581
4659
|
const res = await this.client.request(CREATE_AIO_QRPH_DEPOSIT_MUTATION, others, {
|
|
4582
4660
|
headers: {
|
|
4583
4661
|
...reCAPTCHAResponse && {
|
|
4584
4662
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4663
|
+
},
|
|
4664
|
+
...domain && {
|
|
4665
|
+
Domain: domain
|
|
4585
4666
|
}
|
|
4586
4667
|
}
|
|
4587
4668
|
});
|
|
@@ -4597,11 +4678,14 @@ var WalletService = class {
|
|
|
4597
4678
|
};
|
|
4598
4679
|
}
|
|
4599
4680
|
async createAiOGCashDeposit(variables) {
|
|
4600
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4681
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4601
4682
|
const res = await this.client.request(CREATE_AIO_GCASH_DEPOSIT_MUTATION, others, {
|
|
4602
4683
|
headers: {
|
|
4603
4684
|
...reCAPTCHAResponse && {
|
|
4604
4685
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4686
|
+
},
|
|
4687
|
+
...domain && {
|
|
4688
|
+
Domain: domain
|
|
4605
4689
|
}
|
|
4606
4690
|
}
|
|
4607
4691
|
});
|
|
@@ -4617,11 +4701,14 @@ var WalletService = class {
|
|
|
4617
4701
|
};
|
|
4618
4702
|
}
|
|
4619
4703
|
async createAiOPayMayaDeposit(variables) {
|
|
4620
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4704
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4621
4705
|
const res = await this.client.request(CREATE_AIO_PAY_MAYA_DEPOSIT_MUTATION, others, {
|
|
4622
4706
|
headers: {
|
|
4623
4707
|
...reCAPTCHAResponse && {
|
|
4624
4708
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4709
|
+
},
|
|
4710
|
+
...domain && {
|
|
4711
|
+
Domain: domain
|
|
4625
4712
|
}
|
|
4626
4713
|
}
|
|
4627
4714
|
});
|
|
@@ -4639,11 +4726,14 @@ var WalletService = class {
|
|
|
4639
4726
|
};
|
|
4640
4727
|
}
|
|
4641
4728
|
async createAiOGrabPayDeposit(variables) {
|
|
4642
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4729
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4643
4730
|
const res = await this.client.request(CREATE_AIO_GRAB_PAY_DEPOSIT_MUTATION, others, {
|
|
4644
4731
|
headers: {
|
|
4645
4732
|
...reCAPTCHAResponse && {
|
|
4646
4733
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4734
|
+
},
|
|
4735
|
+
...domain && {
|
|
4736
|
+
Domain: domain
|
|
4647
4737
|
}
|
|
4648
4738
|
}
|
|
4649
4739
|
});
|
|
@@ -4661,11 +4751,14 @@ var WalletService = class {
|
|
|
4661
4751
|
};
|
|
4662
4752
|
}
|
|
4663
4753
|
async createAiOPalawanPayDeposit(variables) {
|
|
4664
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4754
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4665
4755
|
const res = await this.client.request(CREATE_AIO_PALAWAN_PAY_DEPOSIT_MUTATION, others, {
|
|
4666
4756
|
headers: {
|
|
4667
4757
|
...reCAPTCHAResponse && {
|
|
4668
4758
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4759
|
+
},
|
|
4760
|
+
...domain && {
|
|
4761
|
+
Domain: domain
|
|
4669
4762
|
}
|
|
4670
4763
|
}
|
|
4671
4764
|
});
|
|
@@ -4683,11 +4776,14 @@ var WalletService = class {
|
|
|
4683
4776
|
};
|
|
4684
4777
|
}
|
|
4685
4778
|
async createAIOOnlineBankDeposit(variables) {
|
|
4686
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4779
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4687
4780
|
const res = await this.client.request(CREATE_AIO_ONLINE_BANK_DEPOSIT_MUTATION, others, {
|
|
4688
4781
|
headers: {
|
|
4689
4782
|
...reCAPTCHAResponse && {
|
|
4690
4783
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4784
|
+
},
|
|
4785
|
+
...domain && {
|
|
4786
|
+
Domain: domain
|
|
4691
4787
|
}
|
|
4692
4788
|
}
|
|
4693
4789
|
});
|
|
@@ -4705,11 +4801,14 @@ var WalletService = class {
|
|
|
4705
4801
|
};
|
|
4706
4802
|
}
|
|
4707
4803
|
async createManualBankDeposit(variables) {
|
|
4708
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4804
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4709
4805
|
const res = await this.client.request(CREATE_MANUAL_BANK_DEPOSIT_MUTATION, others, {
|
|
4710
4806
|
headers: {
|
|
4711
4807
|
...reCAPTCHAResponse && {
|
|
4712
4808
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4809
|
+
},
|
|
4810
|
+
...domain && {
|
|
4811
|
+
Domain: domain
|
|
4713
4812
|
}
|
|
4714
4813
|
}
|
|
4715
4814
|
});
|
|
@@ -4727,11 +4826,14 @@ var WalletService = class {
|
|
|
4727
4826
|
};
|
|
4728
4827
|
}
|
|
4729
4828
|
async createManualUPIDeposit(variables) {
|
|
4730
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4829
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4731
4830
|
const res = await this.client.request(CREATE_MANUAL_UPI_DEPOSIT_MUTATION, others, {
|
|
4732
4831
|
headers: {
|
|
4733
4832
|
...reCAPTCHAResponse && {
|
|
4734
4833
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4834
|
+
},
|
|
4835
|
+
...domain && {
|
|
4836
|
+
Domain: domain
|
|
4735
4837
|
}
|
|
4736
4838
|
}
|
|
4737
4839
|
});
|
|
@@ -4747,11 +4849,14 @@ var WalletService = class {
|
|
|
4747
4849
|
};
|
|
4748
4850
|
}
|
|
4749
4851
|
async createMayaAppDeposit(variables) {
|
|
4750
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4852
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4751
4853
|
const res = await this.client.request(CREATE_MAYA_APP_DEPOSIT_MUTATION, others, {
|
|
4752
4854
|
headers: {
|
|
4753
4855
|
...reCAPTCHAResponse && {
|
|
4754
4856
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4857
|
+
},
|
|
4858
|
+
...domain && {
|
|
4859
|
+
Domain: domain
|
|
4755
4860
|
}
|
|
4756
4861
|
}
|
|
4757
4862
|
});
|
|
@@ -4767,11 +4872,14 @@ var WalletService = class {
|
|
|
4767
4872
|
};
|
|
4768
4873
|
}
|
|
4769
4874
|
async createManualUpiDeposit(variables) {
|
|
4770
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4875
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4771
4876
|
const res = await this.client.request(CREATE_MANUAL_UPI_DEPOSIT_MUTATION, others, {
|
|
4772
4877
|
headers: {
|
|
4773
4878
|
...reCAPTCHAResponse && {
|
|
4774
4879
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4880
|
+
},
|
|
4881
|
+
...domain && {
|
|
4882
|
+
Domain: domain
|
|
4775
4883
|
}
|
|
4776
4884
|
}
|
|
4777
4885
|
});
|
|
@@ -4787,11 +4895,14 @@ var WalletService = class {
|
|
|
4787
4895
|
};
|
|
4788
4896
|
}
|
|
4789
4897
|
async createGCashWithdrawal(variables) {
|
|
4790
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4898
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4791
4899
|
const res = await this.client.request(CREATE_GCASH_WITHDRAWAL_MUTATION, others, {
|
|
4792
4900
|
headers: {
|
|
4793
4901
|
...reCAPTCHAResponse && {
|
|
4794
4902
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4903
|
+
},
|
|
4904
|
+
...domain && {
|
|
4905
|
+
Domain: domain
|
|
4795
4906
|
}
|
|
4796
4907
|
}
|
|
4797
4908
|
});
|
|
@@ -4807,11 +4918,14 @@ var WalletService = class {
|
|
|
4807
4918
|
};
|
|
4808
4919
|
}
|
|
4809
4920
|
async createGCashStandardCashInWithdrawal(variables) {
|
|
4810
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4921
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4811
4922
|
const res = await this.client.request(CREATE_GCASH_STANDARD_CASHIN_WITHDRAWAL_MUTATION, others, {
|
|
4812
4923
|
headers: {
|
|
4813
4924
|
...reCAPTCHAResponse && {
|
|
4814
4925
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4926
|
+
},
|
|
4927
|
+
...domain && {
|
|
4928
|
+
Domain: domain
|
|
4815
4929
|
}
|
|
4816
4930
|
}
|
|
4817
4931
|
});
|
|
@@ -4829,11 +4943,14 @@ var WalletService = class {
|
|
|
4829
4943
|
};
|
|
4830
4944
|
}
|
|
4831
4945
|
async createMayaWithdrawal(variables) {
|
|
4832
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4946
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4833
4947
|
const res = await this.client.request(CREATE_MAYA_WITHDRAWAL_MUTATION, others, {
|
|
4834
4948
|
headers: {
|
|
4835
4949
|
...reCAPTCHAResponse && {
|
|
4836
4950
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4951
|
+
},
|
|
4952
|
+
...domain && {
|
|
4953
|
+
Domain: domain
|
|
4837
4954
|
}
|
|
4838
4955
|
}
|
|
4839
4956
|
});
|
|
@@ -4849,11 +4966,14 @@ var WalletService = class {
|
|
|
4849
4966
|
};
|
|
4850
4967
|
}
|
|
4851
4968
|
async createMayaAppWithdrawal(variables) {
|
|
4852
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4969
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4853
4970
|
const res = await this.client.request(CREATE_MAYA_APP_WITHDRAWAL_MUTATION, others, {
|
|
4854
4971
|
headers: {
|
|
4855
4972
|
...reCAPTCHAResponse && {
|
|
4856
4973
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4974
|
+
},
|
|
4975
|
+
...domain && {
|
|
4976
|
+
Domain: domain
|
|
4857
4977
|
}
|
|
4858
4978
|
}
|
|
4859
4979
|
});
|
|
@@ -4871,11 +4991,14 @@ var WalletService = class {
|
|
|
4871
4991
|
};
|
|
4872
4992
|
}
|
|
4873
4993
|
async createBankWithdrawal(variables) {
|
|
4874
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
4994
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4875
4995
|
const res = await this.client.request(CREATE_BANK_WITHDRAWAL_MUTATION, others, {
|
|
4876
4996
|
headers: {
|
|
4877
4997
|
...reCAPTCHAResponse && {
|
|
4878
4998
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
4999
|
+
},
|
|
5000
|
+
...domain && {
|
|
5001
|
+
Domain: domain
|
|
4879
5002
|
}
|
|
4880
5003
|
}
|
|
4881
5004
|
});
|
|
@@ -4891,11 +5014,14 @@ var WalletService = class {
|
|
|
4891
5014
|
};
|
|
4892
5015
|
}
|
|
4893
5016
|
async createAIOInstapayWithdrawal(variables) {
|
|
4894
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
5017
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4895
5018
|
const res = await this.client.request(CREATE_AIO_INSTAPAY_WITHDRAWAL_MUTATION, others, {
|
|
4896
5019
|
headers: {
|
|
4897
5020
|
...reCAPTCHAResponse && {
|
|
4898
5021
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
5022
|
+
},
|
|
5023
|
+
...domain && {
|
|
5024
|
+
Domain: domain
|
|
4899
5025
|
}
|
|
4900
5026
|
}
|
|
4901
5027
|
});
|
|
@@ -4913,11 +5039,14 @@ var WalletService = class {
|
|
|
4913
5039
|
};
|
|
4914
5040
|
}
|
|
4915
5041
|
async createAIOInstapayWithdrawal_next(variables) {
|
|
4916
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
5042
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4917
5043
|
const res = await this.client.request(CREATE_AIO_INSTAPAY_WITHDRAWAL_MUTATION_NEXT, others, {
|
|
4918
5044
|
headers: {
|
|
4919
5045
|
...reCAPTCHAResponse && {
|
|
4920
5046
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
5047
|
+
},
|
|
5048
|
+
...domain && {
|
|
5049
|
+
Domain: domain
|
|
4921
5050
|
}
|
|
4922
5051
|
}
|
|
4923
5052
|
});
|
|
@@ -4935,11 +5064,14 @@ var WalletService = class {
|
|
|
4935
5064
|
};
|
|
4936
5065
|
}
|
|
4937
5066
|
async createManualUpiWithdrawal(variables) {
|
|
4938
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
5067
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4939
5068
|
const res = await this.client.request(CREATE_MANUAL_UPI_WITHDRAWAL_MUTATION, others, {
|
|
4940
5069
|
headers: {
|
|
4941
5070
|
...reCAPTCHAResponse && {
|
|
4942
5071
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
5072
|
+
},
|
|
5073
|
+
...domain && {
|
|
5074
|
+
Domain: domain
|
|
4943
5075
|
}
|
|
4944
5076
|
}
|
|
4945
5077
|
});
|
|
@@ -4957,11 +5089,14 @@ var WalletService = class {
|
|
|
4957
5089
|
};
|
|
4958
5090
|
}
|
|
4959
5091
|
async createManualBankWithdrawal(variables) {
|
|
4960
|
-
const { reCAPTCHAResponse, ...others } = variables;
|
|
5092
|
+
const { reCAPTCHAResponse, domain, ...others } = variables;
|
|
4961
5093
|
const res = await this.client.request(CREATE_MANUAL_BANK_WITHDRAWAL_MUTATION, others, {
|
|
4962
5094
|
headers: {
|
|
4963
5095
|
...reCAPTCHAResponse && {
|
|
4964
5096
|
"google-recaptcha-response": reCAPTCHAResponse
|
|
5097
|
+
},
|
|
5098
|
+
...domain && {
|
|
5099
|
+
Domain: domain
|
|
4965
5100
|
}
|
|
4966
5101
|
}
|
|
4967
5102
|
});
|
|
@@ -5016,7 +5151,14 @@ var WalletService = class {
|
|
|
5016
5151
|
return res.ok ? { ok: true, data: res.data.node } : res;
|
|
5017
5152
|
}
|
|
5018
5153
|
async createGameSession(variables) {
|
|
5019
|
-
const
|
|
5154
|
+
const { domain, ...others } = variables;
|
|
5155
|
+
const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, others, {
|
|
5156
|
+
headers: {
|
|
5157
|
+
...domain && {
|
|
5158
|
+
Domain: domain
|
|
5159
|
+
}
|
|
5160
|
+
}
|
|
5161
|
+
});
|
|
5020
5162
|
if (!res.ok) return res;
|
|
5021
5163
|
if (res.data.createGameSession) {
|
|
5022
5164
|
return {
|
|
@@ -5183,10 +5325,7 @@ var WalletService = class {
|
|
|
5183
5325
|
};
|
|
5184
5326
|
}
|
|
5185
5327
|
async cabinetWithdrawal(variables) {
|
|
5186
|
-
const res = await this.client.request(
|
|
5187
|
-
CABINET_WITHDRAWAL_QUERY,
|
|
5188
|
-
variables
|
|
5189
|
-
);
|
|
5328
|
+
const res = await this.client.request(CABINET_WITHDRAWAL_QUERY, variables);
|
|
5190
5329
|
return res.ok ? { ok: res.ok, data: res.data.node } : res;
|
|
5191
5330
|
}
|
|
5192
5331
|
async redeemVoucher(variables) {
|
|
@@ -5710,8 +5849,8 @@ function pollable(func, config) {
|
|
|
5710
5849
|
};
|
|
5711
5850
|
}
|
|
5712
5851
|
|
|
5713
|
-
// src/sdk/session-manager.ts
|
|
5714
|
-
var
|
|
5852
|
+
// src/sdk/session-manager-cookie.ts
|
|
5853
|
+
var SessionManagerCookie = class {
|
|
5715
5854
|
logger;
|
|
5716
5855
|
storageKey = "session";
|
|
5717
5856
|
platformStorageKey = "session/platform";
|
|
@@ -5722,10 +5861,6 @@ var SessionManager = class {
|
|
|
5722
5861
|
this.authService = config.authService;
|
|
5723
5862
|
this.walletService = config.walletService;
|
|
5724
5863
|
this.logger = config.logger;
|
|
5725
|
-
if (config.sessionPrefix) {
|
|
5726
|
-
this.storageKey = `${config.sessionPrefix}/${this.storageKey}`;
|
|
5727
|
-
this.platformStorageKey = `${config.sessionPrefix}/${this.platformStorageKey}`;
|
|
5728
|
-
}
|
|
5729
5864
|
}
|
|
5730
5865
|
get refreshing() {
|
|
5731
5866
|
return this._refreshing;
|
|
@@ -5734,16 +5869,6 @@ var SessionManager = class {
|
|
|
5734
5869
|
this._refreshing = value;
|
|
5735
5870
|
}
|
|
5736
5871
|
async create(input) {
|
|
5737
|
-
if (this.isServer) {
|
|
5738
|
-
this.logger.warn("'localStorage' is not available on the server.");
|
|
5739
|
-
return {
|
|
5740
|
-
ok: false,
|
|
5741
|
-
error: {
|
|
5742
|
-
name: "UnknownError",
|
|
5743
|
-
message: "Server sign in is not supported."
|
|
5744
|
-
}
|
|
5745
|
-
};
|
|
5746
|
-
}
|
|
5747
5872
|
if (input.type === "MAYA") {
|
|
5748
5873
|
localStorage.setItem(this.platformStorageKey, "MAYA");
|
|
5749
5874
|
const f0 = () => this.walletService.mayaSession({ id: input.sessionId });
|
|
@@ -5770,13 +5895,14 @@ var SessionManager = class {
|
|
|
5770
5895
|
})();
|
|
5771
5896
|
if (!r1.ok) return r1;
|
|
5772
5897
|
const now2 = /* @__PURE__ */ new Date();
|
|
5773
|
-
|
|
5898
|
+
cookies__default.default.set(
|
|
5774
5899
|
this.storageKey,
|
|
5775
5900
|
JSON.stringify({
|
|
5776
5901
|
...r1.data,
|
|
5777
5902
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
5778
5903
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
5779
|
-
})
|
|
5904
|
+
}),
|
|
5905
|
+
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
5780
5906
|
);
|
|
5781
5907
|
return {
|
|
5782
5908
|
ok: true,
|
|
@@ -5787,13 +5913,16 @@ var SessionManager = class {
|
|
|
5787
5913
|
const res2 = await this.authService.createSession(input);
|
|
5788
5914
|
if (res2.ok) {
|
|
5789
5915
|
const now2 = /* @__PURE__ */ new Date();
|
|
5790
|
-
|
|
5916
|
+
cookies__default.default.set(
|
|
5791
5917
|
this.storageKey,
|
|
5792
5918
|
JSON.stringify({
|
|
5793
5919
|
...res2.data,
|
|
5794
5920
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
5795
5921
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
5796
|
-
})
|
|
5922
|
+
}),
|
|
5923
|
+
{
|
|
5924
|
+
expires: subMinutes(addDays(now2, 30), 2).getTime()
|
|
5925
|
+
}
|
|
5797
5926
|
);
|
|
5798
5927
|
return {
|
|
5799
5928
|
ok: true,
|
|
@@ -5805,18 +5934,18 @@ var SessionManager = class {
|
|
|
5805
5934
|
if (input.type === "SOCIALS" || input.type === "TOKEN") {
|
|
5806
5935
|
const res2 = await this.authService.createSession({
|
|
5807
5936
|
type: "SOCIALS",
|
|
5808
|
-
token: input.token
|
|
5809
|
-
channel: input.channel
|
|
5937
|
+
token: input.token
|
|
5810
5938
|
});
|
|
5811
5939
|
if (res2.ok) {
|
|
5812
5940
|
const now2 = /* @__PURE__ */ new Date();
|
|
5813
|
-
|
|
5941
|
+
cookies__default.default.set(
|
|
5814
5942
|
this.storageKey,
|
|
5815
5943
|
JSON.stringify({
|
|
5816
5944
|
...res2.data,
|
|
5817
5945
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
5818
5946
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
5819
|
-
})
|
|
5947
|
+
}),
|
|
5948
|
+
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
5820
5949
|
);
|
|
5821
5950
|
return {
|
|
5822
5951
|
ok: true,
|
|
@@ -5830,13 +5959,14 @@ var SessionManager = class {
|
|
|
5830
5959
|
const res2 = await this.authService.createSession(input);
|
|
5831
5960
|
if (res2.ok) {
|
|
5832
5961
|
const now2 = /* @__PURE__ */ new Date();
|
|
5833
|
-
|
|
5962
|
+
cookies__default.default.set(
|
|
5834
5963
|
this.storageKey,
|
|
5835
5964
|
JSON.stringify({
|
|
5836
5965
|
...res2.data,
|
|
5837
5966
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
5838
5967
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
5839
|
-
})
|
|
5968
|
+
}),
|
|
5969
|
+
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
5840
5970
|
);
|
|
5841
5971
|
return {
|
|
5842
5972
|
ok: true,
|
|
@@ -5856,13 +5986,14 @@ var SessionManager = class {
|
|
|
5856
5986
|
};
|
|
5857
5987
|
}
|
|
5858
5988
|
const now = /* @__PURE__ */ new Date();
|
|
5859
|
-
|
|
5989
|
+
cookies__default.default.set(
|
|
5860
5990
|
this.storageKey,
|
|
5861
5991
|
JSON.stringify({
|
|
5862
5992
|
...res.data,
|
|
5863
5993
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
5864
5994
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
5865
|
-
})
|
|
5995
|
+
}),
|
|
5996
|
+
{}
|
|
5866
5997
|
);
|
|
5867
5998
|
return {
|
|
5868
5999
|
ok: true,
|
|
@@ -5874,15 +6005,18 @@ var SessionManager = class {
|
|
|
5874
6005
|
if (res.ok) {
|
|
5875
6006
|
const now = /* @__PURE__ */ new Date();
|
|
5876
6007
|
if (this.isServer) {
|
|
5877
|
-
this.logger.warn("'
|
|
6008
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
5878
6009
|
} else {
|
|
5879
|
-
|
|
6010
|
+
cookies__default.default.set(
|
|
5880
6011
|
this.storageKey,
|
|
5881
6012
|
JSON.stringify({
|
|
5882
6013
|
...res.data,
|
|
5883
6014
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
5884
6015
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
5885
|
-
})
|
|
6016
|
+
}),
|
|
6017
|
+
{
|
|
6018
|
+
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6019
|
+
}
|
|
5886
6020
|
);
|
|
5887
6021
|
}
|
|
5888
6022
|
return { ok: true };
|
|
@@ -5892,7 +6026,7 @@ var SessionManager = class {
|
|
|
5892
6026
|
}
|
|
5893
6027
|
async get() {
|
|
5894
6028
|
if (this.isServer) {
|
|
5895
|
-
this.logger.warn("'
|
|
6029
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
5896
6030
|
return {
|
|
5897
6031
|
ok: true,
|
|
5898
6032
|
data: null
|
|
@@ -5902,7 +6036,7 @@ var SessionManager = class {
|
|
|
5902
6036
|
await sleep(1e3);
|
|
5903
6037
|
return await this.get();
|
|
5904
6038
|
}
|
|
5905
|
-
const val =
|
|
6039
|
+
const val = cookies__default.default.get(this.storageKey);
|
|
5906
6040
|
if (!val) {
|
|
5907
6041
|
return {
|
|
5908
6042
|
ok: true,
|
|
@@ -5916,7 +6050,7 @@ var SessionManager = class {
|
|
|
5916
6050
|
const refreshTokenExpiresAt = new Date(obj.refreshTokenExpiresAt);
|
|
5917
6051
|
if (isAfter(now, refreshTokenExpiresAt)) {
|
|
5918
6052
|
this.logger.warn("Session expired. Logging out..");
|
|
5919
|
-
|
|
6053
|
+
cookies__default.default.remove(this.storageKey);
|
|
5920
6054
|
return {
|
|
5921
6055
|
ok: false,
|
|
5922
6056
|
error: {
|
|
@@ -5933,7 +6067,7 @@ var SessionManager = class {
|
|
|
5933
6067
|
if (!res.ok) {
|
|
5934
6068
|
this.logger.error(`Failed to refresh session: ${res.error.message}`);
|
|
5935
6069
|
if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
|
|
5936
|
-
|
|
6070
|
+
cookies__default.default.remove(this.storageKey);
|
|
5937
6071
|
return {
|
|
5938
6072
|
ok: false,
|
|
5939
6073
|
error: res.error
|
|
@@ -5954,7 +6088,9 @@ var SessionManager = class {
|
|
|
5954
6088
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
5955
6089
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
5956
6090
|
};
|
|
5957
|
-
|
|
6091
|
+
cookies__default.default.set(this.storageKey, JSON.stringify(obj), {
|
|
6092
|
+
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6093
|
+
});
|
|
5958
6094
|
}
|
|
5959
6095
|
return {
|
|
5960
6096
|
ok: true,
|
|
@@ -5972,13 +6108,13 @@ var SessionManager = class {
|
|
|
5972
6108
|
}
|
|
5973
6109
|
async refresh() {
|
|
5974
6110
|
if (this.isServer) {
|
|
5975
|
-
this.logger.warn("'
|
|
6111
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
5976
6112
|
return {
|
|
5977
6113
|
ok: true,
|
|
5978
6114
|
data: null
|
|
5979
6115
|
};
|
|
5980
6116
|
}
|
|
5981
|
-
const val =
|
|
6117
|
+
const val = cookies__default.default.get(this.storageKey);
|
|
5982
6118
|
if (!val) {
|
|
5983
6119
|
return {
|
|
5984
6120
|
ok: true,
|
|
@@ -5995,7 +6131,7 @@ var SessionManager = class {
|
|
|
5995
6131
|
if (!res.ok) {
|
|
5996
6132
|
this.logger.error(`Failed to refresh session: ${res.error.message}`);
|
|
5997
6133
|
if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
|
|
5998
|
-
|
|
6134
|
+
cookies__default.default.remove(this.storageKey);
|
|
5999
6135
|
return {
|
|
6000
6136
|
ok: false,
|
|
6001
6137
|
error: res.error
|
|
@@ -6016,7 +6152,9 @@ var SessionManager = class {
|
|
|
6016
6152
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
6017
6153
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
6018
6154
|
};
|
|
6019
|
-
|
|
6155
|
+
cookies__default.default.set(this.storageKey, JSON.stringify(obj), {
|
|
6156
|
+
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6157
|
+
});
|
|
6020
6158
|
return {
|
|
6021
6159
|
ok: true,
|
|
6022
6160
|
data: obj
|
|
@@ -6033,18 +6171,18 @@ var SessionManager = class {
|
|
|
6033
6171
|
}
|
|
6034
6172
|
async destroy() {
|
|
6035
6173
|
if (this.isServer) {
|
|
6036
|
-
this.logger.warn("'
|
|
6174
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
6037
6175
|
return;
|
|
6038
6176
|
}
|
|
6039
6177
|
const res = await this.get();
|
|
6040
6178
|
if (res.data?.accessToken) {
|
|
6041
6179
|
await this.authService.destroySession(res.data.accessToken);
|
|
6042
6180
|
}
|
|
6043
|
-
|
|
6181
|
+
cookies__default.default.remove(this.storageKey);
|
|
6044
6182
|
}
|
|
6045
6183
|
async verify() {
|
|
6046
6184
|
if (this.isServer) {
|
|
6047
|
-
this.logger.warn("'
|
|
6185
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
6048
6186
|
return true;
|
|
6049
6187
|
}
|
|
6050
6188
|
const s = await this.get();
|
|
@@ -6054,13 +6192,13 @@ var SessionManager = class {
|
|
|
6054
6192
|
if (!s.data) return true;
|
|
6055
6193
|
const v = await this.authService.verifySession(s.data.accessToken);
|
|
6056
6194
|
if (!v) {
|
|
6057
|
-
|
|
6195
|
+
cookies__default.default.remove(this.storageKey);
|
|
6058
6196
|
}
|
|
6059
6197
|
return v;
|
|
6060
6198
|
}
|
|
6061
6199
|
get onMaya() {
|
|
6062
6200
|
if (this.isServer) {
|
|
6063
|
-
this.logger.warn("'
|
|
6201
|
+
this.logger.warn("'client cookies' is not available on the server.");
|
|
6064
6202
|
return false;
|
|
6065
6203
|
}
|
|
6066
6204
|
return localStorage.getItem(this.platformStorageKey) === "MAYA";
|
|
@@ -6076,7 +6214,9 @@ var SessionManager = class {
|
|
|
6076
6214
|
return typeof window === "undefined";
|
|
6077
6215
|
}
|
|
6078
6216
|
};
|
|
6079
|
-
|
|
6217
|
+
|
|
6218
|
+
// src/sdk/session-manager.ts
|
|
6219
|
+
var SessionManager = class {
|
|
6080
6220
|
logger;
|
|
6081
6221
|
storageKey = "session";
|
|
6082
6222
|
platformStorageKey = "session/platform";
|
|
@@ -6087,6 +6227,10 @@ var SessionManagerCookie = class {
|
|
|
6087
6227
|
this.authService = config.authService;
|
|
6088
6228
|
this.walletService = config.walletService;
|
|
6089
6229
|
this.logger = config.logger;
|
|
6230
|
+
if (config.sessionPrefix) {
|
|
6231
|
+
this.storageKey = `${config.sessionPrefix}/${this.storageKey}`;
|
|
6232
|
+
this.platformStorageKey = `${config.sessionPrefix}/${this.platformStorageKey}`;
|
|
6233
|
+
}
|
|
6090
6234
|
}
|
|
6091
6235
|
get refreshing() {
|
|
6092
6236
|
return this._refreshing;
|
|
@@ -6095,6 +6239,16 @@ var SessionManagerCookie = class {
|
|
|
6095
6239
|
this._refreshing = value;
|
|
6096
6240
|
}
|
|
6097
6241
|
async create(input) {
|
|
6242
|
+
if (this.isServer) {
|
|
6243
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6244
|
+
return {
|
|
6245
|
+
ok: false,
|
|
6246
|
+
error: {
|
|
6247
|
+
name: "UnknownError",
|
|
6248
|
+
message: "Server sign in is not supported."
|
|
6249
|
+
}
|
|
6250
|
+
};
|
|
6251
|
+
}
|
|
6098
6252
|
if (input.type === "MAYA") {
|
|
6099
6253
|
localStorage.setItem(this.platformStorageKey, "MAYA");
|
|
6100
6254
|
const f0 = () => this.walletService.mayaSession({ id: input.sessionId });
|
|
@@ -6121,14 +6275,13 @@ var SessionManagerCookie = class {
|
|
|
6121
6275
|
})();
|
|
6122
6276
|
if (!r1.ok) return r1;
|
|
6123
6277
|
const now2 = /* @__PURE__ */ new Date();
|
|
6124
|
-
|
|
6278
|
+
localStorage.setItem(
|
|
6125
6279
|
this.storageKey,
|
|
6126
6280
|
JSON.stringify({
|
|
6127
6281
|
...r1.data,
|
|
6128
6282
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
6129
6283
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
6130
|
-
})
|
|
6131
|
-
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
6284
|
+
})
|
|
6132
6285
|
);
|
|
6133
6286
|
return {
|
|
6134
6287
|
ok: true,
|
|
@@ -6139,16 +6292,13 @@ var SessionManagerCookie = class {
|
|
|
6139
6292
|
const res2 = await this.authService.createSession(input);
|
|
6140
6293
|
if (res2.ok) {
|
|
6141
6294
|
const now2 = /* @__PURE__ */ new Date();
|
|
6142
|
-
|
|
6295
|
+
localStorage.setItem(
|
|
6143
6296
|
this.storageKey,
|
|
6144
6297
|
JSON.stringify({
|
|
6145
6298
|
...res2.data,
|
|
6146
6299
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
6147
6300
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
6148
|
-
})
|
|
6149
|
-
{
|
|
6150
|
-
expires: subMinutes(addDays(now2, 30), 2).getTime()
|
|
6151
|
-
}
|
|
6301
|
+
})
|
|
6152
6302
|
);
|
|
6153
6303
|
return {
|
|
6154
6304
|
ok: true,
|
|
@@ -6160,18 +6310,18 @@ var SessionManagerCookie = class {
|
|
|
6160
6310
|
if (input.type === "SOCIALS" || input.type === "TOKEN") {
|
|
6161
6311
|
const res2 = await this.authService.createSession({
|
|
6162
6312
|
type: "SOCIALS",
|
|
6163
|
-
token: input.token
|
|
6313
|
+
token: input.token,
|
|
6314
|
+
channel: input.channel
|
|
6164
6315
|
});
|
|
6165
6316
|
if (res2.ok) {
|
|
6166
6317
|
const now2 = /* @__PURE__ */ new Date();
|
|
6167
|
-
|
|
6318
|
+
localStorage.setItem(
|
|
6168
6319
|
this.storageKey,
|
|
6169
6320
|
JSON.stringify({
|
|
6170
6321
|
...res2.data,
|
|
6171
6322
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
6172
6323
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
6173
|
-
})
|
|
6174
|
-
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
6324
|
+
})
|
|
6175
6325
|
);
|
|
6176
6326
|
return {
|
|
6177
6327
|
ok: true,
|
|
@@ -6185,14 +6335,13 @@ var SessionManagerCookie = class {
|
|
|
6185
6335
|
const res2 = await this.authService.createSession(input);
|
|
6186
6336
|
if (res2.ok) {
|
|
6187
6337
|
const now2 = /* @__PURE__ */ new Date();
|
|
6188
|
-
|
|
6338
|
+
localStorage.setItem(
|
|
6189
6339
|
this.storageKey,
|
|
6190
6340
|
JSON.stringify({
|
|
6191
6341
|
...res2.data,
|
|
6192
6342
|
accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
|
|
6193
6343
|
refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
|
|
6194
|
-
})
|
|
6195
|
-
{ expires: subMinutes(addDays(now2, 30), 2).getTime() }
|
|
6344
|
+
})
|
|
6196
6345
|
);
|
|
6197
6346
|
return {
|
|
6198
6347
|
ok: true,
|
|
@@ -6212,14 +6361,13 @@ var SessionManagerCookie = class {
|
|
|
6212
6361
|
};
|
|
6213
6362
|
}
|
|
6214
6363
|
const now = /* @__PURE__ */ new Date();
|
|
6215
|
-
|
|
6364
|
+
localStorage.setItem(
|
|
6216
6365
|
this.storageKey,
|
|
6217
6366
|
JSON.stringify({
|
|
6218
6367
|
...res.data,
|
|
6219
6368
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
6220
6369
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
6221
|
-
})
|
|
6222
|
-
{}
|
|
6370
|
+
})
|
|
6223
6371
|
);
|
|
6224
6372
|
return {
|
|
6225
6373
|
ok: true,
|
|
@@ -6231,18 +6379,15 @@ var SessionManagerCookie = class {
|
|
|
6231
6379
|
if (res.ok) {
|
|
6232
6380
|
const now = /* @__PURE__ */ new Date();
|
|
6233
6381
|
if (this.isServer) {
|
|
6234
|
-
this.logger.warn("'
|
|
6382
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6235
6383
|
} else {
|
|
6236
|
-
|
|
6384
|
+
localStorage.setItem(
|
|
6237
6385
|
this.storageKey,
|
|
6238
6386
|
JSON.stringify({
|
|
6239
6387
|
...res.data,
|
|
6240
6388
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
6241
6389
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
6242
|
-
})
|
|
6243
|
-
{
|
|
6244
|
-
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6245
|
-
}
|
|
6390
|
+
})
|
|
6246
6391
|
);
|
|
6247
6392
|
}
|
|
6248
6393
|
return { ok: true };
|
|
@@ -6252,7 +6397,7 @@ var SessionManagerCookie = class {
|
|
|
6252
6397
|
}
|
|
6253
6398
|
async get() {
|
|
6254
6399
|
if (this.isServer) {
|
|
6255
|
-
this.logger.warn("'
|
|
6400
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6256
6401
|
return {
|
|
6257
6402
|
ok: true,
|
|
6258
6403
|
data: null
|
|
@@ -6262,7 +6407,7 @@ var SessionManagerCookie = class {
|
|
|
6262
6407
|
await sleep(1e3);
|
|
6263
6408
|
return await this.get();
|
|
6264
6409
|
}
|
|
6265
|
-
const val =
|
|
6410
|
+
const val = localStorage.getItem(this.storageKey);
|
|
6266
6411
|
if (!val) {
|
|
6267
6412
|
return {
|
|
6268
6413
|
ok: true,
|
|
@@ -6276,7 +6421,7 @@ var SessionManagerCookie = class {
|
|
|
6276
6421
|
const refreshTokenExpiresAt = new Date(obj.refreshTokenExpiresAt);
|
|
6277
6422
|
if (isAfter(now, refreshTokenExpiresAt)) {
|
|
6278
6423
|
this.logger.warn("Session expired. Logging out..");
|
|
6279
|
-
|
|
6424
|
+
localStorage.removeItem(this.storageKey);
|
|
6280
6425
|
return {
|
|
6281
6426
|
ok: false,
|
|
6282
6427
|
error: {
|
|
@@ -6293,7 +6438,7 @@ var SessionManagerCookie = class {
|
|
|
6293
6438
|
if (!res.ok) {
|
|
6294
6439
|
this.logger.error(`Failed to refresh session: ${res.error.message}`);
|
|
6295
6440
|
if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
|
|
6296
|
-
|
|
6441
|
+
localStorage.removeItem(this.storageKey);
|
|
6297
6442
|
return {
|
|
6298
6443
|
ok: false,
|
|
6299
6444
|
error: res.error
|
|
@@ -6314,9 +6459,7 @@ var SessionManagerCookie = class {
|
|
|
6314
6459
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
6315
6460
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
6316
6461
|
};
|
|
6317
|
-
|
|
6318
|
-
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6319
|
-
});
|
|
6462
|
+
localStorage.setItem(this.storageKey, JSON.stringify(obj));
|
|
6320
6463
|
}
|
|
6321
6464
|
return {
|
|
6322
6465
|
ok: true,
|
|
@@ -6334,13 +6477,13 @@ var SessionManagerCookie = class {
|
|
|
6334
6477
|
}
|
|
6335
6478
|
async refresh() {
|
|
6336
6479
|
if (this.isServer) {
|
|
6337
|
-
this.logger.warn("'
|
|
6480
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6338
6481
|
return {
|
|
6339
6482
|
ok: true,
|
|
6340
6483
|
data: null
|
|
6341
6484
|
};
|
|
6342
6485
|
}
|
|
6343
|
-
const val =
|
|
6486
|
+
const val = localStorage.getItem(this.storageKey);
|
|
6344
6487
|
if (!val) {
|
|
6345
6488
|
return {
|
|
6346
6489
|
ok: true,
|
|
@@ -6357,7 +6500,7 @@ var SessionManagerCookie = class {
|
|
|
6357
6500
|
if (!res.ok) {
|
|
6358
6501
|
this.logger.error(`Failed to refresh session: ${res.error.message}`);
|
|
6359
6502
|
if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
|
|
6360
|
-
|
|
6503
|
+
localStorage.removeItem(this.storageKey);
|
|
6361
6504
|
return {
|
|
6362
6505
|
ok: false,
|
|
6363
6506
|
error: res.error
|
|
@@ -6378,9 +6521,7 @@ var SessionManagerCookie = class {
|
|
|
6378
6521
|
accessTokenExpiresAt: addMinutes(now, 8).getTime(),
|
|
6379
6522
|
refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
|
|
6380
6523
|
};
|
|
6381
|
-
|
|
6382
|
-
expires: subMinutes(addDays(now, 30), 2).getTime()
|
|
6383
|
-
});
|
|
6524
|
+
localStorage.setItem(this.storageKey, JSON.stringify(obj));
|
|
6384
6525
|
return {
|
|
6385
6526
|
ok: true,
|
|
6386
6527
|
data: obj
|
|
@@ -6397,18 +6538,18 @@ var SessionManagerCookie = class {
|
|
|
6397
6538
|
}
|
|
6398
6539
|
async destroy() {
|
|
6399
6540
|
if (this.isServer) {
|
|
6400
|
-
this.logger.warn("'
|
|
6541
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6401
6542
|
return;
|
|
6402
6543
|
}
|
|
6403
6544
|
const res = await this.get();
|
|
6404
6545
|
if (res.data?.accessToken) {
|
|
6405
6546
|
await this.authService.destroySession(res.data.accessToken);
|
|
6406
6547
|
}
|
|
6407
|
-
|
|
6548
|
+
localStorage.removeItem(this.storageKey);
|
|
6408
6549
|
}
|
|
6409
6550
|
async verify() {
|
|
6410
6551
|
if (this.isServer) {
|
|
6411
|
-
this.logger.warn("'
|
|
6552
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6412
6553
|
return true;
|
|
6413
6554
|
}
|
|
6414
6555
|
const s = await this.get();
|
|
@@ -6418,13 +6559,13 @@ var SessionManagerCookie = class {
|
|
|
6418
6559
|
if (!s.data) return true;
|
|
6419
6560
|
const v = await this.authService.verifySession(s.data.accessToken);
|
|
6420
6561
|
if (!v) {
|
|
6421
|
-
|
|
6562
|
+
localStorage.removeItem(this.storageKey);
|
|
6422
6563
|
}
|
|
6423
6564
|
return v;
|
|
6424
6565
|
}
|
|
6425
6566
|
get onMaya() {
|
|
6426
6567
|
if (this.isServer) {
|
|
6427
|
-
this.logger.warn("'
|
|
6568
|
+
this.logger.warn("'localStorage' is not available on the server.");
|
|
6428
6569
|
return false;
|
|
6429
6570
|
}
|
|
6430
6571
|
return localStorage.getItem(this.platformStorageKey) === "MAYA";
|
|
@@ -8162,6 +8303,23 @@ var Sdk = class {
|
|
|
8162
8303
|
get middleware() {
|
|
8163
8304
|
return this._middleware;
|
|
8164
8305
|
}
|
|
8306
|
+
initWebDomain() {
|
|
8307
|
+
if (typeof window === "undefined") return;
|
|
8308
|
+
if (core.Capacitor.isNativePlatform()) return;
|
|
8309
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
8310
|
+
const hostname = window.location.hostname;
|
|
8311
|
+
const market = searchParams.get("market");
|
|
8312
|
+
if (market) {
|
|
8313
|
+
sessionStorage.setItem("domain", `${hostname}/${market}`);
|
|
8314
|
+
} else if (sessionStorage.getItem("domain") == null) {
|
|
8315
|
+
sessionStorage.setItem("domain", hostname);
|
|
8316
|
+
}
|
|
8317
|
+
}
|
|
8318
|
+
get webDomain() {
|
|
8319
|
+
if (typeof window === "undefined") return null;
|
|
8320
|
+
if (core.Capacitor.isNativePlatform()) return null;
|
|
8321
|
+
return sessionStorage.getItem("domain");
|
|
8322
|
+
}
|
|
8165
8323
|
/*
|
|
8166
8324
|
*=============================================
|
|
8167
8325
|
* ADS
|
|
@@ -8239,7 +8397,7 @@ var Sdk = class {
|
|
|
8239
8397
|
request.headers.set("Domain", this.memberDomain);
|
|
8240
8398
|
return request;
|
|
8241
8399
|
}
|
|
8242
|
-
const domain = typeof window === "undefined" ?
|
|
8400
|
+
const domain = typeof window === "undefined" ? request.headers.get("Domain") : !core.Capacitor.isNativePlatform() ? request.headers.get("Domain") : core.Capacitor.getPlatform() === "ios" ? `ios/${this.config.platform}`.toLowerCase() : core.Capacitor.getPlatform() === "android" ? `android/${this.config.platform}`.toLowerCase() : request.headers.get("Domain");
|
|
8243
8401
|
if (domain) {
|
|
8244
8402
|
request.headers.set("Domain", domain);
|
|
8245
8403
|
return request;
|
|
@@ -8540,7 +8698,10 @@ var Sdk = class {
|
|
|
8540
8698
|
},
|
|
8541
8699
|
referralCode: input.referralCode,
|
|
8542
8700
|
verificationCode: input.verificationCode,
|
|
8543
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
8701
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
8702
|
+
...this.webDomain && {
|
|
8703
|
+
domain: this.webDomain
|
|
8704
|
+
}
|
|
8544
8705
|
});
|
|
8545
8706
|
return res.ok ? { ok: true, data: { id } } : res;
|
|
8546
8707
|
}
|
|
@@ -8564,7 +8725,10 @@ var Sdk = class {
|
|
|
8564
8725
|
referralCode: input.referralCode,
|
|
8565
8726
|
verificationCode: input.verificationCode,
|
|
8566
8727
|
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
8567
|
-
testPass: input.testPass
|
|
8728
|
+
testPass: input.testPass,
|
|
8729
|
+
...this.webDomain && {
|
|
8730
|
+
domain: this.webDomain
|
|
8731
|
+
}
|
|
8568
8732
|
});
|
|
8569
8733
|
return res2.ok ? { ok: true, data: { id } } : res2;
|
|
8570
8734
|
}
|
|
@@ -8579,7 +8743,10 @@ var Sdk = class {
|
|
|
8579
8743
|
},
|
|
8580
8744
|
mobileNumberVerificationCode: input.mobileVerificationCode,
|
|
8581
8745
|
testPass: input.testPass,
|
|
8582
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
8746
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
8747
|
+
...this.webDomain && {
|
|
8748
|
+
domain: this.webDomain
|
|
8749
|
+
}
|
|
8583
8750
|
}
|
|
8584
8751
|
);
|
|
8585
8752
|
return res2.ok ? { ok: true, data: { id } } : res2;
|
|
@@ -8594,7 +8761,10 @@ var Sdk = class {
|
|
|
8594
8761
|
password: await sha256(input.password),
|
|
8595
8762
|
mobileNumber: input.mobileNumber ? addAreaCode(input.mobileNumber, await this.locale) : void 0
|
|
8596
8763
|
},
|
|
8597
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
8764
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
8765
|
+
...this.webDomain && {
|
|
8766
|
+
domain: this.webDomain
|
|
8767
|
+
}
|
|
8598
8768
|
});
|
|
8599
8769
|
return res2.ok ? { ok: true, data: { id } } : res2;
|
|
8600
8770
|
}
|
|
@@ -8604,7 +8774,10 @@ var Sdk = class {
|
|
|
8604
8774
|
name: input.name,
|
|
8605
8775
|
password: await sha256(input.password)
|
|
8606
8776
|
},
|
|
8607
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
8777
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
8778
|
+
...this.webDomain && {
|
|
8779
|
+
domain: this.webDomain
|
|
8780
|
+
}
|
|
8608
8781
|
});
|
|
8609
8782
|
return res.ok ? { ok: true, data: { id } } : res;
|
|
8610
8783
|
}
|
|
@@ -8614,6 +8787,24 @@ var Sdk = class {
|
|
|
8614
8787
|
name: input.name,
|
|
8615
8788
|
password: await sha256(input.password),
|
|
8616
8789
|
domain: input.domain
|
|
8790
|
+
},
|
|
8791
|
+
...this.webDomain && {
|
|
8792
|
+
domain: this.webDomain
|
|
8793
|
+
}
|
|
8794
|
+
});
|
|
8795
|
+
}
|
|
8796
|
+
async registerAgentAccount(input) {
|
|
8797
|
+
return await this.accountService.registerAgentAccount({
|
|
8798
|
+
input: {
|
|
8799
|
+
name: input.name,
|
|
8800
|
+
firstName: input.firstName,
|
|
8801
|
+
lastName: input.lastName,
|
|
8802
|
+
mobileNumber: input.mobileNumber,
|
|
8803
|
+
emailAddress: input.emailAddress,
|
|
8804
|
+
customProperties: input.customProperties
|
|
8805
|
+
},
|
|
8806
|
+
...this.webDomain && {
|
|
8807
|
+
domain: this.webDomain
|
|
8617
8808
|
}
|
|
8618
8809
|
});
|
|
8619
8810
|
}
|
|
@@ -8812,7 +9003,10 @@ var Sdk = class {
|
|
|
8812
9003
|
amount: input.amount.toString(),
|
|
8813
9004
|
transactionPassword: await sha256(input.transactionPassword)
|
|
8814
9005
|
},
|
|
8815
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9006
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9007
|
+
...this.webDomain && {
|
|
9008
|
+
domain: this.webDomain
|
|
9009
|
+
}
|
|
8816
9010
|
});
|
|
8817
9011
|
if (!res.ok) return res;
|
|
8818
9012
|
}
|
|
@@ -8836,7 +9030,10 @@ var Sdk = class {
|
|
|
8836
9030
|
await this.locale
|
|
8837
9031
|
)
|
|
8838
9032
|
},
|
|
8839
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9033
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9034
|
+
...this.webDomain && {
|
|
9035
|
+
domain: this.webDomain
|
|
9036
|
+
}
|
|
8840
9037
|
});
|
|
8841
9038
|
if (!res.ok) return res;
|
|
8842
9039
|
}
|
|
@@ -8851,7 +9048,10 @@ var Sdk = class {
|
|
|
8851
9048
|
await this.locale
|
|
8852
9049
|
)
|
|
8853
9050
|
},
|
|
8854
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9051
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9052
|
+
...this.webDomain && {
|
|
9053
|
+
domain: this.webDomain
|
|
9054
|
+
}
|
|
8855
9055
|
});
|
|
8856
9056
|
if (!res.ok) return res;
|
|
8857
9057
|
}
|
|
@@ -8866,7 +9066,10 @@ var Sdk = class {
|
|
|
8866
9066
|
await this.locale
|
|
8867
9067
|
)
|
|
8868
9068
|
},
|
|
8869
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9069
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9070
|
+
...this.webDomain && {
|
|
9071
|
+
domain: this.webDomain
|
|
9072
|
+
}
|
|
8870
9073
|
});
|
|
8871
9074
|
if (!res.ok) return res;
|
|
8872
9075
|
}
|
|
@@ -8877,7 +9080,10 @@ var Sdk = class {
|
|
|
8877
9080
|
amount: input.amount.toString(),
|
|
8878
9081
|
transactionPassword: await sha256(input.transactionPassword)
|
|
8879
9082
|
},
|
|
8880
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9083
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9084
|
+
...this.webDomain && {
|
|
9085
|
+
domain: this.webDomain
|
|
9086
|
+
}
|
|
8881
9087
|
});
|
|
8882
9088
|
if (!res.ok) return res;
|
|
8883
9089
|
}
|
|
@@ -8891,7 +9097,10 @@ var Sdk = class {
|
|
|
8891
9097
|
accountName: input.accountName,
|
|
8892
9098
|
transactionPassword: await sha256(input.transactionPassword)
|
|
8893
9099
|
},
|
|
8894
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9100
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9101
|
+
...this.webDomain && {
|
|
9102
|
+
domain: this.webDomain
|
|
9103
|
+
}
|
|
8895
9104
|
});
|
|
8896
9105
|
if (!res.ok) return res;
|
|
8897
9106
|
}
|
|
@@ -8905,7 +9114,10 @@ var Sdk = class {
|
|
|
8905
9114
|
transactionPassword: await sha256(input.transactionPassword),
|
|
8906
9115
|
accountName: input.accountName
|
|
8907
9116
|
},
|
|
8908
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9117
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9118
|
+
...this.webDomain && {
|
|
9119
|
+
domain: this.webDomain
|
|
9120
|
+
}
|
|
8909
9121
|
});
|
|
8910
9122
|
if (!res.ok) return res;
|
|
8911
9123
|
}
|
|
@@ -8916,7 +9128,10 @@ var Sdk = class {
|
|
|
8916
9128
|
amount: input.amount.toString(),
|
|
8917
9129
|
upiId: input.upiId
|
|
8918
9130
|
},
|
|
8919
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9131
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9132
|
+
...this.webDomain && {
|
|
9133
|
+
domain: this.webDomain
|
|
9134
|
+
}
|
|
8920
9135
|
});
|
|
8921
9136
|
if (!res.ok) return res;
|
|
8922
9137
|
}
|
|
@@ -8929,7 +9144,10 @@ var Sdk = class {
|
|
|
8929
9144
|
bankAccountNumber: input.bankAccountNumber,
|
|
8930
9145
|
bankIFSCCode: input.bankIFSCCode
|
|
8931
9146
|
},
|
|
8932
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9147
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9148
|
+
...this.webDomain && {
|
|
9149
|
+
domain: this.webDomain
|
|
9150
|
+
}
|
|
8933
9151
|
});
|
|
8934
9152
|
if (!res.ok) return res;
|
|
8935
9153
|
}
|
|
@@ -8976,6 +9194,9 @@ var Sdk = class {
|
|
|
8976
9194
|
id,
|
|
8977
9195
|
amount: input.amount.toString(),
|
|
8978
9196
|
promo: input.promo
|
|
9197
|
+
},
|
|
9198
|
+
...this.webDomain && {
|
|
9199
|
+
domain: this.webDomain
|
|
8979
9200
|
}
|
|
8980
9201
|
});
|
|
8981
9202
|
if (!res.ok) return res;
|
|
@@ -8987,7 +9208,10 @@ var Sdk = class {
|
|
|
8987
9208
|
amount: input.amount.toString(),
|
|
8988
9209
|
promo: input.promo
|
|
8989
9210
|
},
|
|
8990
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9211
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9212
|
+
...this.webDomain && {
|
|
9213
|
+
domain: this.webDomain
|
|
9214
|
+
}
|
|
8991
9215
|
});
|
|
8992
9216
|
if (!res.ok) return res;
|
|
8993
9217
|
}
|
|
@@ -8998,7 +9222,10 @@ var Sdk = class {
|
|
|
8998
9222
|
amount: input.amount.toString(),
|
|
8999
9223
|
promo: input.promo
|
|
9000
9224
|
},
|
|
9001
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9225
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9226
|
+
...this.webDomain && {
|
|
9227
|
+
domain: this.webDomain
|
|
9228
|
+
}
|
|
9002
9229
|
});
|
|
9003
9230
|
if (!res.ok) return res;
|
|
9004
9231
|
}
|
|
@@ -9009,7 +9236,10 @@ var Sdk = class {
|
|
|
9009
9236
|
amount: input.amount.toString(),
|
|
9010
9237
|
promo: input.promo
|
|
9011
9238
|
},
|
|
9012
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9239
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9240
|
+
...this.webDomain && {
|
|
9241
|
+
domain: this.webDomain
|
|
9242
|
+
}
|
|
9013
9243
|
});
|
|
9014
9244
|
if (!res.ok) return res;
|
|
9015
9245
|
}
|
|
@@ -9021,7 +9251,10 @@ var Sdk = class {
|
|
|
9021
9251
|
promo: input.promo,
|
|
9022
9252
|
redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
|
|
9023
9253
|
},
|
|
9024
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9254
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9255
|
+
...this.webDomain && {
|
|
9256
|
+
domain: this.webDomain
|
|
9257
|
+
}
|
|
9025
9258
|
});
|
|
9026
9259
|
if (!res.ok) return res;
|
|
9027
9260
|
}
|
|
@@ -9033,7 +9266,10 @@ var Sdk = class {
|
|
|
9033
9266
|
promo: input.promo,
|
|
9034
9267
|
redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
|
|
9035
9268
|
},
|
|
9036
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9269
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9270
|
+
...this.webDomain && {
|
|
9271
|
+
domain: this.webDomain
|
|
9272
|
+
}
|
|
9037
9273
|
});
|
|
9038
9274
|
if (!res.ok) return res;
|
|
9039
9275
|
}
|
|
@@ -9045,7 +9281,10 @@ var Sdk = class {
|
|
|
9045
9281
|
promo: input.promo,
|
|
9046
9282
|
redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
|
|
9047
9283
|
},
|
|
9048
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9284
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9285
|
+
...this.webDomain && {
|
|
9286
|
+
domain: this.webDomain
|
|
9287
|
+
}
|
|
9049
9288
|
});
|
|
9050
9289
|
if (!res.ok) return res;
|
|
9051
9290
|
}
|
|
@@ -9057,7 +9296,10 @@ var Sdk = class {
|
|
|
9057
9296
|
promo: input.promo,
|
|
9058
9297
|
redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
|
|
9059
9298
|
},
|
|
9060
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9299
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9300
|
+
...this.webDomain && {
|
|
9301
|
+
domain: this.webDomain
|
|
9302
|
+
}
|
|
9061
9303
|
});
|
|
9062
9304
|
if (!res.ok) return res;
|
|
9063
9305
|
}
|
|
@@ -9068,7 +9310,10 @@ var Sdk = class {
|
|
|
9068
9310
|
amount: input.amount.toString(),
|
|
9069
9311
|
promo: input.promo
|
|
9070
9312
|
},
|
|
9071
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9313
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9314
|
+
...this.webDomain && {
|
|
9315
|
+
domain: this.webDomain
|
|
9316
|
+
}
|
|
9072
9317
|
});
|
|
9073
9318
|
if (!res.ok) return res;
|
|
9074
9319
|
}
|
|
@@ -9079,7 +9324,10 @@ var Sdk = class {
|
|
|
9079
9324
|
amount: input.amount.toString(),
|
|
9080
9325
|
promo: input.promo
|
|
9081
9326
|
},
|
|
9082
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9327
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9328
|
+
...this.webDomain && {
|
|
9329
|
+
domain: this.webDomain
|
|
9330
|
+
}
|
|
9083
9331
|
});
|
|
9084
9332
|
if (!res.ok) return res;
|
|
9085
9333
|
}
|
|
@@ -9092,7 +9340,10 @@ var Sdk = class {
|
|
|
9092
9340
|
referenceImage: input.referenceImage,
|
|
9093
9341
|
promo: input.promo
|
|
9094
9342
|
},
|
|
9095
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9343
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9344
|
+
...this.webDomain && {
|
|
9345
|
+
domain: this.webDomain
|
|
9346
|
+
}
|
|
9096
9347
|
});
|
|
9097
9348
|
if (!res.ok) return res;
|
|
9098
9349
|
}
|
|
@@ -9104,7 +9355,10 @@ var Sdk = class {
|
|
|
9104
9355
|
referenceImage: input.referenceId,
|
|
9105
9356
|
promo: input.promo
|
|
9106
9357
|
},
|
|
9107
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9358
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9359
|
+
...this.webDomain && {
|
|
9360
|
+
domain: this.webDomain
|
|
9361
|
+
}
|
|
9108
9362
|
});
|
|
9109
9363
|
if (!res.ok) return res;
|
|
9110
9364
|
}
|
|
@@ -9117,7 +9371,10 @@ var Sdk = class {
|
|
|
9117
9371
|
cancelRedirectionUrl: input.cancelRedirectionUrl,
|
|
9118
9372
|
successRedirectionUrl: input.successRedirectionUrl
|
|
9119
9373
|
},
|
|
9120
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9374
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9375
|
+
...this.webDomain && {
|
|
9376
|
+
domain: this.webDomain
|
|
9377
|
+
}
|
|
9121
9378
|
});
|
|
9122
9379
|
if (!res.ok) return res;
|
|
9123
9380
|
}
|
|
@@ -9129,7 +9386,10 @@ var Sdk = class {
|
|
|
9129
9386
|
promo: input.promo,
|
|
9130
9387
|
redirectUrl: input.redirectUrl
|
|
9131
9388
|
},
|
|
9132
|
-
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
9389
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse,
|
|
9390
|
+
...this.webDomain && {
|
|
9391
|
+
domain: this.webDomain
|
|
9392
|
+
}
|
|
9133
9393
|
});
|
|
9134
9394
|
if (!res.ok) return res;
|
|
9135
9395
|
}
|
|
@@ -9513,12 +9773,18 @@ var Sdk = class {
|
|
|
9513
9773
|
input: {
|
|
9514
9774
|
id,
|
|
9515
9775
|
game: input.reference
|
|
9776
|
+
},
|
|
9777
|
+
...this.webDomain && {
|
|
9778
|
+
domain: this.webDomain
|
|
9516
9779
|
}
|
|
9517
9780
|
}) : await this.gameService.createGameSession({
|
|
9518
9781
|
input: {
|
|
9519
9782
|
id,
|
|
9520
9783
|
game: input.reference,
|
|
9521
9784
|
homepageUrl: typeof window === "undefined" ? void 0 : input.homepageUrl
|
|
9785
|
+
},
|
|
9786
|
+
...this.webDomain && {
|
|
9787
|
+
domain: this.webDomain
|
|
9522
9788
|
}
|
|
9523
9789
|
});
|
|
9524
9790
|
return res.ok ? { ok: true, data: { id } } : res;
|
|
@@ -9551,12 +9817,18 @@ var Sdk = class {
|
|
|
9551
9817
|
}
|
|
9552
9818
|
const { provider, reference } = res0.data;
|
|
9553
9819
|
const res1 = NEW_GAME_PROVIDERS.includes(provider) ? await this.walletService.createGameSession({
|
|
9554
|
-
input: { id, game: reference }
|
|
9820
|
+
input: { id, game: reference },
|
|
9821
|
+
...this.webDomain && {
|
|
9822
|
+
domain: this.webDomain
|
|
9823
|
+
}
|
|
9555
9824
|
}) : await this.gameService.createGameSession({
|
|
9556
9825
|
input: {
|
|
9557
9826
|
id,
|
|
9558
9827
|
game: reference,
|
|
9559
9828
|
homepageUrl: typeof window === "undefined" ? void 0 : input.homepageUrl
|
|
9829
|
+
},
|
|
9830
|
+
...this.webDomain && {
|
|
9831
|
+
domain: this.webDomain
|
|
9560
9832
|
}
|
|
9561
9833
|
});
|
|
9562
9834
|
return res1.ok ? { ok: true, data: { id } } : res1;
|