@opexa/portal-components 0.1.36 → 0.1.38
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/usePlatformGamesQuery.d.ts +3 -0
- package/dist/client/hooks/usePlatformGamesQuery.js +42 -0
- package/dist/components/Search/Search.lazy.d.ts +15 -1
- package/dist/components/Search/Search.lazy.js +41 -3
- package/dist/images/game-types/arcade.png +0 -0
- package/dist/images/game-types/bingo.png +0 -0
- package/dist/images/game-types/live.png +0 -0
- package/dist/images/game-types/numeric.png +0 -0
- package/dist/images/game-types/slots.png +0 -0
- package/dist/images/game-types/specialty.png +0 -0
- package/dist/images/game-types/sports.png +0 -0
- package/dist/schemas/forgotPasswordSchema.d.ts +4 -4
- package/dist/services/queries.d.ts +1 -0
- package/dist/services/queries.js +28 -0
- package/dist/services/wallet.d.ts +20 -1
- package/dist/services/wallet.js +5 -1
- package/dist/types/index.d.ts +12 -0
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
- package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/PinInput/PinInput.d.ts +12 -12
- package/dist/ui/PinInput/pinInput.recipe.d.ts +3 -3
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/utils/queryKeys.d.ts +2 -1
- package/dist/utils/queryKeys.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
import { getPlatformGames, } from '../../services/wallet.js';
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getPlatformGamesQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
6
|
+
import { getSession } from '../services/getSession.js';
|
|
7
|
+
import { useSessionQuery } from './useSessionQuery.js';
|
|
8
|
+
export const usePlatformGamesQuery = (input, config) => {
|
|
9
|
+
const sessionQuery = useSessionQuery();
|
|
10
|
+
return useInfiniteQuery({
|
|
11
|
+
refetchOnMount: false,
|
|
12
|
+
refetchOnReconnect: false,
|
|
13
|
+
refetchOnWindowFocus: false,
|
|
14
|
+
...config,
|
|
15
|
+
enabled: config?.enabled === false
|
|
16
|
+
? false
|
|
17
|
+
: sessionQuery.data?.status === 'authenticated',
|
|
18
|
+
queryKey: getPlatformGamesQueryKey(input),
|
|
19
|
+
queryFn: async ({ pageParam, signal }) => {
|
|
20
|
+
const session = await getQueryClient().fetchQuery({
|
|
21
|
+
queryKey: getSessionQueryKey(),
|
|
22
|
+
queryFn: async () => getSession(),
|
|
23
|
+
});
|
|
24
|
+
invariant(session.status === 'authenticated');
|
|
25
|
+
return getPlatformGames({
|
|
26
|
+
...input,
|
|
27
|
+
after: pageParam,
|
|
28
|
+
}, {
|
|
29
|
+
signal,
|
|
30
|
+
headers: {
|
|
31
|
+
Authorization: `Bearer ${session.token}`,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
initialPageParam: undefined,
|
|
36
|
+
getNextPageParam(lastPage) {
|
|
37
|
+
if (lastPage?.pageInfo?.hasNextPage) {
|
|
38
|
+
return lastPage?.pageInfo?.endCursor;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ImageProps } from 'next/image';
|
|
2
2
|
import { type BypassDomainConfig } from '../../client/hooks/useBypassKycChecker';
|
|
3
|
-
import type { GameProvider, GameProviderData, GameType } from '../../types';
|
|
3
|
+
import type { GameProvider, GameProviderData, GameType, GameTypeData } from '../../types';
|
|
4
4
|
export interface ClassNameEntries {
|
|
5
5
|
root?: string;
|
|
6
6
|
gameThumbnailRoot?: string;
|
|
@@ -8,6 +8,8 @@ export interface ClassNameEntries {
|
|
|
8
8
|
gameSearchResult?: string;
|
|
9
9
|
providerThumbnailRoot?: string;
|
|
10
10
|
providerThumbnailImage?: string;
|
|
11
|
+
gameTypeThumbnailRoot?: string;
|
|
12
|
+
gameTypeThumbnailName?: string;
|
|
11
13
|
loadMoreButton?: string;
|
|
12
14
|
}
|
|
13
15
|
export interface SearchProps {
|
|
@@ -26,7 +28,19 @@ export interface SearchProps {
|
|
|
26
28
|
* ```
|
|
27
29
|
*/
|
|
28
30
|
viewGamesUrl?: string | ((gameProvider: GameProviderData) => string);
|
|
31
|
+
/**
|
|
32
|
+
* @default '/games/<slug>'
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* '/games/:slug' // '/games/slots'
|
|
36
|
+
* '/games/:id' // '/games/SLOTS'
|
|
37
|
+
* // or using a function
|
|
38
|
+
* ({slug}) => `/games/${slug}`
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
viewGameTypeUrl?: string | ((gameType: GameTypeData) => string);
|
|
29
42
|
gameProviderImages?: Partial<Record<GameProvider, ImageProps['src']>>;
|
|
43
|
+
gameTypeImages?: Partial<Record<GameType, ImageProps['src']>>;
|
|
30
44
|
placeholder?: string;
|
|
31
45
|
bypassDomains?: BypassDomainConfig[];
|
|
32
46
|
variant?: string;
|
|
@@ -9,11 +9,19 @@ import { useDebounceCallback } from 'usehooks-ts';
|
|
|
9
9
|
import { useShallow } from 'zustand/shallow';
|
|
10
10
|
import { useBypassKycChecker, } from '../../client/hooks/useBypassKycChecker.js';
|
|
11
11
|
import { useControllableState } from '../../client/hooks/useControllableState.js';
|
|
12
|
+
import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
|
|
12
13
|
import { useGamesQuery } from '../../client/hooks/useGamesQuery.js';
|
|
13
14
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
14
|
-
import { GAME_PROVIDER_DATA } from '../../constants/index.js';
|
|
15
|
+
import { GAME_PROVIDER_DATA, GAME_TYPE_DATA } from '../../constants/index.js';
|
|
15
16
|
import { SearchLgIcon } from '../../icons/SearchLgIcon.js';
|
|
16
17
|
import { XIcon } from '../../icons/XIcon.js';
|
|
18
|
+
import arcadeImg from '../../images/game-types/arcade.png';
|
|
19
|
+
import bingoImg from '../../images/game-types/bingo.png';
|
|
20
|
+
import liveImg from '../../images/game-types/live.png';
|
|
21
|
+
import numericImg from '../../images/game-types/numeric.png';
|
|
22
|
+
import slotsImg from '../../images/game-types/slots.png';
|
|
23
|
+
import specialtyImg from '../../images/game-types/specialty.png';
|
|
24
|
+
import sportsImg from '../../images/game-types/sports.png';
|
|
17
25
|
import RainbowballImg from '../../images/rainbow-ball-online.webp';
|
|
18
26
|
import { Button } from '../../ui/Button/index.js';
|
|
19
27
|
import { Dialog } from '../../ui/Dialog/index.js';
|
|
@@ -31,6 +39,7 @@ function lookup(value, compare) {
|
|
|
31
39
|
}
|
|
32
40
|
export function Search(props) {
|
|
33
41
|
const isBypass = useBypassKycChecker(props.bypassDomains);
|
|
42
|
+
const featureFlag = useFeatureFlag();
|
|
34
43
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
35
44
|
search: ctx.search,
|
|
36
45
|
})));
|
|
@@ -44,6 +53,20 @@ export function Search(props) {
|
|
|
44
53
|
.filter((provider) => {
|
|
45
54
|
return lookup(provider.name, search) || lookup(provider.slug, search);
|
|
46
55
|
});
|
|
56
|
+
const gameTypesFiltered = props.gameTypes
|
|
57
|
+
.map((type) => GAME_TYPE_DATA[type])
|
|
58
|
+
.filter((type) => {
|
|
59
|
+
return lookup(type.name, search) || lookup(type.slug, search);
|
|
60
|
+
});
|
|
61
|
+
const defaultGameTypeImages = {
|
|
62
|
+
ARCADE: arcadeImg,
|
|
63
|
+
BINGO: bingoImg,
|
|
64
|
+
LIVE: liveImg,
|
|
65
|
+
NUMERIC: numericImg,
|
|
66
|
+
SLOTS: slotsImg,
|
|
67
|
+
SPECIALTY: specialtyImg,
|
|
68
|
+
SPORTS: sportsImg,
|
|
69
|
+
};
|
|
47
70
|
const gamesQuery = useGamesQuery({
|
|
48
71
|
first: 18,
|
|
49
72
|
search: gameProviders.length > 0 ? undefined : search,
|
|
@@ -91,7 +114,9 @@ export function Search(props) {
|
|
|
91
114
|
void collapsedGamesQuery.fetchNextPage();
|
|
92
115
|
}
|
|
93
116
|
}
|
|
94
|
-
const empty = games.length <= 0 &&
|
|
117
|
+
const empty = games.length <= 0 &&
|
|
118
|
+
gameProviders.length <= 0 &&
|
|
119
|
+
gameTypesFiltered.length <= 0;
|
|
95
120
|
const viewGamesUrl = (data) => {
|
|
96
121
|
return props.viewGamesUrl
|
|
97
122
|
? callIfFn(props.viewGamesUrl, data)
|
|
@@ -99,19 +124,32 @@ export function Search(props) {
|
|
|
99
124
|
.replace(':slug', data.slug)
|
|
100
125
|
: `/providers/${data.slug}`;
|
|
101
126
|
};
|
|
127
|
+
const viewGameTypeUrl = (data) => {
|
|
128
|
+
return props.viewGameTypeUrl
|
|
129
|
+
? callIfFn(props.viewGameTypeUrl, data)
|
|
130
|
+
.replace(':id', data.id)
|
|
131
|
+
.replace(':slug', data.slug)
|
|
132
|
+
: `/casino/${data.slug}`;
|
|
133
|
+
};
|
|
102
134
|
const classNames = isString(props.className)
|
|
103
135
|
? { root: props.className }
|
|
104
136
|
: (props.className ?? {});
|
|
105
137
|
function fixMojibake(str) {
|
|
106
138
|
return str.replace(/ÔÇÖ/g, "'").replace(/ÔÇô/g, '');
|
|
107
139
|
}
|
|
140
|
+
console.log(gameTypesFiltered, 'gameTypesFiltered');
|
|
108
141
|
return (_jsx(Dialog.Root, { open: globalStore.search.open, onOpenChange: (details) => {
|
|
109
142
|
globalStore.search.setOpen(details.open);
|
|
110
143
|
setSearch('');
|
|
111
144
|
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "mx-auto min-h-full w-full overflow-y-auto bg-bg-primary pt-xl lg:mt-[132px] lg:min-h-auto lg:max-w-[1136px] lg:bg-unset lg:px-2 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: "size-6 text-text-quinary" }) })] })) }), _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: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3.5 size-5 text-text-quinary" }), _jsx(DebouncedInput, { ref: inputRef, value: search, placeholder: props.placeholder ?? 'Search', onChange: setSearch }), _jsx(Presence, { present: search.length > 0, asChild: true, lazyMount: true, children: _jsx("button", { type: "button", className: "-translate-y-1/2 absolute top-1/2 right-3.5 cursor-pointer font-semibold text-text-secondary-700", onClick: () => {
|
|
112
145
|
setSearch('');
|
|
113
146
|
inputRef.current?.focus();
|
|
114
|
-
}, children: "Clear" }) })] }) }), _jsx("div", { className: "flex max-h-[85dvh] min-h-0 flex-1 flex-col", children: _jsx("div", { className: "mt-2xl p-xl pb-3xl lg:mt-2 lg:max-h-[41rem] lg:overflow-y-auto lg:rounded-xl lg:border lg:border-border-primary lg:bg-bg-primary", children: search.length <= 0 ? (_jsx(Alert, { message: "Search for your favorite game or
|
|
147
|
+
}, children: "Clear" }) })] }) }), _jsx("div", { className: "flex max-h-[85dvh] min-h-0 flex-1 flex-col", children: _jsx("div", { className: "mt-2xl p-xl pb-3xl lg:mt-2 lg:max-h-[41rem] lg:overflow-y-auto lg:rounded-xl lg:border lg:border-border-primary lg:bg-bg-primary", children: search.length <= 0 ? (_jsx(Alert, { message: "Search for your favorite game, provider, or game type." })) : search.length === 1 ? (_jsx(Alert, { message: "Search requires at least 2 characters." })) : (_jsxs(_Fragment, { children: [empty && _jsx(Alert, { message: "No results found" }), !empty && (_jsxs(_Fragment, { children: [gameTypesFiltered.length > 0 &&
|
|
148
|
+
featureFlag.enabled && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "font-semibold text-lg", children: "Type" }), _jsx("div", { className: "mt-3.5 mb-3xl grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: gameTypesFiltered.map((type) => (_jsx(Link, { href: viewGameTypeUrl(type), "aria-label": `View ${type.name} games`, className: twMerge('flex h-14 w-full items-center rounded-md bg-bg-primary-alt', classNames.gameTypeThumbnailRoot), onClick: () => {
|
|
149
|
+
globalStore.search.setOpen(false);
|
|
150
|
+
}, children: _jsx(Image, { src: props.gameTypeImages?.[type.id] ??
|
|
151
|
+
defaultGameTypeImages[type.id] ??
|
|
152
|
+
'', alt: "", width: 100, height: 50, className: twMerge('mx-auto h-auto w-full', classNames.gameTypeThumbnailName) }) }, type.id))) })] })), gameProviders.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "font-semibold text-lg", children: "Providers" }), _jsx("div", { className: "mt-3.5 mb-3xl 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('flex h-14 w-full items-center rounded-md bg-brand-800', classNames.providerThumbnailRoot), onClick: () => {
|
|
115
153
|
globalStore.search.setOpen(false);
|
|
116
154
|
}, children: _jsx(Image, { src: props.gameProviderImages?.[provider.id] ??
|
|
117
155
|
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: "font-semibold text-lg", children: "Games" }), _jsx("div", { className: twMerge('mt-3.5 grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5', classNames.gameSearchResult), children: games.map((game) => (_jsxs(GameLaunchTrigger, { bypassKycCheck: isBypass, game: game, className: twMerge('block w-full shadow-sm', classNames.gameThumbnailRoot), onClick: () => {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -8,23 +8,23 @@ export declare const createForgotPasswordSchema: (mobileNumberParser: MobileNumb
|
|
|
8
8
|
mobileNumber: z.ZodEffects<z.ZodString, string, string>;
|
|
9
9
|
verificationCode: z.ZodEffects<z.ZodString, string, string>;
|
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
verificationCode: string;
|
|
12
11
|
password: string;
|
|
12
|
+
verificationCode: string;
|
|
13
13
|
mobileNumber: string;
|
|
14
14
|
confirmPassword: string;
|
|
15
15
|
}, {
|
|
16
|
-
verificationCode: string;
|
|
17
16
|
password: string;
|
|
17
|
+
verificationCode: string;
|
|
18
18
|
mobileNumber: string;
|
|
19
19
|
confirmPassword: string;
|
|
20
20
|
}>, {
|
|
21
|
-
verificationCode: string;
|
|
22
21
|
password: string;
|
|
22
|
+
verificationCode: string;
|
|
23
23
|
mobileNumber: string;
|
|
24
24
|
confirmPassword: string;
|
|
25
25
|
}, {
|
|
26
|
-
verificationCode: string;
|
|
27
26
|
password: string;
|
|
27
|
+
verificationCode: string;
|
|
28
28
|
mobileNumber: string;
|
|
29
29
|
confirmPassword: string;
|
|
30
30
|
}>;
|
|
@@ -140,6 +140,7 @@ export declare const UNLINK_FIREBASE_CLOUD_MESSAGING_DEVICE = "\n mutation Unli
|
|
|
140
140
|
export declare const MARK_GAME_AS_FAVORITE = "\n mutation MarkGameAsFavorite($input: MarkGameAsFavoriteInput!) {\n markGameAsFavorite(input: $input)\n }\n";
|
|
141
141
|
export declare const UNMARK_GAME_AS_FAVORITE = "\n mutation UnmarkGameAsFavorite($input: UnmarkGameAsFavoriteInput!) {\n unmarkGameAsFavorite(input: $input)\n }\n";
|
|
142
142
|
export declare const FAVORITE_GAMES = "\n query FavoriteGames {\n favoriteGames {\n ... on Game {\n id\n name\n type\n provider\n }\n }\n }\n";
|
|
143
|
+
export declare const PLATFORM_GAMES = "\n query PlatformGames($first: Int, $after: Cursor, $filter: _GameFilterInput) {\n _games(first: $first, after: $after, filter: $filter) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n cursor\n node {\n ... on _Game {\n id\n reference\n name\n displayName\n type\n provider\n status\n hidden\n hasFreeBet\n hasJackpot\n }\n }\n }\n }\n }\n";
|
|
143
144
|
export declare const GOOGLE_CLIENT_ID = "\n query GoogleClientId {\n googleClientId\n }\n";
|
|
144
145
|
export declare const FACEBOOK_CLIENT_ID = "\n query FacebookClientId {\n facebookClientId\n }\n";
|
|
145
146
|
export declare const REQUIRE_FIRST_DEPOSIT = "\n query RequireFirstDeposit {\n requireFirstDeposit\n }\n";
|
package/dist/services/queries.js
CHANGED
|
@@ -3325,6 +3325,34 @@ export const FAVORITE_GAMES = /* GraphQL */ `
|
|
|
3325
3325
|
}
|
|
3326
3326
|
}
|
|
3327
3327
|
`;
|
|
3328
|
+
export const PLATFORM_GAMES = /* GraphQL */ `
|
|
3329
|
+
query PlatformGames($first: Int, $after: Cursor, $filter: _GameFilterInput) {
|
|
3330
|
+
_games(first: $first, after: $after, filter: $filter) {
|
|
3331
|
+
totalCount
|
|
3332
|
+
pageInfo {
|
|
3333
|
+
hasNextPage
|
|
3334
|
+
endCursor
|
|
3335
|
+
}
|
|
3336
|
+
edges {
|
|
3337
|
+
cursor
|
|
3338
|
+
node {
|
|
3339
|
+
... on _Game {
|
|
3340
|
+
id
|
|
3341
|
+
reference
|
|
3342
|
+
name
|
|
3343
|
+
displayName
|
|
3344
|
+
type
|
|
3345
|
+
provider
|
|
3346
|
+
status
|
|
3347
|
+
hidden
|
|
3348
|
+
hasFreeBet
|
|
3349
|
+
hasJackpot
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
}
|
|
3355
|
+
`;
|
|
3328
3356
|
export const GOOGLE_CLIENT_ID = /* GraphQL */ `
|
|
3329
3357
|
query GoogleClientId {
|
|
3330
3358
|
googleClientId
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Simplify, SimplifyDeep } from 'type-fest';
|
|
2
|
-
import type { Bonus, Cashback, CashbackBonus, DateFilterField, Deposit, EnumFilterField, FavoriteGame, GameSession, InstapayBank, MayaSession, ObjectIdFilterField, PointsWallet, Promo, PromoType, Wallet } from '../types';
|
|
2
|
+
import type { BooleanFilterField, Bonus, Cashback, CashbackBonus, DateFilterField, Deposit, EnumFilterField, FavoriteGame, GameProvider, GameSession, GameType, InstapayBank, MayaSession, ObjectIdFilterField, PaginatedQueryResult, PlatformGame, PointsWallet, Promo, PromoType, StringFilterField, Wallet } from '../types';
|
|
3
3
|
import { type GraphQLRequestOptions } from './graphqlRequest';
|
|
4
4
|
export interface PromosQuery {
|
|
5
5
|
promos: Promo[];
|
|
@@ -718,6 +718,25 @@ export interface FavoriteGamesQuery {
|
|
|
718
718
|
favoriteGames: FavoriteGame[];
|
|
719
719
|
}
|
|
720
720
|
export declare const getFavoriteGames: (options?: GraphQLRequestOptions) => Promise<FavoriteGame[]>;
|
|
721
|
+
export interface PlatformGamesQueryVariables {
|
|
722
|
+
after?: string;
|
|
723
|
+
first?: number;
|
|
724
|
+
filter?: {
|
|
725
|
+
id?: ObjectIdFilterField;
|
|
726
|
+
reference?: StringFilterField;
|
|
727
|
+
name?: StringFilterField;
|
|
728
|
+
displayName?: StringFilterField;
|
|
729
|
+
type?: EnumFilterField<GameType>;
|
|
730
|
+
provider?: EnumFilterField<GameProvider>;
|
|
731
|
+
hasFreeBet?: BooleanFilterField;
|
|
732
|
+
hasJackpot?: BooleanFilterField;
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
export interface PlatformGamesQuery {
|
|
736
|
+
_games: PaginatedQueryResult<PlatformGame>;
|
|
737
|
+
}
|
|
738
|
+
export type PlatformGamesInput = SimplifyDeep<PlatformGamesQueryVariables>;
|
|
739
|
+
export declare const getPlatformGames: (input?: PlatformGamesInput, options?: GraphQLRequestOptions) => Promise<PaginatedQueryResult<PlatformGame>>;
|
|
721
740
|
export type RedeemVoucherError = {
|
|
722
741
|
name: 'InvalidVoucherError';
|
|
723
742
|
message: string;
|
package/dist/services/wallet.js
CHANGED
|
@@ -2,7 +2,7 @@ import { cache } from 'react';
|
|
|
2
2
|
import { WALLET_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
3
|
import { parseDecimal } from '../utils/parseDecimal.js';
|
|
4
4
|
import { graphqlRequest } from './graphqlRequest.js';
|
|
5
|
-
import { AVAILABLE_PROMOS, BONUS, BONUS_BALANCES, BONUS_IDS, BONUSES, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUS_IDS, CASHBACK_BONUSES, CASHBACKS, CLAIM_CASHBACK_BONUS, CLAIM_SPOT_BONUS, CREATE_AIO_GCASH_DEPOSIT, CREATE_AIO_GRAB_PAY_DEPOSIT, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_INSTAPAY_WITHDRAWAL_NEXT, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_PALAWAN_PAY_DEPOSIT, CREATE_AIO_PAY_MAYA_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_AURIX_PAY_GCASH_DEPOSIT, CREATE_AURIX_PAY_GRAB_PAY_DEPOSIT, CREATE_AURIX_PAY_PAY_MAYA_DEPOSIT, CREATE_AURIX_PAY_QR_PH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL, CREATE_GCASH_WEBPAY_DEPOSIT, CREATE_GCASH_WITHDRAWAL, CREATE_LIBANGAN_DEPOSIT, CREATE_MANUAL_BANK_DEPOSIT, CREATE_MANUAL_BANK_WITHDRAWAL, CREATE_MANUAL_UPI_DEPOSIT, CREATE_MANUAL_UPI_WITHDRAWAL, CREATE_MAYA_APP_DEPOSIT, CREATE_MAYA_APP_WITHDRAWAL, CREATE_MAYA_DEPOSIT, CREATE_MAYA_WEBPAY_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CREATE_PISO_PAY_DEPOSIT, CREATE_PISO_PAY_WITHDRAWAL, CREATE_VENTAJA_WITHDRAWAL, DEPOSIT, END_GAME_SESSION, FAVORITE_GAMES, GAME_SESSION, INSTAPAY_BANK_LIST, MARK_GAME_AS_FAVORITE, MAYA_SESSION, MEMBER_WALLET_ACCOUNT_QUERY, POINTS_WALLET, PROMO, PROMOS, REDEEM_POINTS_TO_CASH, REDEEM_VOUCHER, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET, } from './queries.js';
|
|
5
|
+
import { AVAILABLE_PROMOS, BONUS, BONUS_BALANCES, BONUS_IDS, BONUSES, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUS_IDS, CASHBACK_BONUSES, CASHBACKS, CLAIM_CASHBACK_BONUS, CLAIM_SPOT_BONUS, CREATE_AIO_GCASH_DEPOSIT, CREATE_AIO_GRAB_PAY_DEPOSIT, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_INSTAPAY_WITHDRAWAL_NEXT, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_PALAWAN_PAY_DEPOSIT, CREATE_AIO_PAY_MAYA_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_AURIX_PAY_GCASH_DEPOSIT, CREATE_AURIX_PAY_GRAB_PAY_DEPOSIT, CREATE_AURIX_PAY_PAY_MAYA_DEPOSIT, CREATE_AURIX_PAY_QR_PH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL, CREATE_GCASH_WEBPAY_DEPOSIT, CREATE_GCASH_WITHDRAWAL, CREATE_LIBANGAN_DEPOSIT, CREATE_MANUAL_BANK_DEPOSIT, CREATE_MANUAL_BANK_WITHDRAWAL, CREATE_MANUAL_UPI_DEPOSIT, CREATE_MANUAL_UPI_WITHDRAWAL, CREATE_MAYA_APP_DEPOSIT, CREATE_MAYA_APP_WITHDRAWAL, CREATE_MAYA_DEPOSIT, CREATE_MAYA_WEBPAY_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CREATE_PISO_PAY_DEPOSIT, CREATE_PISO_PAY_WITHDRAWAL, CREATE_VENTAJA_WITHDRAWAL, DEPOSIT, END_GAME_SESSION, FAVORITE_GAMES, GAME_SESSION, INSTAPAY_BANK_LIST, MARK_GAME_AS_FAVORITE, MAYA_SESSION, MEMBER_WALLET_ACCOUNT_QUERY, PLATFORM_GAMES, POINTS_WALLET, PROMO, PROMOS, REDEEM_POINTS_TO_CASH, REDEEM_VOUCHER, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET, } from './queries.js';
|
|
6
6
|
import { sha256 } from './sha256.js';
|
|
7
7
|
export const getPromos = cache(async (options) => {
|
|
8
8
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PROMOS, undefined, {
|
|
@@ -582,6 +582,10 @@ export const getFavoriteGames = cache(async (options) => {
|
|
|
582
582
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, FAVORITE_GAMES, undefined, options);
|
|
583
583
|
return res.favoriteGames;
|
|
584
584
|
});
|
|
585
|
+
export const getPlatformGames = cache(async (input, options) => {
|
|
586
|
+
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PLATFORM_GAMES, input, options);
|
|
587
|
+
return res._games;
|
|
588
|
+
});
|
|
585
589
|
var VoucherType;
|
|
586
590
|
(function (VoucherType) {
|
|
587
591
|
VoucherType[VoucherType["BUILTIN"] = 0] = "BUILTIN";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -179,6 +179,18 @@ export interface Game {
|
|
|
179
179
|
dateTimeLastUpdated: string;
|
|
180
180
|
favorite: boolean;
|
|
181
181
|
}
|
|
182
|
+
export interface PlatformGame {
|
|
183
|
+
id: string;
|
|
184
|
+
reference?: string | null;
|
|
185
|
+
name?: string | null;
|
|
186
|
+
displayName?: string | null;
|
|
187
|
+
type?: GameType | null;
|
|
188
|
+
provider?: GameProvider | null;
|
|
189
|
+
status: GameStatus;
|
|
190
|
+
hidden: boolean;
|
|
191
|
+
hasFreeBet: boolean;
|
|
192
|
+
hasJackpot: boolean;
|
|
193
|
+
}
|
|
182
194
|
export interface RecommendedGame {
|
|
183
195
|
id: string;
|
|
184
196
|
name: string;
|
package/dist/ui/Badge/Badge.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare const Root: import("react").ComponentType<import("@ark-ui/react")
|
|
|
37
37
|
root: string;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
}, Record<"
|
|
40
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, undefined, {
|
|
41
41
|
size: {
|
|
42
42
|
md: {
|
|
43
43
|
root: string;
|
|
@@ -72,7 +72,7 @@ export declare const Root: import("react").ComponentType<import("@ark-ui/react")
|
|
|
72
72
|
root: string;
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
|
-
}, Record<"
|
|
75
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, import("tailwind-variants").TVReturnType<{
|
|
76
76
|
size: {
|
|
77
77
|
md: {
|
|
78
78
|
root: string;
|
|
@@ -107,7 +107,7 @@ export declare const Root: import("react").ComponentType<import("@ark-ui/react")
|
|
|
107
107
|
root: string;
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
-
}, Record<"
|
|
110
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, undefined, unknown, unknown, undefined>>>>>;
|
|
111
111
|
interface BadgeLabelProps extends ComponentPropsWithRef<'span'> {
|
|
112
112
|
asChild?: boolean;
|
|
113
113
|
}
|
|
@@ -146,7 +146,7 @@ export declare const Label: import("react").ComponentType<import("@ark-ui/react"
|
|
|
146
146
|
root: string;
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
|
-
}, Record<"
|
|
149
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, undefined, {
|
|
150
150
|
size: {
|
|
151
151
|
md: {
|
|
152
152
|
root: string;
|
|
@@ -181,7 +181,7 @@ export declare const Label: import("react").ComponentType<import("@ark-ui/react"
|
|
|
181
181
|
root: string;
|
|
182
182
|
};
|
|
183
183
|
};
|
|
184
|
-
}, Record<"
|
|
184
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, import("tailwind-variants").TVReturnType<{
|
|
185
185
|
size: {
|
|
186
186
|
md: {
|
|
187
187
|
root: string;
|
|
@@ -216,7 +216,7 @@ export declare const Label: import("react").ComponentType<import("@ark-ui/react"
|
|
|
216
216
|
root: string;
|
|
217
217
|
};
|
|
218
218
|
};
|
|
219
|
-
}, Record<"
|
|
219
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, undefined, unknown, unknown, undefined>>>>>;
|
|
220
220
|
interface BadgeIndicatorProps extends ComponentPropsWithRef<'svg'> {
|
|
221
221
|
asChild?: boolean;
|
|
222
222
|
}
|
|
@@ -255,7 +255,7 @@ export declare const Indicator: import("react").ComponentType<import("@ark-ui/re
|
|
|
255
255
|
root: string;
|
|
256
256
|
};
|
|
257
257
|
};
|
|
258
|
-
}, Record<"
|
|
258
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, undefined, {
|
|
259
259
|
size: {
|
|
260
260
|
md: {
|
|
261
261
|
root: string;
|
|
@@ -290,7 +290,7 @@ export declare const Indicator: import("react").ComponentType<import("@ark-ui/re
|
|
|
290
290
|
root: string;
|
|
291
291
|
};
|
|
292
292
|
};
|
|
293
|
-
}, Record<"
|
|
293
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, import("tailwind-variants").TVReturnType<{
|
|
294
294
|
size: {
|
|
295
295
|
md: {
|
|
296
296
|
root: string;
|
|
@@ -325,7 +325,7 @@ export declare const Indicator: import("react").ComponentType<import("@ark-ui/re
|
|
|
325
325
|
root: string;
|
|
326
326
|
};
|
|
327
327
|
};
|
|
328
|
-
}, Record<"
|
|
328
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, undefined, unknown, unknown, undefined>>>>>;
|
|
329
329
|
interface BadgeIconProps extends ComponentPropsWithRef<'svg'> {
|
|
330
330
|
asChild?: boolean;
|
|
331
331
|
}
|
|
@@ -364,7 +364,7 @@ export declare const Icon: import("react").ComponentType<import("@ark-ui/react")
|
|
|
364
364
|
root: string;
|
|
365
365
|
};
|
|
366
366
|
};
|
|
367
|
-
}, Record<"
|
|
367
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, undefined, {
|
|
368
368
|
size: {
|
|
369
369
|
md: {
|
|
370
370
|
root: string;
|
|
@@ -399,7 +399,7 @@ export declare const Icon: import("react").ComponentType<import("@ark-ui/react")
|
|
|
399
399
|
root: string;
|
|
400
400
|
};
|
|
401
401
|
};
|
|
402
|
-
}, Record<"
|
|
402
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, import("tailwind-variants").TVReturnType<{
|
|
403
403
|
size: {
|
|
404
404
|
md: {
|
|
405
405
|
root: string;
|
|
@@ -434,5 +434,5 @@ export declare const Icon: import("react").ComponentType<import("@ark-ui/react")
|
|
|
434
434
|
root: string;
|
|
435
435
|
};
|
|
436
436
|
};
|
|
437
|
-
}, Record<"
|
|
437
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, undefined, unknown, unknown, undefined>>>>>;
|
|
438
438
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const badgeAnatomy: import("@ark-ui/react/anatomy").AnatomyInstance<"
|
|
1
|
+
export declare const badgeAnatomy: import("@ark-ui/react/anatomy").AnatomyInstance<"root" | "label" | "icon" | "indicator">;
|
|
@@ -33,7 +33,7 @@ export declare const badgeRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
33
33
|
root: string;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
}, Record<"
|
|
36
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, undefined, {
|
|
37
37
|
size: {
|
|
38
38
|
md: {
|
|
39
39
|
root: string;
|
|
@@ -68,7 +68,7 @@ export declare const badgeRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
68
68
|
root: string;
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
|
-
}, Record<"
|
|
71
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, import("tailwind-variants").TVReturnType<{
|
|
72
72
|
size: {
|
|
73
73
|
md: {
|
|
74
74
|
root: string;
|
|
@@ -103,4 +103,4 @@ export declare const badgeRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
103
103
|
root: string;
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
|
-
}, Record<"
|
|
106
|
+
}, Record<"root" | "label" | "icon" | "indicator", string | string[]>, undefined, unknown, unknown, undefined>>;
|