@opexa/portal-components 0.1.59 → 0.1.62

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 (69) hide show
  1. package/dist/client/hooks/useSignInMutation.d.ts +2 -1
  2. package/dist/client/hooks/useSignInMutation.js +3 -3
  3. package/dist/client/services/signIn.d.ts +2 -2
  4. package/dist/client/services/signIn.js +6 -2
  5. package/dist/components/SignIn/CrazyWin/MobileNumberSignIn.js +1 -0
  6. package/dist/components/SignIn/CrazyWin/NameAndPasswordSignIn.js +1 -0
  7. package/dist/components/SignIn/HappyBingo/MobileNumberSignIn.js +1 -0
  8. package/dist/components/SignIn/HappyBingo/NameAndPasswordSignIn.js +1 -0
  9. package/dist/components/SignIn/MobileNumberSignIn.js +1 -0
  10. package/dist/components/SignIn/MobileNumberSignInternational.js +1 -0
  11. package/dist/components/SignIn/NameAndPasswordSignIn.js +1 -0
  12. package/dist/components/SignIn/SignIn.lazy.d.ts +7 -1
  13. package/dist/constants/GameProvider.js +7 -1
  14. package/dist/constants/HeaderKey.d.ts +2 -0
  15. package/dist/constants/HeaderKey.js +2 -0
  16. package/dist/handlers/postSession.js +6 -3
  17. package/dist/images/crazywin-game-providers/SEXYCASINO.png +0 -0
  18. package/dist/images/game-providers/SEXYCASINO.png +0 -0
  19. package/dist/schemas/forgotPasswordSchema.d.ts +8 -8
  20. package/dist/services/auth.d.ts +10 -3
  21. package/dist/services/auth.js +24 -16
  22. package/dist/types/crazywinTypes.js +1 -0
  23. package/dist/types/index.d.ts +1 -1
  24. package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
  25. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
  26. package/dist/ui/Avatar/Avatar.d.ts +9 -9
  27. package/dist/ui/Avatar/avatar.recipe.d.ts +3 -3
  28. package/dist/ui/Badge/Badge.d.ts +12 -12
  29. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  30. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  31. package/dist/ui/Carousel/Carousel.d.ts +72 -72
  32. package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
  33. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  34. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  35. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  36. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  37. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  38. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  39. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  40. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  41. package/dist/ui/Dialog/Dialog.d.ts +33 -33
  42. package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
  43. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  44. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  45. package/dist/ui/Field/Field.d.ts +21 -21
  46. package/dist/ui/Field/field.recipe.d.ts +3 -3
  47. package/dist/ui/Menu/Menu.d.ts +144 -144
  48. package/dist/ui/Menu/menu.recipe.d.ts +8 -8
  49. package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
  50. package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
  51. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  52. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  53. package/dist/ui/PinInput/PinInput.d.ts +12 -12
  54. package/dist/ui/PinInput/pinInput.recipe.d.ts +3 -3
  55. package/dist/ui/Popover/Popover.d.ts +121 -121
  56. package/dist/ui/Popover/popover.recipe.d.ts +11 -11
  57. package/dist/ui/Progress/Progress.d.ts +27 -27
  58. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  59. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  60. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  61. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  62. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  63. package/dist/ui/Select/Select.d.ts +45 -45
  64. package/dist/ui/Select/select.recipe.d.ts +3 -3
  65. package/dist/ui/Table/Table.d.ts +21 -21
  66. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  67. package/dist/ui/Table/table.recipe.d.ts +3 -3
  68. package/dist/utils/getProviderData.js +6 -1
  69. package/package.json +1 -1
@@ -1,8 +1,9 @@
1
1
  import { type UseMutationResult } from '@tanstack/react-query';
2
- import type { VersionSession } from '../../services/auth';
2
+ import type { ApiVersion, VersionSession } from '../../services/auth';
3
3
  import type { Authenticator, MutationConfig } from '../../types';
4
4
  import { type SignInInput } from '../services/signIn';
5
5
  export interface UseSignInMutationOptions extends MutationConfig<Authenticator | null, SignInInput> {
6
6
  versionSession?: VersionSession;
7
+ version?: ApiVersion;
7
8
  }
