@opexa/portal-components 0.0.83 → 0.0.84
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.d.ts +1 -2
- package/dist/client/hooks/useAccountQuery.js +1 -4
- package/dist/client/hooks/useAuthenticateMutation.d.ts +1 -1
- package/dist/client/hooks/useAvailablePromosQuery.d.ts +2 -2
- package/dist/client/hooks/useAvailablePromosQuery.js +1 -4
- package/dist/client/hooks/useAvailableQuestsQuery.d.ts +1 -2
- package/dist/client/hooks/useAvailableQuestsQuery.js +1 -4
- package/dist/client/hooks/useBetRecordsQuery.d.ts +2 -2
- package/dist/client/hooks/useBetRecordsQuery.js +1 -4
- package/dist/client/hooks/useBonusQuery.d.ts +1 -2
- package/dist/client/hooks/useBonusQuery.js +3 -8
- package/dist/client/hooks/useBonusesQuery.d.ts +1 -2
- package/dist/client/hooks/useBonusesQuery.js +1 -4
- package/dist/client/hooks/useCashbackBonusQuery.d.ts +1 -2
- package/dist/client/hooks/useCashbackBonusQuery.js +1 -4
- package/dist/client/hooks/useCashbackBonusesQuery.d.ts +1 -2
- package/dist/client/hooks/useCashbackBonusesQuery.js +1 -4
- package/dist/client/hooks/useCashbackQuery.d.ts +1 -2
- package/dist/client/hooks/useCashbackQuery.js +3 -12
- package/dist/client/hooks/useCashbacksQuery.d.ts +1 -2
- package/dist/client/hooks/useCashbacksQuery.js +1 -6
- package/dist/client/hooks/useCheckInDailyCheckInQuestMutation.js +3 -6
- package/dist/client/hooks/useClaimCashbackBonusMutation.js +1 -4
- package/dist/client/hooks/useClaimSpotBonusMutation.js +1 -4
- package/dist/client/hooks/useCreateGCashDepositMutation.d.ts +2 -2
- package/dist/client/hooks/useCreateGCashDepositMutation.js +2 -7
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.js +2 -5
- package/dist/client/hooks/useCreateGameSessionMutation.d.ts +1 -2
- package/dist/client/hooks/useCreateGameSessionMutation.js +3 -11
- package/dist/client/hooks/useCreateInstapayWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateInstapayWithdrawalMutation.js +2 -5
- package/dist/client/hooks/useCreateMayaAppDepositMutation.d.ts +2 -2
- package/dist/client/hooks/useCreateMayaAppDepositMutation.js +2 -7
- package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.js +2 -5
- package/dist/client/hooks/useCreateMayaDepositMutation.d.ts +2 -2
- package/dist/client/hooks/useCreateMayaDepositMutation.js +2 -7
- package/dist/client/hooks/useCreateMayaWithdrawalMutation.d.ts +1 -1
- package/dist/client/hooks/useCreateMayaWithdrawalMutation.js +2 -5
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.d.ts +2 -2
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +2 -7
- package/dist/client/hooks/useCreateQRPHDepositMutation.d.ts +3 -3
- package/dist/client/hooks/useCreateQRPHDepositMutation.js +2 -7
- package/dist/client/hooks/useDepositQuery.d.ts +1 -2
- package/dist/client/hooks/useDepositQuery.js +3 -5
- package/dist/client/hooks/useDepositRecordsQuery.d.ts +2 -2
- package/dist/client/hooks/useDepositRecordsQuery.js +1 -4
- package/dist/client/hooks/useDepositsCountQuery.js +3 -5
- package/dist/client/hooks/useEndGameSessionMutation.d.ts +1 -2
- package/dist/client/hooks/useEndGameSessionMutation.js +2 -6
- package/dist/client/hooks/useFavoriteGamesQuery.d.ts +1 -2
- package/dist/client/hooks/useFavoriteGamesQuery.js +3 -5
- package/dist/client/hooks/useGamesQuery.d.ts +2 -2
- package/dist/client/hooks/useGamesQuery.js +1 -7
- package/dist/client/hooks/useGlobalStore.d.ts +1 -1
- package/dist/client/hooks/useInfiniteQueryHelper.d.ts +1 -2
- package/dist/client/hooks/useInstapayBankListQuery.d.ts +1 -2
- package/dist/client/hooks/useInstapayBankListQuery.js +3 -5
- package/dist/client/hooks/useIsMayaSessionValidQuery.js +1 -4
- package/dist/client/hooks/useJackpotPayoutsQuery.d.ts +2 -2
- package/dist/client/hooks/useJackpotPayoutsQuery.js +2 -9
- package/dist/client/hooks/useJackpotsQuery.d.ts +2 -2
- package/dist/client/hooks/useJackpotsQuery.js +2 -9
- package/dist/client/hooks/useMarkGameAsFavoriteMutation.js +1 -4
- package/dist/client/hooks/useMarkMessageAsReadMutation.js +1 -4
- package/dist/client/hooks/useMemberVerificationQuery.d.ts +1 -2
- package/dist/client/hooks/useMemberVerificationQuery.js +1 -4
- package/dist/client/hooks/useMessagesQuery.d.ts +2 -2
- package/dist/client/hooks/useMessagesQuery.js +1 -4
- package/dist/client/hooks/usePaymentSettingsQuery.d.ts +1 -2
- package/dist/client/hooks/usePaymentSettingsQuery.js +1 -4
- package/dist/client/hooks/usePlatformQuery.d.ts +1 -2
- package/dist/client/hooks/usePlatformQuery.js +3 -8
- package/dist/client/hooks/useProfileCompletionQuery.d.ts +1 -2
- package/dist/client/hooks/useProfileCompletionQuery.js +1 -4
- package/dist/client/hooks/usePromoQuery.d.ts +1 -2
- package/dist/client/hooks/usePromoQuery.js +3 -12
- package/dist/client/hooks/usePromosQuery.d.ts +1 -2
- package/dist/client/hooks/usePromosQuery.js +2 -9
- package/dist/client/hooks/useSendVerificationCodeMutation.d.ts +1 -1
- package/dist/client/hooks/useSendVerificationCodeMutation.js +2 -8
- package/dist/client/hooks/useSessionQuery.js +2 -2
- package/dist/client/hooks/useSignInMutation.d.ts +1 -2
- package/dist/client/hooks/useSignUpMutation.d.ts +1 -1
- package/dist/client/hooks/useSignUpMutation.js +2 -11
- package/dist/client/hooks/useTopWinsQuery.d.ts +1 -2
- package/dist/client/hooks/useTopWinsQuery.js +3 -9
- package/dist/client/hooks/useTournamentsQuery.d.ts +2 -2
- package/dist/client/hooks/useTournamentsQuery.js +2 -9
- package/dist/client/hooks/useTransactionRecordsQuery.d.ts +2 -2
- package/dist/client/hooks/useTransactionRecordsQuery.js +1 -4
- package/dist/client/hooks/useUnmarkGameAsFavoriteMutation.js +1 -4
- package/dist/client/hooks/useUnreadMessagesCountQuery.d.ts +1 -1
- package/dist/client/hooks/useUnreadMessagesCountQuery.js +1 -4
- package/dist/client/hooks/useUpdateAccountMutation.d.ts +1 -1
- package/dist/client/hooks/useUpdateAccountMutation.js +1 -4
- package/dist/client/hooks/useWalletQuery.d.ts +1 -2
- package/dist/client/hooks/useWalletQuery.js +3 -10
- package/dist/client/hooks/useWithdrawalRecordsQuery.d.ts +2 -2
- package/dist/client/hooks/useWithdrawalRecordsQuery.js +1 -4
- package/dist/client/services/authenticate.d.ts +3 -2
- package/dist/client/services/authenticate.js +5 -12
- package/dist/client/services/getSession.d.ts +2 -1
- package/dist/client/services/getSession.js +4 -11
- package/dist/client/services/signIn.d.ts +4 -2
- package/dist/client/services/signIn.js +6 -13
- package/dist/client/services/signOut.d.ts +2 -1
- package/dist/client/services/signOut.js +15 -13
- package/dist/components/AccountSecurity/AccountSecurity.js +2 -25
- package/dist/components/BetRecords/BetRecords.d.ts +1 -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/GameLaunch/GameLaunchTrigger.d.ts +1 -1
- package/dist/components/GameProviders/GameProvidersCarousel.d.ts +1 -2
- package/dist/components/GameProviders/GameProvidersList.d.ts +1 -2
- package/dist/components/Games/GamesCarousel.d.ts +1 -1
- package/dist/components/Games/GamesContext.d.ts +1 -1
- package/dist/components/Games/GamesList.d.ts +1 -1
- package/dist/components/GamesSearch/GamesSearch.d.ts +1 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +1 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +184 -184
- package/dist/components/Jackpots/Jackpots.d.ts +1 -1
- package/dist/components/Jackpots/JackpotsContext.d.ts +1 -1
- package/dist/components/Jackpots/useJackpotData.d.ts +2 -2
- package/dist/components/Jackpots/useJackpotData.js +0 -1
- package/dist/components/Messages/Message.d.ts +4 -0
- package/dist/components/Messages/{MessageItem.js → Message.js} +2 -2
- package/dist/components/Messages/MessageTrigger.d.ts +1 -1
- package/dist/components/Messages/Messages.js +2 -2
- package/dist/components/Messages/utils.d.ts +1 -1
- package/dist/components/Promos/Cashback.d.ts +1 -1
- package/dist/components/Promos/Promo.d.ts +1 -1
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +1 -1
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +1 -1
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +1 -1
- package/dist/components/Search/Search.d.ts +1 -2
- package/dist/components/SignUp/SignUpForm.js +1 -1
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +1 -1
- package/dist/components/Tournaments/Tournaments.d.ts +1 -1
- package/dist/components/Tournaments/TournamentsContext.d.ts +1 -1
- package/dist/components/Tournaments/useTournamentData.js +0 -1
- package/dist/components/TransactionRecords/DepositRecordsTable.js +0 -1
- package/dist/components/TransactionRecords/TableFilters.d.ts +1 -2
- package/dist/constants/endpoints.d.ts +10 -0
- package/dist/constants/endpoints.js +41 -0
- package/dist/constants/gameProviders.d.ts +1 -2
- package/dist/constants/gameTypes.d.ts +1 -2
- package/dist/constants/headerKeys.d.ts +1 -0
- package/dist/constants/headerKeys.js +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/secretQuestions.d.ts +1 -1
- package/dist/handlers.js +2 -12
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.js +2 -3
- package/dist/server/services/authenticate.d.ts +1 -1
- package/dist/server/services/authenticate.js +3 -8
- package/dist/server/services/signIn.d.ts +2 -1
- package/dist/server/services/signIn.js +3 -8
- package/dist/server/services/signOut.js +2 -3
- package/dist/server/utils/prefetchAccountQuery.js +1 -4
- package/dist/server/utils/prefetchAvailablePromosQuery.d.ts +1 -1
- package/dist/server/utils/prefetchAvailablePromosQuery.js +1 -4
- package/dist/server/utils/prefetchAvailableQuestsQuery.js +1 -4
- package/dist/server/utils/prefetchBetRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchBetRecordsQuery.js +1 -4
- package/dist/server/utils/prefetchBonusQuery.js +3 -8
- package/dist/server/utils/prefetchBonusesQuery.js +1 -4
- package/dist/server/utils/prefetchCashbackBonusQuery.js +1 -4
- package/dist/server/utils/prefetchCashbackBonusesQuery.js +1 -4
- package/dist/server/utils/prefetchCashbackQuery.js +3 -12
- package/dist/server/utils/prefetchCashbacksQuery.js +1 -6
- package/dist/server/utils/prefetchDepositQuery.js +3 -5
- package/dist/server/utils/prefetchDepositRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchDepositRecordsQuery.js +1 -4
- package/dist/server/utils/prefetchDepositsCountQuery.js +3 -5
- package/dist/server/utils/prefetchFavoriteGamesQuery.js +3 -5
- package/dist/server/utils/prefetchGamesQuery.d.ts +1 -1
- package/dist/server/utils/prefetchGamesQuery.js +2 -10
- package/dist/server/utils/prefetchInstapayBankListQuery.js +3 -5
- package/dist/server/utils/prefetchIsMayaSessionValidQuery.js +1 -4
- package/dist/server/utils/prefetchJackpotsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchJackpotsQuery.js +2 -9
- package/dist/server/utils/prefetchMemberVerificationQuery.js +1 -4
- package/dist/server/utils/prefetchPaymentSettingsQuery.js +1 -4
- package/dist/server/utils/prefetchPlatformQuery.js +2 -9
- package/dist/server/utils/prefetchProfileCompletionQuery.js +1 -4
- package/dist/server/utils/prefetchPromoQuery.js +3 -12
- package/dist/server/utils/prefetchPromosQuery.js +2 -9
- package/dist/server/utils/prefetchTopWinsQuery.js +2 -9
- package/dist/server/utils/prefetchTournamentsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchTournamentsQuery.js +2 -9
- package/dist/server/utils/prefetchTransactionRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchTransactionRecordsQuery.js +1 -4
- package/dist/server/utils/prefetchUnreadMessagesCountQuery.d.ts +1 -1
- package/dist/server/utils/prefetchUnreadMessagesCountQuery.js +1 -4
- package/dist/server/utils/prefetchWalletQuery.js +3 -5
- package/dist/server/utils/prefetchWithdrawalRecordsQuery.d.ts +1 -1
- package/dist/server/utils/prefetchWithdrawalRecordsQuery.js +1 -4
- package/dist/services/ObjectId.d.ts +24 -0
- package/dist/services/ObjectId.js +86 -0
- package/dist/services/account.service.d.ts +341 -0
- package/dist/services/account.service.js +233 -0
- package/dist/services/auth.service.d.ts +80 -0
- package/dist/services/auth.service.js +152 -0
- package/dist/services/cmsPortal.service.d.ts +43 -0
- package/dist/services/cmsPortal.service.js +148 -0
- package/dist/services/file.service.d.ts +33 -0
- package/dist/services/file.service.js +18 -0
- package/dist/services/game.service.d.ts +44 -0
- package/dist/services/game.service.js +33 -0
- package/dist/services/graphqlRequest.d.ts +4 -0
- package/dist/services/graphqlRequest.js +255 -0
- package/dist/services/httpRequest.d.ts +23 -0
- package/dist/services/httpRequest.js +93 -0
- package/dist/services/index.d.ts +12 -0
- package/dist/services/index.js +12 -0
- package/dist/services/portal.service.d.ts +37 -0
- package/dist/services/portal.service.js +44 -0
- package/dist/services/queries.d.ts +115 -0
- package/dist/services/queries.js +2319 -0
- package/dist/services/report.service.d.ts +203 -0
- package/dist/services/report.service.js +64 -0
- package/dist/services/sha256.d.ts +4 -0
- package/dist/services/sha256.js +16 -0
- package/dist/services/trigger.service.d.ts +88 -0
- package/dist/services/trigger.service.js +84 -0
- package/dist/services/wallet.service.d.ts +463 -0
- package/dist/services/wallet.service.js +357 -0
- package/dist/styles/theme.css +697 -697
- package/dist/types/index.d.ts +752 -6
- package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- 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/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- 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 +264 -264
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +11 -11
- package/dist/ui/Dialog/Dialog.d.ts +88 -88
- package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +55 -55
- package/dist/ui/Popover/popover.recipe.d.ts +5 -5
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.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/getGameImageUrl.d.ts +1 -1
- package/dist/utils/getGameImageUrl.js +3 -5
- package/dist/utils/getGameProviderData.d.ts +1 -2
- package/dist/utils/getGameTypeData.d.ts +1 -2
- package/dist/utils/graphqlRequest.d.ts +4 -0
- package/dist/utils/graphqlRequest.js +255 -0
- package/dist/utils/httpRequest.d.ts +6 -0
- package/dist/utils/httpRequest.js +87 -0
- package/dist/utils/queryKeys.d.ts +1 -1
- package/dist/utils/sha256.d.ts +4 -0
- package/dist/utils/sha256.js +16 -0
- package/package.json +166 -160
- package/dist/components/Games/GameContext.d.ts +0 -2
- package/dist/components/Games/GameContext.js +0 -2
- package/dist/components/Jackpots/JackpotItemDesktop.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemDesktop.js +0 -43
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemMobile.js +0 -44
- package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -20
- package/dist/components/Jackpots/useJackpotItemData.js +0 -87
- package/dist/components/Messages/MessageItem.d.ts +0 -4
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemDesktop.js +0 -56
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemMobile.js +0 -54
- package/dist/components/Tournaments/useTournamentItemData.d.ts +0 -16
- package/dist/components/Tournaments/useTournamentItemData.js +0 -64
- package/dist/images/hacksaw-gaming.png +0 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import type { SimplifyDeep } from 'type-fest';
|
|
2
|
+
import type { ActivityRecord, ActivityRecordType, BetRecord, BetRecordStatus, BooleanFilterField, DateFilterField, DepositRecord, DepositStatus, DepositType, EnumFilterField, GameProvider, GameType, Jackpot, JackpotCursor, JackpotPayout, JackpotPayoutCursor, JackpotStatus, NumberFilterField, ObjectIdFilterField, PaginatedQuery, PointsWalletTransaction, PointsWalletTransactionType, Referral, ReferralCommission, SortOrder, SpotBonusPromo, StringFilterField, Tournament, TournamentStatus, TournamentType, TransactionRecord, TransactionType, WithdrawalRecord, WithdrawalStatus, WithdrawalType } from '../types';
|
|
3
|
+
import { type GraphQLRequestOptions } from './graphqlRequest';
|
|
4
|
+
export type BetRecordsInput = SimplifyDeep<BetRecordsQueryVariables>;
|
|
5
|
+
export interface BetRecordsQuery {
|
|
6
|
+
member: PaginatedQuery<'betRecords', BetRecord>;
|
|
7
|
+
}
|
|
8
|
+
export interface BetRecordsQueryVariables {
|
|
9
|
+
first?: number;
|
|
10
|
+
after?: string;
|
|
11
|
+
sort?: SortOrder;
|
|
12
|
+
filter?: {
|
|
13
|
+
game__type?: EnumFilterField<GameType>;
|
|
14
|
+
game__provider?: EnumFilterField<GameProvider>;
|
|
15
|
+
serialCode?: StringFilterField;
|
|
16
|
+
dateTimeCreated?: DateFilterField;
|
|
17
|
+
vendorRoundId?: StringFilterField;
|
|
18
|
+
status?: EnumFilterField<BetRecordStatus>;
|
|
19
|
+
};
|
|
20
|
+
startDateTime?: DateFilterField;
|
|
21
|
+
endDateTime?: DateFilterField;
|
|
22
|
+
}
|
|
23
|
+
export declare const getBetRecords: (input?: BetRecordsInput, options?: GraphQLRequestOptions) => Promise<import("../types").PaginatedQueryResult<BetRecord>>;
|
|
24
|
+
export interface TransactionRecordsQuery {
|
|
25
|
+
member: PaginatedQuery<'transactionRecords', TransactionRecord>;
|
|
26
|
+
}
|
|
27
|
+
export interface TransactionRecordsQueryVariables {
|
|
28
|
+
first?: number;
|
|
29
|
+
after?: string;
|
|
30
|
+
filter?: {
|
|
31
|
+
referenceNumber?: StringFilterField;
|
|
32
|
+
type?: EnumFilterField<TransactionType>;
|
|
33
|
+
dateTimeCreated?: DateFilterField;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export type TransactionRecordsInput = SimplifyDeep<TransactionRecordsQueryVariables>;
|
|
37
|
+
export declare const getTransactionRecords: (input?: TransactionRecordsInput, options?: GraphQLRequestOptions) => Promise<import("../types").PaginatedQueryResult<TransactionRecord>>;
|
|
38
|
+
export interface WithdrawalRecordsQuery {
|
|
39
|
+
member: PaginatedQuery<'withdrawalRecords', WithdrawalRecord>;
|
|
40
|
+
}
|
|
41
|
+
export interface WithdrawalRecordsQueryVariables {
|
|
42
|
+
first?: number;
|
|
43
|
+
after?: string;
|
|
44
|
+
filter?: {
|
|
45
|
+
id?: ObjectIdFilterField;
|
|
46
|
+
type?: EnumFilterField<WithdrawalType>;
|
|
47
|
+
status?: EnumFilterField<WithdrawalStatus>;
|
|
48
|
+
reference?: StringFilterField;
|
|
49
|
+
withdrawal?: ObjectIdFilterField;
|
|
50
|
+
withdrawalNumber?: StringFilterField;
|
|
51
|
+
dateTimeCreated?: DateFilterField;
|
|
52
|
+
dateTimeLastUpdated?: DateFilterField;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export type WithdrawalRecordsInput = SimplifyDeep<WithdrawalRecordsQueryVariables>;
|
|
56
|
+
export declare const getWithdrawalRecords: (input?: WithdrawalRecordsInput, options?: GraphQLRequestOptions) => Promise<import("../types").PaginatedQueryResult<WithdrawalRecord>>;
|
|
57
|
+
export interface DepositRecordsQuery {
|
|
58
|
+
member: PaginatedQuery<'depositRecords', DepositRecord>;
|
|
59
|
+
}
|
|
60
|
+
export interface DepositRecordsQueryVariables {
|
|
61
|
+
first?: number;
|
|
62
|
+
after?: string;
|
|
63
|
+
filter?: {
|
|
64
|
+
id?: ObjectIdFilterField;
|
|
65
|
+
type?: EnumFilterField<DepositType>;
|
|
66
|
+
status?: EnumFilterField<DepositStatus>;
|
|
67
|
+
deposit?: ObjectIdFilterField;
|
|
68
|
+
depositNumber?: StringFilterField;
|
|
69
|
+
reference?: StringFilterField;
|
|
70
|
+
dateTimeCreated?: DateFilterField;
|
|
71
|
+
dateTimeLastUpdated?: DateFilterField;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export type DepositRecordsInput = SimplifyDeep<DepositRecordsQueryVariables>;
|
|
75
|
+
export declare const getDepositRecords: (input?: DepositRecordsInput, options?: GraphQLRequestOptions) => Promise<import("../types").PaginatedQueryResult<DepositRecord>>;
|
|
76
|
+
export interface DepositsCountQuery {
|
|
77
|
+
member: {
|
|
78
|
+
depositsCount: number;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export declare const getDepositsCount: (options?: GraphQLRequestOptions) => Promise<number>;
|
|
82
|
+
export interface PointsWalletTransactionsQueryVariables {
|
|
83
|
+
first?: number;
|
|
84
|
+
after?: string;
|
|
85
|
+
filter?: {
|
|
86
|
+
type?: EnumFilterField<PointsWalletTransactionType>;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export interface PointsWalletTransactionsQuery {
|
|
90
|
+
member: PaginatedQuery<'pointsWalletTransactions', PointsWalletTransaction>;
|
|
91
|
+
}
|
|
92
|
+
export type PointsWalletTransactionsInput = SimplifyDeep<PointsWalletTransactionsQueryVariables>;
|
|
93
|
+
export declare const getPointsWalletTransactions: (input?: PointsWalletTransactionsInput, options?: GraphQLRequestOptions) => Promise<import("../types").PaginatedQueryResult<PointsWalletTransaction>>;
|
|
94
|
+
export interface ActivityRecordsQuery {
|
|
95
|
+
member: PaginatedQuery<'activityRecords', ActivityRecord>;
|
|
96
|
+
}
|
|
97
|
+
export interface ActivityRecordsQueryVariables {
|
|
98
|
+
first?: number;
|
|
99
|
+
after?: string;
|
|
100
|
+
filter?: {
|
|
101
|
+
type?: EnumFilterField<ActivityRecordType>;
|
|
102
|
+
dateTimeCreated?: DateFilterField;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export type ActivityRecordsInput = SimplifyDeep<ActivityRecordsQueryVariables>;
|
|
106
|
+
export declare const getActivityRecords: (input?: ActivityRecordsInput, options?: GraphQLRequestOptions) => Promise<import("../types").PaginatedQueryResult<ActivityRecord>>;
|
|
107
|
+
export interface ReferralsQuery {
|
|
108
|
+
member: PaginatedQuery<'referrals', Referral>;
|
|
109
|
+
}
|
|
110
|
+
export interface ReferralsQueryVariables {
|
|
111
|
+
first?: number;
|
|
112
|
+
after?: string;
|
|
113
|
+
filter?: {
|
|
114
|
+
level?: NumberFilterField;
|
|
115
|
+
upline?: ObjectIdFilterField;
|
|
116
|
+
downline?: ObjectIdFilterField;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export type ReferralsInput = SimplifyDeep<ReferralsQueryVariables>;
|
|
120
|
+
export declare const getReferrals: (input?: ReferralsInput, options?: GraphQLRequestOptions) => Promise<import("../types").PaginatedQueryResult<Referral>>;
|
|
121
|
+
export interface ReferralCommissionQuery {
|
|
122
|
+
member: {
|
|
123
|
+
referralCommission?: ReferralCommission | null;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export declare const getReferralCommission: (options?: GraphQLRequestOptions) => Promise<ReferralCommission | null>;
|
|
127
|
+
export interface UplinesByNameQuery {
|
|
128
|
+
uplinesByName: Referral[];
|
|
129
|
+
}
|
|
130
|
+
export interface UplinesByNameQueryVariables {
|
|
131
|
+
search: string;
|
|
132
|
+
first?: number;
|
|
133
|
+
}
|
|
134
|
+
export type UplinesByNameInput = SimplifyDeep<UplinesByNameQueryVariables>;
|
|
135
|
+
export declare const getUplinesByName: (input?: UplinesByNameInput, options?: GraphQLRequestOptions) => Promise<Referral[]>;
|
|
136
|
+
export interface DownlinesByNameQueryVariables {
|
|
137
|
+
search: string;
|
|
138
|
+
first?: number;
|
|
139
|
+
}
|
|
140
|
+
export interface DownlinesByNameQuery {
|
|
141
|
+
downlinesByName: Referral[];
|
|
142
|
+
}
|
|
143
|
+
export type DownlinesByNameInput = SimplifyDeep<DownlinesByNameQueryVariables>;
|
|
144
|
+
export declare const getDownlinesByName: (input?: DownlinesByNameInput, options?: GraphQLRequestOptions) => Promise<Referral[]>;
|
|
145
|
+
export interface PromoByCodeQueryVariables {
|
|
146
|
+
code: string;
|
|
147
|
+
}
|
|
148
|
+
export interface PromoByCodeQuery {
|
|
149
|
+
promoByCode: SpotBonusPromo;
|
|
150
|
+
}
|
|
151
|
+
export declare const getPromoByCode: (code: string, options?: GraphQLRequestOptions) => Promise<SpotBonusPromo>;
|
|
152
|
+
export interface JackpotsQuery extends PaginatedQuery<'jackpots', Jackpot> {
|
|
153
|
+
}
|
|
154
|
+
export interface JackpotsQueryVariables {
|
|
155
|
+
after?: string;
|
|
156
|
+
first?: number;
|
|
157
|
+
filter?: {
|
|
158
|
+
id?: ObjectIdFilterField;
|
|
159
|
+
name?: StringFilterField;
|
|
160
|
+
status?: EnumFilterField<JackpotStatus>;
|
|
161
|
+
drawing?: BooleanFilterField;
|
|
162
|
+
deleted?: BooleanFilterField;
|
|
163
|
+
};
|
|
164
|
+
sort?: {
|
|
165
|
+
order: SortOrder;
|
|
166
|
+
cursor: JackpotCursor;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
export type JackpotsInput = SimplifyDeep<JackpotsQueryVariables>;
|
|
170
|
+
export declare const getJackpots: (input?: JackpotsInput, options?: GraphQLRequestOptions) => Promise<import("../types").PaginatedQueryResult<Jackpot>>;
|
|
171
|
+
export interface JackpotPayoutsQuery extends PaginatedQuery<'jackpotPayouts', JackpotPayout> {
|
|
172
|
+
}
|
|
173
|
+
export interface JackpotPayoutsQueryVariables {
|
|
174
|
+
after?: string;
|
|
175
|
+
first?: number;
|
|
176
|
+
filter?: {
|
|
177
|
+
id?: ObjectIdFilterField;
|
|
178
|
+
member?: ObjectIdFilterField;
|
|
179
|
+
jackpot?: ObjectIdFilterField;
|
|
180
|
+
dateTimeCreated?: DateFilterField;
|
|
181
|
+
};
|
|
182
|
+
sort?: {
|
|
183
|
+
order: SortOrder;
|
|
184
|
+
cursor: JackpotPayoutCursor;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
export type JackpotPayoutsInput = SimplifyDeep<JackpotPayoutsQueryVariables>;
|
|
188
|
+
export declare const getJackpotPayouts: (input?: JackpotPayoutsInput, options?: GraphQLRequestOptions) => Promise<import("../types").PaginatedQueryResult<JackpotPayout>>;
|
|
189
|
+
export interface TournamentsQuery extends PaginatedQuery<'tournaments', Tournament> {
|
|
190
|
+
}
|
|
191
|
+
export interface TournamentsQueryVariables {
|
|
192
|
+
after?: string;
|
|
193
|
+
first?: number;
|
|
194
|
+
filter?: {
|
|
195
|
+
id?: ObjectIdFilterField;
|
|
196
|
+
type?: EnumFilterField<TournamentType>;
|
|
197
|
+
status?: EnumFilterField<TournamentStatus>;
|
|
198
|
+
activationStartDateTime?: DateFilterField;
|
|
199
|
+
activationEndDateTime?: DateFilterField;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
export type TournamentsInput = SimplifyDeep<TournamentsQueryVariables>;
|
|
203
|
+
export declare const getTournaments: (input?: TournamentsInput, options?: GraphQLRequestOptions) => Promise<import("../types").PaginatedQueryResult<Tournament>>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { cache } from 'react';
|
|
2
|
+
import { REPORT_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
|
+
import { graphqlRequest } from './graphqlRequest.js';
|
|
4
|
+
import { ACTIVITY_RECORDS, BET_RECORDS, DEPOSIT_RECORDS, DEPOSITS_COUNT, DOWNLINES_BY_NAME, JACKPOT_PAYOUTS, JACKPOTS, POINTS_WALLET_TRANSACTIONS, PROMO_BY_CODE, REFERRAL_COMMISSION, REFERRALS, TOURNAMENTS, TRANSACTION_RECORDS, UPLINES_BY_NAME, WITHDRAWAL_RECORDS, } from './queries.js';
|
|
5
|
+
export const getBetRecords = cache(async (input, options) => {
|
|
6
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, BET_RECORDS, input, options);
|
|
7
|
+
return res.member.betRecords;
|
|
8
|
+
});
|
|
9
|
+
export const getTransactionRecords = cache(async (input, options) => {
|
|
10
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, TRANSACTION_RECORDS, input, options);
|
|
11
|
+
return res.member.transactionRecords;
|
|
12
|
+
});
|
|
13
|
+
export const getWithdrawalRecords = cache(async (input, options) => {
|
|
14
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, WITHDRAWAL_RECORDS, input, options);
|
|
15
|
+
return res.member.withdrawalRecords;
|
|
16
|
+
});
|
|
17
|
+
export const getDepositRecords = cache(async (input, options) => {
|
|
18
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, DEPOSIT_RECORDS, input, options);
|
|
19
|
+
return res.member.depositRecords;
|
|
20
|
+
});
|
|
21
|
+
export const getDepositsCount = cache(async (options) => {
|
|
22
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, DEPOSITS_COUNT, undefined, options);
|
|
23
|
+
return res.member.depositsCount;
|
|
24
|
+
});
|
|
25
|
+
export const getPointsWalletTransactions = cache(async (input, options) => {
|
|
26
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, POINTS_WALLET_TRANSACTIONS, input, options);
|
|
27
|
+
return res.member.pointsWalletTransactions;
|
|
28
|
+
});
|
|
29
|
+
export const getActivityRecords = cache(async (input, options) => {
|
|
30
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, ACTIVITY_RECORDS, input, options);
|
|
31
|
+
return res.member.activityRecords;
|
|
32
|
+
});
|
|
33
|
+
export const getReferrals = cache(async (input, options) => {
|
|
34
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, REFERRALS, input, options);
|
|
35
|
+
return res.member.referrals;
|
|
36
|
+
});
|
|
37
|
+
export const getReferralCommission = cache(async (options) => {
|
|
38
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, REFERRAL_COMMISSION, undefined, options);
|
|
39
|
+
return res.member.referralCommission ?? null;
|
|
40
|
+
});
|
|
41
|
+
export const getUplinesByName = cache(async (input, options) => {
|
|
42
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, UPLINES_BY_NAME, input, options);
|
|
43
|
+
return res.uplinesByName;
|
|
44
|
+
});
|
|
45
|
+
export const getDownlinesByName = cache(async (input, options) => {
|
|
46
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, DOWNLINES_BY_NAME, input, options);
|
|
47
|
+
return res.downlinesByName;
|
|
48
|
+
});
|
|
49
|
+
export const getPromoByCode = cache(async (code, options) => {
|
|
50
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, PROMO_BY_CODE, { code }, options);
|
|
51
|
+
return res.promoByCode;
|
|
52
|
+
});
|
|
53
|
+
export const getJackpots = cache(async (input, options) => {
|
|
54
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, JACKPOTS, input, options);
|
|
55
|
+
return res.jackpots;
|
|
56
|
+
});
|
|
57
|
+
export const getJackpotPayouts = cache(async (input, options) => {
|
|
58
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, JACKPOT_PAYOUTS, input, options);
|
|
59
|
+
return res.jackpotPayouts;
|
|
60
|
+
});
|
|
61
|
+
export const getTournaments = cache(async (input, options) => {
|
|
62
|
+
const res = await graphqlRequest(REPORT_GRAPHQL_ENDPOINT, TOURNAMENTS, input, options);
|
|
63
|
+
return res.tournaments;
|
|
64
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export async function sha256(input) {
|
|
2
|
+
/*
|
|
3
|
+
* crypto and other node apis are not available in edge runtime
|
|
4
|
+
* ref: https://vercel.com/docs/functions/runtimes/edge#check-if-you're-running-on-the-edge-runtime
|
|
5
|
+
*/
|
|
6
|
+
if (typeof EdgeRuntime === 'string') {
|
|
7
|
+
throw new Error("Cannot use 'sha256' in edge runtime");
|
|
8
|
+
}
|
|
9
|
+
if (typeof window === 'undefined') {
|
|
10
|
+
const crypto = await import('crypto');
|
|
11
|
+
return crypto.createHash('sha256').update(input).digest('hex');
|
|
12
|
+
}
|
|
13
|
+
return Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(input))))
|
|
14
|
+
.map((b) => b.toString(16).padStart(2, '0'))
|
|
15
|
+
.join('');
|
|
16
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Simplify, SimplifyDeep } from 'type-fest';
|
|
2
|
+
import type { BooleanFilterField, FCMDeviceType, Message, PaginatedQuery, Quest } from '../types';
|
|
3
|
+
import { type GraphQLRequestOptions } from './graphqlRequest';
|
|
4
|
+
export interface MessagesQueryVariables {
|
|
5
|
+
first?: number;
|
|
6
|
+
after?: string;
|
|
7
|
+
filter?: {
|
|
8
|
+
popup?: BooleanFilterField;
|
|
9
|
+
markedAsRead?: BooleanFilterField;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface MessagesQuery extends PaginatedQuery<'messages', Message> {
|
|
13
|
+
}
|
|
14
|
+
export interface MessagesInput extends SimplifyDeep<MessagesQueryVariables> {
|
|
15
|
+
}
|
|
16
|
+
export declare const getMessages: (input?: MessagesInput, options?: GraphQLRequestOptions) => Promise<import("../types").PaginatedQueryResult<Message>>;
|
|
17
|
+
export interface UnreadMessagesCountQuery {
|
|
18
|
+
messages: {
|
|
19
|
+
totalCount: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface UnreadMessagesCountQueryVariables {
|
|
23
|
+
filter?: {
|
|
24
|
+
popup?: BooleanFilterField;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export type UnreadMessagesCountInput = SimplifyDeep<UnreadMessagesCountQueryVariables>;
|
|
28
|
+
export declare const getUnreadMessagesCount: (input?: UnreadMessagesCountInput, options?: GraphQLRequestOptions) => Promise<number>;
|
|
29
|
+
export interface MarkMessageAsReadMutationVariables {
|
|
30
|
+
id: string;
|
|
31
|
+
}
|
|
32
|
+
export interface MarkMessageAsReadMutation {
|
|
33
|
+
markMessageAsRead: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare const markMessageAsRead: (id: string, options?: GraphQLRequestOptions) => Promise<void>;
|
|
36
|
+
export interface MarkAllMessagesAsReadMutation {
|
|
37
|
+
markAllMessagesAsRead: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare const markAllMessagesAsRead: (options?: GraphQLRequestOptions) => Promise<void>;
|
|
40
|
+
export interface ClaimRewardMutationVariables {
|
|
41
|
+
id: string;
|
|
42
|
+
}
|
|
43
|
+
export type ClaimRewardError = {
|
|
44
|
+
name: 'RewardAlreadyClaimedError';
|
|
45
|
+
message: string;
|
|
46
|
+
} | {
|
|
47
|
+
name: 'RewardAlreadyExpiredError';
|
|
48
|
+
message: string;
|
|
49
|
+
};
|
|
50
|
+
export interface ClaimRewardMutation {
|
|
51
|
+
claimReward?: null | ClaimRewardError;
|
|
52
|
+
}
|
|
53
|
+
export declare const claimReward: (id: string, options?: GraphQLRequestOptions) => Promise<void>;
|
|
54
|
+
export interface AvailableQuestsQuery {
|
|
55
|
+
availableQuests: Quest[];
|
|
56
|
+
}
|
|
57
|
+
export declare const getAvailableQuests: (options?: GraphQLRequestOptions) => Promise<Quest[]>;
|
|
58
|
+
export interface CheckInDailyCheckInQuestMutation {
|
|
59
|
+
checkInDailyCheckInQuest: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface CheckInDailyCheckInQuestMutationVariables {
|
|
62
|
+
input: {
|
|
63
|
+
id: string;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export declare const checkInDailyCheckInQuest: (id: string, options?: GraphQLRequestOptions) => Promise<void>;
|
|
67
|
+
export interface RegisterFCMDeviceMutationVariables {
|
|
68
|
+
input: {
|
|
69
|
+
type: FCMDeviceType;
|
|
70
|
+
token: string;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export interface RegisterFCMDeviceMutation {
|
|
74
|
+
registerFCMDevice: boolean;
|
|
75
|
+
}
|
|
76
|
+
export type RegisterFCMDeviceInput = Simplify<RegisterFCMDeviceMutationVariables['input']>;
|
|
77
|
+
export declare const registerFCMDevice: (input: RegisterFCMDeviceInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
78
|
+
export interface UnregisterFCMDeviceMutationVariables {
|
|
79
|
+
input: {
|
|
80
|
+
type: FCMDeviceType;
|
|
81
|
+
token: string;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export interface UnregisterFCMDeviceMutation {
|
|
85
|
+
unregisterFCMDevice: boolean;
|
|
86
|
+
}
|
|
87
|
+
export type UnregisterFCMDeviceInput = Simplify<UnregisterFCMDeviceMutationVariables['input']>;
|
|
88
|
+
export declare const unregisterFCMDevice: (input: UnregisterFCMDeviceInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { cache } from 'react';
|
|
2
|
+
import { TRIGGER_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
|
+
import { graphqlRequest } from './graphqlRequest.js';
|
|
4
|
+
import { AVAILABLE_QUESTS, CHECK_IN_DAILY_QUEST, CLAIM_REWARD, MARK_ALL_MESSAGES_AS_READ, MARK_MESSAGE_AS_READ, MESSAGES, REGISTER_FCM_DEVICE, UNREAD_MESSAGES_COUNT, UNREGISTER_FCM_DEVICE, } from './queries.js';
|
|
5
|
+
export const getMessages = cache(async (input, options) => {
|
|
6
|
+
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT, MESSAGES, input, options);
|
|
7
|
+
return res.messages;
|
|
8
|
+
});
|
|
9
|
+
export const getUnreadMessagesCount = cache(async (input, options) => {
|
|
10
|
+
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT, UNREAD_MESSAGES_COUNT, {
|
|
11
|
+
...input,
|
|
12
|
+
filter: {
|
|
13
|
+
...input?.filter,
|
|
14
|
+
markedAsRead: {
|
|
15
|
+
equal: false,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
}, options);
|
|
19
|
+
return res.messages.totalCount ?? 0;
|
|
20
|
+
});
|
|
21
|
+
export const markMessageAsRead = async (id, options) => {
|
|
22
|
+
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT, MARK_MESSAGE_AS_READ, { id }, options);
|
|
23
|
+
if (!res.markMessageAsRead) {
|
|
24
|
+
const error = new Error();
|
|
25
|
+
error.name = 'UnknownError';
|
|
26
|
+
error.message = 'Something went wrong.';
|
|
27
|
+
Error.captureStackTrace?.(error, markMessageAsRead);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export const markAllMessagesAsRead = async (options) => {
|
|
32
|
+
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT, MARK_ALL_MESSAGES_AS_READ, undefined, options);
|
|
33
|
+
if (!res.markAllMessagesAsRead) {
|
|
34
|
+
const error = new Error();
|
|
35
|
+
error.name = 'UnknownError';
|
|
36
|
+
error.message = 'Something went wrong.';
|
|
37
|
+
Error.captureStackTrace?.(error, markAllMessagesAsRead);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
export const claimReward = async (id, options) => {
|
|
42
|
+
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT, CLAIM_REWARD, { id }, options);
|
|
43
|
+
if (res.claimReward) {
|
|
44
|
+
const error = new Error();
|
|
45
|
+
error.name = res.claimReward.name;
|
|
46
|
+
error.message = res.claimReward.message;
|
|
47
|
+
Error.captureStackTrace?.(error, claimReward);
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export const getAvailableQuests = cache(async (options) => {
|
|
52
|
+
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT, AVAILABLE_QUESTS, undefined, options);
|
|
53
|
+
return res.availableQuests;
|
|
54
|
+
});
|
|
55
|
+
export const checkInDailyCheckInQuest = async (id, options) => {
|
|
56
|
+
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT, CHECK_IN_DAILY_QUEST, { input: { id } }, options);
|
|
57
|
+
if (!res.checkInDailyCheckInQuest) {
|
|
58
|
+
const error = new Error();
|
|
59
|
+
error.name = 'UnknownError';
|
|
60
|
+
error.message = 'Something went wrong.';
|
|
61
|
+
Error.captureStackTrace?.(error, checkInDailyCheckInQuest);
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
export const registerFCMDevice = async (input, options) => {
|
|
66
|
+
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT, REGISTER_FCM_DEVICE, { input }, options);
|
|
67
|
+
if (!res.registerFCMDevice) {
|
|
68
|
+
const error = new Error();
|
|
69
|
+
error.name = 'UnknownError';
|
|
70
|
+
error.message = 'Something went wrong.';
|
|
71
|
+
Error.captureStackTrace?.(error, registerFCMDevice);
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
export const unregisterFCMDevice = async (input, options) => {
|
|
76
|
+
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT, UNREGISTER_FCM_DEVICE, { input }, options);
|
|
77
|
+
if (!res.unregisterFCMDevice) {
|
|
78
|
+
const error = new Error();
|
|
79
|
+
error.name = 'UnknownError';
|
|
80
|
+
error.message = 'Something went wrong.';
|
|
81
|
+
Error.captureStackTrace?.(error, unregisterFCMDevice);
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
};
|