@opexa/portal-sdk 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +466 -469
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +902 -868
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/sdk.d.ts +8 -23
- package/dist/sdk/session-manager.d.ts +8 -3
- package/dist/sdk/types.d.ts +141 -98
- package/dist/services/account.service.d.ts +1 -4
- package/dist/services/auth.service.d.ts +2 -4
- package/dist/services/file.service.d.ts +1 -1
- package/dist/services/game.service.d.ts +11 -6
- package/dist/services/index.d.ts +0 -16
- package/dist/services/portal.service.d.ts +1 -1
- package/dist/services/queries.d.ts +54 -0
- package/dist/services/report.service.d.ts +1 -6
- package/dist/services/types.d.ts +780 -8
- package/dist/services/utils.d.ts +2 -9
- package/dist/services/wallet.service.d.ts +17 -10
- package/dist/utils/clamp.d.ts +1 -0
- package/dist/utils/pollable.d.ts +28 -0
- package/package.json +4 -1
- package/dist/services/announcement.d.ts +0 -29
- package/dist/services/bet-record.d.ts +0 -65
- package/dist/services/bonus.d.ts +0 -45
- package/dist/services/cashback.d.ts +0 -20
- package/dist/services/deposit.d.ts +0 -90
- package/dist/services/file.d.ts +0 -49
- package/dist/services/game.d.ts +0 -98
- package/dist/services/member.d.ts +0 -202
- package/dist/services/platform.d.ts +0 -38
- package/dist/services/points.d.ts +0 -24
- package/dist/services/promo.d.ts +0 -33
- package/dist/services/session.d.ts +0 -80
- package/dist/services/transaction.d.ts +0 -25
- package/dist/services/wallet.d.ts +0 -14
- package/dist/services/withdrawal.d.ts +0 -114
package/dist/sdk/sdk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountReturn, AnnouncementsInput, AnnouncementsReturn, AuthenticateInput, AuthenticateReturn, AvailablePromosReturn, BetRecordsInput, BetRecordsReturn, BonusReturn, CashbackBonusReturn, CashbacksReturn, ClaimCashbackBonusReturn, CreateAccountInput, CreateAccountReturn, CreateDepositInput, CreateDepositReturn, CreateGameSessionInput, CreateGameSessionReturn, CreateWithdrawalInput, CreateWithdrawalReturn, DeleteAccountReturn, DepositRecordsInput, DepositRecordsReturn, DepositReturn, DepositsCountReturn, EndGameSessionReturn,
|
|
1
|
+
import { AccountReturn, AnnouncementsInput, AnnouncementsReturn, AuthenticateInput, AuthenticateReturn, AvailablePromosReturn, BetRecordsInput, BetRecordsReturn, BonusReturn, CashbackBonusReturn, CashbacksReturn, ClaimCashbackBonusReturn, CreateAccountInput, CreateAccountReturn, CreateDepositInput, CreateDepositReturn, CreateGameSessionInput, CreateGameSessionReturn, CreateWithdrawalInput, CreateWithdrawalReturn, DeleteAccountReturn, DepositRecordsInput, DepositRecordsReturn, DepositReturn, DepositsCountReturn, EndGameSessionReturn, EndGameSessionReturn__Legacy, FileReturn, GamesByNameInput, GamesByNameReturn, GameSessionReturn, GamesInput, GamesReturn, LatestBetRecordsReturn, MayaSignInInput, MayaSignInReturn, MobileNumberSignInInput, MobileNumberSignInReturn, NameAndPasswordSignInInput, NameAndPasswordSignInReturn, PlatformReturn, PointsToCashConversionReturn, PointsWalletReturn, ProfileCompletionReturn, PromosReturn, RemainingDailyWithdrawalsCountReturn, ResetPasswordInput, ResetPasswordReturn, SendVerificationCodeReturn, SessionReturn, SubmitVerificationDetailsInput, SubmitVerificationDetailsReturn, TransactionRecordsInput, TransactionRecordsReturn, UpdateAccountInput, UpdateAccountReturn, UpdateVerificationDetailsInput, UpdateVerificationDetailsReturn, UploadImageFileInput, UploadImageFileReturn, VerificationDetailsReturn, VerifyMobileNumberReturn, WalletReturn, WatchSessionInput, WithdrawalRecordsInput, WithdrawalRecordsReturn } from './types';
|
|
2
2
|
|
|
3
3
|
export interface SdkConfig {
|
|
4
4
|
platform: string;
|
|
@@ -226,9 +226,11 @@ export declare class Sdk {
|
|
|
226
226
|
cashbackBonuses(): Promise<CashbackBonusReturn>;
|
|
227
227
|
claimCashbackBonus(id: string): Promise<ClaimCashbackBonusReturn>;
|
|
228
228
|
games(input?: GamesInput): Promise<GamesReturn>;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
games__legacy(input?: GamesInput): Promise<GamesReturn>;
|
|
230
|
+
gamesByName(input?: GamesByNameInput): Promise<GamesByNameReturn>;
|
|
231
|
+
gamesByName__legacy(input?: GamesByNameInput): Promise<GamesByNameReturn>;
|
|
232
|
+
gameSession(id: string): Promise<GameSessionReturn>;
|
|
233
|
+
gameSession__legacy(id: string): Promise<GameSessionReturn>;
|
|
232
234
|
/**
|
|
233
235
|
* @example
|
|
234
236
|
* ```ts
|
|
@@ -245,26 +247,9 @@ export declare class Sdk {
|
|
|
245
247
|
* ```
|
|
246
248
|
*/
|
|
247
249
|
createGameSession(input: CreateGameSessionInput): Promise<CreateGameSessionReturn>;
|
|
248
|
-
|
|
249
|
-
* @example
|
|
250
|
-
* ```ts
|
|
251
|
-
* const res = await sdk.createGameSession({
|
|
252
|
-
* id: ObjectId.generate(ObjectType.GameSession).toString(),
|
|
253
|
-
* game: game.id,
|
|
254
|
-
* });
|
|
255
|
-
*
|
|
256
|
-
* if (!res.ok) {
|
|
257
|
-
* window.alert(res.error.message);
|
|
258
|
-
* } else {
|
|
259
|
-
* // Do something
|
|
260
|
-
* }
|
|
261
|
-
* ```
|
|
262
|
-
*/
|
|
263
|
-
createGameSession__next(input: CreateGameSessionInput): Promise<CreateGameSessionReturn>;
|
|
264
|
-
gameSession(id: string): Promise<GameSessionReturn>;
|
|
265
|
-
gameSession__next(id: string): Promise<GameSessionReturn>;
|
|
250
|
+
createGameSession__legacy(input: CreateGameSessionInput): Promise<CreateGameSessionReturn>;
|
|
266
251
|
endGameSession(id: string): Promise<EndGameSessionReturn>;
|
|
267
|
-
|
|
252
|
+
endGameSession__legacy(id: string): Promise<EndGameSessionReturn__Legacy>;
|
|
268
253
|
file(id: string): Promise<FileReturn>;
|
|
269
254
|
/**
|
|
270
255
|
* @example
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthServiceConfig } from '../services';
|
|
2
2
|
import { OperationResult } from '../utils/types';
|
|
3
|
+
import { AuthenticateError, AuthenticateInput, Authenticator, RefreshSessionError, Session, SignInError, SignInInput } from './types';
|
|
3
4
|
|
|
4
5
|
interface Data {
|
|
5
6
|
session: Session;
|
|
@@ -8,18 +9,22 @@ interface Data {
|
|
|
8
9
|
refreshToken: string;
|
|
9
10
|
refreshTokenExpiresAt: number;
|
|
10
11
|
}
|
|
11
|
-
interface SessionManagerConfig extends AuthServiceConfig {
|
|
12
|
+
interface SessionManagerConfig extends Omit<AuthServiceConfig, 'url'> {
|
|
13
|
+
authUrl: string;
|
|
14
|
+
walletUrl: string;
|
|
15
|
+
platform: string;
|
|
12
16
|
log?: boolean;
|
|
13
17
|
}
|
|
14
18
|
export declare class SessionManager {
|
|
15
19
|
private logger;
|
|
16
20
|
private storageKey;
|
|
17
21
|
private authService;
|
|
22
|
+
private walletService;
|
|
18
23
|
private _refreshing;
|
|
19
24
|
constructor(config: SessionManagerConfig);
|
|
20
25
|
get refreshing(): boolean;
|
|
21
26
|
set refreshing(value: boolean);
|
|
22
|
-
create(input:
|
|
27
|
+
create(input: SignInInput): Promise<OperationResult<SignInError, {
|
|
23
28
|
authenticator: Authenticator;
|
|
24
29
|
} | null>>;
|
|
25
30
|
createFromAuthenticator(input: AuthenticateInput): Promise<OperationResult<AuthenticateError>>;
|
package/dist/sdk/types.d.ts
CHANGED
|
@@ -12,20 +12,31 @@ type PaginatedQueryResult<K extends string, T> = Record<K, Array<WithCursor<T>>>
|
|
|
12
12
|
hasNextPage: true;
|
|
13
13
|
endCursor: string;
|
|
14
14
|
});
|
|
15
|
-
|
|
15
|
+
type UnionAlias<T extends string, K extends T = T> = Extract<T, K>;
|
|
16
|
+
export type SecretQuestion = UnionAlias<Internal.SecretQuestion>;
|
|
17
|
+
export interface SecurityQuestionAuthenticator {
|
|
18
|
+
type: 'SECURITY_QUESTION';
|
|
19
|
+
token: string;
|
|
20
|
+
secretQuestion: SecretQuestion;
|
|
16
21
|
}
|
|
17
22
|
export type Authenticator = SecurityQuestionAuthenticator;
|
|
18
|
-
export
|
|
19
|
-
|
|
23
|
+
export interface NameAndPasswordSignInInput {
|
|
24
|
+
type: 'NAME_AND_PASSWORD';
|
|
25
|
+
name: string;
|
|
26
|
+
password: string;
|
|
20
27
|
}
|
|
21
|
-
export interface MobileNumberSignInInput
|
|
28
|
+
export interface MobileNumberSignInInput {
|
|
29
|
+
type: 'MOBILE_NUMBER';
|
|
30
|
+
mobileNumber: string;
|
|
31
|
+
verificationCode: string;
|
|
22
32
|
}
|
|
23
|
-
export interface MayaSignInInput
|
|
33
|
+
export interface MayaSignInInput {
|
|
34
|
+
type: 'MAYA';
|
|
35
|
+
sessionId: string;
|
|
24
36
|
}
|
|
25
37
|
export type MayaSignInReturn = OperationResult<SignInError>;
|
|
26
38
|
export type MobileNumberSignInReturn = OperationResult<SignInError>;
|
|
27
39
|
export type NameAndPasswordSignInReturn = OperationResult<SignInError, {
|
|
28
|
-
/** Two Factor Authentication is enabled */
|
|
29
40
|
'2FAEnabled': true;
|
|
30
41
|
authenticator: Authenticator;
|
|
31
42
|
} | {
|
|
@@ -33,39 +44,45 @@ export type NameAndPasswordSignInReturn = OperationResult<SignInError, {
|
|
|
33
44
|
authenticator?: never;
|
|
34
45
|
}>;
|
|
35
46
|
export type SignInInput = NameAndPasswordSignInInput | MobileNumberSignInInput | MayaSignInInput;
|
|
36
|
-
export type SignInError = Internal.CreateSessionError
|
|
47
|
+
export type SignInError = UnionAlias<Internal.CreateSessionError>;
|
|
37
48
|
export type SignInReturn = NameAndPasswordSignInReturn | MobileNumberSignInReturn | MayaSignInReturn;
|
|
38
|
-
export
|
|
49
|
+
export type RefreshSessionError = UnionAlias<Internal.RefreshSessionError>;
|
|
50
|
+
export interface SecurityQuestionAuthenticateInput extends Internal.SecurityQuestionAuthenticateInput {
|
|
39
51
|
}
|
|
40
52
|
export type AuthenticateInput = SecurityQuestionAuthenticateInput;
|
|
41
|
-
export type AuthenticateError = Internal.AuthenticateError
|
|
53
|
+
export type AuthenticateError = UnionAlias<Internal.AuthenticateError>;
|
|
42
54
|
export type AuthenticateReturn = OperationResult<AuthenticateError>;
|
|
43
55
|
export interface Session {
|
|
44
56
|
id: string;
|
|
45
57
|
dateTimeCreated: Date;
|
|
46
58
|
}
|
|
47
|
-
export type SessionError =
|
|
59
|
+
export type SessionError = UnionAlias<RefreshSessionError>;
|
|
48
60
|
export type SessionReturn = OperationResult<SessionError, Session | null>;
|
|
49
61
|
export interface WatchSessionInput {
|
|
50
62
|
/**
|
|
51
63
|
* @default 30000
|
|
64
|
+
* @min `30000` (30s)
|
|
65
|
+
* @max `300000` (5m)
|
|
52
66
|
*/
|
|
53
67
|
interval?: number;
|
|
54
68
|
onInvalid: () => void | Promise<void>;
|
|
55
69
|
}
|
|
56
70
|
export type File = {
|
|
57
71
|
id: string;
|
|
58
|
-
dateTimeCreated: Date;
|
|
59
|
-
} & ({
|
|
60
72
|
url?: never;
|
|
61
73
|
status: 'UPLOADING' | 'FAILED';
|
|
74
|
+
dateTimeCreated: Date;
|
|
62
75
|
} | {
|
|
63
|
-
|
|
64
|
-
status: 'DELETED';
|
|
65
|
-
} | {
|
|
76
|
+
id: string;
|
|
66
77
|
url: string;
|
|
67
78
|
status: 'READY';
|
|
68
|
-
|
|
79
|
+
dateTimeCreated: Date;
|
|
80
|
+
} | {
|
|
81
|
+
id: string;
|
|
82
|
+
url?: string;
|
|
83
|
+
status: 'DELETED';
|
|
84
|
+
dateTimeCreated: Date;
|
|
85
|
+
};
|
|
69
86
|
export type FileReturn = OperationResult<never, File | null>;
|
|
70
87
|
export interface UploadImageFileInput {
|
|
71
88
|
/**
|
|
@@ -86,11 +103,11 @@ export interface UploadImageFileInput {
|
|
|
86
103
|
*/
|
|
87
104
|
file: globalThis.File;
|
|
88
105
|
}
|
|
89
|
-
export type UploadImageFileError = Internal.UploadPrivateImageFileError
|
|
106
|
+
export type UploadImageFileError = UnionAlias<Internal.UploadPrivateImageFileError>;
|
|
90
107
|
export type UploadImageFileReturn = OperationResult<UploadImageFileError, {
|
|
91
108
|
id: string;
|
|
92
109
|
}>;
|
|
93
|
-
export type AccountStatus = Internal.MemberAccountStatus
|
|
110
|
+
export type AccountStatus = UnionAlias<Internal.MemberAccountStatus>;
|
|
94
111
|
export type AccountVerificationStatus = Internal.MemberAccountVerificationStatus;
|
|
95
112
|
export interface Account {
|
|
96
113
|
id: string;
|
|
@@ -113,7 +130,7 @@ export interface Account {
|
|
|
113
130
|
dateTimeLastUpdated: Date;
|
|
114
131
|
}
|
|
115
132
|
export type AccountReturn = OperationResult<never, Account>;
|
|
116
|
-
export type VerificationDetailsStatus = Internal.MemberVerificationStatus
|
|
133
|
+
export type VerificationDetailsStatus = UnionAlias<Internal.MemberVerificationStatus>;
|
|
117
134
|
export interface VerificationDetails {
|
|
118
135
|
id: string;
|
|
119
136
|
status: VerificationDetailsStatus;
|
|
@@ -189,9 +206,9 @@ export interface CreateAccountInput {
|
|
|
189
206
|
*/
|
|
190
207
|
verificationCode?: string;
|
|
191
208
|
reCAPTCHAResponse?: string;
|
|
192
|
-
|
|
209
|
+
referralCode?: string;
|
|
193
210
|
}
|
|
194
|
-
export type CreateAccountError = Internal.RegisterMemberAccountError
|
|
211
|
+
export type CreateAccountError = UnionAlias<Internal.RegisterMemberAccountError>;
|
|
195
212
|
export type CreateAccountReturn = OperationResult<CreateAccountError, {
|
|
196
213
|
id: string;
|
|
197
214
|
}>;
|
|
@@ -255,7 +272,7 @@ export interface UpdateAccountInput {
|
|
|
255
272
|
secretQuestion?: SecretQuestion;
|
|
256
273
|
secretAnswer?: string;
|
|
257
274
|
}
|
|
258
|
-
export type UpdateAccountError = Internal.UpdateMemberAccountError
|
|
275
|
+
export type UpdateAccountError = UnionAlias<Internal.UpdateMemberAccountError>;
|
|
259
276
|
export type UpdateAccountReturn = OperationResult<UpdateAccountError>;
|
|
260
277
|
export type DeleteAccountReturn = OperationResult;
|
|
261
278
|
export interface ResetPasswordInput {
|
|
@@ -286,7 +303,7 @@ export interface ResetPasswordInput {
|
|
|
286
303
|
*/
|
|
287
304
|
verificationCode: string;
|
|
288
305
|
}
|
|
289
|
-
export type ResetPasswordError = Internal.ResetPasswordError
|
|
306
|
+
export type ResetPasswordError = UnionAlias<Internal.ResetPasswordError>;
|
|
290
307
|
export type ResetPasswordReturn = OperationResult<ResetPasswordError>;
|
|
291
308
|
export interface SubmitVerificationDetailsInput {
|
|
292
309
|
/**
|
|
@@ -349,19 +366,19 @@ export interface SubmitVerificationDetailsInput {
|
|
|
349
366
|
*/
|
|
350
367
|
placeOfBirth: string;
|
|
351
368
|
}
|
|
352
|
-
export type SubmitVerificationError = Internal.CreateMemberVerificationError
|
|
369
|
+
export type SubmitVerificationError = UnionAlias<Internal.CreateMemberVerificationError>;
|
|
353
370
|
export type SubmitVerificationDetailsReturn = OperationResult<SubmitVerificationError, {
|
|
354
371
|
id: string;
|
|
355
372
|
}>;
|
|
356
373
|
export interface UpdateVerificationDetailsInput extends Partial<Omit<SubmitVerificationDetailsInput, 'id'>> {
|
|
357
374
|
}
|
|
358
|
-
export type UpdateVerificationError = Internal.UpdateMemberVerificationError
|
|
375
|
+
export type UpdateVerificationError = UnionAlias<Internal.UpdateMemberVerificationError>;
|
|
359
376
|
export type UpdateVerificationDetailsReturn = OperationResult<UpdateVerificationError>;
|
|
360
|
-
export type SendVerificationCodeError = Internal.SendVerificationCodeError
|
|
377
|
+
export type SendVerificationCodeError = UnionAlias<Internal.SendVerificationCodeError>;
|
|
361
378
|
export type SendVerificationCodeReturn = OperationResult<SendVerificationCodeError>;
|
|
362
|
-
export type VerifyMobileNumberError = Internal.VerifyMobileNumberError
|
|
379
|
+
export type VerifyMobileNumberError = UnionAlias<Internal.VerifyMobileNumberError>;
|
|
363
380
|
export type VerifyMobileNumberReturn = OperationResult<VerifyMobileNumberError>;
|
|
364
|
-
export type Currency = Internal.Currency
|
|
381
|
+
export type Currency = UnionAlias<Internal.Currency>;
|
|
365
382
|
export interface Wallet {
|
|
366
383
|
id: string;
|
|
367
384
|
balance: number;
|
|
@@ -377,12 +394,10 @@ export interface PointsWallet {
|
|
|
377
394
|
dateTimeCreated: Date;
|
|
378
395
|
}
|
|
379
396
|
export type PointsWalletReturn = OperationResult<never, PointsWallet | null>;
|
|
380
|
-
export type PointsToCashConversionError = Internal.PointsToCashConversionError
|
|
397
|
+
export type PointsToCashConversionError = UnionAlias<Internal.PointsToCashConversionError>;
|
|
381
398
|
export type PointsToCashConversionReturn = OperationResult<PointsToCashConversionError>;
|
|
382
|
-
export type GameType = Internal.GameType
|
|
383
|
-
export type GameProvider = Internal.GameProvider
|
|
384
|
-
export type GameProvider__Next = Internal.GameProvider__Next;
|
|
385
|
-
export type GameSessionStatus = Internal.GameSessionStatus;
|
|
399
|
+
export type GameType = UnionAlias<Internal.GameType>;
|
|
400
|
+
export type GameProvider = UnionAlias<Internal.GameProvider>;
|
|
386
401
|
export interface Game {
|
|
387
402
|
id: string;
|
|
388
403
|
name: string;
|
|
@@ -390,49 +405,26 @@ export interface Game {
|
|
|
390
405
|
images: string[];
|
|
391
406
|
provider: GameProvider;
|
|
392
407
|
}
|
|
393
|
-
export interface GamesInput {
|
|
394
|
-
after?: string;
|
|
395
|
-
first?: number;
|
|
396
|
-
filter?: {
|
|
397
|
-
id?: Internal.ObjectIdFilterField;
|
|
398
|
-
name?: Internal.StringFilterField;
|
|
399
|
-
type?: Internal.EnumFilterField<GameType>;
|
|
400
|
-
provider?: Internal.EnumFilterField<Exclude<GameProvider, GameProvider__Next>>;
|
|
401
|
-
};
|
|
402
|
-
}
|
|
403
|
-
export interface GamesInput__Next {
|
|
404
|
-
after?: string;
|
|
405
|
-
first?: number;
|
|
406
|
-
filter?: {
|
|
407
|
-
id?: Internal.ObjectIdFilterField;
|
|
408
|
-
name?: Internal.StringFilterField;
|
|
409
|
-
type?: Internal.EnumFilterField<GameType>;
|
|
410
|
-
provider?: Internal.EnumFilterField<GameProvider__Next>;
|
|
411
|
-
};
|
|
408
|
+
export interface GamesInput extends Internal.GamesQueryVariables {
|
|
412
409
|
}
|
|
413
410
|
export type GamesReturn = OperationResult<never, PaginatedQueryResult<'games', Game>>;
|
|
414
|
-
export interface GamesByNameInput {
|
|
415
|
-
first?: number;
|
|
416
|
-
filter?: GamesInput['filter'];
|
|
417
|
-
search: string;
|
|
418
|
-
}
|
|
419
|
-
export interface GamesByNameInput__Next {
|
|
420
|
-
first?: number;
|
|
421
|
-
filter?: GamesInput__Next['filter'];
|
|
422
|
-
search: string;
|
|
411
|
+
export interface GamesByNameInput extends Internal.GamesByNameQueryVariables {
|
|
423
412
|
}
|
|
424
413
|
export type GamesByNameReturn = OperationResult<never, Game[]>;
|
|
414
|
+
export type GameSessionStatus = UnionAlias<Internal.GameSessionStatus>;
|
|
425
415
|
export type GameSession = {
|
|
426
416
|
id: string;
|
|
427
|
-
dateTimeCreated: Date;
|
|
428
|
-
dateTimeLastUpdated: Date;
|
|
429
|
-
} & ({
|
|
430
417
|
status: 'READY' | 'ENDED';
|
|
431
418
|
launchUrl: string;
|
|
419
|
+
dateTimeCreated: Date;
|
|
420
|
+
dateTimeLastUpdated: Date;
|
|
432
421
|
} | {
|
|
422
|
+
id: string;
|
|
433
423
|
status: 'PENDING' | 'STARTING' | 'CANCELLED';
|
|
434
424
|
launchUrl?: never;
|
|
435
|
-
|
|
425
|
+
dateTimeCreated: Date;
|
|
426
|
+
dateTimeLastUpdated: Date;
|
|
427
|
+
};
|
|
436
428
|
export type GameSessionReturn = OperationResult<never, GameSession | null>;
|
|
437
429
|
export interface CreateGameSessionInput {
|
|
438
430
|
/**
|
|
@@ -449,13 +441,15 @@ export interface CreateGameSessionInput {
|
|
|
449
441
|
*/
|
|
450
442
|
game: string;
|
|
451
443
|
}
|
|
452
|
-
export type CreateGameSessionError = Internal.CreateGameSessionError
|
|
444
|
+
export type CreateGameSessionError = UnionAlias<Internal.CreateGameSessionError>;
|
|
453
445
|
export type CreateGameSessionReturn = OperationResult<CreateGameSessionError, {
|
|
454
446
|
id: string;
|
|
455
447
|
}>;
|
|
456
448
|
export type EndGameSessionReturn = OperationResult;
|
|
457
|
-
export type
|
|
458
|
-
export type
|
|
449
|
+
export type EndGameSessionError__Legacy = UnionAlias<Internal.EndGameSessionError__Legacy>;
|
|
450
|
+
export type EndGameSessionReturn__Legacy = OperationResult<EndGameSessionError__Legacy>;
|
|
451
|
+
export type AnnouncementType = UnionAlias<Internal.AnnouncementType>;
|
|
452
|
+
export type AnnouncementStatus = UnionAlias<Internal.AnnouncementStatus>;
|
|
459
453
|
export interface Announcement {
|
|
460
454
|
id: string;
|
|
461
455
|
type: AnnouncementType;
|
|
@@ -470,7 +464,7 @@ export interface Announcement {
|
|
|
470
464
|
export interface AnnouncementsInput extends Omit<Internal.AnnouncementsQueryVariables, 'filter'> {
|
|
471
465
|
}
|
|
472
466
|
export type AnnouncementsReturn = OperationResult<never, PaginatedQueryResult<'announcements', Announcement>>;
|
|
473
|
-
export type BetRecordStatus = Internal.BetRecordStatus
|
|
467
|
+
export type BetRecordStatus = UnionAlias<Internal.BetRecordStatus>;
|
|
474
468
|
export interface BetRecord {
|
|
475
469
|
id: string;
|
|
476
470
|
game: Game;
|
|
@@ -510,10 +504,10 @@ export interface LatestBetRecord {
|
|
|
510
504
|
dateTimeCreated: Date;
|
|
511
505
|
}
|
|
512
506
|
export type LatestBetRecordsReturn = OperationResult<never, LatestBetRecord[]>;
|
|
513
|
-
export type
|
|
507
|
+
export type TransactionType = UnionAlias<Internal.TransactionType>;
|
|
514
508
|
export interface TransactionRecord {
|
|
515
509
|
id: string;
|
|
516
|
-
type:
|
|
510
|
+
type: TransactionType;
|
|
517
511
|
amount: number;
|
|
518
512
|
content?: string;
|
|
519
513
|
currentBalance: number;
|
|
@@ -523,12 +517,12 @@ export interface TransactionRecord {
|
|
|
523
517
|
export interface TransactionRecordsInput extends Internal.TransactionRecordsQueryVariables {
|
|
524
518
|
}
|
|
525
519
|
export type TransactionRecordsReturn = OperationResult<never, PaginatedQueryResult<'transactionRecords', TransactionRecord>>;
|
|
526
|
-
export type
|
|
527
|
-
export type
|
|
520
|
+
export type DepositType = UnionAlias<Internal.DepositType>;
|
|
521
|
+
export type DepositStatus = UnionAlias<Internal.DepositStatus>;
|
|
528
522
|
export interface DepositRecord {
|
|
529
523
|
id: string;
|
|
530
|
-
type:
|
|
531
|
-
status:
|
|
524
|
+
type: DepositType;
|
|
525
|
+
status: DepositStatus;
|
|
532
526
|
amount: number;
|
|
533
527
|
netAmount: number;
|
|
534
528
|
fee: number;
|
|
@@ -540,40 +534,89 @@ export interface DepositRecord {
|
|
|
540
534
|
export interface DepositRecordsInput extends Internal.DepositRecordsQueryVariables {
|
|
541
535
|
}
|
|
542
536
|
export type DepositRecordsReturn = OperationResult<never, PaginatedQueryResult<'depositRecords', DepositRecord>>;
|
|
543
|
-
export type
|
|
544
|
-
|
|
545
|
-
export type GCashDeposit = DepositCommonProps & {
|
|
537
|
+
export type GCashDeposit = {
|
|
538
|
+
id: string;
|
|
546
539
|
type: 'GCASH';
|
|
547
|
-
} & ({
|
|
548
540
|
status: 'PENDING';
|
|
549
541
|
checkoutUrl?: never;
|
|
550
542
|
} | {
|
|
543
|
+
id: string;
|
|
544
|
+
type: 'GCASH';
|
|
551
545
|
status: 'REJECTED' | 'CANCELLED';
|
|
552
546
|
checkoutUrl?: string;
|
|
553
547
|
} | {
|
|
548
|
+
id: string;
|
|
549
|
+
type: 'GCASH';
|
|
554
550
|
status: 'ACCEPTED' | 'APPROVED' | 'CONFIRMED';
|
|
555
551
|
checkoutUrl: string;
|
|
556
|
-
}
|
|
557
|
-
export type MayaDeposit =
|
|
552
|
+
};
|
|
553
|
+
export type MayaDeposit = {
|
|
554
|
+
id: string;
|
|
558
555
|
type: 'MAYA';
|
|
559
|
-
} & ({
|
|
560
556
|
status: 'PENDING';
|
|
561
557
|
checkoutUrl?: never;
|
|
562
558
|
} | {
|
|
559
|
+
id: string;
|
|
560
|
+
type: 'MAYA';
|
|
563
561
|
status: 'REJECTED' | 'CANCELLED';
|
|
564
562
|
checkoutUrl?: string;
|
|
565
563
|
} | {
|
|
564
|
+
id: string;
|
|
565
|
+
type: 'MAYA';
|
|
566
566
|
status: 'ACCEPTED' | 'APPROVED' | 'CONFIRMED';
|
|
567
567
|
checkoutUrl: string;
|
|
568
|
-
}
|
|
569
|
-
export
|
|
568
|
+
};
|
|
569
|
+
export type MayaAppDeposit = {
|
|
570
|
+
id: string;
|
|
570
571
|
type: 'MAYA_APP';
|
|
571
|
-
status:
|
|
572
|
+
status: 'PENDING';
|
|
572
573
|
checkoutUrl?: never;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
|
|
574
|
+
} | {
|
|
575
|
+
id: string;
|
|
576
|
+
type: 'MAYA_APP';
|
|
577
|
+
status: 'REJECTED' | 'CANCELLED';
|
|
578
|
+
checkoutUrl?: never;
|
|
579
|
+
} | {
|
|
580
|
+
id: string;
|
|
581
|
+
type: 'MAYA_APP';
|
|
582
|
+
status: 'ACCEPTED' | 'APPROVED' | 'CONFIRMED';
|
|
583
|
+
checkoutUrl?: never;
|
|
584
|
+
};
|
|
585
|
+
export type BankDeposit = {
|
|
586
|
+
id: string;
|
|
587
|
+
type: 'BANK';
|
|
588
|
+
status: 'PENDING';
|
|
589
|
+
checkoutUrl?: never;
|
|
590
|
+
} | {
|
|
591
|
+
id: string;
|
|
592
|
+
type: 'BANK';
|
|
593
|
+
status: 'REJECTED' | 'CANCELLED';
|
|
594
|
+
checkoutUrl?: never;
|
|
595
|
+
} | {
|
|
596
|
+
id: string;
|
|
597
|
+
type: 'BANK';
|
|
598
|
+
status: 'ACCEPTED' | 'APPROVED' | 'CONFIRMED';
|
|
599
|
+
checkoutUrl?: string;
|
|
600
|
+
};
|
|
601
|
+
export type ManualDeposit = {
|
|
602
|
+
id: string;
|
|
603
|
+
type: 'MANUAL';
|
|
604
|
+
status: 'PENDING';
|
|
605
|
+
checkoutUrl?: never;
|
|
606
|
+
} | {
|
|
607
|
+
id: string;
|
|
608
|
+
type: 'MANUAL';
|
|
609
|
+
status: 'REJECTED' | 'CANCELLED';
|
|
610
|
+
checkoutUrl?: never;
|
|
611
|
+
} | {
|
|
612
|
+
id: string;
|
|
613
|
+
type: 'MANUAL';
|
|
614
|
+
status: 'ACCEPTED' | 'APPROVED' | 'CONFIRMED';
|
|
615
|
+
checkoutUrl?: never;
|
|
616
|
+
};
|
|
617
|
+
export type Deposit = GCashDeposit | MayaDeposit | MayaAppDeposit | BankDeposit | ManualDeposit;
|
|
576
618
|
export type DepositReturn = OperationResult<never, Deposit | null>;
|
|
619
|
+
export type DepositsCountReturn = OperationResult<never, number>;
|
|
577
620
|
export interface CreateMayaDepositInput {
|
|
578
621
|
/**
|
|
579
622
|
* @example
|
|
@@ -626,18 +669,18 @@ export interface CreateMayaAppDepositInput {
|
|
|
626
669
|
promo?: string;
|
|
627
670
|
}
|
|
628
671
|
export type CreateDepositInput = CreateMayaDepositInput | CreateGCashDepositInput | CreateMayaAppDepositInput;
|
|
629
|
-
export type CreateDepositError = Internal.CreateDepositError
|
|
672
|
+
export type CreateDepositError = UnionAlias<Internal.CreateDepositError>;
|
|
630
673
|
export type CreateDepositReturn = OperationResult<CreateDepositError, {
|
|
631
674
|
id: string;
|
|
632
675
|
}>;
|
|
633
|
-
export type
|
|
634
|
-
export type
|
|
676
|
+
export type WithdrawalType = UnionAlias<Internal.WithdrawalType>;
|
|
677
|
+
export type WithdrawalStatus = UnionAlias<Internal.WithdrawalStatus>;
|
|
635
678
|
interface WithdrawalRecordCommonProps {
|
|
636
679
|
id: string;
|
|
637
680
|
fee: number;
|
|
638
681
|
amount: number;
|
|
639
682
|
netAmount: number;
|
|
640
|
-
status:
|
|
683
|
+
status: WithdrawalStatus;
|
|
641
684
|
reference?: string;
|
|
642
685
|
withdrawalNumber: string;
|
|
643
686
|
dateTimeConfirmed?: Date;
|
|
@@ -655,7 +698,7 @@ export interface ManualWithdrawalRecord extends WithdrawalRecordCommonProps {
|
|
|
655
698
|
* - `BNORPHMM` - BDO UNIBANK, INC.
|
|
656
699
|
* - `MKRUPHM1` - BANK OF MAKATI
|
|
657
700
|
*/
|
|
658
|
-
export type Bank = Internal.Bank
|
|
701
|
+
export type Bank = UnionAlias<Internal.Bank>;
|
|
659
702
|
export interface BankWithdrawalRecord extends WithdrawalRecordCommonProps {
|
|
660
703
|
type: 'BANK';
|
|
661
704
|
bank: Bank;
|
|
@@ -781,7 +824,7 @@ export interface CreateMayaAppWithdrawalInput {
|
|
|
781
824
|
transactionPassword: string;
|
|
782
825
|
}
|
|
783
826
|
export type CreateWithdrawalInput = CreateBankWithdrawalInput | CreateGCashWithdrawalInput | CreateMayaWithdrawalInput | CreateMayaAppWithdrawalInput;
|
|
784
|
-
export type CreateWithdrawalError = Internal.CreateWithdrawalError
|
|
827
|
+
export type CreateWithdrawalError = UnionAlias<Internal.CreateWithdrawalError>;
|
|
785
828
|
export type CreateWithdrawalReturn = OperationResult<CreateWithdrawalError, {
|
|
786
829
|
id: string;
|
|
787
830
|
}>;
|
|
@@ -819,8 +862,8 @@ export interface Platform {
|
|
|
819
862
|
pointsClubSettings: PointsClubSettings;
|
|
820
863
|
}
|
|
821
864
|
export type PlatformReturn = OperationResult<never, Platform>;
|
|
822
|
-
export type PromoType = Internal.PromoType
|
|
823
|
-
export type PromoStatus = Internal.PromoStatus
|
|
865
|
+
export type PromoType = UnionAlias<Internal.PromoType>;
|
|
866
|
+
export type PromoStatus = UnionAlias<Internal.PromoStatus>;
|
|
824
867
|
export interface Promo {
|
|
825
868
|
id: string;
|
|
826
869
|
type: PromoType;
|
|
@@ -839,7 +882,7 @@ export interface Promo {
|
|
|
839
882
|
}
|
|
840
883
|
export type PromosReturn = OperationResult<never, Promo[]>;
|
|
841
884
|
export type AvailablePromosReturn = OperationResult<never, Promo[]>;
|
|
842
|
-
export type CashbackStatus = Internal.CashbackStatus
|
|
885
|
+
export type CashbackStatus = UnionAlias<Internal.CashbackStatus>;
|
|
843
886
|
export interface Cashback {
|
|
844
887
|
id: string;
|
|
845
888
|
name: string;
|
|
@@ -876,6 +919,6 @@ export interface CashbackBonus {
|
|
|
876
919
|
dateTimeLastUpdated: Date;
|
|
877
920
|
}
|
|
878
921
|
export type CashbackBonusReturn = OperationResult<never, CashbackBonus[]>;
|
|
879
|
-
export type ClaimCashbackBonusError = Internal.ClaimCashbackBonusError
|
|
922
|
+
export type ClaimCashbackBonusError = UnionAlias<Internal.ClaimCashbackBonusError>;
|
|
880
923
|
export type ClaimCashbackBonusReturn = OperationResult<ClaimCashbackBonusError>;
|
|
881
924
|
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { GraphQLClient } from '../utils/graphql-client';
|
|
2
2
|
import { OperationResult } from '../utils/types';
|
|
3
|
-
import { Announcement, AnnouncementsQueryVariables } from './
|
|
4
|
-
import { CreateMemberVerificationError, CreateMemberVerificationMutationVariables, DeleteMemberAccountMutationVariables, MemberAccount, MemberVerification, ProfileCompletion, RegisterMemberAccountError, RegisterMemberAccountMutationVariables, ResetPasswordError, ResetPasswordMutationVariables, SendVerificationCodeError, SendVerificationCodeMutationVariables, UpdateMemberAccountError, UpdateMemberAccountMutationVariables, UpdateMemberVerificationError, UpdateMemberVerificationMutationVariables, VerifyMobileNumberError, VerifyMobileNumberMutationVariables } from './member';
|
|
5
|
-
import { Platform } from './platform';
|
|
6
|
-
import { PaginatedQueryResult } from './types';
|
|
3
|
+
import { Announcement, AnnouncementsQueryVariables, CreateMemberVerificationError, CreateMemberVerificationMutationVariables, DeleteMemberAccountMutationVariables, MemberAccount, MemberVerification, PaginatedQueryResult, Platform, ProfileCompletion, RegisterMemberAccountError, RegisterMemberAccountMutationVariables, ResetPasswordError, ResetPasswordMutationVariables, SendVerificationCodeError, SendVerificationCodeMutationVariables, UpdateMemberAccountError, UpdateMemberAccountMutationVariables, UpdateMemberVerificationError, UpdateMemberVerificationMutationVariables, VerifyMobileNumberError, VerifyMobileNumberMutationVariables } from './types';
|
|
7
4
|
|
|
8
5
|
export declare class AccountService {
|
|
9
6
|
private client;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OperationResult } from '../utils/types';
|
|
2
|
-
import { AuthenticateError, AuthenticateInput, AuthenticateMutation, CreateSessionError,
|
|
2
|
+
import { AuthenticateError, AuthenticateInput, AuthenticateMutation, CreateSessionError, CreateSessionInput, CreateSessionMutation, RefreshSessionError, RefreshSessionMutation } from './types';
|
|
3
3
|
|
|
4
4
|
export interface AuthServiceConfig {
|
|
5
5
|
url: string;
|
|
@@ -9,9 +9,7 @@ export declare class AuthService {
|
|
|
9
9
|
private url;
|
|
10
10
|
private platform;
|
|
11
11
|
constructor(config: AuthServiceConfig);
|
|
12
|
-
createSession(input:
|
|
13
|
-
createSession(input: CreateSessionInput__MobileNumber): Promise<OperationResult<CreateSessionError, CreateSessionMutation__MobileNumber>>;
|
|
14
|
-
createSession(input: CreateSessionInput__NameAndPassword): Promise<OperationResult<CreateSessionError, CreateSessionMutation__NameAndPassword>>;
|
|
12
|
+
createSession(input: CreateSessionInput): Promise<OperationResult<CreateSessionError, CreateSessionMutation>>;
|
|
15
13
|
authenticate(input: AuthenticateInput): Promise<OperationResult<AuthenticateError, AuthenticateMutation>>;
|
|
16
14
|
refreshSession(refreshToken: string): Promise<OperationResult<RefreshSessionError, RefreshSessionMutation>>;
|
|
17
15
|
destroySession(accessToken: string): Promise<OperationResult>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GraphQLClient } from '../utils/graphql-client';
|
|
2
2
|
import { OperationResult } from '../utils/types';
|
|
3
|
-
import { File, FileQueryVariables, UploadPrivateImageFileError, UploadPrivateImageFileMutationVariables } from './
|
|
3
|
+
import { File, FileQueryVariables, UploadPrivateImageFileError, UploadPrivateImageFileMutationVariables } from './types';
|
|
4
4
|
|
|
5
5
|
export declare class FileService {
|
|
6
6
|
private client;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { GraphQLClient } from '../utils/graphql-client';
|
|
2
2
|
import { OperationResult } from '../utils/types';
|
|
3
|
-
import { CreateGameSessionError, CreateGameSessionMutationVariables, EndGameSessionMutationVariables, Game,
|
|
4
|
-
import { PaginatedQueryResult } from './types';
|
|
3
|
+
import { CreateGameSessionError, CreateGameSessionMutationVariables, EndGameSessionError__Legacy, EndGameSessionMutationVariables, Game, GamesByNameQueryVariables, GameSession, GameSessionQueryVariables, GamesQueryVariables, PaginatedQueryResult } from './types';
|
|
5
4
|
|
|
6
5
|
export declare class GameService {
|
|
7
|
-
|
|
6
|
+
private client;
|
|
8
7
|
constructor(client: GraphQLClient);
|
|
9
|
-
game(variables?: GameQueryVariables): Promise<OperationResult<never, Game | null | undefined>>;
|
|
10
8
|
games(variables?: GamesQueryVariables): Promise<OperationResult<never, PaginatedQueryResult<Game>>>;
|
|
11
|
-
gamesByName(variables?: GamesByNameQueryVariables): Promise<
|
|
9
|
+
gamesByName(variables?: GamesByNameQueryVariables): Promise<{
|
|
10
|
+
ok: false;
|
|
11
|
+
data?: never;
|
|
12
|
+
error: import('../utils/types').OperationError<import('../utils/types').HttpError | "UnknownError"> | import('../utils/types').OperationError<never>;
|
|
13
|
+
} | {
|
|
14
|
+
ok: true;
|
|
15
|
+
data: Game[];
|
|
16
|
+
}>;
|
|
12
17
|
gameSession(variables: GameSessionQueryVariables): Promise<OperationResult<never, GameSession | null | undefined>>;
|
|
13
18
|
createGameSession(variables: CreateGameSessionMutationVariables): Promise<OperationResult<CreateGameSessionError>>;
|
|
14
|
-
endGameSession(variables: EndGameSessionMutationVariables): Promise<OperationResult
|
|
19
|
+
endGameSession(variables: EndGameSessionMutationVariables): Promise<OperationResult<EndGameSessionError__Legacy>>;
|
|
15
20
|
}
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
export * from './announcement';
|
|
2
|
-
export * from './bet-record';
|
|
3
|
-
export * from './bonus';
|
|
4
|
-
export * from './cashback';
|
|
5
|
-
export * from './deposit';
|
|
6
|
-
export * from './file';
|
|
7
|
-
export * from './game';
|
|
8
|
-
export * from './member';
|
|
9
|
-
export * from './platform';
|
|
10
|
-
export * from './points';
|
|
11
|
-
export * from './promo';
|
|
12
|
-
export * from './session';
|
|
13
|
-
export * from './transaction';
|
|
14
1
|
export * from './types';
|
|
15
|
-
export * from './wallet';
|
|
16
|
-
export * from './withdrawal';
|
|
17
2
|
export * from './account.service';
|
|
18
3
|
export * from './auth.service';
|
|
19
4
|
export * from './file.service';
|
|
20
|
-
export * from './game.service';
|
|
21
5
|
export * from './report.service';
|
|
22
6
|
export * from './static.service';
|
|
23
7
|
export * from './wallet.service';
|