8
9
  export declare const useSignInMutation: (options?: UseSignInMutationOptions) => UseMutationResult<Authenticator | null, Error, SignInInput>;
@@ -12,7 +12,7 @@ import { useRecaptcha } from './useRecaptcha.js';
12
12
  export const useSignInMutation = (options) => {
13
13
  const queryClient = getQueryClient();
14
14
  const { executeRecaptcha, isGoogleFraudDefense } = useRecaptcha();
15
- const { versionSession, ...config } = options ?? {};
15
+ const { versionSession, version = 1, ...config } = options ?? {};
16
16
  return useMutation({
17
17
  ...config,
18
18
  mutationKey: getSignInMutationKey(),
@@ -20,7 +20,7 @@ export const useSignInMutation = (options) => {
20
20
  const session = await getSession();
21
21
  const token = await executeRecaptcha('submit');
22
22
  const isInplayEligible = input.type === 'NAME_AND_PASSWORD' || input.type === 'MOBILE_NUMBER';
23
- const fingerprint = versionSession === 'Inplay' && isInplayEligible
23
+ const fingerprint = (versionSession === 'Inplay' || version !== 1) && isInplayEligible
24
24
  ? await getFingerprint()
25
25
  : null;
26
26
  const recaptchaHeaderKey = isGoogleFraudDefense
@@ -41,7 +41,7 @@ export const useSignInMutation = (options) => {
41
41
  ? { Channel: 'ANDROID' }
42
42
  : { Channel: 'IOS' }),
43
43
  },
44
- }, versionSession);
44
+ }, versionSession, version);
45
45
  const authenticator = versionSession === 'Inplay' && isInplayEligible
46
46
  ? await pollSignIn(signInOnce)
47
47
  : await signInOnce();
@@ -1,5 +1,5 @@
1
- import type { CreateSessionInput, VersionSession } from '../../services/auth';
1
+ import type { ApiVersion, CreateSessionInput, VersionSession } from '../../services/auth';
2
2
  import { type HttpRequestOptions } from '../../services/httpRequest';
3
3
  import type { Authenticator } from '../../types';
4
4
  export type SignInInput = CreateSessionInput;
5
- export declare function signIn(input: SignInInput, options?: HttpRequestOptions, versionSession?: VersionSession): Promise<Authenticator | null>;
5
+ export declare function signIn(input: SignInInput, options?: HttpRequestOptions, versionSession?: VersionSession, version?: ApiVersion): Promise<Authenticator | null>;
@@ -1,10 +1,14 @@
1
1
  import { Capacitor } from '@capacitor/core';
2
- import { SESSION_VERSION_HEADER_KEY } from '../../constants/index.js';
2
+ import { API_VERSION_HEADER_KEY, PLATFORM_WEB_HEADER_KEY, SESSION_VERSION_HEADER_KEY, } from '../../constants/index.js';
3
3
  import { httpRequest, } from '../../services/httpRequest.js';
4
4
  const platform = Capacitor.getPlatform();
