@opexa/portal-components 0.0.84 → 0.0.86

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.
Files changed (151) hide show
  1. package/dist/client/hooks/useAccountQuery.js +2 -6
  2. package/dist/client/hooks/useAvailablePromosQuery.js +2 -6
  3. package/dist/client/hooks/useAvailableQuestsQuery.js +2 -6
  4. package/dist/client/hooks/useBetRecordsQuery.js +2 -6
  5. package/dist/client/hooks/useBonusQuery.js +2 -6
  6. package/dist/client/hooks/useBonusesQuery.js +2 -6
  7. package/dist/client/hooks/useCashbackBonusQuery.js +2 -6
  8. package/dist/client/hooks/useCashbackBonusesQuery.js +2 -6
  9. package/dist/client/hooks/useCashbacksQuery.js +1 -3
  10. package/dist/client/hooks/useCheckInDailyCheckInQuestMutation.js +2 -6
  11. package/dist/client/hooks/useClaimCashbackBonusMutation.js +2 -5
  12. package/dist/client/hooks/useClaimSpotBonusMutation.js +2 -5
  13. package/dist/client/hooks/useCreateGCashDepositMutation.js +5 -10
  14. package/dist/client/hooks/useCreateGCashWithdrawalMutation.js +4 -7
  15. package/dist/client/hooks/useCreateGameSessionMutation.js +6 -15
  16. package/dist/client/hooks/useCreateInstapayWithdrawalMutation.js +4 -7
  17. package/dist/client/hooks/useCreateMayaAppDepositMutation.js +5 -10
  18. package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.js +4 -7
  19. package/dist/client/hooks/useCreateMayaDepositMutation.js +5 -10
  20. package/dist/client/hooks/useCreateMayaWithdrawalMutation.js +4 -7
  21. package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +5 -10
  22. package/dist/client/hooks/useCreateQRPHDepositMutation.js +5 -10
  23. package/dist/client/hooks/useDepositQuery.js +2 -6
  24. package/dist/client/hooks/useDepositRecordsQuery.js +2 -6
  25. package/dist/client/hooks/useDepositsCountQuery.js +2 -6
  26. package/dist/client/hooks/useEndGameSessionMutation.js +2 -6
  27. package/dist/client/hooks/useFavoriteGamesQuery.js +2 -6
  28. package/dist/client/hooks/useInstapayBankListQuery.js +2 -6
  29. package/dist/client/hooks/useIsMayaSessionValidQuery.js +2 -6
  30. package/dist/client/hooks/useMarkGameAsFavoriteMutation.js +2 -5
  31. package/dist/client/hooks/useMarkMessageAsReadMutation.js +2 -5
  32. package/dist/client/hooks/useMemberVerificationQuery.js +2 -6
  33. package/dist/client/hooks/useMessagesQuery.js +2 -6
  34. package/dist/client/hooks/usePaymentSettingsQuery.js +2 -6
  35. package/dist/client/hooks/useProfileCompletionQuery.js +2 -6
  36. package/dist/client/hooks/useTransactionRecordsQuery.js +2 -6
  37. package/dist/client/hooks/useUnmarkGameAsFavoriteMutation.js +2 -5
  38. package/dist/client/hooks/useUnreadMessagesCountQuery.js +2 -6
  39. package/dist/client/hooks/useUpdateAccountMutation.js +2 -5
  40. package/dist/client/hooks/useWalletQuery.js +8 -7
  41. package/dist/client/hooks/useWithdrawalRecordsQuery.js +2 -6
  42. package/dist/components/Account/Account.d.ts +0 -2
  43. package/dist/components/Account/Account.js +10 -8
  44. package/dist/components/Account/AccountTrigger.d.ts +1 -2
  45. package/dist/components/Account/AccountTrigger.js +18 -6
  46. package/dist/components/Bonuses/BonusesTrigger.d.ts +1 -1
  47. package/dist/components/Bonuses/BonusesTrigger.js +3 -3
  48. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
  49. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
  50. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
  51. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
  52. package/dist/components/DepositWithdrawal/DepositWithdrawal.d.ts +1 -6
  53. package/dist/components/DepositWithdrawal/DepositWithdrawal.js +8 -19
  54. package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.d.ts +1 -1
  55. package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.js +12 -4
  56. package/dist/components/Messages/Message.d.ts +1 -4
  57. package/dist/components/Messages/Message.js +8 -9
  58. package/dist/components/Messages/MessageContext.d.ts +2 -0
  59. package/dist/components/Messages/MessageContext.js +2 -0
  60. package/dist/components/Messages/Messages.d.ts +0 -1
  61. package/dist/components/Messages/Messages.js +9 -8
  62. package/dist/components/Messages/MessagesTrigger.d.ts +1 -1
  63. package/dist/components/Messages/MessagesTrigger.js +8 -4
  64. package/dist/components/PortalProvider/Providers.js +1 -5
  65. package/dist/components/SignUp/SignUpForm.js +2 -1
  66. package/dist/handlers.js +1 -0
  67. package/dist/services/ObjectId.d.ts +0 -14
  68. package/dist/services/ObjectId.js +62 -76
  69. package/dist/services/ObjectType.d.ts +10 -0
  70. package/dist/services/ObjectType.js +10 -0
  71. package/dist/services/index.d.ts +4 -3
  72. package/dist/services/index.js +4 -3
  73. package/dist/styles/theme.css +2 -2
  74. package/dist/ui/AlertDialog/AlertDialog.d.ts +122 -122
  75. package/dist/ui/AlertDialog/AlertDialog.js +2 -1
  76. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
  77. package/dist/ui/AlertDialog/alertDialog.recipe.js +1 -1
  78. package/dist/ui/Avatar/Avatar.d.ts +1 -1
  79. package/dist/ui/Avatar/Avatar.js +1 -1
  80. package/dist/ui/Avatar/avatar.recipe.js +1 -1
  81. package/dist/ui/Badge/Badge.js +1 -1
  82. package/dist/ui/Button/Button.js +1 -1
  83. package/dist/ui/Checkbox/Checkbox.d.ts +24 -24
  84. package/dist/ui/Checkbox/Checkbox.js +1 -1
  85. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  86. package/dist/ui/Checkbox/checkbox.recipe.js +1 -1
  87. package/dist/ui/Clipboard/Clipboard.d.ts +19 -19
  88. package/dist/ui/Clipboard/Clipboard.js +1 -1
  89. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  90. package/dist/ui/Clipboard/clipboard.recipe.js +1 -1
  91. package/dist/ui/Collapsible/Collapsible.d.ts +1 -1
  92. package/dist/ui/Collapsible/Collapsible.js +1 -1
  93. package/dist/ui/Collapsible/collapsible.recipe.js +1 -1
  94. package/dist/ui/Combobox/Combobox.d.ts +43 -43
  95. package/dist/ui/Combobox/Combobox.js +1 -1
  96. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  97. package/dist/ui/Combobox/combobox.recipe.js +1 -1
  98. package/dist/ui/DatePicker/DatePicker.d.ts +337 -337
  99. package/dist/ui/DatePicker/DatePicker.js +1 -1
  100. package/dist/ui/DatePicker/datePicker.recipe.d.ts +14 -14
  101. package/dist/ui/DatePicker/datePicker.recipe.js +1 -1
  102. package/dist/ui/Dialog/Dialog.d.ts +122 -122
  103. package/dist/ui/Dialog/Dialog.js +2 -1
  104. package/dist/ui/Dialog/dialog.recipe.d.ts +11 -11
  105. package/dist/ui/Dialog/dialog.recipe.js +1 -1
  106. package/dist/ui/Drawer/Drawer.d.ts +34 -34
  107. package/dist/ui/Drawer/Drawer.js +2 -1
  108. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  109. package/dist/ui/Drawer/drawer.recipe.js +1 -1
  110. package/dist/ui/Field/Field.d.ts +22 -22
  111. package/dist/ui/Field/Field.js +1 -1
  112. package/dist/ui/Field/field.recipe.d.ts +3 -3
  113. package/dist/ui/Field/field.recipe.js +1 -1
  114. package/dist/ui/IconButton/IconButton.js +1 -1
  115. package/dist/ui/NumberInput/NumberInput.d.ts +1 -1
  116. package/dist/ui/NumberInput/NumberInput.js +1 -1
  117. package/dist/ui/NumberInput/numberInput.recipe.js +1 -1
  118. package/dist/ui/PasswordInput/PasswordInput.d.ts +1 -1
  119. package/dist/ui/PasswordInput/PasswordInput.js +1 -1
  120. package/dist/ui/PasswordInput/passwordInput.recipe.js +1 -1
  121. package/dist/ui/PinInput/PinInput.d.ts +1 -1
  122. package/dist/ui/PinInput/PinInput.js +1 -1
  123. package/dist/ui/PinInput/pinInput.recipe.js +1 -1
  124. package/dist/ui/Popover/Popover.d.ts +89 -89
  125. package/dist/ui/Popover/Popover.js +1 -1
  126. package/dist/ui/Popover/popover.recipe.d.ts +8 -8
  127. package/dist/ui/Popover/popover.recipe.js +1 -1
  128. package/dist/ui/Progress/Progress.d.ts +1 -1
  129. package/dist/ui/Progress/Progress.js +1 -1
  130. package/dist/ui/Progress/progress.recipe.js +1 -1
  131. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +1 -1
  132. package/dist/ui/SegmentGroup/SegmentGroup.js +1 -1
  133. package/dist/ui/SegmentGroup/segmentGroup.recipe.js +1 -1
  134. package/dist/ui/Select/Select.d.ts +46 -46
  135. package/dist/ui/Select/Select.js +1 -1
  136. package/dist/ui/Select/select.recipe.d.ts +3 -3
  137. package/dist/ui/Select/select.recipe.js +1 -1
  138. package/dist/ui/Table/Table.d.ts +21 -21
  139. package/dist/ui/Table/Table.js +1 -1
  140. package/dist/ui/Table/table.recipe.d.ts +3 -3
  141. package/dist/ui/Tabs/Tabs.d.ts +16 -16
  142. package/dist/ui/Tabs/Tabs.js +1 -1
  143. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  144. package/dist/ui/Tabs/tabs.recipe.js +1 -1
  145. package/package.json +27 -30
  146. package/dist/utils/graphqlRequest.d.ts +0 -4
  147. package/dist/utils/graphqlRequest.js +0 -255
  148. package/dist/utils/httpRequest.d.ts +0 -6
  149. package/dist/utils/httpRequest.js +0 -87
  150. package/dist/utils/sha256.d.ts +0 -4
  151. package/dist/utils/sha256.js +0 -16
