@opexa/portal-components 0.0.468 → 0.0.470
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/components/Banner/Banner.client.d.ts +12 -0
- package/dist/components/Banner/Banner.client.js +49 -0
- package/dist/components/DigitainLauncher/Loading.d.ts +1 -0
- package/dist/components/DigitainLauncher/Loading.js +5 -0
- package/dist/components/KYC/BasicInformation.d.ts +1 -0
- package/dist/components/KYC/BasicInformation.js +101 -0
- package/dist/components/KYC/IdentityVerification.d.ts +1 -0
- package/dist/components/KYC/IdentityVerification.js +120 -0
- package/dist/components/KYC/Indicator.d.ts +1 -0
- package/dist/components/KYC/Indicator.js +8 -0
- package/dist/components/KYC/KYC.lazy.d.ts +6 -0
- package/dist/components/KYC/KYC.lazy.js +45 -0
- package/dist/components/KYC/KYCContext.d.ts +6 -0
- package/dist/components/KYC/KYCContext.js +2 -0
- package/dist/components/KYC/PersonalInformation.d.ts +1 -0
- package/dist/components/KYC/PersonalInformation.js +122 -0
- package/dist/components/KYC/useKYC.d.ts +25 -0
- package/dist/components/KYC/useKYC.js +38 -0
- package/dist/components/PortalProvider/CXDTokenObserver.d.ts +1 -0
- package/dist/components/PortalProvider/CXDTokenObserver.js +30 -0
- package/dist/components/Quests/JourneyQuest.d.ts +5 -1
- package/dist/components/Quests/JourneyQuest.js +7 -6
- package/dist/components/Quests/OnboardingQuest.d.ts +5 -1
- package/dist/components/Quests/OnboardingQuest.js +2 -2
- package/dist/components/Quests/Quests.client.d.ts +2 -0
- package/dist/components/Quests/Quests.client.js +5 -1
- package/dist/components/SignIn/utils.d.ts +8 -0
- package/dist/components/SignIn/utils.js +26 -0
- package/dist/constants/Branches.d.ts +2 -0
- package/dist/constants/Branches.js +42 -0
- package/dist/images/responsible-gaming-yellow.png +0 -0
- package/dist/services/wallet.d.ts +53 -53
- package/dist/services/wallet.js +59 -59
- package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +4 -0
- package/dist/third-parties/FacebookPixel/FacebookPixel.js +4 -0
- package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
- package/dist/third-parties/FacebookPixel/api.js +1 -0
- package/dist/third-parties/FacebookPixel/index.d.ts +1 -0
- package/dist/third-parties/FacebookPixel/index.js +1 -0
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +4 -0
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +4 -0
- package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
- package/dist/third-parties/GoogleRecaptcha/api.js +1 -0
- package/dist/third-parties/GoogleRecaptcha/index.d.ts +1 -0
- package/dist/third-parties/GoogleRecaptcha/index.js +1 -0
- package/dist/third-parties/index.d.ts +2 -0
- package/dist/third-parties/index.js +2 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +99 -99
- package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +33 -33
- package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +252 -252
- package/dist/ui/Menu/menu.recipe.d.ts +14 -14
- package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
- package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/PinInput/PinInput.d.ts +12 -12
- package/dist/ui/PinInput/pinInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +55 -55
- package/dist/ui/Popover/popover.recipe.d.ts +5 -5
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/package.json +1 -1
package/dist/services/wallet.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { cache } from
|
|
2
|
-
import { WALLET_GRAPHQL_ENDPOINT } from
|
|
3
|
-
import { parseDecimal } from
|
|
4
|
-
import { graphqlRequest } from
|
|
5
|
-
import { AVAILABLE_PROMOS, BONUS, BONUS_BALANCES, BONUS_IDS, BONUSES, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUS_IDS, CASHBACK_BONUSES, CASHBACKS, CLAIM_CASHBACK_BONUS, CLAIM_SPOT_BONUS, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_INSTAPAY_WITHDRAWAL_NEXT, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_DIRECT_WEBPAY_DEPOSIT,
|
|
6
|
-
import { sha256 } from
|
|
1
|
+
import { cache } from 'react';
|
|
2
|
+
import { WALLET_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
|
+
import { parseDecimal } from '../utils/parseDecimal.js';
|
|
4
|
+
import { graphqlRequest } from './graphqlRequest.js';
|
|
5
|
+
import { AVAILABLE_PROMOS, BONUS, BONUS_BALANCES, BONUS_IDS, BONUSES, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUS_IDS, CASHBACK_BONUSES, CASHBACKS, CLAIM_CASHBACK_BONUS, CLAIM_SPOT_BONUS, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_INSTAPAY_WITHDRAWAL_NEXT, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_DIRECT_WEBPAY_DEPOSIT, CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL, CREATE_GCASH_WITHDRAWAL, CREATE_LIBANGAN_DEPOSIT, CREATE_MANUAL_BANK_DEPOSIT, CREATE_MANUAL_BANK_WITHDRAWAL, CREATE_MANUAL_UPI_DEPOSIT, CREATE_MANUAL_UPI_WITHDRAWAL, CREATE_MAYA_APP_DEPOSIT, CREATE_MAYA_APP_WITHDRAWAL, CREATE_MAYA_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CREATE_PISO_PAY_DEPOSIT, CREATE_PISO_PAY_WITHDRAWAL, CREATE_VENTAJA_WITHDRAWAL, DEPOSIT, END_GAME_SESSION, FAVORITE_GAMES, GAME_SESSION, INSTAPAY_BANK_LIST, MARK_GAME_AS_FAVORITE, MAYA_SESSION, POINTS_WALLET, PROMO, PROMOS, REDEEM_POINTS_TO_CASH, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET } from './queries.js';
|
|
6
|
+
import { sha256 } from './sha256.js';
|
|
7
7
|
export const getPromos = cache(async (options) => {
|
|
8
8
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PROMOS, undefined, {
|
|
9
|
-
cache:
|
|
9
|
+
cache: 'force-cache',
|
|
10
10
|
...options,
|
|
11
11
|
next: {
|
|
12
|
-
tags: [
|
|
12
|
+
tags: ['promos'],
|
|
13
13
|
revalidate: 60,
|
|
14
14
|
...options?.next,
|
|
15
15
|
},
|
|
@@ -18,10 +18,10 @@ export const getPromos = cache(async (options) => {
|
|
|
18
18
|
});
|
|
19
19
|
export const getCashbacks = cache(async (options) => {
|
|
20
20
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACKS, undefined, {
|
|
21
|
-
cache:
|
|
21
|
+
cache: 'force-cache',
|
|
22
22
|
...options,
|
|
23
23
|
next: {
|
|
24
|
-
tags: [
|
|
24
|
+
tags: ['cashbacks'],
|
|
25
25
|
revalidate: 60,
|
|
26
26
|
...options?.next,
|
|
27
27
|
},
|
|
@@ -30,10 +30,10 @@ export const getCashbacks = cache(async (options) => {
|
|
|
30
30
|
});
|
|
31
31
|
export const getPromo = cache(async (id, options) => {
|
|
32
32
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PROMO, { id }, {
|
|
33
|
-
cache:
|
|
33
|
+
cache: 'force-cache',
|
|
34
34
|
...options,
|
|
35
35
|
next: {
|
|
36
|
-
tags: [
|
|
36
|
+
tags: ['promo', id],
|
|
37
37
|
revalidate: 60,
|
|
38
38
|
...options?.next,
|
|
39
39
|
},
|
|
@@ -42,10 +42,10 @@ export const getPromo = cache(async (id, options) => {
|
|
|
42
42
|
});
|
|
43
43
|
export const getCashback = cache(async (id, options) => {
|
|
44
44
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACK, { id }, {
|
|
45
|
-
cache:
|
|
45
|
+
cache: 'force-cache',
|
|
46
46
|
...options,
|
|
47
47
|
next: {
|
|
48
|
-
tags: [
|
|
48
|
+
tags: ['cashback', id],
|
|
49
49
|
revalidate: 60,
|
|
50
50
|
...options?.next,
|
|
51
51
|
},
|
|
@@ -88,12 +88,12 @@ export const getWallet = cache(async (options) => {
|
|
|
88
88
|
graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUS_BALANCES, undefined, options),
|
|
89
89
|
]);
|
|
90
90
|
return {
|
|
91
|
-
balance: res0.status ===
|
|
92
|
-
bonus: res1.status ===
|
|
93
|
-
? res1.value.bonuses
|
|
91
|
+
balance: res0.status === 'fulfilled' ? (res0.value.wallet?.balance ?? '0') : '0',
|
|
92
|
+
bonus: res1.status === 'fulfilled'
|
|
93
|
+
? (res1.value.bonuses
|
|
94
94
|
?.reduce((total, n) => total + parseDecimal(n.balance, 0), 0)
|
|
95
|
-
.toString() ??
|
|
96
|
-
:
|
|
95
|
+
.toString() ?? '0')
|
|
96
|
+
: '0',
|
|
97
97
|
};
|
|
98
98
|
});
|
|
99
99
|
export const getDeposit = cache(async (id, options) => {
|
|
@@ -240,10 +240,10 @@ export const createPisoPayWithdrawal = async (input, options) => {
|
|
|
240
240
|
input: others,
|
|
241
241
|
transactionPassword: await sha256(transactionPassword),
|
|
242
242
|
}, options);
|
|
243
|
-
if (res.
|
|
243
|
+
if (res.createPisoPayRemittanceWithdrawal) {
|
|
244
244
|
const error = new Error();
|
|
245
|
-
error.name = res.
|
|
246
|
-
error.message = ERROR_CODES_MESSAGE_MAP[res.
|
|
245
|
+
error.name = res.createPisoPayRemittanceWithdrawal.name;
|
|
246
|
+
error.message = ERROR_CODES_MESSAGE_MAP[res.createPisoPayRemittanceWithdrawal.name];
|
|
247
247
|
Error.captureStackTrace?.(error, createGCashWithdrawal);
|
|
248
248
|
throw error;
|
|
249
249
|
}
|
|
@@ -359,11 +359,11 @@ export const createManualBankWithdrawal = async (input, options) => {
|
|
|
359
359
|
};
|
|
360
360
|
export const getInstapayBankList = cache(async (options) => {
|
|
361
361
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, INSTAPAY_BANK_LIST, undefined, {
|
|
362
|
-
cache:
|
|
362
|
+
cache: 'force-cache',
|
|
363
363
|
...options,
|
|
364
364
|
next: {
|
|
365
365
|
revalidate: 60 * 60 * 4,
|
|
366
|
-
tags: [
|
|
366
|
+
tags: ['instapayBankList'],
|
|
367
367
|
},
|
|
368
368
|
});
|
|
369
369
|
return res.instapayBankList;
|
|
@@ -408,8 +408,8 @@ export const endGameSession = async (id, options) => {
|
|
|
408
408
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, END_GAME_SESSION, { input: { id } }, options);
|
|
409
409
|
if (!res.endGameSession) {
|
|
410
410
|
const error = new Error();
|
|
411
|
-
error.name =
|
|
412
|
-
error.message =
|
|
411
|
+
error.name = 'UnknownError';
|
|
412
|
+
error.message = 'Something went wrong';
|
|
413
413
|
Error.captureStackTrace?.(error, endGameSession);
|
|
414
414
|
throw error;
|
|
415
415
|
}
|
|
@@ -418,8 +418,8 @@ export const validateMayaSession = async (options) => {
|
|
|
418
418
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, VALIDATE_MAYA_SESSION, undefined, options);
|
|
419
419
|
if (!res.validateMayaSession) {
|
|
420
420
|
const error = new Error();
|
|
421
|
-
error.name =
|
|
422
|
-
error.message =
|
|
421
|
+
error.name = 'UnknownError';
|
|
422
|
+
error.message = 'Something went wrong';
|
|
423
423
|
Error.captureStackTrace?.(error, validateMayaSession);
|
|
424
424
|
throw error;
|
|
425
425
|
}
|
|
@@ -446,8 +446,8 @@ export const touchGCashDeposit = async (id, options) => {
|
|
|
446
446
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, TOUCH_GCASH_DEPOSIT, { input: { id } }, options);
|
|
447
447
|
if (!res.touchGCashDeposit) {
|
|
448
448
|
const error = new Error();
|
|
449
|
-
error.name =
|
|
450
|
-
error.message =
|
|
449
|
+
error.name = 'UnknownError';
|
|
450
|
+
error.message = 'Something went wrong';
|
|
451
451
|
Error.captureStackTrace?.(error, touchGCashDeposit);
|
|
452
452
|
throw error;
|
|
453
453
|
}
|
|
@@ -456,8 +456,8 @@ export const touchQRPHDeposit = async (id, options) => {
|
|
|
456
456
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, TOUCH_QRPH_DEPOSIT, { input: { id } }, options);
|
|
457
457
|
if (!res.touchQRPHDeposit) {
|
|
458
458
|
const error = new Error();
|
|
459
|
-
error.name =
|
|
460
|
-
error.message =
|
|
459
|
+
error.name = 'UnknownError';
|
|
460
|
+
error.message = 'Something went wrong';
|
|
461
461
|
Error.captureStackTrace?.(error, touchQRPHDeposit);
|
|
462
462
|
throw error;
|
|
463
463
|
}
|
|
@@ -466,8 +466,8 @@ export const markGameAsFavorite = async (id, options) => {
|
|
|
466
466
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, MARK_GAME_AS_FAVORITE, { input: { id } }, options);
|
|
467
467
|
if (!res.markGameAsFavorite) {
|
|
468
468
|
const error = new Error();
|
|
469
|
-
error.name =
|
|
470
|
-
error.message =
|
|
469
|
+
error.name = 'UnknownError';
|
|
470
|
+
error.message = 'Something went wrong';
|
|
471
471
|
Error.captureStackTrace?.(error, markGameAsFavorite);
|
|
472
472
|
throw error;
|
|
473
473
|
}
|
|
@@ -476,8 +476,8 @@ export const unmarkGameAsFavorite = async (id, options) => {
|
|
|
476
476
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, UNMARK_GAME_AS_FAVORITE, { input: { id } }, options);
|
|
477
477
|
if (!res.unmarkGameAsFavorite) {
|
|
478
478
|
const error = new Error();
|
|
479
|
-
error.name =
|
|
480
|
-
error.message =
|
|
479
|
+
error.name = 'UnknownError';
|
|
480
|
+
error.message = 'Something went wrong';
|
|
481
481
|
Error.captureStackTrace?.(error, unmarkGameAsFavorite);
|
|
482
482
|
throw error;
|
|
483
483
|
}
|
|
@@ -487,27 +487,27 @@ export const getFavoriteGames = cache(async (options) => {
|
|
|
487
487
|
return res.favoriteGames;
|
|
488
488
|
});
|
|
489
489
|
const ERROR_CODES_MESSAGE_MAP = {
|
|
490
|
-
PointsNotDivisibleBy100Error:
|
|
491
|
-
MaximumBonusesCountLimitExceededError:
|
|
492
|
-
InvalidPromoCodeError:
|
|
493
|
-
SpotBonusAlreadyClaimedError:
|
|
494
|
-
AccountNotVerifiedError:
|
|
495
|
-
CashbackBonusDoesNotExistError:
|
|
496
|
-
DepositPromoMaximumAmountExceededError:
|
|
497
|
-
DepositPromoMinimumAmountNotMetError:
|
|
498
|
-
GameDoesNotExistError:
|
|
499
|
-
InsufficientPointsError:
|
|
500
|
-
InvalidTransactionPasswordError:
|
|
501
|
-
InvalidWithdrawalAmountError:
|
|
502
|
-
MaximumDepositAmountExceededError:
|
|
503
|
-
MinimumDepositAmountNotMetError:
|
|
504
|
-
MinimumFirstDepositAmountNotMetError:
|
|
505
|
-
MobileNumberNotVerifiedError:
|
|
506
|
-
NotEnoughBalanceError:
|
|
507
|
-
PromoNotEnabledError:
|
|
508
|
-
WalletDoesNotExistError:
|
|
509
|
-
WithdrawalDailyLimitExceededError:
|
|
510
|
-
ReCAPTCHAVerificationFailedError:
|
|
511
|
-
UPIReferenceNotAvailableError:
|
|
512
|
-
GCashDirectApiRequestError:
|
|
490
|
+
PointsNotDivisibleBy100Error: 'Please input points that are multiples of 100.',
|
|
491
|
+
MaximumBonusesCountLimitExceededError: 'Maximum bonuses reached',
|
|
492
|
+
InvalidPromoCodeError: 'Invalid Promo Code',
|
|
493
|
+
SpotBonusAlreadyClaimedError: 'This promo code has already been redeemed and cannot be used again',
|
|
494
|
+
AccountNotVerifiedError: 'Account is not verified',
|
|
495
|
+
CashbackBonusDoesNotExistError: 'Cashback bonus does not exists',
|
|
496
|
+
DepositPromoMaximumAmountExceededError: 'Deposit amount exceeds maximum amount for selected promo',
|
|
497
|
+
DepositPromoMinimumAmountNotMetError: 'Deposit amount does not meet minimum amount for selected promo',
|
|
498
|
+
GameDoesNotExistError: 'Game does not exist',
|
|
499
|
+
InsufficientPointsError: 'Insufficient points',
|
|
500
|
+
InvalidTransactionPasswordError: 'Invalid transaction password',
|
|
501
|
+
InvalidWithdrawalAmountError: 'Invalid withdrawal amount',
|
|
502
|
+
MaximumDepositAmountExceededError: 'Maximum deposit amount exceeded',
|
|
503
|
+
MinimumDepositAmountNotMetError: 'Minimum deposit amount not met',
|
|
504
|
+
MinimumFirstDepositAmountNotMetError: 'Minimum first deposit amount not met',
|
|
505
|
+
MobileNumberNotVerifiedError: 'Mobile number is not verified',
|
|
506
|
+
NotEnoughBalanceError: 'Insufficient balance',
|
|
507
|
+
PromoNotEnabledError: 'Promo is not enabled',
|
|
508
|
+
WalletDoesNotExistError: 'Wallet does not exist',
|
|
509
|
+
WithdrawalDailyLimitExceededError: 'Daily withdrawal limit exceeded',
|
|
510
|
+
ReCAPTCHAVerificationFailedError: 'Invalid reCAPTCHA',
|
|
511
|
+
UPIReferenceNotAvailableError: 'UPI reference is no longer available',
|
|
512
|
+
GCashDirectApiRequestError: 'GCash direct API request error',
|
|
513
513
|
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FacebookPixel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FacebookPixel.js';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GoogleRecaptcha';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GoogleRecaptcha.js';
|