@opexa/portal-components 0.0.100 → 0.0.101

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 (130) hide show
  1. package/dist/client/hooks/index.d.ts +65 -0
  2. package/dist/client/hooks/index.js +65 -0
  3. package/dist/client/services/index.d.ts +4 -0
  4. package/dist/client/services/index.js +4 -0
  5. package/dist/client/utils/index.d.ts +3 -0
  6. package/dist/client/utils/index.js +3 -0
  7. package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +2 -0
  8. package/dist/components/CashbackBonus/CashbackBonus.client.js +9 -0
  9. package/dist/components/CashbackBonus/CashbackBonus.d.ts +10 -0
  10. package/dist/components/CashbackBonus/CashbackBonus.js +5 -0
  11. package/dist/components/CashbackBonus/index.d.ts +1 -0
  12. package/dist/components/CashbackBonus/index.js +1 -0
  13. package/dist/components/Games/GameContext.d.ts +2 -0
  14. package/dist/components/Games/GameContext.js +2 -0
  15. package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +2 -0
  16. package/dist/components/JackpotCounter/JackpotCounter.client.js +66 -0
  17. package/dist/components/JackpotCounter/JackpotCounter.d.ts +17 -0
  18. package/dist/components/JackpotCounter/JackpotCounter.js +21 -0
  19. package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +18 -0
  20. package/dist/components/JackpotCounter/JackpotCounterItem.js +109 -0
  21. package/dist/components/JackpotCounter/JackpotCounterItem.module.css +184 -0
  22. package/dist/components/JackpotCounter/index.d.ts +1 -0
  23. package/dist/components/JackpotCounter/index.js +1 -0
  24. package/dist/components/Jackpots/JackpotDesktop.d.ts +1 -0
  25. package/dist/components/Jackpots/JackpotDesktop.js +45 -0
  26. package/dist/components/Jackpots/JackpotGameProviders.d.ts +5 -0
  27. package/dist/components/Jackpots/JackpotGameProviders.js +41 -0
  28. package/dist/components/Jackpots/JackpotItemDesktop.d.ts +9 -0
  29. package/dist/components/Jackpots/JackpotItemDesktop.js +43 -0
  30. package/dist/components/Jackpots/JackpotItemMobile.d.ts +9 -0
  31. package/dist/components/Jackpots/JackpotItemMobile.js +44 -0
  32. package/dist/components/Jackpots/JackpotMobile.d.ts +1 -0
  33. package/dist/components/Jackpots/JackpotMobile.js +46 -0
  34. package/dist/components/Jackpots/JackpotRules.d.ts +5 -0
  35. package/dist/components/Jackpots/JackpotRules.js +11 -0
  36. package/dist/components/Jackpots/Jackpots.client.d.ts +2 -0
  37. package/dist/components/Jackpots/Jackpots.client.js +29 -0
  38. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +5 -6
  39. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
  40. package/dist/components/Jackpots/JackpotsContext.d.ts +4 -0
  41. package/dist/components/Jackpots/JackpotsContext.js +3 -0
  42. package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +3 -1
  43. package/dist/components/Jackpots/JackpotsList/JackpotsList.js +7 -7
  44. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
  45. package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +6 -7
  46. package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +8 -2
  47. package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +4 -5
  48. package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.d.ts +0 -4
  49. package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +0 -23
  50. package/dist/components/Jackpots/useJackpotData.d.ts +14 -0
  51. package/dist/components/Jackpots/useJackpotData.js +93 -0
  52. package/dist/components/Jackpots/useJackpotItemData.d.ts +20 -0
  53. package/dist/components/Jackpots/useJackpotItemData.js +87 -0
  54. package/dist/components/Messages/MessageItem.d.ts +4 -0
  55. package/dist/components/Messages/MessageItem.js +34 -0
  56. package/dist/components/PortalProvider/WebVitals.d.ts +1 -0
  57. package/dist/components/PortalProvider/WebVitals.js +8 -0
  58. package/dist/components/Promo/PromoContent.d.ts +2 -0
  59. package/dist/components/Promo/PromoContent.js +9 -0
  60. package/dist/components/Promos/PromoCarousel.d.ts +2 -0
  61. package/dist/components/Promos/PromoCarousel.js +41 -0
  62. package/dist/components/Promos/PromoGrid.d.ts +2 -0
  63. package/dist/components/Promos/PromoGrid.js +12 -0
  64. package/dist/components/Promos/PromoItem.d.ts +7 -0
  65. package/dist/components/Promos/PromoItem.js +10 -0
  66. package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +2 -0
  67. package/dist/components/TournamentCounter/TournamentCounter.client.js +50 -0
  68. package/dist/components/TournamentCounter/TournamentCounter.d.ts +8 -0
  69. package/dist/components/TournamentCounter/TournamentCounter.js +21 -0
  70. package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +8 -0
  71. package/dist/components/TournamentCounter/TournamentCounterItem.js +106 -0
  72. package/dist/components/TournamentCounter/index.d.ts +1 -0
  73. package/dist/components/TournamentCounter/index.js +1 -0
  74. package/dist/components/Tournaments/TournamentDesktop.d.ts +1 -0
  75. package/dist/components/Tournaments/TournamentDesktop.js +57 -0
  76. package/dist/components/Tournaments/TournamentGameProviders.d.ts +5 -0
  77. package/dist/components/Tournaments/TournamentGameProviders.js +38 -0
  78. package/dist/components/Tournaments/TournamentItemDesktop.d.ts +7 -0
  79. package/dist/components/Tournaments/TournamentItemDesktop.js +56 -0
  80. package/dist/components/Tournaments/TournamentItemMobile.d.ts +7 -0
  81. package/dist/components/Tournaments/TournamentItemMobile.js +54 -0
  82. package/dist/components/Tournaments/TournamentMobile.d.ts +1 -0
  83. package/dist/components/Tournaments/TournamentMobile.js +55 -0
  84. package/dist/components/Tournaments/TournamentRules.d.ts +5 -0
  85. package/dist/components/Tournaments/TournamentRules.js +11 -0
  86. package/dist/components/Tournaments/Tournaments.client.d.ts +2 -0
  87. package/dist/components/Tournaments/Tournaments.client.js +20 -0
  88. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
  89. package/dist/components/Tournaments/TournamentsContext.d.ts +4 -0
  90. package/dist/components/Tournaments/TournamentsContext.js +3 -0
  91. package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
  92. package/dist/components/Tournaments/useTournamentData.d.ts +10 -0
  93. package/dist/components/Tournaments/useTournamentData.js +72 -0
  94. package/dist/components/Tournaments/useTournamentItemData.d.ts +16 -0
  95. package/dist/components/Tournaments/useTournamentItemData.js +64 -0
  96. package/dist/components/index.d.ts +33 -0
  97. package/dist/components/index.js +33 -0
  98. package/dist/icons/index.d.ts +65 -0
  99. package/dist/icons/index.js +65 -0
  100. package/dist/images/hacksaw-gaming.png +0 -0
  101. package/dist/next.config.js +4 -0
  102. package/dist/server/services/index.d.ts +4 -0
  103. package/dist/server/services/index.js +4 -0
  104. package/dist/server/utils/index.d.ts +29 -0
  105. package/dist/server/utils/index.js +29 -0
  106. package/dist/services/queries.js +2351 -2351
  107. package/dist/styles/theme.css +697 -697
  108. package/dist/ui/index.d.ts +26 -0
  109. package/dist/ui/index.js +26 -0
  110. package/dist/utils/index.d.ts +17 -0
  111. package/dist/utils/index.js +17 -0
  112. package/package.json +162 -162
  113. package/dist/services/account.service.d.ts +0 -341
  114. package/dist/services/account.service.js +0 -233
  115. package/dist/services/auth.service.d.ts +0 -80
  116. package/dist/services/auth.service.js +0 -152
  117. package/dist/services/cmsPortal.service.d.ts +0 -43
  118. package/dist/services/cmsPortal.service.js +0 -148
  119. package/dist/services/file.service.d.ts +0 -33
  120. package/dist/services/file.service.js +0 -18
  121. package/dist/services/game.service.d.ts +0 -44
  122. package/dist/services/game.service.js +0 -33
  123. package/dist/services/portal.service.d.ts +0 -37
  124. package/dist/services/portal.service.js +0 -44
  125. package/dist/services/report.service.d.ts +0 -223
  126. package/dist/services/report.service.js +0 -72
  127. package/dist/services/trigger.service.d.ts +0 -94
  128. package/dist/services/trigger.service.js +0 -88
  129. package/dist/services/wallet.service.d.ts +0 -475
  130. package/dist/services/wallet.service.js +0 -365
