@opexa/portal-components 0.0.112 → 0.0.114
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/index.d.ts +65 -0
- package/dist/client/hooks/index.js +65 -0
- package/dist/client/hooks/useCashbackQuery.js +3 -0
- package/dist/client/hooks/useCashbacksQuery.js +3 -0
- package/dist/client/hooks/useChunk.js +3 -2
- package/dist/client/hooks/useFavoriteGamesQuery.js +3 -0
- package/dist/client/hooks/useInstapayBankListQuery.js +3 -0
- package/dist/client/hooks/useJackpotPayoutsQuery.js +3 -0
- package/dist/client/hooks/useJackpotsCountQuery.js +3 -0
- package/dist/client/hooks/useJackpotsQuery.js +3 -0
- package/dist/client/hooks/usePlatformQuery.js +3 -0
- package/dist/client/hooks/usePromoQuery.js +3 -0
- package/dist/client/hooks/usePromosQuery.js +3 -0
- package/dist/client/hooks/useRecommendedGamesQuery.js +5 -2
- package/dist/client/hooks/useRemainingTime.d.ts +2 -2
- package/dist/client/hooks/useRemainingTime.js +35 -24
- package/dist/client/hooks/useSiteQuery.js +4 -2
- package/dist/client/hooks/useTopWinsQuery.js +3 -0
- package/dist/client/services/index.d.ts +4 -0
- package/dist/client/services/index.js +4 -0
- package/dist/client/utils/index.d.ts +3 -0
- package/dist/client/utils/index.js +3 -0
- package/dist/components/Bonus/Bonus.client.js +1 -1
- package/dist/components/Cashback/Cashback.client.js +1 -1
- package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +2 -0
- package/dist/components/CashbackBonus/CashbackBonus.client.js +9 -0
- package/dist/components/CashbackBonus/CashbackBonus.d.ts +10 -0
- package/dist/components/CashbackBonus/CashbackBonus.js +5 -0
- package/dist/components/CashbackBonus/index.d.ts +1 -0
- package/dist/components/CashbackBonus/index.js +1 -0
- package/dist/components/Disclaimer/DisclaimerV2.js +6 -4
- package/dist/components/Empty.d.ts +9 -0
- package/dist/components/Empty.js +7 -0
- package/dist/components/FavoriteGames/FavoriteGames.client.js +23 -1
- package/dist/components/GameLaunch/GameLaunch.lazy.js +1 -1
- package/dist/components/Games/GameContext.d.ts +2 -0
- package/dist/components/Games/GameContext.js +2 -0
- package/dist/components/GamesSearch/GamesSearch.js +1 -1
- package/dist/components/InfiniteScroll.d.ts +10 -0
- package/dist/components/InfiniteScroll.js +25 -0
- package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +2 -0
- package/dist/components/JackpotCounter/JackpotCounter.client.js +66 -0
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +17 -0
- package/dist/components/JackpotCounter/JackpotCounter.js +21 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +18 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.js +109 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +184 -0
- package/dist/components/JackpotCounter/index.d.ts +1 -0
- package/dist/components/JackpotCounter/index.js +1 -0
- package/dist/components/Jackpots/JackpotDesktop.d.ts +1 -0
- package/dist/components/Jackpots/JackpotDesktop.js +45 -0
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +5 -0
- package/dist/components/Jackpots/JackpotGameProviders.js +41 -0
- package/dist/components/Jackpots/JackpotItemDesktop.d.ts +9 -0
- package/dist/components/Jackpots/JackpotItemDesktop.js +43 -0
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +9 -0
- package/dist/components/Jackpots/JackpotItemMobile.js +44 -0
- package/dist/components/Jackpots/JackpotMobile.d.ts +1 -0
- package/dist/components/Jackpots/JackpotMobile.js +46 -0
- package/dist/components/Jackpots/JackpotRules.d.ts +5 -0
- package/dist/components/Jackpots/JackpotRules.js +11 -0
- package/dist/components/Jackpots/Jackpots.client.d.ts +2 -0
- package/dist/components/Jackpots/Jackpots.client.js +29 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsContext.d.ts +4 -0
- package/dist/components/Jackpots/JackpotsContext.js +3 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/Jackpots/useJackpotData.d.ts +14 -0
- package/dist/components/Jackpots/useJackpotData.js +93 -0
- package/dist/components/Jackpots/useJackpotItemData.d.ts +20 -0
- package/dist/components/Jackpots/useJackpotItemData.js +87 -0
- package/dist/components/KYC/Header.d.ts +1 -0
- package/dist/components/KYC/Header.js +8 -0
- package/dist/components/KYC/Step1.d.ts +1 -0
- package/dist/components/KYC/Step1.js +13 -0
- package/dist/components/KYC/Step2.d.ts +1 -0
- package/dist/components/KYC/Step2.js +13 -0
- package/dist/components/KYC/Step3.d.ts +1 -0
- package/dist/components/KYC/Step3.js +13 -0
- package/dist/components/KYC/Step4.d.ts +1 -0
- package/dist/components/KYC/Step4.js +7 -0
- package/dist/components/Messages/MessageItem.d.ts +4 -0
- package/dist/components/Messages/MessageItem.js +34 -0
- package/dist/components/News/News.js +1 -1
- package/dist/components/PortalProvider/WebVitals.d.ts +1 -0
- package/dist/components/PortalProvider/WebVitals.js +8 -0
- package/dist/components/Promo/Promo.client.js +1 -1
- package/dist/components/Promo/PromoContent.d.ts +2 -0
- package/dist/components/Promo/PromoContent.js +9 -0
- package/dist/components/Promos/PromoCarousel.d.ts +2 -0
- package/dist/components/Promos/PromoCarousel.js +41 -0
- package/dist/components/Promos/PromoGrid.d.ts +2 -0
- package/dist/components/Promos/PromoGrid.js +12 -0
- package/dist/components/Promos/PromoItem.d.ts +7 -0
- package/dist/components/Promos/PromoItem.js +10 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +4 -1
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +25 -28
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +8 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +9 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +4 -1
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +3 -27
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +4 -1
- package/dist/components/Quests/WageringQuest/WageringQuest.js +9 -12
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +9 -0
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +9 -0
- package/dist/components/Search/Search.lazy.js +1 -1
- package/dist/components/TopWins/TopWins.client.js +2 -2
- package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +2 -0
- package/dist/components/TournamentCounter/TournamentCounter.client.js +50 -0
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +8 -0
- package/dist/components/TournamentCounter/TournamentCounter.js +21 -0
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +8 -0
- package/dist/components/TournamentCounter/TournamentCounterItem.js +106 -0
- package/dist/components/TournamentCounter/index.d.ts +1 -0
- package/dist/components/TournamentCounter/index.js +1 -0
- package/dist/components/Tournaments/TournamentDesktop.d.ts +1 -0
- package/dist/components/Tournaments/TournamentDesktop.js +57 -0
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +5 -0
- package/dist/components/Tournaments/TournamentGameProviders.js +38 -0
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +7 -0
- package/dist/components/Tournaments/TournamentItemDesktop.js +56 -0
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +7 -0
- package/dist/components/Tournaments/TournamentItemMobile.js +54 -0
- package/dist/components/Tournaments/TournamentMobile.d.ts +1 -0
- package/dist/components/Tournaments/TournamentMobile.js +55 -0
- package/dist/components/Tournaments/TournamentRules.d.ts +5 -0
- package/dist/components/Tournaments/TournamentRules.js +11 -0
- package/dist/components/Tournaments/Tournaments.client.d.ts +2 -0
- package/dist/components/Tournaments/Tournaments.client.js +20 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsContext.d.ts +4 -0
- package/dist/components/Tournaments/TournamentsContext.js +3 -0
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/components/Tournaments/useTournamentData.d.ts +10 -0
- package/dist/components/Tournaments/useTournamentData.js +72 -0
- package/dist/components/Tournaments/useTournamentItemData.d.ts +16 -0
- package/dist/components/Tournaments/useTournamentItemData.js +64 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +33 -0
- package/dist/constants/endpoints.d.ts +10 -0
- package/dist/constants/endpoints.js +41 -0
- package/dist/constants/envVars.d.ts +5 -0
- package/dist/constants/envVars.js +28 -0
- package/dist/constants/gameProviders.d.ts +4 -0
- package/dist/constants/gameProviders.js +368 -0
- package/dist/constants/gameTypes.d.ts +3 -0
- package/dist/constants/gameTypes.js +64 -0
- package/dist/constants/headerKeys.d.ts +2 -0
- package/dist/constants/headerKeys.js +2 -0
- package/dist/constants/secretQuestions.d.ts +3 -0
- package/dist/constants/secretQuestions.js +24 -0
- package/dist/constants/storageKeys.d.ts +2 -0
- package/dist/constants/storageKeys.js +2 -0
- package/dist/icons/index.d.ts +65 -0
- package/dist/icons/index.js +65 -0
- package/dist/images/hacksaw-gaming.png +0 -0
- package/dist/images/pagcor2.png +0 -0
- package/dist/server/services/index.d.ts +4 -0
- package/dist/server/services/index.js +4 -0
- package/dist/server/utils/index.d.ts +29 -0
- package/dist/server/utils/index.js +29 -0
- package/dist/server/utils/prefetchSiteQuery.js +1 -4
- package/dist/services/auth.d.ts +21 -2
- package/dist/services/auth.js +25 -6
- package/dist/services/cmsPortal.d.ts +1 -1
- package/dist/services/cmsPortal.js +31 -5
- package/dist/services/portal.js +27 -3
- package/dist/services/queries.js +2369 -2369
- package/dist/services/report.js +45 -5
- package/dist/services/wallet.js +26 -3
- package/dist/styles/theme.css +699 -699
- package/dist/ui/AlertDialog/AlertDialog.d.ts +55 -55
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.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 +192 -192
- package/dist/ui/Dialog/Dialog.d.ts +55 -55
- package/dist/ui/Dialog/dialog.recipe.d.ts +5 -5
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Menu/Menu.d.ts +307 -307
- package/dist/ui/Menu/menu.recipe.d.ts +8 -8
- package/dist/ui/Presence.d.ts +2 -0
- package/dist/ui/Presence.js +7 -0
- package/dist/ui/Prose.d.ts +2 -0
- package/dist/ui/Prose.js +5 -0
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- 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/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/ui/index.d.ts +26 -0
- package/dist/ui/index.js +26 -0
- package/dist/utils/index.d.ts +17 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/isMobile.d.ts +5 -0
- package/dist/utils/isMobile.js +9 -0
- package/package.json +163 -163
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.d.ts +0 -6
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.js +0 -15
- package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.d.ts +0 -6
- package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.js +0 -15
- package/dist/components/Quests/WageringQuest/WageringQuestRules.d.ts +0 -7
- package/dist/components/Quests/WageringQuest/WageringQuestRules.js +0 -17
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './prefetchAccountQuery';
|
|
2
|
+
export * from './prefetchAvailablePromosQuery';
|
|
3
|
+
export * from './prefetchAvailableQuestsQuery';
|
|
4
|
+
export * from './prefetchBetRecordsQuery';
|
|
5
|
+
export * from './prefetchBonusesQuery';
|
|
6
|
+
export * from './prefetchBonusQuery';
|
|
7
|
+
export * from './prefetchCashbackBonusesQuery';
|
|
8
|
+
export * from './prefetchCashbackBonusQuery';
|
|
9
|
+
export * from './prefetchCashbackQuery';
|
|
10
|
+
export * from './prefetchCashbacksQuery';
|
|
11
|
+
export * from './prefetchDepositQuery';
|
|
12
|
+
export * from './prefetchDepositRecordsQuery';
|
|
13
|
+
export * from './prefetchFavoriteGamesQuery';
|
|
14
|
+
export * from './prefetchGamesQuery';
|
|
15
|
+
export * from './prefetchInstapayBankListQuery';
|
|
16
|
+
export * from './prefetchIsMayaSessionValidQuery';
|
|
17
|
+
export * from './prefetchJackpotsQuery';
|
|
18
|
+
export * from './prefetchMemberVerificationQuery';
|
|
19
|
+
export * from './prefetchPaymentSettingsQuery';
|
|
20
|
+
export * from './prefetchPlatformQuery';
|
|
21
|
+
export * from './prefetchProfileCompletionQuery';
|
|
22
|
+
export * from './prefetchPromoQuery';
|
|
23
|
+
export * from './prefetchPromosQuery';
|
|
24
|
+
export * from './prefetchSessionQuery';
|
|
25
|
+
export * from './prefetchTopWinsQuery';
|
|
26
|
+
export * from './prefetchTournamentsQuery';
|
|
27
|
+
export * from './prefetchTransactionRecordsQuery';
|
|
28
|
+
export * from './prefetchWalletQuery';
|
|
29
|
+
export * from './prefetchWithdrawalRecordsQuery';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './prefetchAccountQuery.js';
|
|
2
|
+
export * from './prefetchAvailablePromosQuery.js';
|
|
3
|
+
export * from './prefetchAvailableQuestsQuery.js';
|
|
4
|
+
export * from './prefetchBetRecordsQuery.js';
|
|
5
|
+
export * from './prefetchBonusesQuery.js';
|
|
6
|
+
export * from './prefetchBonusQuery.js';
|
|
7
|
+
export * from './prefetchCashbackBonusesQuery.js';
|
|
8
|
+
export * from './prefetchCashbackBonusQuery.js';
|
|
9
|
+
export * from './prefetchCashbackQuery.js';
|
|
10
|
+
export * from './prefetchCashbacksQuery.js';
|
|
11
|
+
export * from './prefetchDepositQuery.js';
|
|
12
|
+
export * from './prefetchDepositRecordsQuery.js';
|
|
13
|
+
export * from './prefetchFavoriteGamesQuery.js';
|
|
14
|
+
export * from './prefetchGamesQuery.js';
|
|
15
|
+
export * from './prefetchInstapayBankListQuery.js';
|
|
16
|
+
export * from './prefetchIsMayaSessionValidQuery.js';
|
|
17
|
+
export * from './prefetchJackpotsQuery.js';
|
|
18
|
+
export * from './prefetchMemberVerificationQuery.js';
|
|
19
|
+
export * from './prefetchPaymentSettingsQuery.js';
|
|
20
|
+
export * from './prefetchPlatformQuery.js';
|
|
21
|
+
export * from './prefetchProfileCompletionQuery.js';
|
|
22
|
+
export * from './prefetchPromoQuery.js';
|
|
23
|
+
export * from './prefetchPromosQuery.js';
|
|
24
|
+
export * from './prefetchSessionQuery.js';
|
|
25
|
+
export * from './prefetchTopWinsQuery.js';
|
|
26
|
+
export * from './prefetchTournamentsQuery.js';
|
|
27
|
+
export * from './prefetchTransactionRecordsQuery.js';
|
|
28
|
+
export * from './prefetchWalletQuery.js';
|
|
29
|
+
export * from './prefetchWithdrawalRecordsQuery.js';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SITE_ID } from '../../constants/index.js';
|
|
2
1
|
import { getSite } from '../../services/cmsPortal.js';
|
|
3
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
4
3
|
import { log } from '../../utils/log.js';
|
|
@@ -8,9 +7,7 @@ export const prefetchSiteQuery = async () => {
|
|
|
8
7
|
.prefetchQuery({
|
|
9
8
|
queryKey: getSiteQueryKey(),
|
|
10
9
|
queryFn: async ({ signal }) => {
|
|
11
|
-
return await getSite(
|
|
12
|
-
signal,
|
|
13
|
-
});
|
|
10
|
+
return await getSite({ signal });
|
|
14
11
|
},
|
|
15
12
|
})
|
|
16
13
|
.catch(() => log.text("'prefetchSiteQuery' failed", 'error'));
|
package/dist/services/auth.d.ts
CHANGED
|
@@ -15,14 +15,13 @@ export interface CreateSessionInput__Maya {
|
|
|
15
15
|
session: string;
|
|
16
16
|
}
|
|
17
17
|
export interface CreateSessionInput__Libangan {
|
|
18
|
-
type: 'LIBANGAN';
|
|
19
18
|
session: string;
|
|
20
19
|
}
|
|
21
20
|
export interface CreateSessionInput__Token {
|
|
22
21
|
type: 'SOCIALS' | 'CABINET' | 'SINGLE_USE_TOKEN';
|
|
23
22
|
token: string;
|
|
24
23
|
}
|
|
25
|
-
export type CreateSessionInput = CreateSessionInput__UsernameAndPassword | CreateSessionInput__MobileNumber | CreateSessionInput__Maya |
|
|
24
|
+
export type CreateSessionInput = CreateSessionInput__UsernameAndPassword | CreateSessionInput__MobileNumber | CreateSessionInput__Maya | CreateSessionInput__Token;
|
|
26
25
|
export interface CreateSessionTwoFactorAuthDisabledMutation {
|
|
27
26
|
session: {
|
|
28
27
|
id: string;
|
|
@@ -32,11 +31,31 @@ export interface CreateSessionTwoFactorAuthDisabledMutation {
|
|
|
32
31
|
refreshToken: string;
|
|
33
32
|
authenticator?: never;
|
|
34
33
|
}
|
|
34
|
+
export interface CreateSessionMutation_next {
|
|
35
|
+
data: {
|
|
36
|
+
session: {
|
|
37
|
+
id: string;
|
|
38
|
+
dateTimeCreated: string;
|
|
39
|
+
};
|
|
40
|
+
accessToken: string;
|
|
41
|
+
refreshToken: string;
|
|
42
|
+
authenticator?: Authenticator;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
35
45
|
export interface CreateSessionTwoFactorAuthEnabledMutation {
|
|
36
46
|
authenticator: Authenticator;
|
|
37
47
|
}
|
|
38
48
|
export type CreateSessionMutation = CreateSessionTwoFactorAuthDisabledMutation | CreateSessionTwoFactorAuthEnabledMutation;
|
|
39
49
|
export declare function createSession(input: CreateSessionInput, options?: HttpRequestOptions): Promise<CreateSessionMutation>;
|
|
50
|
+
export declare function createSessionLibangan(input: CreateSessionInput__Libangan, options?: HttpRequestOptions): Promise<{
|
|
51
|
+
session: {
|
|
52
|
+
id: string;
|
|
53
|
+
dateTimeCreated: string;
|
|
54
|
+
};
|
|
55
|
+
accessToken: string;
|
|
56
|
+
refreshToken: string;
|
|
57
|
+
authenticator?: Authenticator;
|
|
58
|
+
}>;
|
|
40
59
|
export interface AuthenticateInput__SecurityQuestion {
|
|
41
60
|
type: 'SECURITY_QUESTION';
|
|
42
61
|
token: string;
|
package/dist/services/auth.js
CHANGED
|
@@ -13,9 +13,6 @@ export async function createSession(input, options) {
|
|
|
13
13
|
if (input.type === 'MAYA') {
|
|
14
14
|
headers.set('Authorization', `MayaSession ${input.session}`);
|
|
15
15
|
}
|
|
16
|
-
if (input.type === 'LIBANGAN') {
|
|
17
|
-
headers.set('Authorization', `Libangan ${input.session}`);
|
|
18
|
-
}
|
|
19
16
|
if (input.type === 'SOCIALS') {
|
|
20
17
|
headers.set('Authorization', `Token ${input.token}`);
|
|
21
18
|
}
|
|
@@ -29,13 +26,35 @@ export async function createSession(input, options) {
|
|
|
29
26
|
headers.set(key, value);
|
|
30
27
|
});
|
|
31
28
|
try {
|
|
32
|
-
return await httpRequest.json(
|
|
33
|
-
|
|
34
|
-
:
|
|
29
|
+
return await httpRequest.json(`${AUTH_ENDPOINT}/sessions`, {
|
|
30
|
+
...options,
|
|
31
|
+
method: 'POST',
|
|
32
|
+
headers,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
if (e instanceof Error) {
|
|
37
|
+
throw e;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const error = new Error();
|
|
41
|
+
error.name = 'AccountNotFoundError';
|
|
42
|
+
error.message = 'Account not found';
|
|
43
|
+
Error.captureStackTrace?.(error, createSession);
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export async function createSessionLibangan(input, options) {
|
|
49
|
+
const headers = new Headers();
|
|
50
|
+
headers.set('Authorization', `Libangan ${input.session}`);
|
|
51
|
+
try {
|
|
52
|
+
const response = await httpRequest.json(`${AUTH_ENDPOINT}/v2/sessions`, {
|
|
35
53
|
...options,
|
|
36
54
|
method: 'POST',
|
|
37
55
|
headers,
|
|
38
56
|
});
|
|
57
|
+
return response.data;
|
|
39
58
|
}
|
|
40
59
|
catch (e) {
|
|
41
60
|
if (e instanceof Error) {
|
|
@@ -4,7 +4,7 @@ import { type HttpRequestOptions } from './httpRequest';
|
|
|
4
4
|
export interface SiteQuery {
|
|
5
5
|
data: Site;
|
|
6
6
|
}
|
|
7
|
-
export declare const getSite: (
|
|
7
|
+
export declare const getSite: (options?: HttpRequestOptions) => Promise<Site | null>;
|
|
8
8
|
export interface GamesQueryVariables {
|
|
9
9
|
after?: string;
|
|
10
10
|
first?: number;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { cache } from 'react';
|
|
2
|
-
import { CMS_PORTAL_ENDPOINT } from '../constants/index.js';
|
|
2
|
+
import { CMS_PORTAL_ENDPOINT, SITE_ID } from '../constants/index.js';
|
|
3
3
|
import { httpRequest } from './httpRequest.js';
|
|
4
|
-
export const getSite = cache(async (
|
|
4
|
+
export const getSite = cache(async (options) => {
|
|
5
5
|
try {
|
|
6
|
-
const { data } = await httpRequest.json(`${CMS_PORTAL_ENDPOINT}/v1/sites/${
|
|
6
|
+
const { data } = await httpRequest.json(`${CMS_PORTAL_ENDPOINT}/v1/sites/${SITE_ID}`, {
|
|
7
|
+
cache: 'force-cache',
|
|
8
|
+
...options,
|
|
9
|
+
next: {
|
|
10
|
+
revalidate: 60 * 5,
|
|
11
|
+
tags: ['site', SITE_ID],
|
|
12
|
+
...options?.next,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
7
15
|
return data ?? null;
|
|
8
16
|
}
|
|
9
17
|
catch {
|
|
@@ -53,7 +61,16 @@ export async function getGames(input, options) {
|
|
|
53
61
|
if (input?.sort)
|
|
54
62
|
search.set('sort[order]', input.sort);
|
|
55
63
|
try {
|
|
56
|
-
const
|
|
64
|
+
const qs = search.toString();
|
|
65
|
+
const res = await httpRequest.json(`${CMS_PORTAL_ENDPOINT}/v1/games?${qs}`, {
|
|
66
|
+
cache: 'force-cache',
|
|
67
|
+
...options,
|
|
68
|
+
next: {
|
|
69
|
+
revalidate: 60 * 5,
|
|
70
|
+
tags: ['games', qs],
|
|
71
|
+
...options?.next,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
57
74
|
return {
|
|
58
75
|
edges: res.data.map((node) => ({
|
|
59
76
|
node,
|
|
@@ -122,7 +139,16 @@ export const getGames__next = cache(async (input, options) => {
|
|
|
122
139
|
search.set('sort[context]', input.sort.context.toLowerCase());
|
|
123
140
|
}
|
|
124
141
|
try {
|
|
125
|
-
const
|
|
142
|
+
const qs = search.toString();
|
|
143
|
+
const res = await httpRequest.json(`${CMS_PORTAL_ENDPOINT}/v2/games?${qs}`, {
|
|
144
|
+
cache: 'force-cache',
|
|
145
|
+
...options,
|
|
146
|
+
next: {
|
|
147
|
+
revalidate: 60 * 5,
|
|
148
|
+
tags: ['games', qs],
|
|
149
|
+
...options?.next,
|
|
150
|
+
},
|
|
151
|
+
});
|
|
126
152
|
return {
|
|
127
153
|
edges: res.data.map((node) => ({
|
|
128
154
|
node,
|
package/dist/services/portal.js
CHANGED
|
@@ -7,11 +7,27 @@ export const getLatestBetRecords = cache(async (options) => {
|
|
|
7
7
|
return res.latestBetRecords;
|
|
8
8
|
});
|
|
9
9
|
export const getPlatform = cache(async (options) => {
|
|
10
|
-
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, PLATFORM, undefined,
|
|
10
|
+
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, PLATFORM, undefined, {
|
|
11
|
+
cache: 'force-cache',
|
|
12
|
+
...options,
|
|
13
|
+
next: {
|
|
14
|
+
revalidate: 60,
|
|
15
|
+
tags: ['platform'],
|
|
16
|
+
...options?.next,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
11
19
|
return res;
|
|
12
20
|
});
|
|
13
21
|
export const getRecommendedGames = cache(async (options) => {
|
|
14
|
-
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, RECOMMENDED_GAMES, undefined,
|
|
22
|
+
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, RECOMMENDED_GAMES, undefined, {
|
|
23
|
+
cache: 'force-cache',
|
|
24
|
+
...options,
|
|
25
|
+
next: {
|
|
26
|
+
revalidate: 60,
|
|
27
|
+
tags: ['recommendedGames'],
|
|
28
|
+
...options?.next,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
15
31
|
return res.recommendedGames;
|
|
16
32
|
});
|
|
17
33
|
export const getOnboardingStatus = cache(async (options) => {
|
|
@@ -39,6 +55,14 @@ export const skipOnboarding = async (options) => {
|
|
|
39
55
|
}
|
|
40
56
|
};
|
|
41
57
|
export const getTopWins = cache(async (options) => {
|
|
42
|
-
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, TOP_WINS, undefined,
|
|
58
|
+
const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, TOP_WINS, undefined, {
|
|
59
|
+
cache: 'force-cache',
|
|
60
|
+
...options,
|
|
61
|
+
next: {
|
|
62
|
+
revalidate: 60 * 5,
|
|
63
|
+
tags: ['topWins'],
|
|
64
|
+
...options?.next,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
43
67
|
return res.topWins;
|
|
44
68
|
});
|