@@ -1,11 +1,10 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { getMemberAccount } from '../../services/index.js';
4
- import { getAccountQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
4
+ import { getAccountQueryKey } from '../../utils/index.js';
5
5
  import { getSession } from '../services/index.js';
6
6
  import { useSessionQuery } from './useSessionQuery.js';
7
7
  export const useAccountQuery = (config) => {
8
- const queryClient = getQueryClient();
9
8
  const sessionQuery = useSessionQuery();
10
9
  const query = useQuery({
11
10
  ...config,
@@ -14,10 +13,7 @@ export const useAccountQuery = (config) => {
14
13
  : sessionQuery.data?.status === 'authenticated',
15
14
  queryKey: getAccountQueryKey(),
16
15
  queryFn: async ({ signal }) => {
17
- const session = await queryClient.fetchQuery({
18
- queryKey: getSessionQueryKey(),
19
- queryFn: () => getSession(),
20
- });
16
+ const session = await getSession();
21
17
  invariant(session.status === 'authenticated');
22
18
  return await getMemberAccount({
23
19
  signal,
@@ -1,11 +1,10 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { getAvailablePromos } from '../../services/index.js';
4
- import { getAvailablePromosQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
4
+ import { getAvailablePromosQueryKey } from '../../utils/index.js';
5
5
  import { getSession } from '../services/index.js';
6
6
  import { useSessionQuery } from './useSessionQuery.js';
7
7
  export const useAvailablePromosQuery = (input, config) => {
8
- const queryClient = getQueryClient();
9
8
  const sessionQuery = useSessionQuery();
10
9
  const query = useQuery({
11
10
  ...config,
@@ -14,10 +13,7 @@ export const useAvailablePromosQuery = (input, config) => {
14
13
  : sessionQuery.data?.status === 'authenticated',
15
14
  queryKey: getAvailablePromosQueryKey(input),
16
15
  queryFn: async ({ signal }) => {
17
- const session = await queryClient.fetchQuery({
18
- queryKey: getSessionQueryKey(),
19
- queryFn: () => getSession(),
20
- });
16
+ const session = await getSession();
21
17
  invariant(session.status === 'authenticated');
22
18
  return await getAvailablePromos(input, {
23
19
  signal,
@@ -1,11 +1,10 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { getAvailableQuests } from '../../services/index.js';
4
- import { getAvailableQuestsQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
4
+ import { getAvailableQuestsQueryKey } from '../../utils/index.js';
5
5
  import { getSession } from '../services/index.js';
6
6
  import { useSessionQuery } from './useSessionQuery.js';
7
7
  export const useAvailableQuestsQuery = (config) => {
8
- const queryClient = getQueryClient();
9
8
  const sessionQuery = useSessionQuery();
10
9
  const query = useQuery({
11
10
  ...config,
@@ -14,10 +13,7 @@ export const useAvailableQuestsQuery = (config) => {
14
13
  : sessionQuery.data?.status === 'authenticated',
15
14
  queryKey: getAvailableQuestsQueryKey(),
16
15
  queryFn: async ({ signal }) => {
17
- const session = await queryClient.fetchQuery({
18
- queryKey: getSessionQueryKey(),
19
- queryFn: () => getSession(),
20
- });
16
+ const session = await getSession();
21
17
  invariant(session.status === 'authenticated');
22
18
  return await getAvailableQuests({
23
19
  signal,
@@ -1,21 +1,17 @@
1
1
  import { useInfiniteQuery } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { getBetRecords } from '../../services/index.js';
4
- import { getBetRecordsQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
4
+ import { getBetRecordsQueryKey } from '../../utils/index.js';
5
5
  import { getSession } from '../services/index.js';
6
6
  import { useSessionQuery } from './useSessionQuery.js';
7
7
  export const useBetRecordsQuery = (input, config) => {
8
- const queryClient = getQueryClient();
9
8
  const sessionQuery = useSessionQuery();
10
9
  const query = useInfiniteQuery({
11
10
  enabled: sessionQuery.data?.status === 'authenticated',
12
11
  ...config,
13
12
  queryKey: getBetRecordsQueryKey(input),
14
13
  queryFn: async ({ pageParam, signal }) => {
15
- const session = await queryClient.fetchQuery({
16
- queryKey: getSessionQueryKey(),
17
- queryFn: () => getSession(),
18
- });
14
+ const session = await getSession();
19
15
  invariant(session.status === 'authenticated');
20
16
  return await getBetRecords({ ...input, after: pageParam }, {
21
17
  signal,
@@ -1,11 +1,10 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { getBonus } from '../../services/index.js';
4
- import { getBonusQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
4
+ import { getBonusQueryKey } from '../../utils/index.js';
5
5
  import { getSession } from '../services/index.js';
6
6
  import { useSessionQuery } from './useSessionQuery.js';
7
7
  export const useBonusQuery = (id, config) => {
8
- const queryClient = getQueryClient();
9
8
  const sessionQuery = useSessionQuery();
10
9
  const query = useQuery({
11
10
  ...config,
@@ -14,10 +13,7 @@ export const useBonusQuery = (id, config) => {
14
13
  : sessionQuery.data?.status === 'authenticated',
15
14
  queryKey: getBonusQueryKey(id),
16
15
  queryFn: async ({ signal }) => {
17
- const session = await queryClient.fetchQuery({
18
- queryKey: getSessionQueryKey(),
19
- queryFn: () => getSession(),
20
- });
16
+ const session = await getSession();
21
17
  invariant(session.status === 'authenticated');
22
18
  const bonus = await getBonus(id, {
23
19
  signal,
@@ -1,11 +1,10 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { getBonuses } from '../../services/index.js';
4
- import { getBonusesQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
4
+ import { getBonusesQueryKey } from '../../utils/index.js';
5
5
  import { getSession } from '../services/index.js';
6
6
  import { useSessionQuery } from './useSessionQuery.js';
7
7
  export const useBonusesQuery = (config) => {
8
- const queryClient = getQueryClient();
9
8
  const sessionQuery = useSessionQuery();
10
9
  const query = useQuery({
11
10
  ...config,
@@ -14,10 +13,7 @@ export const useBonusesQuery = (config) => {
14
13
  : sessionQuery.data?.status === 'authenticated',
15
14
  queryKey: getBonusesQueryKey(),
16
15
  queryFn: async ({ signal }) => {
17
- const session = await queryClient.fetchQuery({
18
- queryKey: getSessionQueryKey(),
19
- queryFn: () => getSession(),
20
- });
16
+ const session = await getSession();
21
17
  invariant(session.status === 'authenticated');
22
18
  return await getBonuses({
23
19
  signal,
@@ -1,11 +1,10 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { getCashbackBonus } from '../../services/index.js';
4
- import { getCashbackBonusQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
4
+ import { getCashbackBonusQueryKey } from '../../utils/index.js';
5
5
  import { getSession } from '../services/index.js';
6
6
  import { useSessionQuery } from './useSessionQuery.js';
7
7
  export const useCashbackBonusQuery = (id, config) => {
8
- const queryClient = getQueryClient();
9
8
  const sessionQuery = useSessionQuery();
10
9
  const query = useQuery({
11
10
  ...config,
@@ -14,10 +13,7 @@ export const useCashbackBonusQuery = (id, config) => {
14
13
  : sessionQuery.data?.status === 'authenticated',
15
14
  queryKey: getCashbackBonusQueryKey(id),
16
15
  queryFn: async ({ signal }) => {
17
- const session = await queryClient.fetchQuery({
18
- queryKey: getSessionQueryKey(),
19
- queryFn: () => getSession(),
20
- });
16
+ const session = await getSession();
21
17
  invariant(session.status === 'authenticated');
22
18
  return await getCashbackBonus(id, {
23
19
  signal,
@@ -1,11 +1,10 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { getCashbackBonuses } from '../../services/index.js';
4
- import { getCashbackBonusesQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
4
+ import { getCashbackBonusesQueryKey } from '../../utils/index.js';
5
5
  import { getSession } from '../services/index.js';
6
6
  import { useSessionQuery } from './useSessionQuery.js';
7
7
  export const useCashbackBonusesQuery = (config) => {
8
- const queryClient = getQueryClient();
9
8
  const sessionQuery = useSessionQuery();
10
9
  return useQuery({
11
10
  ...config,
@@ -14,10 +13,7 @@ export const useCashbackBonusesQuery = (config) => {
14
13
  : sessionQuery.data?.status === 'authenticated',
15
14
  queryKey: getCashbackBonusesQueryKey(),
16
15
  queryFn: async ({ signal }) => {
17
- const session = await queryClient.fetchQuery({
18
- queryKey: getSessionQueryKey(),
19
- queryFn: () => getSession(),
20
- });
16
+ const session = await getSession();
21
17
  invariant(session.status === 'authenticated');
22
18
  return await getCashbackBonuses({
23
19
  signal,
@@ -6,9 +6,7 @@ export const useCashbacksQuery = (config) => {
6
6
  ...config,
7
7
  queryKey: getCashbacksQueryKey(),
8
8
  queryFn: async ({ signal }) => {
9
- return await getCashbacks({
10
- signal,
11
- });
9
+ return await getCashbacks({ signal });
12
10
  },
13
11
  });
14
12
  };
@@ -1,18 +1,14 @@
1
1
  import { useMutation } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { checkInDailyCheckInQuest } from '../../services/index.js';
4
- import { getCheckInDailyQuestMutationKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
4
+ import { getCheckInDailyQuestMutationKey } from '../../utils/index.js';
5
5
  import { getSession } from '../services/index.js';
6
6
  export const useCheckInDailyCheckInQuestMutation = (config) => {
7
- const queryClient = getQueryClient();
8
7
  const mutation = useMutation({
9
8
  ...config,
10
9
  mutationKey: getCheckInDailyQuestMutationKey(),
11
10
  mutationFn: async (id) => {
12
- const session = await queryClient.fetchQuery({
13
- queryKey: getSessionQueryKey(),
14
- queryFn: () => getSession(),
15
- });
11
+ const session = await getSession();
16
12
  invariant(session.status === 'authenticated');
17
13
  await checkInDailyCheckInQuest(id, {
18
14
  headers: {
@@ -1,7 +1,7 @@
1
1
  import { useMutation } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { claimCashbackBonus } from '../../services/index.js';
4
- import { getCashbackBonusesQueryKey, getClaimCashbackBonusMutationKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
4
+ import { getCashbackBonusesQueryKey, getClaimCashbackBonusMutationKey, getQueryClient, } from '../../utils/index.js';
5
5
  import { getSession } from '../services/index.js';
6
6
  export const useClaimCashbackBonusMutation = (config) => {
7
7
  const queryClient = getQueryClient();
@@ -9,10 +9,7 @@ export const useClaimCashbackBonusMutation = (config) => {
9
9
  ...config,
10
10
  mutationKey: getClaimCashbackBonusMutationKey(),
11
11
  mutationFn: async (id) => {
12
- const session = await queryClient.fetchQuery({
13
- queryKey: getSessionQueryKey(),
14
- queryFn: () => getSession(),
15
- });
12
+ const session = await getSession();
16
13
  invariant(session.status === 'authenticated');
17
14
  await claimCashbackBonus(id, {
18
15
  headers: {
@@ -1,7 +1,7 @@
1
1
  import { useMutation } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { claimSpotBonus } from '../../services/index.js';
4
- import { getBonusesQueryKey, getClaimSpotBonusMutationKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
4
+ import { getBonusesQueryKey, getClaimSpotBonusMutationKey, getQueryClient, } from '../../utils/index.js';
5
5
  import { getSession } from '../services/index.js';
6
6
  export const useClaimSpotBonusMutation = (config) => {
7
7
  const queryClient = getQueryClient();
@@ -9,10 +9,7 @@ export const useClaimSpotBonusMutation = (config) => {
9
9
  ...config,
10
10
  mutationKey: getClaimSpotBonusMutationKey(),
11
11
  mutationFn: async (id) => {
12
- const session = await queryClient.fetchQuery({
13
- queryKey: getSessionQueryKey(),
14
- queryFn: () => getSession(),
15
- });
12
+ const session = await getSession();
16
13
  invariant(session.status === 'authenticated');
17
14
  await claimSpotBonus(id, {
18
15
  headers: {
@@ -1,8 +1,9 @@
1
+ import { ObjectId } from '@opexa/object-id';
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import invariant from 'tiny-invariant';
3
4
  import { createGCashDeposit, getDeposit, } from '../../services/index.js';
4
- import { ObjectId, ObjectType } from '../../services/ObjectId.js';
5
- import { createPoll, getCreateGCashDepositMutationKey, getDepositsCountQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { createPoll, getCreateGCashDepositMutationKey, getDepositsCountQueryKey, getQueryClient, } from '../../utils/index.js';
6
7
  import { getSession } from '../services/index.js';
7
8
  export const useCreateGCashDepositMutation = (config) => {
8
9
  const queryClient = getQueryClient();
@@ -11,10 +12,7 @@ export const useCreateGCashDepositMutation = (config) => {
11
12
  mutationKey: getCreateGCashDepositMutationKey(),
12
13
  mutationFn: async (input) => {
13
14
  const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
14
- const session = await queryClient.fetchQuery({
15
- queryKey: getSessionQueryKey(),
16
- queryFn: () => getSession(),
17
- });
15
+ const session = await getSession();
18
16
  invariant(session.status === 'authenticated');
19
17
  await createGCashDeposit({ ...input, id }, {
20
18
  headers: {
@@ -22,10 +20,7 @@ export const useCreateGCashDepositMutation = (config) => {
22
20
  },
23
21
  });
24
22
  const poll = createPoll(async () => {
25
- const session = await queryClient.fetchQuery({
26
- queryKey: getSessionQueryKey(),
27
- queryFn: () => getSession(),
28
- });
23
+ const session = await getSession();
29
24
  invariant(session.status === 'authenticated');
30
25
  return await getDeposit(id, {
31
26
  headers: {
@@ -1,20 +1,17 @@
1
+ import { ObjectId } from '@opexa/object-id';
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import invariant from 'tiny-invariant';
3
4
  import { createGCashWithdrawal, } from '../../services/index.js';
4
- import { ObjectId, ObjectType } from '../../services/ObjectId.js';
5
- import { getCreateGCashWithdrawalMutationKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { getCreateGCashWithdrawalMutationKey } from '../../utils/index.js';
6
7
  import { getSession } from '../services/index.js';
7
8
  export const useCreateGCashWithdrawalMutation = (config) => {
8
- const queryClient = getQueryClient();
9
9
  const mutation = useMutation({
10
10
  ...config,
11
11
  mutationKey: getCreateGCashWithdrawalMutationKey(),
12
12
  mutationFn: async (input) => {
13
13
  const id = input.id ?? ObjectId.generate(ObjectType.Withdrawal).toString();
14
- const session = await queryClient.fetchQuery({
15
- queryKey: getSessionQueryKey(),
16
- queryFn: () => getSession(),
17
- });
14
+ const session = await getSession();
18
15
  invariant(session.status === 'authenticated');
19
16
  await createGCashWithdrawal({ ...input, id }, {
20
17
  headers: {
@@ -1,21 +1,18 @@
1
+ import { ObjectId } from '@opexa/object-id';
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import invariant from 'tiny-invariant';
3
4
  import { LEGACY_GAME_PROVIDERS } from '../../constants/index.js';
4
5
  import { createGameSession, createGameSession__legacy, getGameSession, getGameSession__legacy, } from '../../services/index.js';
5
- import { ObjectId, ObjectType } from '../../services/ObjectId.js';
6
- import { createPoll, getCreateGameSessionMutationKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
6
+ import { ObjectType } from '../../services/ObjectType.js';
7
+ import { createPoll, getCreateGameSessionMutationKey } from '../../utils/index.js';
7
8
  import { getSession } from '../services/index.js';
8
9
  export const useCreateGameSessionMutation = (config) => {
9
- const queryClient = getQueryClient();
10
10
  return useMutation({
11
11
  ...config,
12
12
  mutationKey: getCreateGameSessionMutationKey(),
13
13
  mutationFn: async (game) => {
14
14
  const id = ObjectId.generate(ObjectType.GameSession).toString();
15
- const session = await queryClient.fetchQuery({
16
- queryKey: getSessionQueryKey(),
17
- queryFn: () => getSession(),
18
- });
15
+ const session = await getSession();
19
16
  invariant(session.status === 'authenticated');
20
17
  if (LEGACY_GAME_PROVIDERS.includes(game.provider)) {
21
18
  await createGameSession__legacy({
@@ -27,10 +24,7 @@ export const useCreateGameSessionMutation = (config) => {
27
24
  },
28
25
  });
29
26
  const data = await createPoll(async () => {
30
- const session = await queryClient.fetchQuery({
31
- queryKey: getSessionQueryKey(),
32
- queryFn: () => getSession(),
33
- });
27
+ const session = await getSession();
34
28
  invariant(session.status === 'authenticated');
35
29
  return await getGameSession__legacy(id, {
36
30
  headers: {
@@ -60,10 +54,7 @@ export const useCreateGameSessionMutation = (config) => {
60
54
  },
61
55
  });
62
56
  const data = await createPoll(async () => {
63
- const session = await queryClient.fetchQuery({
64
- queryKey: getSessionQueryKey(),
65
- queryFn: () => getSession(),
66
- });
57
+ const session = await getSession();
67
58
  invariant(session.status === 'authenticated');
68
59
  return await getGameSession(id, {
69
60
  headers: {
@@ -1,20 +1,17 @@
1
+ import { ObjectId } from '@opexa/object-id';
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import invariant from 'tiny-invariant';
3
4
  import { createAIOInstapayWithdrawal, } from '../../services/index.js';
4
- import { ObjectId, ObjectType } from '../../services/ObjectId.js';
5
- import { getCreateInstapayWithdrawalMutationKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { getCreateInstapayWithdrawalMutationKey } from '../../utils/index.js';
6
7
  import { getSession } from '../services/index.js';
7
8
  export const useCreateInstapayWithdrawalMutation = (config) => {
8
- const queryClient = getQueryClient();
9
9
  const mutation = useMutation({
10
10
  ...config,
11
11
  mutationKey: getCreateInstapayWithdrawalMutationKey(),
12
12
  mutationFn: async (input) => {
13
13
  const id = input.id ?? ObjectId.generate(ObjectType.Withdrawal).toString();
14
- const session = await queryClient.fetchQuery({
15
- queryKey: getSessionQueryKey(),
16
- queryFn: () => getSession(),
17
- });
14
+ const session = await getSession();
18
15
  invariant(session.status === 'authenticated');
19
16
  await createAIOInstapayWithdrawal({ ...input, id }, {
20
17
  headers: {
@@ -1,8 +1,9 @@
1
+ import { ObjectId } from '@opexa/object-id';
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import invariant from 'tiny-invariant';
3
4
  import { createMayaAppDeposit, getDeposit, } from '../../services/index.js';
4
- import { ObjectId, ObjectType } from '../../services/ObjectId.js';
5
- import { createPoll, getCreateMayaAppDepositMutationKey, getDepositsCountQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { createPoll, getCreateMayaAppDepositMutationKey, getDepositsCountQueryKey, getQueryClient, } from '../../utils/index.js';
6
7
  import { getSession } from '../services/index.js';
7
8
  export const useCreateMayaAppDepositMutation = (config) => {
8
9
  const queryClient = getQueryClient();
@@ -11,10 +12,7 @@ export const useCreateMayaAppDepositMutation = (config) => {
11
12
  mutationKey: getCreateMayaAppDepositMutationKey(),
12
13
  mutationFn: async (input) => {
13
14
  const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
14
- const session = await queryClient.fetchQuery({
15
- queryKey: getSessionQueryKey(),
16
- queryFn: () => getSession(),
17
- });
15
+ const session = await getSession();
18
16
  invariant(session.status === 'authenticated');
19
17
  await createMayaAppDeposit({ ...input, id }, {
20
18
  headers: {
@@ -22,10 +20,7 @@ export const useCreateMayaAppDepositMutation = (config) => {
22
20
  },
23
21
  });
24
22
  const poll = createPoll(async () => {
25
- const session = await queryClient.fetchQuery({
26
- queryKey: getSessionQueryKey(),
27
- queryFn: () => getSession(),
28
- });
23
+ const session = await getSession();
29
24
  invariant(session.status === 'authenticated');
30
25
  return await getDeposit(id, {
31
26
  headers: {
@@ -1,20 +1,17 @@
1
+ import { ObjectId } from '@opexa/object-id';
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import invariant from 'tiny-invariant';
3
4
  import { createMayaAppWithdrawal, } from '../../services/index.js';
4
- import { ObjectId, ObjectType } from '../../services/ObjectId.js';
5
- import { getCreateMayaAppWithdrawalMutationKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { getCreateMayaAppWithdrawalMutationKey } from '../../utils/index.js';
6
7
  import { getSession } from '../services/index.js';
7
8
  export const useCreateMayaAppWithdrawalMutation = (config) => {
8
- const queryClient = getQueryClient();
9
9
  const mutation = useMutation({
10
10
  ...config,
11
11
  mutationKey: getCreateMayaAppWithdrawalMutationKey(),
12
12
  mutationFn: async (input) => {
13
13
  const id = input.id ?? ObjectId.generate(ObjectType.Withdrawal).toString();
14
- const session = await queryClient.fetchQuery({
15
- queryKey: getSessionQueryKey(),
16
- queryFn: () => getSession(),
17
- });
14
+ const session = await getSession();
18
15
  invariant(session.status === 'authenticated');
19
16
  await createMayaAppWithdrawal({ ...input, id }, {
20
17
  headers: {
@@ -1,8 +1,9 @@
1
+ import { ObjectId } from '@opexa/object-id';
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import invariant from 'tiny-invariant';
3
4
  import { createMayaDeposit, getDeposit, } from '../../services/index.js';
4
- import { ObjectId, ObjectType } from '../../services/ObjectId.js';
5
- import { createPoll, getCreateMayaDepositMutationKey, getDepositsCountQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { createPoll, getCreateMayaDepositMutationKey, getDepositsCountQueryKey, getQueryClient, } from '../../utils/index.js';
6
7
  import { getSession } from '../services/index.js';
7
8
  export const useCreateMayaDepositMutation = (config) => {
8
9
  const queryClient = getQueryClient();
@@ -11,10 +12,7 @@ export const useCreateMayaDepositMutation = (config) => {
11
12
  mutationKey: getCreateMayaDepositMutationKey(),
12
13
  mutationFn: async (input) => {
13
14
  const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
14
- const session = await queryClient.fetchQuery({
15
- queryKey: getSessionQueryKey(),
16
- queryFn: () => getSession(),
17
- });
15
+ const session = await getSession();
18
16
  invariant(session.status === 'authenticated');
19
17
  await createMayaDeposit({ ...input, id }, {
20
18
  headers: {
@@ -22,10 +20,7 @@ export const useCreateMayaDepositMutation = (config) => {
22
20
  },
23
21
  });
24
22
  const poll = createPoll(async () => {
25
- const session = await queryClient.fetchQuery({
26
- queryKey: getSessionQueryKey(),
27
- queryFn: () => getSession(),
28
- });
23
+ const session = await getSession();
29
24
  invariant(session.status === 'authenticated');
30
25
  return await getDeposit(id, {
31
26
  headers: {
@@ -1,20 +1,17 @@
1
+ import { ObjectId } from '@opexa/object-id';
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import invariant from 'tiny-invariant';
3
4
  import { createMayaWithdrawal, } from '../../services/index.js';
4
- import { ObjectId, ObjectType } from '../../services/ObjectId.js';
5
- import { getCreateMayaWithdrawalMutationKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { getCreateMayaWithdrawalMutationKey } from '../../utils/index.js';
6
7
  import { getSession } from '../services/index.js';
7
8
  export const useCreateMayaWithdrawalMutation = (config) => {
8
- const queryClient = getQueryClient();
9
9
  const mutation = useMutation({
10
10
  ...config,
11
11
  mutationKey: getCreateMayaWithdrawalMutationKey(),
12
12
  mutationFn: async (input) => {
13
13
  const id = input.id ?? ObjectId.generate(ObjectType.Withdrawal).toString();
14
- const session = await queryClient.fetchQuery({
15
- queryKey: getSessionQueryKey(),
16
- queryFn: () => getSession(),
17
- });
14
+ const session = await getSession();
18
15
  invariant(session.status === 'authenticated');
19
16
  await createMayaWithdrawal({ ...input, id }, {
20
17
  headers: {
@@ -1,8 +1,9 @@
1
+ import { ObjectId } from '@opexa/object-id';
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import invariant from 'tiny-invariant';
3
4
  import { createAIOOnlineBankDeposit, getDeposit, } from '../../services/index.js';
4
- import { ObjectId, ObjectType } from '../../services/ObjectId.js';
5
- import { createPoll, getCreateOnlineBankDepositMutationKey, getDepositsCountQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { createPoll, getCreateOnlineBankDepositMutationKey, getDepositsCountQueryKey, getQueryClient, } from '../../utils/index.js';
6
7
  import { getSession } from '../services/index.js';
7
8
  export const useCreateOnlineBankDepositMutation = (config) => {
8
9
  const queryClient = getQueryClient();
@@ -11,10 +12,7 @@ export const useCreateOnlineBankDepositMutation = (config) => {
11
12
  mutationKey: getCreateOnlineBankDepositMutationKey(),
12
13
  mutationFn: async (input) => {
13
14
  const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
14
- const session = await queryClient.fetchQuery({
15
- queryKey: getSessionQueryKey(),
16
- queryFn: () => getSession(),
17
- });
15
+ const session = await getSession();
18
16
  invariant(session.status === 'authenticated');
19
17
  await createAIOOnlineBankDeposit({ ...input, id }, {
20
18
  headers: {
@@ -22,10 +20,7 @@ export const useCreateOnlineBankDepositMutation = (config) => {
22
20
  },
23
21
  });
24
22
  const poll = createPoll(async () => {
25
- const session = await queryClient.fetchQuery({
26
- queryKey: getSessionQueryKey(),
27
- queryFn: () => getSession(),
28
- });
23
+ const session = await getSession();
29
24
  invariant(session.status === 'authenticated');
30
25
  return await getDeposit(id, {
31
26
  headers: {
@@ -1,8 +1,9 @@
1
+ import { ObjectId } from '@opexa/object-id';
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import invariant from 'tiny-invariant';
3
4
  import { createAIOQRPHDeposit, getDeposit, } from '../../services/index.js';
4
- import { ObjectId, ObjectType } from '../../services/ObjectId.js';
5
- import { createPoll, getCreateQRPHDepositMutationKey, getDepositsCountQueryKey, getQueryClient, getSessionQueryKey, } from '../../utils/index.js';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { createPoll, getCreateQRPHDepositMutationKey, getDepositsCountQueryKey, getQueryClient, } from '../../utils/index.js';
6
7
  import { getSession } from '../services/index.js';
7
8
  export const useCreateQRPHDepositMutation = (config) => {
8
9
  const queryClient = getQueryClient();
@@ -11,10 +12,7 @@ export const useCreateQRPHDepositMutation = (config) => {
11
12
  mutationKey: getCreateQRPHDepositMutationKey(),
12
13
  mutationFn: async (input) => {
13
14
  const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
14
- const session = await queryClient.fetchQuery({
15
- queryKey: getSessionQueryKey(),
16
- queryFn: () => getSession(),
17
- });
15
+ const session = await getSession();
18
16
  invariant(session.status === 'authenticated');
19
17
  await createAIOQRPHDeposit({ ...input, id }, {
20
18
  headers: {
@@ -22,10 +20,7 @@ export const useCreateQRPHDepositMutation = (config) => {
22
20
  },
23
21
  });
24
22
  const poll = createPoll(async () => {
25
- const session = await queryClient.fetchQuery({
26
- queryKey: getSessionQueryKey(),
27
- queryFn: () => getSession(),
28
- });
23
+ const session = await getSession();
29
24
  invariant(session.status === 'authenticated');
30
25
  return await getDeposit(id, {
31
26
  headers: {