@@ -1,152 +0,0 @@
1
- import { AUTH_ENDPOINT } from '../constants/index.js';
2
- import { httpRequest } from './httpRequest.js';
3
- import { sha256 } from './sha256.js';
4
- export async function createSession(input, options) {
5
- const headers = new Headers();
6
- if (input.type === 'NAME_AND_PASSWORD') {
7
- const password = await sha256(input.password);
8
- headers.set('Authorization', `Basic ${Buffer.from(`${input.name}:${password}`).toString('base64')}`);
9
- }
10
- if (input.type === 'MOBILE_NUMBER') {
11
- headers.set('Authorization', `MobileNumberOTP ${Buffer.from(`${input.mobileNumber}:${input.verificationCode}`).toString('base64')}`);
12
- }
13
- if (input.type === 'MAYA') {
14
- headers.set('Authorization', `MayaSession ${input.session}`);
15
- }
16
- if (input.type === 'LIBANGAN') {
17
- headers.set('Authorization', `Libangan ${input.session}`);
18
- }
19
- if (input.type === 'SOCIALS') {
20
- headers.set('Authorization', `Token ${input.token}`);
21
- }
22
- if (input.type === 'CABINET') {
23
- headers.set('Authorization', `Opexa-Cabinet-Token ${input.token}`);
24
- }
25
- if (input.type === 'SINGLE_USE_TOKEN') {
26
- headers.set('Authorization', `Single-Use-Token ${input.token}`);
27
- }
28
- new Headers(options?.headers).forEach((value, key) => {
29
- headers.set(key, value);
30
- });
31
- try {
32
- return await httpRequest.json(input.type === 'LIBANGAN'
33
- ? `${AUTH_ENDPOINT}/v2/sessions`
34
- : `${AUTH_ENDPOINT}/sessions`, {
35
- ...options,
36
- method: 'POST',
37
- headers,
38
- });
39
- }
40
- catch (e) {
41
- if (e instanceof Error) {
42
- throw e;
43
- }
44
- else {
45
- const error = new Error();
46
- error.name = 'AccountNotFoundError';
47
- error.message = 'Account not found';
48
- Error.captureStackTrace?.(error, createSession);
49
- throw error;
50
- }
51
- }
52
- }
53
- export async function authenticate(input, options) {
54
- if (input.type === 'SECURITY_QUESTION') {
55
- try {
56
- return await httpRequest.json(`${AUTH_ENDPOINT}/session/${input.token}/authenticate`, {
57
- ...options,
58
- method: 'POST',
59
- body: JSON.stringify({
60
- secretAnswer: await sha256(input.secretAnswer),
61
- }),
62
- });
63
- }
64
- catch (e) {
65
- if (e instanceof Error) {
66
- throw e;
67
- }
68
- else {
69
- const error = new Error();
70
- error.name = 'AccountNotFoundError';
71
- error.message = 'Account not found';
72
- Error.captureStackTrace?.(error, authenticate);
73
- throw error;
74
- }
75
- }
76
- }
77
- throw new Error("Invalid input 'type'");
78
- }
79
- export async function refreshSession(options) {
80
- try {
81
- return await httpRequest.json(`${AUTH_ENDPOINT}/session:refresh`, {
82
- ...options,
83
- method: 'POST',
84
- });
85
- }
86
- catch (e) {
87
- if (e instanceof Error) {
88
- throw e;
89
- }
90
- else {
91
- const error = new Error();
92
- error.name = 'AccountNotFoundError';
93
- error.message = 'Account not found';
94
- Error.captureStackTrace?.(error, refreshSession);
95
- throw error;
96
- }
97
- }
98
- }
99
- export async function destroySession(options) {
100
- try {
101
- await httpRequest(`${AUTH_ENDPOINT}/session`, {
102
- ...options,
103
- method: 'DELETE',
104
- });
105
- }
106
- catch {
107
- /* ignore */
108
- }
109
- }
110
- export async function verifySession(options) {
111
- try {
112
- const res = await httpRequest(`${AUTH_ENDPOINT}/session`, options);
113
- return res.ok;
114
- }
115
- catch {
116
- /* Assume session is still valid for unknown errors like Network */
117
- return true;
118
- }
119
- }
120
- export async function sendVerificationCode(input, options) {
121
- const { strict, ...rest } = input;
122
- const headers = new Headers();
123
- headers.set('Accept', 'application/json');
124
- headers.set('Content-Type', 'application/json');
125
- new Headers(options?.headers).forEach((value, key) => {
126
- headers.set(key, value);
127
- });
128
- return httpRequest(`${AUTH_ENDPOINT}/otps`, {
129
- ...options,
130
- method: 'POST',
131
- headers,
132
- body: JSON.stringify({
133
- verificationType: strict ? 'MEMBER' : undefined,
134
- ...rest,
135
- }),
136
- });
137
- }
138
- export async function createSingleUseToken(options) {
139
- try {
140
- return await httpRequest.json(`${AUTH_ENDPOINT}/token`, {
141
- ...options,
142
- method: 'POST',
143
- });
144
- }
145
- catch {
146
- const error = new Error();
147
- error.name = 'InvalidTokenError';
148
- error.message = 'Invalid token';
149
- Error.captureStackTrace?.(error, createSingleUseToken);
150
- throw error;
151
- }
152
- }
@@ -1,43 +0,0 @@
1
- import type { SimplifyDeep } from 'type-fest';
2
- import type { EnumFilterField, Game, GameProvider, GameTag, GameType, ObjectIdFilterField, PaginatedQueryResult, Site, SortOrder } from '../types';
3
- import { type HttpRequestOptions } from './httpRequest';
4
- export interface SiteQuery {
5
- data: Site;
6
- }
7
- export declare const getSite: (id: string, options?: HttpRequestOptions) => Promise<Site | null>;
8
- export interface GamesQueryVariables {
9
- after?: string;
10
- first?: number;
11
- search?: string;
12
- filter?: {
13
- tags?: EnumFilterField<GameTag>;
14
- type?: EnumFilterField<GameType>;
15
- provider?: EnumFilterField<GameProvider>;
16
- reference?: ObjectIdFilterField;
17
- };
18
- sort?: SortOrder;
19
- }
20
- export interface GamesQuery {
21
- data: Game[];
22
- next?: string | null;
23
- totalCount?: number | null;
24
- }
25
- export type GamesInput = SimplifyDeep<GamesQueryVariables>;
26
- export declare function getGames(input?: GamesInput, options?: HttpRequestOptions): Promise<PaginatedQueryResult<Game>>;
27
- export interface GamesQueryVariables__Next {
28
- after?: string;
29
- first?: number;
30
- search?: string;
31
- filter?: {
32
- tags?: EnumFilterField<GameTag>;
33
- type?: EnumFilterField<GameType>;
34
- provider?: EnumFilterField<GameProvider>;
35
- reference?: ObjectIdFilterField;
36
- };
37
- sort?: {
38
- order: SortOrder;
39
- context: string;
40
- };
41
- }
42
- export type GamesInput__Next = SimplifyDeep<GamesQueryVariables__Next>;
43
- export declare const getGames__next: (input?: GamesInput__Next, options?: HttpRequestOptions) => Promise<PaginatedQueryResult<Game>>;
@@ -1,148 +0,0 @@
1
- import { cache } from 'react';
2
- import { CMS_PORTAL_ENDPOINT } from '../constants/index.js';
3
- import { httpRequest } from './httpRequest.js';
4
- export const getSite = cache(async (id, options) => {
5
- try {
6
- const { data } = await httpRequest.json(`${CMS_PORTAL_ENDPOINT}/v1/sites/${id}`, options);
7
- return data ?? null;
8
- }
9
- catch {
10
- return null;
11
- }
12
- });
13
- export async function getGames(input, options) {
14
- const search = new URLSearchParams();
15
- if (input?.first)
16
- search.set('first', input.first.toString());
17
- if (input?.after)
18
- search.set('after', input.after);
19
- if (input?.search)
20
- search.set('search', input.search);
21
- if (input?.filter?.type?.equal)
22
- search.set('filter[type][eq]', input.filter.type.equal);
23
- if (input?.filter?.type?.notEqual)
24
- search.set('filter[type][neq]', input.filter.type.notEqual);
25
- if (input?.filter?.type?.in)
26
- search.set('filter[type][in]', input.filter.type.in.join(','));
27
- if (input?.filter?.type?.notIn)
28
- search.set('filter[type][nin]', input.filter.type.notIn.join(','));
29
- if (input?.filter?.provider?.equal)
30
- search.set('filter[provider][eq]', input.filter.provider.equal);
31
- if (input?.filter?.provider?.notEqual)
32
- search.set('filter[provider][neq]', input.filter.provider.notEqual);
33
- if (input?.filter?.provider?.in)
34
- search.set('filter[provider][in]', input.filter.provider.in.join(','));
35
- if (input?.filter?.provider?.notIn)
36
- search.set('filter[provider][nin]', input.filter.provider.notIn.join(','));
37
- if (input?.filter?.tags?.equal)
38
- search.set('filter[tags][eq]', input.filter.tags.equal.toLowerCase());
39
- if (input?.filter?.tags?.notEqual)
40
- search.set('filter[tags][neq]', input.filter.tags.notEqual.toLowerCase());
41
- if (input?.filter?.tags?.in)
42
- search.set('filter[tags][in]', input.filter.tags.in.map((v) => v.toLowerCase()).join(','));
43
- if (input?.filter?.tags?.notIn)
44
- search.set('filter[tags][nin]', input.filter.tags.notIn.map((v) => v.toLowerCase()).join(','));
45
- if (input?.filter?.reference?.equal)
46
- search.set('filter[reference][eq]', input.filter.reference.equal);
47
- if (input?.filter?.reference?.notEqual)
48
- search.set('filter[reference][neq]', input.filter.reference.notEqual);
49
- if (input?.filter?.reference?.in)
50
- search.set('filter[reference][in]', input.filter.reference.in.join(','));
51
- if (input?.filter?.reference?.notIn)
52
- search.set('filter[reference][nin]', input.filter.reference.notIn.join(','));
53
- if (input?.sort)
54
- search.set('sort[order]', input.sort);
55
- try {
56
- const res = await httpRequest.json(`${CMS_PORTAL_ENDPOINT}/v1/games?${search.toString()}`, options);
57
- return {
58
- edges: res.data.map((node) => ({
59
- node,
60
- cursor: node.cursor,
61
- })),
62
- totalCount: res.totalCount ?? 0,
63
- pageInfo: {
64
- hasNextPage: Boolean(res.next),
65
- endCursor: res.next,
66
- },
67
- };
68
- }
69
- catch {
70
- return {
71
- edges: [],
72
- totalCount: 0,
73
- pageInfo: {
74
- hasNextPage: false,
75
- endCursor: null,
76
- },
77
- };
78
- }
79
- }
80
- export const getGames__next = cache(async (input, options) => {
81
- const search = new URLSearchParams();
82
- if (input?.first)
83
- search.set('first', input.first.toString());
84
- if (input?.after)
85
- search.set('after', input.after);
86
- if (input?.search)
87
- search.set('search', input.search);
88
- if (input?.filter?.type?.equal)
89
- search.set('filter[type][eq]', input.filter.type.equal);
90
- if (input?.filter?.type?.notEqual)
91
- search.set('filter[type][neq]', input.filter.type.notEqual);
92
- if (input?.filter?.type?.in)
93
- search.set('filter[type][in]', input.filter.type.in.join(','));
94
- if (input?.filter?.type?.notIn)
95
- search.set('filter[type][nin]', input.filter.type.notIn.join(','));
96
- if (input?.filter?.provider?.equal)
97
- search.set('filter[provider][eq]', input.filter.provider.equal);
98
- if (input?.filter?.provider?.notEqual)
99
- search.set('filter[provider][neq]', input.filter.provider.notEqual);
100
- if (input?.filter?.provider?.in)
101
- search.set('filter[provider][in]', input.filter.provider.in.join(','));
102
- if (input?.filter?.provider?.notIn)
103
- search.set('filter[provider][nin]', input.filter.provider.notIn.join(','));
104
- if (input?.filter?.tags?.equal)
105
- search.set('filter[tags][eq]', input.filter.tags.equal.toLowerCase());
106
- if (input?.filter?.tags?.notEqual)
107
- search.set('filter[tags][neq]', input.filter.tags.notEqual.toLowerCase());
108
- if (input?.filter?.tags?.in)
109
- search.set('filter[tags][in]', input.filter.tags.in.map((v) => v.toLowerCase()).join(','));
110
- if (input?.filter?.tags?.notIn)
111
- search.set('filter[tags][nin]', input.filter.tags.notIn.map((v) => v.toLowerCase()).join(','));
112
- if (input?.filter?.reference?.equal)
113
- search.set('filter[reference][eq]', input.filter.reference.equal);
114
- if (input?.filter?.reference?.notEqual)
115
- search.set('filter[reference][neq]', input.filter.reference.notEqual);
116
- if (input?.filter?.reference?.in)
117
- search.set('filter[reference][in]', input.filter.reference.in.join(','));
118
- if (input?.filter?.reference?.notIn)
119
- search.set('filter[reference][nin]', input.filter.reference.notIn.join(','));
120
- if (input?.sort) {
121
- search.set('sort[order]', input.sort.order);
122
- search.set('sort[context]', input.sort.context.toLowerCase());
123
- }
124
- try {
125
- const res = await httpRequest.json(`${CMS_PORTAL_ENDPOINT}/v2/games?${search.toString()}`, options);
126
- return {
127
- edges: res.data.map((node) => ({
128
- node,
129
- cursor: node.cursor,
130
- })),
131
- totalCount: res.totalCount ?? 0,
132
- pageInfo: {
133
- endCursor: res.next,
134
- hasNextPage: Boolean(res.next),
135
- },
136
- };
137
- }
138
- catch {
139
- return {
140
- edges: [],
141
- totalCount: 0,
142
- pageInfo: {
143
- hasNextPage: false,
144
- endCursor: null,
145
- },
146
- };
147
- }
148
- });
@@ -1,33 +0,0 @@
1
- import type { File } from '../types';
2
- import { type GraphQLRequestOptions } from './graphqlRequest';
3
- export interface FileQuery {
4
- node?: File | null;
5
- }
6
- export interface FileQueryVariables {
7
- id: string;
8
- }
9
- export declare const getFile: (id: string, options?: GraphQLRequestOptions) => Promise<File | null>;
10
- export type UploadPrivateImageFileError = {
11
- name: 'FileFormatNotSupportedError';
12
- message: string;
13
- } | {
14
- name: 'FileNameTooLongError';
15
- message: string;
16
- } | {
17
- name: 'FileSizeTooBigError';
18
- message: string;
19
- };
20
- export interface UploadPrivateImageFileMutation {
21
- uploadPrivateImageFile?: null | UploadPrivateImageFileError;
22
- }
23
- export interface UploadPrivateImageFileMutationVariables {
24
- input: {
25
- id: string;
26
- file: globalThis.File;
27
- };
28
- }
29
- export interface UploadPrivateImageFileInput {
30
- id: string;
31
- file: globalThis.File;
32
- }
33
- export declare const uploadPrivateImageFile: (input: UploadPrivateImageFileInput, options?: GraphQLRequestOptions) => Promise<void>;
@@ -1,18 +0,0 @@
1
- import { cache } from 'react';
2
- import { FILE_GRAPHQL_ENDPOINT } from '../constants/index.js';
3
- import { graphqlRequest, graphqlUpload, } from './graphqlRequest.js';
4
- import { FILE, UPLOAD_PRIVATE_IMAGE_FILE } from './queries.js';
5
- export const getFile = cache(async (id, options) => {
6
- const res = await graphqlRequest(FILE_GRAPHQL_ENDPOINT, FILE, { id }, options);
7
- return res.node ?? null;
8
- });
9
- export const uploadPrivateImageFile = async (input, options) => {
10
- const res = await graphqlUpload(FILE_GRAPHQL_ENDPOINT, UPLOAD_PRIVATE_IMAGE_FILE, { input }, options);
11
- if (res.uploadPrivateImageFile) {
12
- const error = new Error();
13
- error.name = res.uploadPrivateImageFile.name;
14
- error.message = res.uploadPrivateImageFile.message;
15
- Error.captureStackTrace?.(error, uploadPrivateImageFile);
16
- throw error;
17
- }
18
- };
@@ -1,44 +0,0 @@
1
- import type { Simplify } from 'type-fest';
2
- import type { GameSession, GameSession__Legacy } from '../types';
3
- import { type GraphQLRequestOptions } from './graphqlRequest';
4
- export interface GameSessionQuery__Legacy {
5
- node?: GameSession__Legacy | null;
6
- }
7
- export interface GameSessionQueryVariables__Legacy {
8
- id: string;
9
- }
10
- export declare const getGameSession__legacy: (id: string, options?: GraphQLRequestOptions) => Promise<GameSession | null>;
11
- export type CreateGameSessionError__Legacy = {
12
- name: 'GameDoesNotExistError';
13
- message: string;
14
- };
15
- export interface CreateGameSessionMutation__Legacy {
16
- createGameSession?: null | CreateGameSessionError__Legacy;
17
- }
18
- export interface CreateGameSessionMutationVariables__Legacy {
19
- input: {
20
- id: string;
21
- game: string;
22
- };
23
- }
24
- export type CreateGameSessionInput__Legacy = Simplify<CreateGameSessionMutationVariables__Legacy['input']>;
25
- export declare function createGameSession__legacy(input: CreateGameSessionInput__Legacy, options?: GraphQLRequestOptions): Promise<void>;
26
- export type EndGameSessionError = {
27
- name: 'GameSessionDoesNotExistError';
28
- message: string;
29
- } | {
30
- name: 'GameSessionAlreadyClosedError';
31
- message: string;
32
- } | {
33
- name: 'GameProviderError';
34
- message: string;
35
- };
36
- export interface EndGameSessionMutation__Legacy {
37
- endGameSession?: null | EndGameSessionError;
38
- }
39
- export interface EndGameSessionMutationVariables__Legacy {
40
- input: {
41
- id: string;
42
- };
43
- }
44
- export declare function endGameSession__legacy(id: string, options?: GraphQLRequestOptions): Promise<void>;
@@ -1,33 +0,0 @@
1
- import { cache } from 'react';
2
- import { GAME_GRAPHQL_ENDPOINT } from '../constants/index.js';
3
- import { graphqlRequest } from './graphqlRequest.js';
4
- import { CREATE_GAME_SESSION, END_GAME_SESSION__LEGACY, GAME_SESSION__LEGACY, } from './queries.js';
5
- export const getGameSession__legacy = cache(async (id, options) => {
6
- const res = await graphqlRequest(GAME_GRAPHQL_ENDPOINT, GAME_SESSION__LEGACY, { id }, options);
7
- if (!res.node)
8
- return null;
9
- return {
10
- ...res.node,
11
- game: res.node.game.id,
12
- };
13
- });
14
- export async function createGameSession__legacy(input, options) {
15
- const res = await graphqlRequest(GAME_GRAPHQL_ENDPOINT, CREATE_GAME_SESSION, { input }, options);
16
- if (res.createGameSession) {
17
- const error = new Error();
18
- error.name = res.createGameSession.name;
19
- error.message = res.createGameSession.message;
20
- Error.captureStackTrace?.(error, createGameSession__legacy);
21
- throw error;
22
- }
23
- }
24
- export async function endGameSession__legacy(id, options) {
25
- const res = await graphqlRequest(GAME_GRAPHQL_ENDPOINT, END_GAME_SESSION__LEGACY, { input: { id } }, options);
26
- if (res.endGameSession) {
27
- const error = new Error();
28
- error.name = res.endGameSession.name;
29
- error.message = res.endGameSession.message;
30
- Error.captureStackTrace?.(error, endGameSession__legacy);
31
- throw error;
32
- }
33
- }
@@ -1,37 +0,0 @@
1
- import type { Simplify } from 'type-fest';
2
- import type { GameType, LatestBetRecord, OnboardingPlayerExperience, OnboardingStatus, Platform, RecommendedGame, TopWin } from '../types';
3
- import { type GraphQLRequestOptions } from './graphqlRequest';
4
- export interface LatestBetRecordsQuery {
5
- latestBetRecords: LatestBetRecord[];
6
- }
7
- export declare const getLatestBetRecords: (options?: GraphQLRequestOptions) => Promise<LatestBetRecord[]>;
8
- export interface PlatformQuery extends Platform {
9
- }
10
- export declare const getPlatform: (options?: GraphQLRequestOptions) => Promise<PlatformQuery>;
11
- export interface RecommendedGamesQuery {
12
- recommendedGames: RecommendedGame[];
13
- }
14
- export declare const getRecommendedGames: (options?: GraphQLRequestOptions) => Promise<RecommendedGame[]>;
15
- export interface OnboardingStatusQuery {
16
- onboardingStatus?: OnboardingStatus | null;
17
- }
18
- export declare const getOnboardingStatus: (options?: GraphQLRequestOptions) => Promise<OnboardingStatus | null>;
19
- export interface CompleteOnboardingMutationVariables {
20
- input: {
21
- playerExperience: OnboardingPlayerExperience;
22
- favoriteGameTypes: GameType[];
23
- };
24
- }
25
- export interface CompleteOnboardingMutation {
26
- completeOnboarding: boolean;
27
- }
28
- export type CompleteOnboardingInput = Simplify<CompleteOnboardingMutationVariables['input']>;
29
- export declare const completeOnboarding: (input: CompleteOnboardingInput, options?: GraphQLRequestOptions) => Promise<void>;
30
- export interface SkipOnboardingMutation {
31
- skipOnboarding: boolean;
32
- }
33
- export declare const skipOnboarding: (options?: GraphQLRequestOptions) => Promise<void>;
34
- export interface TopWinsQuery {
35
- topWins: TopWin[];
36
- }
37
- export declare const getTopWins: (options?: GraphQLRequestOptions) => Promise<TopWin[]>;
@@ -1,44 +0,0 @@
1
- import { cache } from 'react';
2
- import { PORTAL_GRAPHQL_ENDPOINT } from '../constants/index.js';
3
- import { graphqlRequest } from './graphqlRequest.js';
4
- import { COMPLETE_ONBOARDING, LATEST_BET_RECORDS, ONBOARDING_STATUS, PLATFORM, RECOMMENDED_GAMES, SKIP_ONBOARDING, TOP_WINS, } from './queries.js';
5
- export const getLatestBetRecords = cache(async (options) => {
6
- const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, LATEST_BET_RECORDS, undefined, options);
7
- return res.latestBetRecords;
8
- });
9
- export const getPlatform = cache(async (options) => {
10
- const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, PLATFORM, undefined, options);
11
- return res;
12
- });
13
- export const getRecommendedGames = cache(async (options) => {
14
- const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, RECOMMENDED_GAMES, undefined, options);
15
- return res.recommendedGames;
16
- });
17
- export const getOnboardingStatus = cache(async (options) => {
18
- const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, ONBOARDING_STATUS, undefined, options);
19
- return res.onboardingStatus ?? null;
20
- });
21
- export const completeOnboarding = async (input, options) => {
22
- const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, COMPLETE_ONBOARDING, { input }, options);
23
- if (!res.completeOnboarding) {
24
- const error = new Error();
25
- error.name = 'UnknownError';
26
- error.message = 'Something went wrong';
27
- Error.captureStackTrace?.(error, completeOnboarding);
28
- throw error;
29
- }
30
- };
31
- export const skipOnboarding = async (options) => {
32
- const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, SKIP_ONBOARDING, undefined, options);
33
- if (!res.skipOnboarding) {
34
- const error = new Error();
35
- error.name = 'UnknownError';
36
- error.message = 'Something went wrong';
37
- Error.captureStackTrace?.(error, skipOnboarding);
38
- throw error;
39
- }
40
- };
41
- export const getTopWins = cache(async (options) => {
42
- const res = await graphqlRequest(PORTAL_GRAPHQL_ENDPOINT, TOP_WINS, undefined, options);
43
- return res.topWins;
44
- });