@opexa/portal-components 0.0.98 → 0.0.100
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/client/hooks/useAccountQuery.js +3 -3
- package/dist/client/hooks/useAuthenticateMutation.d.ts +1 -1
- package/dist/client/hooks/useAuthenticateMutation.js +3 -2
- package/dist/client/hooks/useAvailablePromosQuery.d.ts +1 -1
- package/dist/client/hooks/useAvailablePromosQuery.js +3 -3
- package/dist/client/hooks/useAvailableQuestsCountQuery.js +3 -3
- package/dist/client/hooks/useAvailableQuestsQuery.js +3 -3
- package/dist/client/hooks/useBetRecordsQuery.d.ts +1 -1
- package/dist/client/hooks/useBetRecordsQuery.js +3 -3
- package/dist/client/hooks/useBonusQuery.js +3 -3
- package/dist/client/hooks/useBonusesCountQuery.js +3 -3
- package/dist/client/hooks/useBonusesQuery.js +3 -3
- package/dist/client/hooks/useCashbackBonusQuery.js +3 -3
- package/dist/client/hooks/useCashbackBonusesCountQuery.js +3 -3
- package/dist/client/hooks/useCashbackBonusesQuery.js +3 -3
- package/dist/client/hooks/useCashbackQuery.js +2 -2
- package/dist/client/hooks/useCashbacksQuery.js +2 -2
- package/dist/client/hooks/useCheckInDailyCheckInQuestMutation.js +3 -3
- package/dist/client/hooks/useClaimCashbackBonusMutation.js +4 -3
- package/dist/client/hooks/useClaimSpotBonusMutation.js +4 -3
- package/dist/client/hooks/useCreateGCashDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateGCashDepositMutation.js +5 -3
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.js +3 -3
- package/dist/client/hooks/useCreateGameSessionMutation.js +5 -3
- package/dist/client/hooks/useCreateInstapayWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateInstapayWithdrawalMutation.js +3 -3
- package/dist/client/hooks/useCreateMayaAppDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaAppDepositMutation.js +5 -3
- package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.js +3 -3
- package/dist/client/hooks/useCreateMayaDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaDepositMutation.js +5 -3
- package/dist/client/hooks/useCreateMayaWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaWithdrawalMutation.js +3 -3
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +5 -3
- package/dist/client/hooks/useCreateQRPHDepositMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateQRPHDepositMutation.js +5 -3
- package/dist/client/hooks/useDepositQuery.js +3 -3
- package/dist/client/hooks/useDepositRecordsQuery.d.ts +1 -1
- package/dist/client/hooks/useDepositRecordsQuery.js +3 -3
- package/dist/client/hooks/useDepositsCountQuery.js +3 -3
- package/dist/client/hooks/useEndGameSessionMutation.js +4 -3
- package/dist/client/hooks/useFavoriteGamesQuery.js +3 -3
- package/dist/client/hooks/useGamesQuery.d.ts +1 -1
- package/dist/client/hooks/useGamesQuery.js +2 -2
- package/dist/client/hooks/useGlobalStore.d.ts +3 -0
- package/dist/client/hooks/useGlobalStore.js +41 -1
- package/dist/client/hooks/useInstapayBankListQuery.js +3 -3
- package/dist/client/hooks/useIsMayaSessionValidQuery.js +5 -5
- package/dist/client/hooks/useJackpotPayoutsQuery.d.ts +1 -1
- package/dist/client/hooks/useJackpotPayoutsQuery.js +2 -2
- package/dist/client/hooks/useJackpotsCountQuery.d.ts +1 -1
- package/dist/client/hooks/useJackpotsCountQuery.js +2 -2
- package/dist/client/hooks/useJackpotsQuery.d.ts +1 -1
- package/dist/client/hooks/useJackpotsQuery.js +2 -2
- package/dist/client/hooks/useLocaleInfo.d.ts +1 -1
- package/dist/client/hooks/useLocaleInfo.js +1 -1
- package/dist/client/hooks/useMarkGameAsFavoriteMutation.js +4 -3
- package/dist/client/hooks/useMarkMessageAsReadMutation.js +4 -3
- package/dist/client/hooks/useMemberVerificationQuery.js +3 -3
- package/dist/client/hooks/useMessagesQuery.d.ts +1 -1
- package/dist/client/hooks/useMessagesQuery.js +3 -3
- package/dist/client/hooks/usePaymentSettingsQuery.js +3 -3
- package/dist/client/hooks/usePlatformQuery.js +2 -2
- package/dist/client/hooks/useProfileCompletionQuery.js +3 -3
- package/dist/client/hooks/usePromoQuery.js +2 -2
- package/dist/client/hooks/usePromosQuery.js +2 -2
- package/dist/client/hooks/useSendVerificationCodeMutation.d.ts +1 -1
- package/dist/client/hooks/useSendVerificationCodeMutation.js +2 -2
- package/dist/client/hooks/useSessionQuery.js +4 -4
- package/dist/client/hooks/useSignInMutation.d.ts +1 -1
- package/dist/client/hooks/useSignInMutation.js +3 -2
- package/dist/client/hooks/useSignOutMutation.js +3 -2
- package/dist/client/hooks/useSignUpMutation.d.ts +1 -1
- package/dist/client/hooks/useSignUpMutation.js +2 -2
- package/dist/client/hooks/useTopWinsQuery.js +2 -2
- package/dist/client/hooks/useTournamentsCountQuery.d.ts +1 -1
- package/dist/client/hooks/useTournamentsCountQuery.js +2 -2
- package/dist/client/hooks/useTournamentsQuery.d.ts +1 -1
- package/dist/client/hooks/useTournamentsQuery.js +2 -2
- package/dist/client/hooks/useTransactionRecordsQuery.d.ts +1 -1
- package/dist/client/hooks/useTransactionRecordsQuery.js +3 -3
- package/dist/client/hooks/useUnmarkGameAsFavoriteMutation.js +4 -3
- package/dist/client/hooks/useUnreadMessagesCountQuery.d.ts +1 -1
- package/dist/client/hooks/useUnreadMessagesCountQuery.js +3 -3
- package/dist/client/hooks/useUpdateAccountMutation.d.ts +1 -1
- package/dist/client/hooks/useUpdateAccountMutation.js +4 -3
- package/dist/client/hooks/useWalletQuery.js +3 -3
- package/dist/client/hooks/useWithdrawalRecordsQuery.d.ts +1 -1
- package/dist/client/hooks/useWithdrawalRecordsQuery.js +3 -3
- package/dist/client/services/authenticate.d.ts +1 -1
- package/dist/client/services/signIn.d.ts +1 -1
- package/dist/client/utils/createRecipeContext.js +1 -1
- package/dist/client/utils/toaster.d.ts +1 -1
- package/dist/client/utils/toaster.js +1 -1
- package/dist/components/Account/Account.d.ts +3 -23
- package/dist/components/Account/Account.js +10 -115
- package/dist/components/Account/Account.lazy.d.ts +23 -0
- package/dist/components/Account/Account.lazy.js +138 -0
- package/dist/components/Account/AccountTrigger.js +2 -2
- package/dist/components/AccountInfo/AccountInfo.js +10 -4
- package/dist/components/AccountSecurity/AccountSecurity.js +13 -4
- package/dist/components/AccountVerification/AccountVerification.js +12 -3
- package/dist/components/Banner/Banner.d.ts +2 -2
- package/dist/components/Banner/Banner.js +2 -2
- package/dist/components/BetRecords/BetRecords.client.d.ts +7 -0
- package/dist/components/BetRecords/BetRecords.client.js +189 -0
- package/dist/components/BetRecords/BetRecords.d.ts +3 -7
- package/dist/components/BetRecords/BetRecords.js +8 -174
- package/dist/components/Bonus/Bonus.client.d.ts +9 -1
- package/dist/components/Bonus/Bonus.client.js +13 -4
- package/dist/components/Bonus/Bonus.d.ts +2 -9
- package/dist/components/Bonus/Bonus.js +22 -6
- package/dist/components/Bonuses/Bonuses.client.d.ts +9 -1
- package/dist/components/Bonuses/Bonuses.client.js +14 -4
- package/dist/components/Bonuses/Bonuses.d.ts +2 -9
- package/dist/components/Bonuses/Bonuses.js +3 -2
- package/dist/components/Bonuses/BonusesTrigger.js +7 -6
- package/dist/components/Cashback/Cashback.client.d.ts +6 -1
- package/dist/components/Cashback/Cashback.client.js +7 -3
- package/dist/components/Cashback/Cashback.d.ts +2 -6
- package/dist/components/Cashback/Cashback.js +11 -6
- package/dist/components/DepositWithdrawal/AmountChoices.js +5 -3
- package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.js +5 -3
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +6 -3
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +15 -4
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +15 -4
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +15 -4
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.js +5 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositDetails.js +5 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +10 -4
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.js +2 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +5 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +4 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +10 -4
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.js +2 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.d.ts +1 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.js +10 -27
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.d.ts +1 -0
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +36 -0
- package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.js +5 -2
- package/dist/components/DepositWithdrawal/PaymentMethods.js +4 -3
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +17 -4
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +18 -4
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +15 -4
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +17 -4
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +11 -4
- package/dist/components/Disclaimer/DisclaimerV1.js +2 -1
- package/dist/components/Disclaimer/DisclaimerV2.js +2 -1
- package/dist/components/Disclaimer/ResponsibleGaming.js +2 -1
- package/dist/components/Disclaimer/TermsOfUse.js +3 -2
- package/dist/components/Empty.d.ts +1 -2
- package/dist/components/FavoriteGames/FavoriteGames.client.d.ts +5 -1
- package/dist/components/FavoriteGames/FavoriteGames.client.js +8 -4
- package/dist/components/FavoriteGames/FavoriteGames.d.ts +2 -5
- package/dist/components/FavoriteGames/FavoriteGames.js +2 -2
- package/dist/components/GameLaunch/GameLaunch.d.ts +1 -1
- package/dist/components/GameLaunch/GameLaunch.js +10 -71
- package/dist/components/GameLaunch/GameLaunch.lazy.d.ts +1 -0
- package/dist/components/GameLaunch/GameLaunch.lazy.js +90 -0
- package/dist/components/GameLaunch/GameLaunchTrigger.js +4 -2
- package/dist/components/GameProviders/GameProvidersCarousel.js +5 -3
- package/dist/components/GameProviders/GameProvidersList.js +4 -3
- package/dist/components/Games/Game.js +14 -5
- package/dist/components/Games/GamesCarousel.client.d.ts +24 -1
- package/dist/components/Games/GamesCarousel.client.js +7 -3
- package/dist/components/Games/GamesCarousel.d.ts +2 -23
- package/dist/components/Games/GamesCarousel.js +2 -2
- package/dist/components/Games/GamesContext.js +1 -1
- package/dist/components/Games/GamesList.client.d.ts +19 -1
- package/dist/components/Games/GamesList.client.js +6 -3
- package/dist/components/Games/GamesList.d.ts +2 -18
- package/dist/components/Games/GamesList.js +1 -1
- package/dist/components/GamesSearch/GamesSearch.d.ts +1 -1
- package/dist/components/GamesSearch/GamesSearch.js +10 -4
- package/dist/components/Jackpots/Jackpots.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +6 -4
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselContext.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +9 -3
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +2 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListContext.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +8 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +3 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +12 -3
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemRules.js +2 -2
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.d.ts +1 -1
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +3 -2
- package/dist/components/KYC/Header.js +4 -2
- package/dist/components/KYC/Indicator.js +2 -2
- package/dist/components/KYC/KYC.d.ts +1 -1
- package/dist/components/KYC/KYC.js +10 -22
- package/dist/components/KYC/KYC.lazy.d.ts +1 -0
- package/dist/components/KYC/KYC.lazy.js +26 -0
- package/dist/components/KYC/KYCContext.js +1 -1
- package/dist/components/KYC/KYCTrigger.js +1 -1
- package/dist/components/KYC/Step1.js +3 -2
- package/dist/components/KYC/Step2.js +3 -2
- package/dist/components/KYC/Step3.js +4 -2
- package/dist/components/KYC/Step4.js +3 -2
- package/dist/components/Messages/Message.js +3 -1
- package/dist/components/Messages/MessageContext.js +1 -1
- package/dist/components/Messages/MessagePopup.js +3 -3
- package/dist/components/Messages/MessageTrigger.js +2 -1
- package/dist/components/Messages/Messages.d.ts +3 -13
- package/dist/components/Messages/Messages.js +10 -35
- package/dist/components/Messages/Messages.lazy.d.ts +13 -0
- package/dist/components/Messages/Messages.lazy.js +48 -0
- package/dist/components/Messages/MessagesTrigger.js +7 -4
- package/dist/components/Messages/utils.d.ts +1 -1
- package/dist/components/Messages/utils.js +1 -1
- package/dist/components/PortalProvider/PortalProvider.js +8 -5
- package/dist/components/PortalProvider/Providers.js +1 -1
- package/dist/components/PortalProvider/Snackbar.js +4 -3
- package/dist/components/Promo/Promo.client.d.ts +6 -1
- package/dist/components/Promo/Promo.client.js +7 -3
- package/dist/components/Promo/Promo.d.ts +2 -6
- package/dist/components/Promo/Promo.js +11 -6
- package/dist/components/Promos/Cashback.js +3 -2
- package/dist/components/Promos/Promo.js +3 -2
- package/dist/components/Promos/Promos.js +3 -2
- package/dist/components/Promos/PromosCarousel.js +7 -3
- package/dist/components/Promos/PromosGrid.js +2 -1
- package/dist/components/Protected/Protected.d.ts +1 -2
- package/dist/components/Protected/Protected.js +1 -1
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +10 -5
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +3 -2
- package/dist/components/Quests/Quests.client.d.ts +5 -1
- package/dist/components/Quests/Quests.client.js +2 -2
- package/dist/components/Quests/Quests.d.ts +2 -5
- package/dist/components/Quests/Quests.js +1 -1
- package/dist/components/Quests/WageringQuest/WageringQuest.js +3 -2
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +3 -2
- package/dist/components/Search/Search.d.ts +3 -21
- package/dist/components/Search/Search.js +10 -64
- package/dist/components/Search/Search.lazy.d.ts +20 -0
- package/dist/components/Search/Search.lazy.js +78 -0
- package/dist/components/Search/SearchTrigger.js +1 -1
- package/dist/components/SignIn/MobileNumberSignIn.js +16 -5
- package/dist/components/SignIn/NameAndPasswordSignIn.js +16 -7
- package/dist/components/SignIn/SignIn.d.ts +3 -7
- package/dist/components/SignIn/SignIn.js +10 -14
- package/dist/components/SignIn/SignIn.lazy.d.ts +7 -0
- package/dist/components/SignIn/SignIn.lazy.js +18 -0
- package/dist/components/SignIn/SignInContext.js +1 -1
- package/dist/components/SignIn/SignInMethod.js +1 -1
- package/dist/components/SignIn/SignInTrigger.js +1 -1
- package/dist/components/SignUp/SignUp.d.ts +3 -7
- package/dist/components/SignUp/SignUp.js +10 -12
- package/dist/components/SignUp/SignUp.lazy.d.ts +7 -0
- package/dist/components/SignUp/SignUp.lazy.js +16 -0
- package/dist/components/SignUp/SignUpForm.js +15 -5
- package/dist/components/SignUp/SignUpTrigger.js +1 -1
- package/dist/components/TopWins/TopWins.client.d.ts +5 -1
- package/dist/components/TopWins/TopWins.client.js +8 -3
- package/dist/components/TopWins/TopWins.d.ts +2 -5
- package/dist/components/TopWins/TopWins.js +1 -1
- package/dist/components/Tournaments/Tournaments.js +1 -1
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.js +6 -4
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselContext.js +1 -1
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.js +8 -3
- package/dist/components/Tournaments/TournamentsList/TournamentsList.js +2 -2
- package/dist/components/Tournaments/TournamentsList/TournamentsListContext.js +1 -1
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.js +7 -2
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +3 -2
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.js +10 -3
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemRules.js +3 -2
- package/dist/components/Tournaments/TournamentsList/useTournamentListItemData.d.ts +1 -1
- package/dist/components/Tournaments/TournamentsList/useTournamentListItemData.js +1 -1
- package/dist/components/TransactionRecords/DepositRecordsTable.js +12 -4
- package/dist/components/TransactionRecords/TableFilters.js +9 -4
- package/dist/components/TransactionRecords/TransactionRecords.d.ts +1 -1
- package/dist/components/TransactionRecords/TransactionRecords.js +7 -2
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +11 -4
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +12 -4
- package/dist/constants/endpoints.js +2 -2
- package/dist/handlers.js +1 -1
- package/dist/middleware.js +1 -1
- package/dist/server/services/authenticate.d.ts +1 -1
- package/dist/server/services/authenticate.js +1 -1
- package/dist/server/services/signIn.d.ts +1 -1
- package/dist/server/services/signIn.js +1 -1
- package/dist/server/services/signOut.js +1 -1
- package/dist/server/utils/prefetchAccountQuery.js +3 -2
- package/dist/server/utils/prefetchAvailablePromosQuery.d.ts +1 -1
- package/dist/server/utils/prefetchAvailablePromosQuery.js +3 -2
- package/dist/server/utils/prefetchAvailableQuestsCountQuery.js +3 -2
- package/dist/server/utils/prefetchAvailableQuestsQuery.js +3 -2
- package/dist/server/utils/prefetchBetRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchBetRecordsQuery.js +3 -2
- package/dist/server/utils/prefetchBonusQuery.js +3 -2
- package/dist/server/utils/prefetchBonusesCountQuery.js +3 -2
- package/dist/server/utils/prefetchBonusesQuery.js +3 -2
- package/dist/server/utils/prefetchCashbackBonusQuery.js +3 -2
- package/dist/server/utils/prefetchCashbackBonusesCountQuery.js +4 -3
- package/dist/server/utils/prefetchCashbackBonusesQuery.js +4 -3
- package/dist/server/utils/prefetchCashbackQuery.js +3 -2
- package/dist/server/utils/prefetchCashbacksQuery.js +3 -2
- package/dist/server/utils/prefetchDepositQuery.js +3 -2
- package/dist/server/utils/prefetchDepositRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchDepositRecordsQuery.js +3 -2
- package/dist/server/utils/prefetchDepositsCountQuery.js +3 -2
- package/dist/server/utils/prefetchFavoriteGamesQuery.js +4 -3
- package/dist/server/utils/prefetchGamesQuery.d.ts +1 -1
- package/dist/server/utils/prefetchGamesQuery.js +3 -2
- package/dist/server/utils/prefetchInstapayBankListQuery.js +3 -2
- package/dist/server/utils/prefetchIsMayaSessionValidQuery.js +3 -2
- package/dist/server/utils/prefetchJackpotsCountQuery.d.ts +1 -1
- package/dist/server/utils/prefetchJackpotsCountQuery.js +3 -2
- package/dist/server/utils/prefetchJackpotsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchJackpotsQuery.js +3 -2
- package/dist/server/utils/prefetchMemberVerificationQuery.js +3 -2
- package/dist/server/utils/prefetchPaymentSettingsQuery.js +3 -2
- package/dist/server/utils/prefetchPlatformQuery.js +3 -2
- package/dist/server/utils/prefetchProfileCompletionQuery.js +3 -2
- package/dist/server/utils/prefetchPromoQuery.js +3 -2
- package/dist/server/utils/prefetchPromosQuery.js +3 -2
- package/dist/server/utils/prefetchSessionQuery.js +2 -1
- package/dist/server/utils/prefetchTopWinsQuery.js +3 -2
- package/dist/server/utils/prefetchTournamentsCountQuery.d.ts +1 -1
- package/dist/server/utils/prefetchTournamentsCountQuery.js +3 -2
- package/dist/server/utils/prefetchTournamentsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchTournamentsQuery.js +3 -2
- package/dist/server/utils/prefetchTransactionRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchTransactionRecordsQuery.js +3 -2
- package/dist/server/utils/prefetchUnreadMessagesCountQuery.d.ts +1 -1
- package/dist/server/utils/prefetchUnreadMessagesCountQuery.js +3 -2
- package/dist/server/utils/prefetchWalletQuery.js +3 -2
- package/dist/server/utils/prefetchWithdrawalRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchWithdrawalRecordsQuery.js +3 -2
- package/dist/services/account.d.ts +341 -0
- package/dist/services/account.js +233 -0
- package/dist/services/auth.d.ts +80 -0
- package/dist/services/auth.js +152 -0
- package/dist/services/cmsPortal.d.ts +43 -0
- package/dist/services/cmsPortal.js +148 -0
- package/dist/services/file.d.ts +33 -0
- package/dist/services/file.js +18 -0
- package/dist/services/game.d.ts +44 -0
- package/dist/services/game.js +33 -0
- package/dist/services/graphqlRequest.js +0 -16
- package/dist/services/httpRequest.js +0 -10
- package/dist/services/portal.d.ts +37 -0
- package/dist/services/portal.js +44 -0
- package/dist/services/report.d.ts +223 -0
- package/dist/services/report.js +72 -0
- package/dist/services/trigger.d.ts +94 -0
- package/dist/services/trigger.js +88 -0
- package/dist/services/wallet.d.ts +475 -0
- package/dist/services/wallet.js +365 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
- package/dist/ui/AlertDialog/AlertDialog.js +1 -1
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
- package/dist/ui/AlertDialog/alertDialog.recipe.js +1 -1
- package/dist/ui/Avatar/Avatar.js +1 -1
- package/dist/ui/Avatar/avatar.recipe.js +1 -1
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/Badge.js +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Badge/badge.recipe.js +1 -1
- package/dist/ui/Button/Button.js +2 -1
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/Checkbox.js +1 -1
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/checkbox.recipe.js +1 -1
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/Clipboard.js +1 -1
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/clipboard.recipe.js +1 -1
- package/dist/ui/Collapsible/Collapsible.d.ts +32 -32
- package/dist/ui/Collapsible/Collapsible.js +1 -1
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +8 -8
- package/dist/ui/Collapsible/collapsible.recipe.js +1 -1
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/Combobox.js +1 -1
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/Combobox/combobox.recipe.js +1 -1
- package/dist/ui/DatePicker/DatePicker.d.ts +336 -336
- package/dist/ui/DatePicker/DatePicker.js +1 -1
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +14 -14
- package/dist/ui/DatePicker/datePicker.recipe.js +1 -1
- package/dist/ui/Dialog/Dialog.d.ts +154 -154
- package/dist/ui/Dialog/Dialog.js +1 -1
- package/dist/ui/Dialog/dialog.recipe.d.ts +14 -14
- package/dist/ui/Dialog/dialog.recipe.js +1 -1
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/Drawer.js +1 -1
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Drawer/drawer.recipe.js +1 -1
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/Field.js +1 -1
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Field/field.recipe.js +1 -1
- package/dist/ui/IconButton/IconButton.js +2 -1
- package/dist/ui/NumberInput/NumberInput.js +1 -1
- package/dist/ui/NumberInput/numberInput.recipe.js +1 -1
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/PasswordInput.js +1 -1
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/passwordInput.recipe.js +1 -1
- package/dist/ui/PinInput/PinInput.js +1 -1
- package/dist/ui/PinInput/pinInput.recipe.js +1 -1
- package/dist/ui/Popover/Popover.d.ts +121 -121
- package/dist/ui/Popover/Popover.js +1 -1
- package/dist/ui/Popover/popover.recipe.d.ts +11 -11
- package/dist/ui/Popover/popover.recipe.js +1 -1
- package/dist/ui/Presence.d.ts +1 -1
- package/dist/ui/Presence.js +1 -1
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/Progress.js +1 -1
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/Progress/progress.recipe.js +1 -1
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/SegmentGroup.js +1 -1
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/SegmentGroup/segmentGroup.recipe.js +1 -1
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/Select.js +1 -1
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Select/select.recipe.js +1 -1
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/Table.js +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Table/table.recipe.js +1 -1
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/Tabs.js +1 -1
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/ui/Tabs/tabs.recipe.js +1 -1
- package/dist/utils/getQueryClient.js +2 -2
- package/dist/utils/onMobileDevice.d.ts +5 -0
- package/dist/utils/onMobileDevice.js +9 -0
- package/dist/utils/queryKeys.d.ts +4 -1
- package/package.json +29 -30
- package/dist/client/hooks/index.d.ts +0 -70
- package/dist/client/hooks/index.js +0 -70
- package/dist/client/services/index.d.ts +0 -4
- package/dist/client/services/index.js +0 -4
- package/dist/client/utils/index.d.ts +0 -3
- package/dist/client/utils/index.js +0 -3
- package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
- package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
- package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
- package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
- package/dist/components/JackpotCounter/index.d.ts +0 -1
- package/dist/components/JackpotCounter/index.js +0 -1
- package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
- package/dist/components/Jackpots/JackpotDesktop.js +0 -45
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
- package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
- package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
- package/dist/components/Jackpots/JackpotMobile.js +0 -46
- package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
- package/dist/components/Jackpots/JackpotRules.js +0 -11
- package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
- package/dist/components/Jackpots/Jackpots.client.js +0 -29
- package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
- package/dist/components/Jackpots/JackpotsContext.js +0 -3
- package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
- package/dist/components/Jackpots/useJackpotData.js +0 -92
- package/dist/components/PortalProvider/WebVitals.d.ts +0 -1
- package/dist/components/PortalProvider/WebVitals.js +0 -8
- package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
- package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
- package/dist/components/TournamentCounter/index.d.ts +0 -1
- package/dist/components/TournamentCounter/index.js +0 -1
- package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
- package/dist/components/Tournaments/TournamentDesktop.js +0 -57
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
- package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
- package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
- package/dist/components/Tournaments/TournamentMobile.js +0 -55
- package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
- package/dist/components/Tournaments/TournamentRules.js +0 -11
- package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
- package/dist/components/Tournaments/Tournaments.client.js +0 -20
- package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
- package/dist/components/Tournaments/TournamentsContext.js +0 -3
- package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
- package/dist/components/Tournaments/useTournamentData.js +0 -71
- package/dist/components/index.d.ts +0 -31
- package/dist/components/index.js +0 -31
- package/dist/icons/index.d.ts +0 -66
- package/dist/icons/index.js +0 -66
- package/dist/server/services/index.d.ts +0 -4
- package/dist/server/services/index.js +0 -4
- package/dist/server/utils/index.d.ts +0 -34
- package/dist/server/utils/index.js +0 -34
- package/dist/services/ObjectId.d.ts +0 -10
- package/dist/services/ObjectId.js +0 -72
- package/dist/services/index.d.ts +0 -13
- package/dist/services/index.js +0 -13
- package/dist/ui/index.d.ts +0 -26
- package/dist/ui/index.js +0 -26
- package/dist/utils/index.d.ts +0 -18
- package/dist/utils/index.js +0 -18
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { AUTH_ENDPOINT } from '../constants/index.js';
|
|
2
|
+
import { httpRequest } from './httpRequest.js';
|
|
3
|
+
import { sha256 } from './sha256.js';
|
|
4
|
+
export async function createSession(input, options) {
|
|
5
|
+
const headers = new Headers();
|
|
6
|
+
if (input.type === 'NAME_AND_PASSWORD') {
|
|
7
|
+
const password = await sha256(input.password);
|
|
8
|
+
headers.set('Authorization', `Basic ${Buffer.from(`${input.name}:${password}`).toString('base64')}`);
|
|
9
|
+
}
|
|
10
|
+
if (input.type === 'MOBILE_NUMBER') {
|
|
11
|
+
headers.set('Authorization', `MobileNumberOTP ${Buffer.from(`${input.mobileNumber}:${input.verificationCode}`).toString('base64')}`);
|
|
12
|
+
}
|
|
13
|
+
if (input.type === 'MAYA') {
|
|
14
|
+
headers.set('Authorization', `MayaSession ${input.session}`);
|
|
15
|
+
}
|
|
16
|
+
if (input.type === 'LIBANGAN') {
|
|
17
|
+
headers.set('Authorization', `Libangan ${input.session}`);
|
|
18
|
+
}
|
|
19
|
+
if (input.type === 'SOCIALS') {
|
|
20
|
+
headers.set('Authorization', `Token ${input.token}`);
|
|
21
|
+
}
|
|
22
|
+
if (input.type === 'CABINET') {
|
|
23
|
+
headers.set('Authorization', `Opexa-Cabinet-Token ${input.token}`);
|
|
24
|
+
}
|
|
25
|
+
if (input.type === 'SINGLE_USE_TOKEN') {
|
|
26
|
+
headers.set('Authorization', `Single-Use-Token ${input.token}`);
|
|
27
|
+
}
|
|
28
|
+
new Headers(options?.headers).forEach((value, key) => {
|
|
29
|
+
headers.set(key, value);
|
|
30
|
+
});
|
|
31
|
+
try {
|
|
32
|
+
return await httpRequest.json(input.type === 'LIBANGAN'
|
|
33
|
+
? `${AUTH_ENDPOINT}/v2/sessions`
|
|
34
|
+
: `${AUTH_ENDPOINT}/sessions`, {
|
|
35
|
+
...options,
|
|
36
|
+
method: 'POST',
|
|
37
|
+
headers,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
if (e instanceof Error) {
|
|
42
|
+
throw e;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
const error = new Error();
|
|
46
|
+
error.name = 'AccountNotFoundError';
|
|
47
|
+
error.message = 'Account not found';
|
|
48
|
+
Error.captureStackTrace?.(error, createSession);
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export async function authenticate(input, options) {
|
|
54
|
+
if (input.type === 'SECURITY_QUESTION') {
|
|
55
|
+
try {
|
|
56
|
+
return await httpRequest.json(`${AUTH_ENDPOINT}/session/${input.token}/authenticate`, {
|
|
57
|
+
...options,
|
|
58
|
+
method: 'POST',
|
|
59
|
+
body: JSON.stringify({
|
|
60
|
+
secretAnswer: await sha256(input.secretAnswer),
|
|
61
|
+
}),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
if (e instanceof Error) {
|
|
66
|
+
throw e;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
const error = new Error();
|
|
70
|
+
error.name = 'AccountNotFoundError';
|
|
71
|
+
error.message = 'Account not found';
|
|
72
|
+
Error.captureStackTrace?.(error, authenticate);
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
throw new Error("Invalid input 'type'");
|
|
78
|
+
}
|
|
79
|
+
export async function refreshSession(options) {
|
|
80
|
+
try {
|
|
81
|
+
return await httpRequest.json(`${AUTH_ENDPOINT}/session:refresh`, {
|
|
82
|
+
...options,
|
|
83
|
+
method: 'POST',
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
catch (e) {
|
|
87
|
+
if (e instanceof Error) {
|
|
88
|
+
throw e;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const error = new Error();
|
|
92
|
+
error.name = 'AccountNotFoundError';
|
|
93
|
+
error.message = 'Account not found';
|
|
94
|
+
Error.captureStackTrace?.(error, refreshSession);
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export async function destroySession(options) {
|
|
100
|
+
try {
|
|
101
|
+
await httpRequest(`${AUTH_ENDPOINT}/session`, {
|
|
102
|
+
...options,
|
|
103
|
+
method: 'DELETE',
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
/* ignore */
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export async function verifySession(options) {
|
|
111
|
+
try {
|
|
112
|
+
const res = await httpRequest(`${AUTH_ENDPOINT}/session`, options);
|
|
113
|
+
return res.ok;
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
/* Assume session is still valid for unknown errors like Network */
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export async function sendVerificationCode(input, options) {
|
|
121
|
+
const { strict, ...rest } = input;
|
|
122
|
+
const headers = new Headers();
|
|
123
|
+
headers.set('Accept', 'application/json');
|
|
124
|
+
headers.set('Content-Type', 'application/json');
|
|
125
|
+
new Headers(options?.headers).forEach((value, key) => {
|
|
126
|
+
headers.set(key, value);
|
|
127
|
+
});
|
|
128
|
+
return httpRequest(`${AUTH_ENDPOINT}/otps`, {
|
|
129
|
+
...options,
|
|
130
|
+
method: 'POST',
|
|
131
|
+
headers,
|
|
132
|
+
body: JSON.stringify({
|
|
133
|
+
verificationType: strict ? 'MEMBER' : undefined,
|
|
134
|
+
...rest,
|
|
135
|
+
}),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
export async function createSingleUseToken(options) {
|
|
139
|
+
try {
|
|
140
|
+
return await httpRequest.json(`${AUTH_ENDPOINT}/token`, {
|
|
141
|
+
...options,
|
|
142
|
+
method: 'POST',
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
const error = new Error();
|
|
147
|
+
error.name = 'InvalidTokenError';
|
|
148
|
+
error.message = 'Invalid token';
|
|
149
|
+
Error.captureStackTrace?.(error, createSingleUseToken);
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { SimplifyDeep } from 'type-fest';
|
|
2
|
+
import type { EnumFilterField, Game, GameProvider, GameTag, GameType, ObjectIdFilterField, PaginatedQueryResult, Site, SortOrder } from '../types';
|
|
3
|
+
import { type HttpRequestOptions } from './httpRequest';
|
|
4
|
+
export interface SiteQuery {
|
|
5
|
+
data: Site;
|
|
6
|
+
}
|
|
7
|
+
export declare const getSite: (id: string, options?: HttpRequestOptions) => Promise<Site | null>;
|
|
8
|
+
export interface GamesQueryVariables {
|
|
9
|
+
after?: string;
|
|
10
|
+
first?: number;
|
|
11
|
+
search?: string;
|
|
12
|
+
filter?: {
|
|
13
|
+
tags?: EnumFilterField<GameTag>;
|
|
14
|
+
type?: EnumFilterField<GameType>;
|
|
15
|
+
provider?: EnumFilterField<GameProvider>;
|
|
16
|
+
reference?: ObjectIdFilterField;
|
|
17
|
+
};
|
|
18
|
+
sort?: SortOrder;
|
|
19
|
+
}
|
|
20
|
+
export interface GamesQuery {
|
|
21
|
+
data: Game[];
|
|
22
|
+
next?: string | null;
|
|
23
|
+
totalCount?: number | null;
|
|
24
|
+
}
|
|
25
|
+
export type GamesInput = SimplifyDeep<GamesQueryVariables>;
|
|
26
|
+
export declare function getGames(input?: GamesInput, options?: HttpRequestOptions): Promise<PaginatedQueryResult<Game>>;
|
|
27
|
+
export interface GamesQueryVariables__Next {
|
|
28
|
+
after?: string;
|
|
29
|
+
first?: number;
|
|
30
|
+
search?: string;
|
|
31
|
+
filter?: {
|
|
32
|
+
tags?: EnumFilterField<GameTag>;
|
|
33
|
+
type?: EnumFilterField<GameType>;
|
|
34
|
+
provider?: EnumFilterField<GameProvider>;
|
|
35
|
+
reference?: ObjectIdFilterField;
|
|
36
|
+
};
|
|
37
|
+
sort?: {
|
|
38
|
+
order: SortOrder;
|
|
39
|
+
context: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export type GamesInput__Next = SimplifyDeep<GamesQueryVariables__Next>;
|
|
43
|
+
export declare const getGames__next: (input?: GamesInput__Next, options?: HttpRequestOptions) => Promise<PaginatedQueryResult<Game>>;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { cache } from 'react';
|
|
2
|
+
import { CMS_PORTAL_ENDPOINT } from '../constants/index.js';
|
|
3
|
+
import { httpRequest } from './httpRequest.js';
|
|
4
|
+
export const getSite = cache(async (id, options) => {
|
|
5
|
+
try {
|
|
6
|
+
const { data } = await httpRequest.json(`${CMS_PORTAL_ENDPOINT}/v1/sites/${id}`, options);
|
|
7
|
+
return data ?? null;
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export async function getGames(input, options) {
|
|
14
|
+
const search = new URLSearchParams();
|
|
15
|
+
if (input?.first)
|
|
16
|
+
search.set('first', input.first.toString());
|
|
17
|
+
if (input?.after)
|
|
18
|
+
search.set('after', input.after);
|
|
19
|
+
if (input?.search)
|
|
20
|
+
search.set('search', input.search);
|
|
21
|
+
if (input?.filter?.type?.equal)
|
|
22
|
+
search.set('filter[type][eq]', input.filter.type.equal);
|
|
23
|
+
if (input?.filter?.type?.notEqual)
|
|
24
|
+
search.set('filter[type][neq]', input.filter.type.notEqual);
|
|
25
|
+
if (input?.filter?.type?.in)
|
|
26
|
+
search.set('filter[type][in]', input.filter.type.in.join(','));
|
|
27
|
+
if (input?.filter?.type?.notIn)
|
|
28
|
+
search.set('filter[type][nin]', input.filter.type.notIn.join(','));
|
|
29
|
+
if (input?.filter?.provider?.equal)
|
|
30
|
+
search.set('filter[provider][eq]', input.filter.provider.equal);
|
|
31
|
+
if (input?.filter?.provider?.notEqual)
|
|
32
|
+
search.set('filter[provider][neq]', input.filter.provider.notEqual);
|
|
33
|
+
if (input?.filter?.provider?.in)
|
|
34
|
+
search.set('filter[provider][in]', input.filter.provider.in.join(','));
|
|
35
|
+
if (input?.filter?.provider?.notIn)
|
|
36
|
+
search.set('filter[provider][nin]', input.filter.provider.notIn.join(','));
|
|
37
|
+
if (input?.filter?.tags?.equal)
|
|
38
|
+
search.set('filter[tags][eq]', input.filter.tags.equal.toLowerCase());
|
|
39
|
+
if (input?.filter?.tags?.notEqual)
|
|
40
|
+
search.set('filter[tags][neq]', input.filter.tags.notEqual.toLowerCase());
|
|
41
|
+
if (input?.filter?.tags?.in)
|
|
42
|
+
search.set('filter[tags][in]', input.filter.tags.in.map((v) => v.toLowerCase()).join(','));
|
|
43
|
+
if (input?.filter?.tags?.notIn)
|
|
44
|
+
search.set('filter[tags][nin]', input.filter.tags.notIn.map((v) => v.toLowerCase()).join(','));
|
|
45
|
+
if (input?.filter?.reference?.equal)
|
|
46
|
+
search.set('filter[reference][eq]', input.filter.reference.equal);
|
|
47
|
+
if (input?.filter?.reference?.notEqual)
|
|
48
|
+
search.set('filter[reference][neq]', input.filter.reference.notEqual);
|
|
49
|
+
if (input?.filter?.reference?.in)
|
|
50
|
+
search.set('filter[reference][in]', input.filter.reference.in.join(','));
|
|
51
|
+
if (input?.filter?.reference?.notIn)
|
|
52
|
+
search.set('filter[reference][nin]', input.filter.reference.notIn.join(','));
|
|
53
|
+
if (input?.sort)
|
|
54
|
+
search.set('sort[order]', input.sort);
|
|
55
|
+
try {
|
|
56
|
+
const res = await httpRequest.json(`${CMS_PORTAL_ENDPOINT}/v1/games?${search.toString()}`, options);
|
|
57
|
+
return {
|
|
58
|
+
edges: res.data.map((node) => ({
|
|
59
|
+
node,
|
|
60
|
+
cursor: node.cursor,
|
|
61
|
+
})),
|
|
62
|
+
totalCount: res.totalCount ?? 0,
|
|
63
|
+
pageInfo: {
|
|
64
|
+
hasNextPage: Boolean(res.next),
|
|
65
|
+
endCursor: res.next,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return {
|
|
71
|
+
edges: [],
|
|
72
|
+
totalCount: 0,
|
|
73
|
+
pageInfo: {
|
|
74
|
+
hasNextPage: false,
|
|
75
|
+
endCursor: null,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export const getGames__next = cache(async (input, options) => {
|
|
81
|
+
const search = new URLSearchParams();
|
|
82
|
+
if (input?.first)
|
|
83
|
+
search.set('first', input.first.toString());
|
|
84
|
+
if (input?.after)
|
|
85
|
+
search.set('after', input.after);
|
|
86
|
+
if (input?.search)
|
|
87
|
+
search.set('search', input.search);
|
|
88
|
+
if (input?.filter?.type?.equal)
|
|
89
|
+
search.set('filter[type][eq]', input.filter.type.equal);
|
|
90
|
+
if (input?.filter?.type?.notEqual)
|
|
91
|
+
search.set('filter[type][neq]', input.filter.type.notEqual);
|
|
92
|
+
if (input?.filter?.type?.in)
|
|
93
|
+
search.set('filter[type][in]', input.filter.type.in.join(','));
|
|
94
|
+
if (input?.filter?.type?.notIn)
|
|
95
|
+
search.set('filter[type][nin]', input.filter.type.notIn.join(','));
|
|
96
|
+
if (input?.filter?.provider?.equal)
|
|
97
|
+
search.set('filter[provider][eq]', input.filter.provider.equal);
|
|
98
|
+
if (input?.filter?.provider?.notEqual)
|
|
99
|
+
search.set('filter[provider][neq]', input.filter.provider.notEqual);
|
|
100
|
+
if (input?.filter?.provider?.in)
|
|
101
|
+
search.set('filter[provider][in]', input.filter.provider.in.join(','));
|
|
102
|
+
if (input?.filter?.provider?.notIn)
|
|
103
|
+
search.set('filter[provider][nin]', input.filter.provider.notIn.join(','));
|
|
104
|
+
if (input?.filter?.tags?.equal)
|
|
105
|
+
search.set('filter[tags][eq]', input.filter.tags.equal.toLowerCase());
|
|
106
|
+
if (input?.filter?.tags?.notEqual)
|
|
107
|
+
search.set('filter[tags][neq]', input.filter.tags.notEqual.toLowerCase());
|
|
108
|
+
if (input?.filter?.tags?.in)
|
|
109
|
+
search.set('filter[tags][in]', input.filter.tags.in.map((v) => v.toLowerCase()).join(','));
|
|
110
|
+
if (input?.filter?.tags?.notIn)
|
|
111
|
+
search.set('filter[tags][nin]', input.filter.tags.notIn.map((v) => v.toLowerCase()).join(','));
|
|
112
|
+
if (input?.filter?.reference?.equal)
|
|
113
|
+
search.set('filter[reference][eq]', input.filter.reference.equal);
|
|
114
|
+
if (input?.filter?.reference?.notEqual)
|
|
115
|
+
search.set('filter[reference][neq]', input.filter.reference.notEqual);
|
|
116
|
+
if (input?.filter?.reference?.in)
|
|
117
|
+
search.set('filter[reference][in]', input.filter.reference.in.join(','));
|
|
118
|
+
if (input?.filter?.reference?.notIn)
|
|
119
|
+
search.set('filter[reference][nin]', input.filter.reference.notIn.join(','));
|
|
120
|
+
if (input?.sort) {
|
|
121
|
+
search.set('sort[order]', input.sort.order);
|
|
122
|
+
search.set('sort[context]', input.sort.context.toLowerCase());
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
const res = await httpRequest.json(`${CMS_PORTAL_ENDPOINT}/v2/games?${search.toString()}`, options);
|
|
126
|
+
return {
|
|
127
|
+
edges: res.data.map((node) => ({
|
|
128
|
+
node,
|
|
129
|
+
cursor: node.cursor,
|
|
130
|
+
})),
|
|
131
|
+
totalCount: res.totalCount ?? 0,
|
|
132
|
+
pageInfo: {
|
|
133
|
+
endCursor: res.next,
|
|
134
|
+
hasNextPage: Boolean(res.next),
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return {
|
|
140
|
+
edges: [],
|
|
141
|
+
totalCount: 0,
|
|
142
|
+
pageInfo: {
|
|
143
|
+
hasNextPage: false,
|
|
144
|
+
endCursor: null,
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { File } from '../types';
|
|
2
|
+
import { type GraphQLRequestOptions } from './graphqlRequest';
|
|
3
|
+
export interface FileQuery {
|
|
4
|
+
node?: File | null;
|
|
5
|
+
}
|
|
6
|
+
export interface FileQueryVariables {
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const getFile: (id: string, options?: GraphQLRequestOptions) => Promise<File | null>;
|
|
10
|
+
export type UploadPrivateImageFileError = {
|
|
11
|
+
name: 'FileFormatNotSupportedError';
|
|
12
|
+
message: string;
|
|
13
|
+
} | {
|
|
14
|
+
name: 'FileNameTooLongError';
|
|
15
|
+
message: string;
|
|
16
|
+
} | {
|
|
17
|
+
name: 'FileSizeTooBigError';
|
|
18
|
+
message: string;
|
|
19
|
+
};
|
|
20
|
+
export interface UploadPrivateImageFileMutation {
|
|
21
|
+
uploadPrivateImageFile?: null | UploadPrivateImageFileError;
|
|
22
|
+
}
|
|
23
|
+
export interface UploadPrivateImageFileMutationVariables {
|
|
24
|
+
input: {
|
|
25
|
+
id: string;
|
|
26
|
+
file: globalThis.File;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface UploadPrivateImageFileInput {
|
|
30
|
+
id: string;
|
|
31
|
+
file: globalThis.File;
|
|
32
|
+
}
|
|
33
|
+
export declare const uploadPrivateImageFile: (input: UploadPrivateImageFileInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cache } from 'react';
|
|
2
|
+
import { FILE_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
|
+
import { graphqlRequest, graphqlUpload, } from './graphqlRequest.js';
|
|
4
|
+
import { FILE, UPLOAD_PRIVATE_IMAGE_FILE } from './queries.js';
|
|
5
|
+
export const getFile = cache(async (id, options) => {
|
|
6
|
+
const res = await graphqlRequest(FILE_GRAPHQL_ENDPOINT, FILE, { id }, options);
|
|
7
|
+
return res.node ?? null;
|
|
8
|
+
});
|
|
9
|
+
export const uploadPrivateImageFile = async (input, options) => {
|
|
10
|
+
const res = await graphqlUpload(FILE_GRAPHQL_ENDPOINT, UPLOAD_PRIVATE_IMAGE_FILE, { input }, options);
|
|
11
|
+
if (res.uploadPrivateImageFile) {
|
|
12
|
+
const error = new Error();
|
|
13
|
+
error.name = res.uploadPrivateImageFile.name;
|
|
14
|
+
error.message = res.uploadPrivateImageFile.message;
|
|
15
|
+
Error.captureStackTrace?.(error, uploadPrivateImageFile);
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Simplify } from 'type-fest';
|
|
2
|
+
import type { GameSession, GameSession__Legacy } from '../types';
|
|
3
|
+
import { type GraphQLRequestOptions } from './graphqlRequest';
|
|
4
|
+
export interface GameSessionQuery__Legacy {
|
|
5
|
+
node?: GameSession__Legacy | null;
|
|
6
|
+
}
|
|
7
|
+
export interface GameSessionQueryVariables__Legacy {
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const getGameSession__legacy: (id: string, options?: GraphQLRequestOptions) => Promise<GameSession | null>;
|
|
11
|
+
export type CreateGameSessionError__Legacy = {
|
|
12
|
+
name: 'GameDoesNotExistError';
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
export interface CreateGameSessionMutation__Legacy {
|
|
16
|
+
createGameSession?: null | CreateGameSessionError__Legacy;
|
|
17
|
+
}
|
|
18
|
+
export interface CreateGameSessionMutationVariables__Legacy {
|
|
19
|
+
input: {
|
|
20
|
+
id: string;
|
|
21
|
+
game: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export type CreateGameSessionInput__Legacy = Simplify<CreateGameSessionMutationVariables__Legacy['input']>;
|
|
25
|
+
export declare function createGameSession__legacy(input: CreateGameSessionInput__Legacy, options?: GraphQLRequestOptions): Promise<void>;
|
|
26
|
+
export type EndGameSessionError = {
|
|
27
|
+
name: 'GameSessionDoesNotExistError';
|
|
28
|
+
message: string;
|
|
29
|
+
} | {
|
|
30
|
+
name: 'GameSessionAlreadyClosedError';
|
|
31
|
+
message: string;
|
|
32
|
+
} | {
|
|
33
|
+
name: 'GameProviderError';
|
|
34
|
+
message: string;
|
|
35
|
+
};
|
|
36
|
+
export interface EndGameSessionMutation__Legacy {
|
|
37
|
+
endGameSession?: null | EndGameSessionError;
|
|
38
|
+
}
|
|
39
|
+
export interface EndGameSessionMutationVariables__Legacy {
|
|
40
|
+
input: {
|
|
41
|
+
id: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export declare function endGameSession__legacy(id: string, options?: GraphQLRequestOptions): Promise<void>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cache } from 'react';
|
|
2
|
+
import { GAME_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
|
+
import { graphqlRequest } from './graphqlRequest.js';
|
|
4
|
+
import { CREATE_GAME_SESSION, END_GAME_SESSION__LEGACY, GAME_SESSION__LEGACY, } from './queries.js';
|
|
5
|
+
export const getGameSession__legacy = cache(async (id, options) => {
|
|
6
|
+
const res = await graphqlRequest(GAME_GRAPHQL_ENDPOINT, GAME_SESSION__LEGACY, { id }, options);
|
|
7
|
+
if (!res.node)
|
|
8
|
+
return null;
|
|
9
|
+
return {
|
|
10
|
+
...res.node,
|
|
11
|
+
game: res.node.game.id,
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
export async function createGameSession__legacy(input, options) {
|
|
15
|
+
const res = await graphqlRequest(GAME_GRAPHQL_ENDPOINT, CREATE_GAME_SESSION, { input }, options);
|
|
16
|
+
if (res.createGameSession) {
|
|
17
|
+
const error = new Error();
|
|
18
|
+
error.name = res.createGameSession.name;
|
|
19
|
+
error.message = res.createGameSession.message;
|
|
20
|
+
Error.captureStackTrace?.(error, createGameSession__legacy);
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export async function endGameSession__legacy(id, options) {
|
|
25
|
+
const res = await graphqlRequest(GAME_GRAPHQL_ENDPOINT, END_GAME_SESSION__LEGACY, { input: { id } }, options);
|
|
26
|
+
if (res.endGameSession) {
|
|
27
|
+
const error = new Error();
|
|
28
|
+
error.name = res.endGameSession.name;
|
|
29
|
+
error.message = res.endGameSession.message;
|
|
30
|
+
Error.captureStackTrace?.(error, endGameSession__legacy);
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -23,14 +23,6 @@ export async function graphqlRequest(url, query, variables, options) {
|
|
|
23
23
|
}
|
|
24
24
|
try {
|
|
25
25
|
const response = await fetch(url_, {
|
|
26
|
-
cache: 'force-cache',
|
|
27
|
-
next: {
|
|
28
|
-
revalidate: 1,
|
|
29
|
-
tags: [
|
|
30
|
-
url_.toString(),
|
|
31
|
-
variables ? JSON.stringify(variables) : '',
|
|
32
|
-
].filter(Boolean),
|
|
33
|
-
},
|
|
34
26
|
...options,
|
|
35
27
|
method: 'POST',
|
|
36
28
|
headers,
|
|
@@ -134,14 +126,6 @@ export async function graphqlUpload(url, query, variables, options) {
|
|
|
134
126
|
}
|
|
135
127
|
try {
|
|
136
128
|
const response = await fetch(url_, {
|
|
137
|
-
cache: 'force-cache',
|
|
138
|
-
next: {
|
|
139
|
-
revalidate: 1,
|
|
140
|
-
tags: [
|
|
141
|
-
url_.toString(),
|
|
142
|
-
variables ? JSON.stringify(variables) : '',
|
|
143
|
-
].filter(Boolean),
|
|
144
|
-
},
|
|
145
129
|
...options,
|
|
146
130
|
method: 'POST',
|
|
147
131
|
headers,
|
|
@@ -15,11 +15,6 @@ export async function httpRequest(url, opts = {}) {
|
|
|
15
15
|
headers.delete(RECAPTCHA_HEADER_KEY);
|
|
16
16
|
}
|
|
17
17
|
const res = await fetch(url, {
|
|
18
|
-
cache: 'force-cache',
|
|
19
|
-
next: {
|
|
20
|
-
revalidate: 1,
|
|
21
|
-
tags: [url, JSON.stringify(opts.body ?? {})].filter(Boolean),
|
|
22
|
-
},
|
|
23
18
|
...opts,
|
|
24
19
|
headers,
|
|
25
20
|
});
|
|
@@ -57,11 +52,6 @@ httpRequest.json = async (url, opts = {}) => {
|
|
|
57
52
|
headers.delete(RECAPTCHA_HEADER_KEY);
|
|
58
53
|
}
|
|
59
54
|
const response = await fetch(url, {
|
|
60
|
-
cache: 'force-cache',
|
|
61
|
-
next: {
|
|
62
|
-
revalidate: 1,
|
|
63
|
-
tags: [url, JSON.stringify(opts.body ?? {})].filter(Boolean),
|
|
64
|
-
},
|
|
65
55
|
...opts,
|
|
66
56
|
headers,
|
|
67
57
|
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Simplify } from 'type-fest';
|
|
2
|
+
import type { GameType, LatestBetRecord, OnboardingPlayerExperience, OnboardingStatus, Platform, RecommendedGame, TopWin } from '../types';
|
|
3
|
+
import { type GraphQLRequestOptions } from './graphqlRequest';
|
|
4
|
+
export interface LatestBetRecordsQuery {
|
|
5
|
+
latestBetRecords: LatestBetRecord[];
|
|
6
|
+
}
|
|
7
|
+
export declare const getLatestBetRecords: (options?: GraphQLRequestOptions) => Promise<LatestBetRecord[]>;
|
|
8
|
+
export interface PlatformQuery extends Platform {
|
|
9
|
+
}
|
|
10
|
+
export declare const getPlatform: (options?: GraphQLRequestOptions) => Promise<PlatformQuery>;
|
|
11
|
+
export interface RecommendedGamesQuery {
|
|
12
|
+
recommendedGames: RecommendedGame[];
|
|
13
|
+
}
|
|
14
|
+
export declare const getRecommendedGames: (options?: GraphQLRequestOptions) => Promise<RecommendedGame[]>;
|
|
15
|
+
export interface OnboardingStatusQuery {
|
|
16
|
+
onboardingStatus?: OnboardingStatus | null;
|
|
17
|
+
}
|
|
18
|
+
export declare const getOnboardingStatus: (options?: GraphQLRequestOptions) => Promise<OnboardingStatus | null>;
|
|
19
|
+
export interface CompleteOnboardingMutationVariables {
|
|
20
|
+
input: {
|
|
21
|
+
playerExperience: OnboardingPlayerExperience;
|
|
22
|
+
favoriteGameTypes: GameType[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface CompleteOnboardingMutation {
|
|
26
|
+
completeOnboarding: boolean;
|
|
27
|
+
}
|
|
28
|
+
export type CompleteOnboardingInput = Simplify<CompleteOnboardingMutationVariables['input']>;
|
|
29
|
+
export declare const completeOnboarding: (input: CompleteOnboardingInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
30
|
+
export interface SkipOnboardingMutation {
|
|
31
|
+
skipOnboarding: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare const skipOnboarding: (options?: GraphQLRequestOptions) => Promise<void>;
|
|
34
|
+
export interface TopWinsQuery {
|
|
35
|
+
topWins: TopWin[];
|
|
36
|
+
}
|
|
37
|
+
export declare const getTopWins: (options?: GraphQLRequestOptions) => Promise<TopWin[]>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { cache } from 'react';
|
|
2
|
+
import { PORTAL_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
|
+
import { graphqlRequest } from './graphqlRequest.js';
|
|
4
|
+
import { COMPLETE_ONBOARDING, LATEST_BET_RECORDS, ONBOARDING_STATUS, PLATFORM, RECOMMENDED_GAMES, SKIP_ONBOARDING, TOP_WINS, } from './queries.js';
|
|
5
|
+
export const getLatestBetRecords = cache(async (options) => {
|
|
6
|
+
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, LATEST_BET_RECORDS, undefined, options);
|
|
7
|
+
return res.latestBetRecords;
|
|
8
|
+
});
|
|
9
|
+
export const getPlatform = cache(async (options) => {
|
|
10
|
+
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, PLATFORM, undefined, options);
|
|
11
|
+
return res;
|
|
12
|
+
});
|
|
13
|
+
export const getRecommendedGames = cache(async (options) => {
|
|
14
|
+
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, RECOMMENDED_GAMES, undefined, options);
|
|
15
|
+
return res.recommendedGames;
|
|
16
|
+
});
|
|
17
|
+
export const getOnboardingStatus = cache(async (options) => {
|
|
18
|
+
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, ONBOARDING_STATUS, undefined, options);
|
|
19
|
+
return res.onboardingStatus ?? null;
|
|
20
|
+
});
|
|
21
|
+
export const completeOnboarding = async (input, options) => {
|
|
22
|
+
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, COMPLETE_ONBOARDING, { input }, options);
|
|
23
|
+
if (!res.completeOnboarding) {
|
|
24
|
+
const error = new Error();
|
|
25
|
+
error.name = 'UnknownError';
|
|
26
|
+
error.message = 'Something went wrong';
|
|
27
|
+
Error.captureStackTrace?.(error, completeOnboarding);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export const skipOnboarding = async (options) => {
|
|
32
|
+
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, SKIP_ONBOARDING, undefined, options);
|
|
33
|
+
if (!res.skipOnboarding) {
|
|
34
|
+
const error = new Error();
|
|
35
|
+
error.name = 'UnknownError';
|
|
36
|
+
error.message = 'Something went wrong';
|
|
37
|
+
Error.captureStackTrace?.(error, skipOnboarding);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
export const getTopWins = cache(async (options) => {
|
|
42
|
+
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, TOP_WINS, undefined, options);
|
|
43
|
+
return res.topWins;
|
|
44
|
+
});
|