@opexa/portal-components 0.0.154 → 0.0.158
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/useBonusesQuery.d.ts +2 -1
- package/dist/client/hooks/useBonusesQuery.js +3 -3
- package/dist/client/hooks/useMarkMessageAsReadMutation.js +5 -1
- package/dist/client/hooks/useMessagesQuery.js +1 -0
- package/dist/client/hooks/useUnreadMessagesCountQuery.js +1 -0
- package/dist/components/AccountVerification/AccountVerification.js +1 -5
- package/dist/components/Bonuses/Bonuses.client.js +29 -17
- package/dist/components/Bonuses/Bonuses.js +2 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/KYC/AutoOpen.d.ts +1 -0
- package/dist/components/KYC/AutoOpen.js +25 -0
- package/dist/components/KYC/BasicInformation.js +6 -4
- package/dist/components/KYC/CaptureSelfie.js +1 -2
- package/dist/components/KYC/FileUpload.js +29 -3
- package/dist/components/KYC/KYC.js +2 -1
- package/dist/components/KYC/KYC.lazy.js +3 -26
- package/dist/components/KYC/useKYC.d.ts +1 -0
- package/dist/components/KYC/useKYC.js +8 -0
- package/dist/components/KYC/utils.d.ts +1 -0
- package/dist/components/KYC/utils.js +9 -0
- package/dist/components/Messages/Messages.lazy.js +2 -2
- package/dist/components/Messages/MessagesPopup.js +19 -14
- package/dist/components/News/News.js +1 -1
- package/dist/components/PortalProvider/PortalProvider.js +2 -1
- package/dist/components/PortalProvider/WebVitals.d.ts +1 -0
- package/dist/components/PortalProvider/WebVitals.js +8 -0
- package/dist/components/Search/Search.lazy.js +2 -2
- package/dist/components/SignUp/SignUpForm.js +0 -4
- package/dist/constants/EnvVar.d.ts +1 -0
- package/dist/constants/EnvVar.js +5 -0
- package/dist/handlers.js +1 -4
- package/dist/server/utils/prefetchBonusesQuery.d.ts +2 -1
- package/dist/server/utils/prefetchBonusesQuery.js +3 -3
- package/dist/services/graphqlRequest.js +3 -1
- package/dist/services/httpRequest.js +3 -1
- package/dist/services/queries.d.ts +1 -1
- package/dist/services/queries.js +2 -2
- package/dist/services/wallet.d.ts +11 -2
- package/dist/services/wallet.js +2 -2
- package/dist/ui/Carousel/Carousel.d.ts +72 -72
- package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
- package/dist/ui/Tooltip/Tooltip.d.ts +48 -48
- package/dist/ui/Tooltip/tooltip.recipe.d.ts +8 -8
- package/dist/utils/queryKeys.d.ts +2 -2
- package/dist/utils/queryKeys.js +1 -1
- package/package.json +1 -1
- package/dist/components/KYC/backup/Header.d.ts +0 -1
- package/dist/components/KYC/backup/Header.js +0 -8
- package/dist/components/KYC/backup/Indicator.d.ts +0 -1
- package/dist/components/KYC/backup/Indicator.js +0 -9
- package/dist/components/KYC/backup/KYC.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.js +0 -14
- package/dist/components/KYC/backup/KYC.lazy.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.lazy.js +0 -26
- package/dist/components/KYC/backup/KYCContext.d.ts +0 -6
- package/dist/components/KYC/backup/KYCContext.js +0 -2
- package/dist/components/KYC/backup/Step1.d.ts +0 -1
- package/dist/components/KYC/backup/Step1.js +0 -13
- package/dist/components/KYC/backup/Step2.d.ts +0 -1
- package/dist/components/KYC/backup/Step2.js +0 -13
- package/dist/components/KYC/backup/Step3.d.ts +0 -1
- package/dist/components/KYC/backup/Step3.js +0 -13
- package/dist/components/KYC/backup/Step4.d.ts +0 -1
- package/dist/components/KYC/backup/Step4.js +0 -7
- package/dist/components/KYC/backup/useKYC.d.ts +0 -10
- package/dist/components/KYC/backup/useKYC.js +0 -8
- package/dist/components/KYC/loadModels.d.ts +0 -1
- package/dist/components/KYC/loadModels.js +0 -9
- package/dist/components/Messages/Message.d.ts +0 -1
- package/dist/components/Messages/Message.js +0 -37
- package/dist/components/Messages/MessageContext.d.ts +0 -6
- package/dist/components/Messages/MessageContext.js +0 -2
- package/dist/components/Messages/MessagePopup.d.ts +0 -1
- package/dist/components/Messages/MessagePopup.js +0 -24
- package/dist/components/Messages/MessageTrigger.d.ts +0 -8
- package/dist/components/Messages/MessageTrigger.js +0 -19
- package/dist/constants/BranchCode.d.ts +0 -4
- package/dist/constants/BranchCode.js +0 -42
- package/dist/icons/BellRingIcon.d.ts +0 -2
- package/dist/icons/BellRingIcon.js +0 -4
|
@@ -9,6 +9,7 @@ import { FacebookPixel, GoogleRecaptcha } from '../../third-parties/index.js';
|
|
|
9
9
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
10
10
|
import { Providers } from './Providers.js';
|
|
11
11
|
import { Snackbar } from './Snackbar.js';
|
|
12
|
+
import { WebVitals } from './WebVitals.js';
|
|
12
13
|
export async function PortalProvider({ children, facebookPixelId, googleAnalyticsId, googleTagManagerId, googleRecaptchaSiteKey, }) {
|
|
13
14
|
const queryClient = getQueryClient();
|
|
14
15
|
await Promise.allSettled([
|
|
@@ -17,5 +18,5 @@ export async function PortalProvider({ children, facebookPixelId, googleAnalytic
|
|
|
17
18
|
prefetchAccountQuery(),
|
|
18
19
|
prefetchWalletQuery(),
|
|
19
20
|
]);
|
|
20
|
-
return (_jsxs(_Fragment, { children: [_jsx(Providers, { children: _jsx(HydrationBoundary, { state: dehydrate(queryClient), children: children }) }), _jsx(Snackbar, {}), facebookPixelId && _jsx(FacebookPixel, { fbId: facebookPixelId }), googleAnalyticsId && _jsx(GoogleAnalytics, { gaId: googleAnalyticsId }), googleTagManagerId && _jsx(GoogleTagManager, { gtmId: googleTagManagerId }), googleRecaptchaSiteKey && (_jsx(GoogleRecaptcha, { siteKey: googleRecaptchaSiteKey }))] }));
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx(WebVitals, {}), _jsx(Providers, { children: _jsx(HydrationBoundary, { state: dehydrate(queryClient), children: children }) }), _jsx(Snackbar, {}), facebookPixelId && _jsx(FacebookPixel, { fbId: facebookPixelId }), googleAnalyticsId && _jsx(GoogleAnalytics, { gaId: googleAnalyticsId }), googleTagManagerId && _jsx(GoogleTagManager, { gtmId: googleTagManagerId }), googleRecaptchaSiteKey && (_jsx(GoogleRecaptcha, { siteKey: googleRecaptchaSiteKey }))] }));
|
|
21
22
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function WebVitals(): null;
|
|
@@ -70,10 +70,10 @@ export function Search(props) {
|
|
|
70
70
|
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "bg-bg-primary lg:min-h-auto mx-auto min-h-full w-full pt-xl lg:mt-[132px] lg:max-w-[1136px] lg:bg-unset lg:pt-0", children: [_jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "flex items-center justify-between px-4 lg:hidden", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 40, className: "h-8 w-auto" }), _jsx(IconButton, { size: "sm", colorScheme: "gray", onClick: () => api.setOpen(false), children: _jsx(XIcon, { className: "text-text-quinary size-6" }) })] })) }), _jsx("div", { className: "flex justify-end", children: _jsx(Dialog.Context, { children: (api) => (_jsx("button", { type: "button", onClick: () => api.setOpen(false), className: "hidden size-9 items-center justify-center rounded-md bg-white/20 lg:flex", children: _jsx(XIcon, { className: "size-5 text-white" }) })) }) }), _jsx("div", { className: "mt-2xl px-4 lg:mt-xl lg:px-0", children: _jsxs("div", { className: "relative", children: [_jsx(SearchLgIcon, { className: "text-text-quinary pointer-events-none absolute left-3.5 top-1/2 size-5 -translate-y-1/2" }), _jsx(DebouncedInput, { ref: inputRef, value: search, onChange: setSearch }), _jsx(Presence, { present: search.length > 0, asChild: true, lazyMount: true, children: _jsx("button", { type: "button", className: "text-text-secondary-700 absolute right-3.5 top-1/2 -translate-y-1/2 font-semibold", onClick: () => {
|
|
71
71
|
setSearch('');
|
|
72
72
|
inputRef.current?.focus();
|
|
73
|
-
}, children: "Clear" }) })] }) }), _jsx("div", { className: "lg:bg-bg-primary lg:border-border-primary mt-2xl p-xl pb-3xl lg:mt-2 lg:max-h-[41rem] lg:overflow-y-auto lg:rounded-xl lg:border", children: search.length <= 0 ? (_jsx(Alert, { message: "Search for your favorite game or provider." })) : search.length >= 1 && search.length <= 2 ? (_jsx(Alert, { message: "Search requires at least 3 characters." })) : (_jsxs(_Fragment, { children: [empty && _jsx(Alert, { message: "No results found" }), !empty && (_jsxs(_Fragment, { children: [gameProviders.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "text-lg font-semibold", children: "Providers" }), _jsx("div", { className: "mt-3.5 grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: viewGamesUrl(provider), "aria-label": `View ${provider.name} games`, className: twMerge('bg-gray-800 flex h-14 w-full items-center rounded-md', classNames.providerThumbnailRoot), onClick: () => {
|
|
73
|
+
}, children: "Clear" }) })] }) }), _jsx("div", { className: "lg:bg-bg-primary lg:border-border-primary mt-2xl p-xl pb-3xl lg:mt-2 lg:max-h-[41rem] lg:overflow-y-auto lg:rounded-xl lg:border", children: search.length <= 0 ? (_jsx(Alert, { message: "Search for your favorite game or provider." })) : search.length >= 1 && search.length <= 2 ? (_jsx(Alert, { message: "Search requires at least 3 characters." })) : (_jsxs(_Fragment, { children: [empty && _jsx(Alert, { message: "No results found" }), !empty && (_jsxs(_Fragment, { children: [gameProviders.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "text-lg font-semibold", children: "Providers" }), _jsx("div", { className: "mb-3xl mt-3.5 grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: viewGamesUrl(provider), "aria-label": `View ${provider.name} games`, className: twMerge('bg-gray-800 flex h-14 w-full items-center rounded-md', classNames.providerThumbnailRoot), onClick: () => {
|
|
74
74
|
globalStore.search.setOpen(false);
|
|
75
75
|
}, children: _jsx(Image, { src: props.gameProviderImages?.[provider.id] ??
|
|
76
|
-
provider.logo, alt: "", width: 100, height: 50, className: twMerge('mx-auto h-auto w-full', classNames.providerThumbnailImage) }) }, provider.id))) })] })), games.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "
|
|
76
|
+
provider.logo, alt: "", width: 100, height: 50, className: twMerge('mx-auto h-auto w-full', classNames.providerThumbnailImage) }) }, provider.id))) })] })), games.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "text-lg font-semibold", children: "Games" }), _jsx("div", { className: "mt-3.5 grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: games.map((game) => (_jsxs(GameLaunchTrigger, { game: game, className: twMerge('block w-full shadow-sm', classNames.gameThumbnailRoot), onClick: () => {
|
|
77
77
|
globalStore.search.setOpen(false);
|
|
78
78
|
}, children: [_jsx(Image, { src: getGameImageUrl({
|
|
79
79
|
reference: game.reference,
|
|
@@ -46,9 +46,6 @@ export function SignUpForm() {
|
|
|
46
46
|
itemToValue: (item) => item.code,
|
|
47
47
|
itemToString: (item) => `${item.code} - ${item.name}`,
|
|
48
48
|
});
|
|
49
|
-
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
50
|
-
kyc: ctx.kyc,
|
|
51
|
-
})));
|
|
52
49
|
const [step, setStep] = useState(1);
|
|
53
50
|
const dialog = useDialogContext();
|
|
54
51
|
const search = useSearchParams();
|
|
@@ -242,7 +239,6 @@ export function SignUpForm() {
|
|
|
242
239
|
dialog.setOpen(false);
|
|
243
240
|
step1Form.reset();
|
|
244
241
|
step2Form.reset();
|
|
245
|
-
globalStore.kyc.setOpen(true);
|
|
246
242
|
setStep(1);
|
|
247
243
|
}
|
|
248
244
|
catch (error) {
|
package/dist/constants/EnvVar.js
CHANGED
|
@@ -26,3 +26,8 @@ export const BYPASS_RECAPTCHA = z
|
|
|
26
26
|
.transform(Boolean)
|
|
27
27
|
.catch(false)
|
|
28
28
|
.parse(process.env.NEXT_PUBLIC_BYPASS_RECAPTCHA);
|
|
29
|
+
export const DOMAIN = z
|
|
30
|
+
.string()
|
|
31
|
+
.url('Environment variable "NEXT_PUBLIC_DOMAIN" must be a valid URL')
|
|
32
|
+
.catch('http://localhost')
|
|
33
|
+
.parse(process.env.NEXT_PUBLIC_DOMAIN);
|
package/dist/handlers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addDays, addMinutes, subMinutes } from 'date-fns';
|
|
2
2
|
import { NextResponse } from 'next/server';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { ACCESS_TOKEN_COOKIE_NAME,
|
|
4
|
+
import { ACCESS_TOKEN_COOKIE_NAME, PLATFORM_CODE, RECAPTCHA_HEADER_KEY, REFRESH_TOKEN_COOKIE_NAME, } from './constants/index.js';
|
|
5
5
|
import { authenticate, createSession, destroySession, refreshSession, } from './services/auth.js';
|
|
6
6
|
const CreateSessionDefinition = z.union([
|
|
7
7
|
z.object({
|
|
@@ -172,9 +172,6 @@ export const POST = async (request, { params }) => {
|
|
|
172
172
|
...(recaptcha && {
|
|
173
173
|
[RECAPTCHA_HEADER_KEY]: recaptcha,
|
|
174
174
|
}),
|
|
175
|
-
...(BYPASS_RECAPTCHA && {
|
|
176
|
-
'Test-Pass': '',
|
|
177
|
-
}),
|
|
178
175
|
},
|
|
179
176
|
});
|
|
180
177
|
if (res.authenticator) {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { type BonusesInput } from '../../services/wallet';
|
|
2
|
+
export declare const prefetchBonusesQuery: (input?: BonusesInput) => Promise<void>;
|
|
@@ -3,15 +3,15 @@ import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
|
3
3
|
import { log } from '../../utils/log.js';
|
|
4
4
|
import { getBonusesQueryKey } from '../../utils/queryKeys.js';
|
|
5
5
|
import { getSession } from '../services/getSession.js';
|
|
6
|
-
export const prefetchBonusesQuery = async () => {
|
|
6
|
+
export const prefetchBonusesQuery = async (input) => {
|
|
7
7
|
const session = await getSession();
|
|
8
8
|
if (session.status === 'unauthenticated')
|
|
9
9
|
return;
|
|
10
10
|
await getQueryClient()
|
|
11
11
|
.prefetchQuery({
|
|
12
|
-
queryKey: getBonusesQueryKey(),
|
|
12
|
+
queryKey: getBonusesQueryKey(input),
|
|
13
13
|
queryFn: async ({ signal }) => {
|
|
14
|
-
return await getBonuses({
|
|
14
|
+
return await getBonuses(input, {
|
|
15
15
|
signal,
|
|
16
16
|
headers: {
|
|
17
17
|
Authorization: `Bearer ${session.token}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { BYPASS_RECAPTCHA, ENVIRONMENT, PLATFORM_CODE, PLATFORM_ID, RECAPTCHA_HEADER_KEY, SITE_ID, TEST_PASS_HEADER_KEY, } from '../constants/index.js';
|
|
2
|
+
import { BYPASS_RECAPTCHA, DOMAIN, ENVIRONMENT, PLATFORM_CODE, PLATFORM_ID, RECAPTCHA_HEADER_KEY, SITE_ID, TEST_PASS_HEADER_KEY, } from '../constants/index.js';
|
|
3
3
|
export async function graphqlRequest(url, query, variables, options) {
|
|
4
4
|
const headers = new Headers();
|
|
5
5
|
headers.set('Role', 'MEMBER');
|
|
@@ -9,6 +9,7 @@ export async function graphqlRequest(url, query, variables, options) {
|
|
|
9
9
|
headers.set('Environment', ENVIRONMENT);
|
|
10
10
|
headers.set('Accept', 'application/json');
|
|
11
11
|
headers.set('Content-Type', 'application/json');
|
|
12
|
+
headers.set('Domain', DOMAIN);
|
|
12
13
|
new Headers(options?.headers).forEach((value, key) => {
|
|
13
14
|
headers.set(key, value);
|
|
14
15
|
});
|
|
@@ -113,6 +114,7 @@ export async function graphqlUpload(url, query, variables, options) {
|
|
|
113
114
|
headers.set('Platform-ID', PLATFORM_ID);
|
|
114
115
|
headers.set('Platform-Code', PLATFORM_CODE);
|
|
115
116
|
headers.set('Environment', ENVIRONMENT);
|
|
117
|
+
headers.set('Domain', DOMAIN);
|
|
116
118
|
headers.delete('Content-Type');
|
|
117
119
|
if (BYPASS_RECAPTCHA) {
|
|
118
120
|
headers.set(TEST_PASS_HEADER_KEY, '');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { BYPASS_RECAPTCHA, ENVIRONMENT, PLATFORM_CODE, PLATFORM_ID, RECAPTCHA_HEADER_KEY, SITE_ID, TEST_PASS_HEADER_KEY, } from '../constants/index.js';
|
|
2
|
+
import { BYPASS_RECAPTCHA, DOMAIN, ENVIRONMENT, PLATFORM_CODE, PLATFORM_ID, RECAPTCHA_HEADER_KEY, SITE_ID, TEST_PASS_HEADER_KEY, } from '../constants/index.js';
|
|
3
3
|
export async function httpRequest(url, opts = {}) {
|
|
4
4
|
const headers = new Headers(opts.headers);
|
|
5
5
|
headers.set('Role', 'MEMBER');
|
|
@@ -7,6 +7,7 @@ export async function httpRequest(url, opts = {}) {
|
|
|
7
7
|
headers.set('Platform-ID', PLATFORM_ID);
|
|
8
8
|
headers.set('Platform-Code', PLATFORM_CODE);
|
|
9
9
|
headers.set('Environment', ENVIRONMENT);
|
|
10
|
+
headers.set('Domain', DOMAIN);
|
|
10
11
|
new Headers(opts.headers).forEach((value, key) => {
|
|
11
12
|
headers.set(key, value);
|
|
12
13
|
});
|
|
@@ -44,6 +45,7 @@ httpRequest.json = async (url, opts = {}) => {
|
|
|
44
45
|
headers.set('Platform-Code', PLATFORM_CODE);
|
|
45
46
|
headers.set('Accept', 'application/json');
|
|
46
47
|
headers.set('Content-Type', 'application/json');
|
|
48
|
+
headers.set('Domain', DOMAIN);
|
|
47
49
|
new Headers(opts.headers).forEach((value, key) => {
|
|
48
50
|
headers.set(key, value);
|
|
49
51
|
});
|
|
@@ -47,7 +47,7 @@ export declare const CASHBACK_FRAGMENT = "\n \n fragment FileFragment on File
|
|
|
47
47
|
export declare const CASHBACKS = "\n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment CashbackFragment on Cashback {\n id\n name\n banner {\n ...FileFragment\n }\n minimumCashback\n maximumMonthlyCashback\n status\n description\n activationStartDateTime\n activationEndDateTime\n turnoverContributionPercentagePerGameProvider\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query Cashbacks {\n cashbacks {\n ...CashbackFragment\n }\n }\n";
|
|
48
48
|
export declare const CASHBACK = "\n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment CashbackFragment on Cashback {\n id\n name\n banner {\n ...FileFragment\n }\n minimumCashback\n maximumMonthlyCashback\n status\n description\n activationStartDateTime\n activationEndDateTime\n turnoverContributionPercentagePerGameProvider\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query Cashback($id: ObjectId!) {\n node(id: $id) {\n ... on Cashback {\n ...CashbackFragment\n }\n }\n }\n";
|
|
49
49
|
export declare const BONUS_FRAGMENT = "\n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n";
|
|
50
|
-
export declare const BONUSES = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query Bonuses {\n bonuses {\n ...BonusFragment\n }\n }\n";
|
|
50
|
+
export declare const BONUSES = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query Bonuses($filter: BonusFilterInput) {\n bonuses(filter: $filter) {\n ...BonusFragment\n }\n }\n";
|
|
51
51
|
export declare const BONUS_IDS = "\n query BonusIds {\n bonuses {\n id\n }\n }\n";
|
|
52
52
|
export declare const BONUS_BALANCES = "\n query BonusesBalance {\n bonuses {\n balance\n }\n }\n";
|
|
53
53
|
export declare const BONUS = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query Bonus($id: ObjectId!) {\n node(id: $id) {\n ... on Bonus {\n ...BonusFragment\n }\n }\n }\n";
|
package/dist/services/queries.js
CHANGED
|
@@ -1187,8 +1187,8 @@ export const BONUS_FRAGMENT = /* GraphQL */ `
|
|
|
1187
1187
|
export const BONUSES = /* GraphQL */ `
|
|
1188
1188
|
${BONUS_FRAGMENT}
|
|
1189
1189
|
|
|
1190
|
-
query Bonuses {
|
|
1191
|
-
bonuses {
|
|
1190
|
+
query Bonuses($filter: BonusFilterInput) {
|
|
1191
|
+
bonuses(filter: $filter) {
|
|
1192
1192
|
...BonusFragment
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Simplify, SimplifyDeep } from 'type-fest';
|
|
2
|
-
import type { Bonus, Cashback, CashbackBonus, Deposit, EnumFilterField, FavoriteGame, GameSession, InstapayBank, MayaSession, PointsWallet, Promo, PromoType, Wallet } from '../types';
|
|
2
|
+
import type { Bonus, Cashback, CashbackBonus, DateFilterField, Deposit, EnumFilterField, FavoriteGame, GameSession, InstapayBank, MayaSession, ObjectIdFilterField, PointsWallet, Promo, PromoType, Wallet } from '../types';
|
|
3
3
|
import { type GraphQLRequestOptions } from './graphqlRequest';
|
|
4
4
|
export interface PromosQuery {
|
|
5
5
|
promos: Promo[];
|
|
@@ -407,10 +407,18 @@ export interface ValidateMayaSessionMutation {
|
|
|
407
407
|
validateMayaSession: boolean;
|
|
408
408
|
}
|
|
409
409
|
export declare const validateMayaSession: (options?: GraphQLRequestOptions) => Promise<void>;
|
|
410
|
+
interface BonusesQueryVariables {
|
|
411
|
+
filter?: {
|
|
412
|
+
promo?: ObjectIdFilterField;
|
|
413
|
+
expiration?: DateFilterField;
|
|
414
|
+
dateTimeCreated?: DateFilterField;
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
export type BonusesInput = SimplifyDeep<BonusesQueryVariables>;
|
|
410
418
|
export interface BonusesQuery {
|
|
411
419
|
bonuses?: Bonus[] | null;
|
|
412
420
|
}
|
|
413
|
-
export declare const getBonuses: (options?: GraphQLRequestOptions) => Promise<Bonus[]>;
|
|
421
|
+
export declare const getBonuses: (input?: BonusesInput, options?: GraphQLRequestOptions) => Promise<Bonus[]>;
|
|
414
422
|
export interface BonusIdsQuery {
|
|
415
423
|
bonuses?: {
|
|
416
424
|
id: string;
|
|
@@ -474,3 +482,4 @@ export interface FavoriteGamesQuery {
|
|
|
474
482
|
favoriteGames: FavoriteGame[];
|
|
475
483
|
}
|
|
476
484
|
export declare const getFavoriteGames: (options?: GraphQLRequestOptions) => Promise<FavoriteGame[]>;
|
|
485
|
+
export {};
|
package/dist/services/wallet.js
CHANGED
|
@@ -330,8 +330,8 @@ export const validateMayaSession = async (options) => {
|
|
|
330
330
|
throw error;
|
|
331
331
|
}
|
|
332
332
|
};
|
|
333
|
-
export const getBonuses = cache(async (options) => {
|
|
334
|
-
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUSES,
|
|
333
|
+
export const getBonuses = cache(async (input, options) => {
|
|
334
|
+
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUSES, input, options);
|
|
335
335
|
return res.bonuses ?? [];
|
|
336
336
|
});
|
|
337
337
|
export const getBonusesCount = cache(async (options) => {
|