5
- export async function signIn(input, options, versionSession = 'default') {
5
+ export async function signIn(input, options, versionSession = 'default', version = 1) {
6
6
  const headers = new Headers(options?.headers);
7
7
  headers.set(SESSION_VERSION_HEADER_KEY, versionSession);
8
+ headers.set(API_VERSION_HEADER_KEY, String(version));
9
+ if (version === 4 && platform === 'web') {
10
+ headers.set(PLATFORM_WEB_HEADER_KEY, 'true');
11
+ }
8
12
  const res = await httpRequest.json('/api/sessions', {
9
13
  ...options,
10
14
  headers,
@@ -46,6 +46,7 @@ export function MobileNumberSignIn() {
46
46
  })));
47
47
  const signInMutation = useSignInMutation({
48
48
  versionSession: signInProps.versionSession,
49
+ version: signInProps.version,
49
50
  onSuccess: async () => {
50
51
  step1Form.reset();
51
52
  step2Form.reset();
@@ -46,6 +46,7 @@ export function NameAndPasswordSignIn() {
46
46
  })));
47
47
  const signInMutation = useSignInMutation({
48
48
  versionSession: signInProps.versionSession,
49
+ version: signInProps.version,
49
50
  onSuccess: async (authenticator) => {
50
51
  if (authenticator) {
51
52
  context.setStep(2);
@@ -47,6 +47,7 @@ export function MobileNumberSignIn() {
47
47
  })));
48
48
  const signInMutation = useSignInMutation({
49
49
  versionSession: signInProps.versionSession,
50
+ version: signInProps.version,
50
51
  onSuccess: async () => {
51
52
  step1Form.reset();
52
53
  step2Form.reset();
@@ -43,6 +43,7 @@ export function NameAndPasswordSignIn() {
43
43
  })));
44
44
  const signInMutation = useSignInMutation({
45
45
  versionSession: signInProps.versionSession,
46
+ version: signInProps.version,
46
47
  onSuccess: async (authenticator) => {
47
48
  if (authenticator) {
48
49
  context.setStep(2);
@@ -54,6 +54,7 @@ export function MobileNumberSignIn() {
54
54
  })));
55
55
  const signInMutation = useSignInMutation({
56
56
  versionSession: signInProps.versionSession,
57
+ version: signInProps.version,
57
58
  onSuccess: async () => {
58
59
  step1Form.reset();
59
60
  step2Form.reset();
@@ -82,6 +82,7 @@ export function MobileNumberSignInInternational() {
82
82
  })));
83
83
  const signInMutation = useSignInMutation({
84
84
  versionSession: signInProps.versionSession,
85
+ version: signInProps.version,
85
86
  onSuccess: async () => {
86
87
  step1Form.reset();
87
88
  step2Form.reset();
@@ -56,6 +56,7 @@ export function NameAndPasswordSignIn() {
56
56
  const [formType, setFormType] = useState('NAME_AND_PASSWORD');
57
57
  const signInMutation = useSignInMutation({
58
58
  versionSession: signInProps.versionSession,
59
+ version: signInProps.version,
59
60
  onSuccess: async (authenticator) => {
60
61
  if (authenticator) {
61
62
  context.setStep(2);
@@ -1,6 +1,6 @@
1
1
  import { type ImageProps } from 'next/image';
2
2
  import { type ReactNode } from 'react';
3
- import type { VersionSession } from '../../services/auth';
3
+ import type { ApiVersion, VersionSession } from '../../services/auth';
4
4
  import type { CountryCode } from '../../utils/countries/types';
5
5
  import { type UseSignInProps } from './useSignIn';
6
6
  export interface ClassNameEntries {
@@ -31,6 +31,12 @@ export interface SignInProps extends UseSignInProps {
31
31
  * - `Inplay`: `${AUTH_ENDPOINT}/v3/inplay/sessions`
32
32
  */
33
33
  versionSession?: VersionSession;
34
+ /**
35
+ * Mirrors portal-sdk's `sdk.signIn` version argument.
36
+ * - `1` (default): legacy flat-response session endpoint
37
+ * - `4`: cookie/fingerprint-aware endpoint (e.g. `/v4/sessions`)
38
+ */
39
+ version?: ApiVersion;
34
40
  fingerprint?: () => Promise<string | null> | string | null;
35
41
  }
36
42
  export declare function SignIn(props: SignInProps): import("react/jsx-runtime").JSX.Element;
@@ -40,7 +40,7 @@ import rtg from '../images/game-providers/RTG.png';
40
40
  import rubyPlay from '../images/game-providers/RUBY_PLAY.png';
41
41
  import saba from '../images/game-providers/SABA.png';
42
42
  import sagaming from '../images/game-providers/SAGAMING.png';
43
- import sexycasino from '../images/game-providers/SEXYCASINO.webp';
43
+ import sexycasino from '../images/game-providers/SEXYCASINO.png';
44
44
  import spadegaming from '../images/game-providers/SPADEGAMING.png';
45
45
  import spinix from '../images/game-providers/SPINIX.png';
46
46
  import spribe from '../images/game-providers/SPRIBE.png';
@@ -244,6 +244,12 @@ export const GAME_PROVIDER_DATA = {
244
244
  slug: 'pragmaticplay',
245
245
  logo: pragmaticplay,
246
246
  },
247
+ PRAGMATICPLAY_DIRECT: {
248
+ id: 'PRAGMATICPLAY_DIRECT',
249
+ name: 'Pragmatic Play Direct',
250
+ slug: 'pragmaticplay-direct',
251
+ logo: pragmaticplay,
252
+ },
247
253
  RELAXGAMING: {
248
254
  id: 'RELAXGAMING',
249
255
  name: 'Relax Gaming',
@@ -2,5 +2,7 @@ export declare const RECAPTCHA_HEADER_KEY: string;
2
2
  export declare const TEST_PASS_HEADER_KEY: string;
3
3
  export declare const DOMAIN_HEADER_KEY: string;
4
4
  export declare const SESSION_VERSION_HEADER_KEY: string;
5
+ export declare const API_VERSION_HEADER_KEY: string;
6
+ export declare const PLATFORM_WEB_HEADER_KEY: string;
5
7
  export declare const FINGERPRINT_HEADER_KEY: string;
6
8
  export declare const GOOGLE_FRAUD_DEFENSE_HEADER_KEY: string;
@@ -2,5 +2,7 @@ export const RECAPTCHA_HEADER_KEY = 'Google-Recaptcha-Response';
2
2
  export const TEST_PASS_HEADER_KEY = 'Test-Pass';
3
3
  export const DOMAIN_HEADER_KEY = 'Domain';
4
4
  export const SESSION_VERSION_HEADER_KEY = 'X-Session-Version';
5
+ export const API_VERSION_HEADER_KEY = 'X-Api-Version';
6
+ export const PLATFORM_WEB_HEADER_KEY = 'X-Platform-Web';
5
7
  export const FINGERPRINT_HEADER_KEY = 'Fingerprint';
6
8
  export const GOOGLE_FRAUD_DEFENSE_HEADER_KEY = 'X-Recaptcha-Token';
@@ -1,8 +1,8 @@
1
1
  import { addDays, addMinutes, subMinutes } from 'date-fns';
2
2
  import { NextResponse } from 'next/server';
3
3
  import { z } from 'zod';
4
- import { ACCESS_TOKEN_COOKIE_NAME, DOMAIN_HEADER_KEY, FINGERPRINT_HEADER_KEY, GOOGLE_FRAUD_DEFENSE_HEADER_KEY, RECAPTCHA_HEADER_KEY, REFRESH_TOKEN_COOKIE_NAME, SESSION_VERSION_HEADER_KEY, } from '../constants/index.js';
5
- import { createSession } from '../services/auth.js';
4
+ import { ACCESS_TOKEN_COOKIE_NAME, API_VERSION_HEADER_KEY, DOMAIN_HEADER_KEY, FINGERPRINT_HEADER_KEY, GOOGLE_FRAUD_DEFENSE_HEADER_KEY, PLATFORM_WEB_HEADER_KEY, RECAPTCHA_HEADER_KEY, REFRESH_TOKEN_COOKIE_NAME, SESSION_VERSION_HEADER_KEY, } from '../constants/index.js';
5
+ import { createSession, } from '../services/auth.js';
6
6
  const CreateSessionDefinition = z.union([
7
7
  z.object({
8
8
  type: z.literal('NAME_AND_PASSWORD'),
@@ -44,6 +44,8 @@ export async function postSession(request) {
44
44
  const fingerprint = request.headers.get(FINGERPRINT_HEADER_KEY);
45
45
  const versionSessionHeader = request.headers.get(SESSION_VERSION_HEADER_KEY);
46
46
  const versionSession = versionSessionHeader === 'Inplay' ? 'Inplay' : 'default';
47
+ const version = request.headers.get(API_VERSION_HEADER_KEY) === '4' ? 4 : 1;
48
+ const isWeb = request.headers.get(PLATFORM_WEB_HEADER_KEY) === 'true';
47
49
  try {
48
50
  const googleFraudDefense = request.headers.get(GOOGLE_FRAUD_DEFENSE_HEADER_KEY);
49
51
  const recaptchaToken = googleFraudDefense ?? recaptcha;
@@ -65,8 +67,9 @@ export async function postSession(request) {
65
67
  'X-Forwarded-For': ipAddress,
66
68
  }),
67
69
  ...(channel && { Channel: channel }),
70
+ ...(isWeb && { [PLATFORM_WEB_HEADER_KEY]: 'true' }),
68
71
  },
69
- }, versionSession);
72
+ }, versionSession, version);
70
73
  if (res.authenticator) {
71
74
  return NextResponse.json({
72
75
  ok: true,
@@ -8,24 +8,24 @@ export declare const createForgotPasswordSchema: (mobileNumberParser: MobileNumb
8
8
  mobileNumber: z.ZodEffects<z.ZodString, string, string>;
9
9
  verificationCode: z.ZodEffects<z.ZodString, string, string>;
10
10
  }, "strip", z.ZodTypeAny, {
11
- password: string;
12
- verificationCode: string;
13
11
  mobileNumber: string;
12
+ verificationCode: string;
13
+ password: string;
14
14
  confirmPassword: string;
15
15
  }, {
16
- password: string;
17
- verificationCode: string;
18
16
  mobileNumber: string;
17
+ verificationCode: string;
18
+ password: string;
19
19
  confirmPassword: string;
20
20
  }>, {
21
- password: string;
22
- verificationCode: string;
23
21
  mobileNumber: string;
22
+ verificationCode: string;
23
+ password: string;
24
24
  confirmPassword: string;
25
25
  }, {
26
- password: string;
27
- verificationCode: string;
28
26
  mobileNumber: string;
27
+ verificationCode: string;
28
+ password: string;
29
29
  confirmPassword: string;
30
30
  }>;
31
31
  export type ForgotPasswordSchema = z.infer<ReturnType<typeof createForgotPasswordSchema>>;
@@ -24,10 +24,17 @@ export interface CreateSessionInput__Token {
24
24
  export type CreateSessionInput = CreateSessionInput__UsernameAndPassword | CreateSessionInput__MobileNumber | CreateSessionInput__Maya | CreateSessionInput__Token;
25
25
  /**
26
26
  * Controls which auth endpoint is used to create a session.
27
- * - `default` -> `${AUTH_ENDPOINT}/sessions`
28
- * - `Inplay` -> `${AUTH_ENDPOINT}/v3/inplay/sessions`
27
+ * - `default` -> `${AUTH_ENDPOINT}/sessions` (or `/v3`/`/v4/sessions`, see `ApiVersion`)
28
+ * - `Inplay` -> `${AUTH_ENDPOINT}/v3/inplay/sessions` (no v4 variant exists)
29
29
  */
30
30
  export type VersionSession = 'default' | 'Inplay';
31
+ /**
32
+ * Applies `AuthService.createSession` version argument:
33
+ * - `1` -> the legacy flat-response endpoint
34
+ * - `3` / `4` -> fingerprint-aware endpoints (wrapped `{ data }` response);
35
+ * `4` is additionally cookie-aware for web sign-ins
36
+ */
37
+ export type ApiVersion = 1 | 3 | 4;
31
38
  export interface CreateSessionTwoFactorAuthDisabledMutation {
32
39
  session: {
33
40
  id: string;
@@ -52,7 +59,7 @@ export interface CreateSessionTwoFactorAuthEnabledMutation {
52
59
  authenticator: Authenticator;
53
60
  }
54
61
  export type CreateSessionMutation = CreateSessionTwoFactorAuthDisabledMutation | CreateSessionTwoFactorAuthEnabledMutation;
55
- export declare function createSession(input: CreateSessionInput, options?: HttpRequestOptions, versionSession?: VersionSession): Promise<CreateSessionMutation>;
62
+ export declare function createSession(input: CreateSessionInput, options?: HttpRequestOptions, versionSession?: VersionSession, version?: ApiVersion): Promise<CreateSessionMutation>;
56
63
  export declare function createSessionLibangan(input: CreateSessionInput__Libangan, options?: HttpRequestOptions): Promise<{
57
64
  session: {
58
65
  id: string;
@@ -1,11 +1,13 @@
1
- import { AUTH_ENDPOINT, FINGERPRINT_HEADER_KEY } from '../constants/index.js';
1
+ import { AUTH_ENDPOINT, FINGERPRINT_HEADER_KEY, PLATFORM_WEB_HEADER_KEY, } from '../constants/index.js';
2
2
  import { httpRequest } from './httpRequest.js';
3
3
  import { sha256 } from './sha256.js';
4
- const SESSION_ENDPOINTS = {
5
- default: '/sessions',
6
- Inplay: '/v3/inplay/sessions',
7
- };
8
- export async function createSession(input, options, versionSession = 'default') {
4
+ function getSessionEndpoint(versionSession, version) {
5
+ if (versionSession === 'Inplay')
6
+ return '/v3/inplay/sessions';
7
+ return version !== 1 ? `/v${version}/sessions` : '/sessions';
8
+ }
9
+ export async function createSession(input, options, versionSession = 'default', version = 1) {
10
+ const isWeb = new Headers(options?.headers).get(PLATFORM_WEB_HEADER_KEY) === 'true';
9
11
  const headers = new Headers();
10
12
  if (input.type === 'NAME_AND_PASSWORD') {
11
13
  const password = versionSession === 'Inplay'
@@ -37,21 +39,27 @@ export async function createSession(input, options, versionSession = 'default')
37
39
  const effectiveVersionSession = input.type === 'NAME_AND_PASSWORD' || input.type === 'MOBILE_NUMBER'
38
40
  ? versionSession
39
41
  : 'default';
40
- if (effectiveVersionSession !== 'Inplay' ||
41
- (input.type !== 'NAME_AND_PASSWORD' && input.type !== 'MOBILE_NUMBER')) {
42
+ headers.delete(PLATFORM_WEB_HEADER_KEY);
43
+ const requiresFingerprint = (effectiveVersionSession === 'Inplay' || version !== 1) &&
44
+ (input.type === 'NAME_AND_PASSWORD' || input.type === 'MOBILE_NUMBER');
45
+ if (!requiresFingerprint) {
42
46
  headers.delete(FINGERPRINT_HEADER_KEY);
43
47
  }
48
+ // Version 4 mirrors portal-sdk's `AuthService`: the auth server relies on
49
+ // its own cookie for web sign-ins, signalled via `?type=web`.
50
+ const queryParam = version === 4 && isWeb ? '?type=web' : '';
51
+ const endpoint = getSessionEndpoint(effectiveVersionSession, version);
44
52
  try {
45
- // The Inplay `/v3/inplay/sessions` endpoint wraps its payload in
46
- // `{ data: { ... } }` (same shape as `/v2/sessions`), while the
47
- // default `/sessions` endpoint returns the flat shape directly.
48
- // Unwrap the Inplay response so callers can treat both consistently
49
- // via the existing `CreateSessionMutation` union.
50
- if (effectiveVersionSession === 'Inplay') {
51
- const wrapped = await httpRequest.json(`${AUTH_ENDPOINT}${SESSION_ENDPOINTS[effectiveVersionSession]}`, {
53
+ // v1 against the default endpoint returns the payload flat; every
54
+ // other combination (Inplay, or version 3/4) wraps it in `{ data: { ... } }`.
55
+ // Unwrap those so callers can treat both consistently via the existing
56
+ // `CreateSessionMutation` union.
57
+ if (effectiveVersionSession === 'Inplay' || version !== 1) {
58
+ const wrapped = await httpRequest.json(`${AUTH_ENDPOINT}${endpoint}${queryParam}`, {
52
59
  ...options,
53
60
  method: 'POST',
54
61
  headers,
62
+ ...(version === 4 && { credentials: 'include' }),
55
63
  });
56
64
  if (wrapped.data.authenticator) {
57
65
  return {
@@ -64,7 +72,7 @@ export async function createSession(input, options, versionSession = 'default')
64
72
  refreshToken: wrapped.data.refreshToken,
65
73
  };
66
74
  }
67
- return await httpRequest.json(`${AUTH_ENDPOINT}${SESSION_ENDPOINTS[effectiveVersionSession]}`, {
75
+ return await httpRequest.json(`${AUTH_ENDPOINT}${endpoint}`, {
68
76
  ...options,
69
77
  method: 'POST',
70
78
  headers,
@@ -12,6 +12,7 @@ export const SLOT_REQUIRES_FUTURE_FLAG = [
12
12
  'RELAXGAMING',
13
13
  'ALIZE',
14
14
  'RUBYPLAY',
15
+ 'PRAGMATICPLAY_DIRECT',
15
16
  ];
16
17
  export const SPECIALTY_REQUIRES_FUTURE_FLAG = [
17
18
  /**/
@@ -157,7 +157,7 @@ export interface Announcement {
157
157
  dateTimeLastUpdated: string;
158
158
  }
159
159
  export type GameType = 'SLOTS' | 'SPORTS' | 'FISHING' | 'BINGO' | 'LIVE' | 'GAMES' | 'TABLE' | 'SPECIALTY' | 'NUMERICAL' | 'NUMERIC' | 'ARCADE';
160
- export type GameProvider = 'JILI' | 'JILI_BINGO' | 'PGSOFT' | 'FACHAI' | 'BTI' | 'DG' | 'PLAYTECH' | 'E2E' | 'ONEAPI_EVOLUTION' | 'EVOLUTION' | 'EVOLUTION_NETENT' | 'EVOLUTION_REDTIGER' | 'EVOLUTION_TAP_A_ROO' | 'MEGABALL' | 'MEGA2SPIN' | 'DARWIN' | 'RTG' | 'DRBINGO' | 'HOLLYWOODTV' | 'CQ9' | 'JDB' | 'HABANERO' | 'SPINIX' | 'JOKER' | 'HACKSAW' | 'JDBGTF' | 'JDBSPRIBE' | 'MICROGAMING' | 'RELAXGAMING' | 'EVOPLAY' | 'BOOONGO' | 'BGAMING' | 'KINGMAKER' | 'KINGMIDAS' | 'YELLOWBAT' | 'ETENGJUE' | 'SABA' | 'PRAGMATICPLAY' | 'SPRIBE' | 'EZUGI' | 'ALIZE' | 'DIGITAIN' | 'BNG' | 'NO_LIMIT_CITY' | 'BIG_TIME_GAMING' | 'SAGAMING' | 'SEXYCASINO' | 'ONEAPI_SPADEGAMING' | 'JK8' | 'RUBYPLAY' | 'EVOLUTIONNETENT' | 'TEST';
160
+ export type GameProvider = 'JILI' | 'JILI_BINGO' | 'PGSOFT' | 'FACHAI' | 'BTI' | 'DG' | 'PLAYTECH' | 'E2E' | 'ONEAPI_EVOLUTION' | 'EVOLUTION' | 'EVOLUTION_NETENT' | 'EVOLUTION_REDTIGER' | 'EVOLUTION_TAP_A_ROO' | 'MEGABALL' | 'MEGA2SPIN' | 'DARWIN' | 'RTG' | 'DRBINGO' | 'HOLLYWOODTV' | 'CQ9' | 'JDB' | 'HABANERO' | 'SPINIX' | 'JOKER' | 'HACKSAW' | 'JDBGTF' | 'JDBSPRIBE' | 'MICROGAMING' | 'RELAXGAMING' | 'EVOPLAY' | 'BOOONGO' | 'BGAMING' | 'KINGMAKER' | 'KINGMIDAS' | 'YELLOWBAT' | 'ETENGJUE' | 'SABA' | 'PRAGMATICPLAY' | 'PRAGMATICPLAY_DIRECT' | 'SPRIBE' | 'EZUGI' | 'ALIZE' | 'DIGITAIN' | 'BNG' | 'NO_LIMIT_CITY' | 'BIG_TIME_GAMING' | 'SAGAMING' | 'SEXYCASINO' | 'ONEAPI_SPADEGAMING' | 'JK8' | 'RUBYPLAY' | 'EVOLUTIONNETENT' | 'TEST';
161
161
  export type GameStatus = 'ACTIVE' | 'INACTIVE' | 'HIDDEN';
162
162
  export type GameTag = 'HOT' | 'hot' | 'NEW' | 'new' | 'TOP' | 'top' | 'POPULAR' | 'popular' | (string & {});
163
163
  export interface Game {