@opexa/portal-sdk 0.0.22 → 0.0.24
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/README.md +29 -1
- package/dist/index.js +77 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +665 -433
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/sdk.d.ts +7 -9
- package/dist/sdk/transformer.d.ts +2 -0
- package/dist/sdk/types.d.ts +7 -0
- package/dist/services/cms-portal.service.d.ts +17 -0
- package/dist/services/game.service.d.ts +2 -2
- package/dist/services/queries.d.ts +1 -0
- package/dist/services/types.d.ts +38 -8
- package/dist/utils/compact.d.ts +1 -0
- package/package.json +1 -1
package/dist/sdk/sdk.d.ts
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
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';
|
|
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, GameReturn, GamesByNameInput, GamesByNameReturn, GameSessionReturn, GamesInput, GamesReturn, LatestBetRecordsReturn, MayaSignInInput, MayaSignInReturn, MobileNumberSignInInput, MobileNumberSignInReturn, NameAndPasswordSignInInput, NameAndPasswordSignInReturn, PlatformReturn, PointsToCashConversionReturn, PointsWalletReturn, ProfileCompletionReturn, PromosReturn, RemainingDailyWithdrawalsCountReturn, ResetPasswordInput, ResetPasswordReturn, SendVerificationCodeReturn, SessionReturn, SiteReturn, 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
|
+
site: string;
|
|
5
|
+
sitePlatform: string;
|
|
4
6
|
platform: string;
|
|
5
|
-
/**
|
|
6
|
-
* @description Whether to use production or development endpoints.
|
|
7
|
-
* @default "development"
|
|
8
|
-
*/
|
|
9
7
|
environment?: 'production' | 'development';
|
|
10
|
-
/**
|
|
11
|
-
* @description Enables/disables logging.
|
|
12
|
-
* @default false
|
|
13
|
-
*/
|
|
14
8
|
log?: boolean;
|
|
15
9
|
}
|
|
16
10
|
export declare class Sdk {
|
|
@@ -20,6 +14,7 @@ export declare class Sdk {
|
|
|
20
14
|
private reportService;
|
|
21
15
|
private portalService;
|
|
22
16
|
private accountService;
|
|
17
|
+
private cmsPortalService;
|
|
23
18
|
private sessionManager;
|
|
24
19
|
private transformer;
|
|
25
20
|
private logger;
|
|
@@ -89,6 +84,7 @@ export declare class Sdk {
|
|
|
89
84
|
*/
|
|
90
85
|
watchSession(input: WatchSessionInput): () => void;
|
|
91
86
|
session(): Promise<SessionReturn>;
|
|
87
|
+
site(): Promise<SiteReturn>;
|
|
92
88
|
platform(): Promise<PlatformReturn>;
|
|
93
89
|
account(): Promise<AccountReturn>;
|
|
94
90
|
/**
|
|
@@ -225,7 +221,9 @@ export declare class Sdk {
|
|
|
225
221
|
bonus(): Promise<BonusReturn>;
|
|
226
222
|
cashbackBonuses(): Promise<CashbackBonusReturn>;
|
|
227
223
|
claimCashbackBonus(id: string): Promise<ClaimCashbackBonusReturn>;
|
|
224
|
+
game(id: string): Promise<GameReturn>;
|
|
228
225
|
games(input?: GamesInput): Promise<GamesReturn>;
|
|
226
|
+
games__next(input?: GamesInput): Promise<GamesReturn>;
|
|
229
227
|
games__legacy(input?: GamesInput): Promise<GamesReturn>;
|
|
230
228
|
gamesByName(input?: GamesByNameInput): Promise<GamesByNameReturn>;
|
|
231
229
|
gamesByName__legacy(input?: GamesByNameInput): Promise<GamesByNameReturn>;
|
|
@@ -7,6 +7,7 @@ export declare class Transformer {
|
|
|
7
7
|
private staticService;
|
|
8
8
|
constructor(config?: TransformerConfig);
|
|
9
9
|
get transform(): {
|
|
10
|
+
site: (data: Internal.Site) => External.Site;
|
|
10
11
|
platform: (data: Internal.Platform) => External.Platform;
|
|
11
12
|
account: (data: Internal.MemberAccount & Internal.Member) => External.Account;
|
|
12
13
|
wallet: (data: Internal.Wallet) => External.Wallet;
|
|
@@ -28,6 +29,7 @@ export declare class Transformer {
|
|
|
28
29
|
file: (data: Internal.File) => External.File;
|
|
29
30
|
pointsWallet: (data: Internal.PointsWallet) => External.PointsWallet;
|
|
30
31
|
};
|
|
32
|
+
private site;
|
|
31
33
|
private platform;
|
|
32
34
|
private account;
|
|
33
35
|
private wallet;
|
package/dist/sdk/types.d.ts
CHANGED
|
@@ -408,6 +408,7 @@ export interface Game {
|
|
|
408
408
|
export interface GamesInput extends Internal.GamesQueryVariables {
|
|
409
409
|
}
|
|
410
410
|
export type GamesReturn = OperationResult<never, PaginatedQueryResult<'games', Game>>;
|
|
411
|
+
export type GameReturn = OperationResult<never, Game | null>;
|
|
411
412
|
export interface GamesByNameInput extends Internal.GamesByNameQueryVariables {
|
|
412
413
|
}
|
|
413
414
|
export type GamesByNameReturn = OperationResult<never, Game[]>;
|
|
@@ -921,4 +922,10 @@ export interface CashbackBonus {
|
|
|
921
922
|
export type CashbackBonusReturn = OperationResult<never, CashbackBonus[]>;
|
|
922
923
|
export type ClaimCashbackBonusError = UnionAlias<Internal.ClaimCashbackBonusError>;
|
|
923
924
|
export type ClaimCashbackBonusReturn = OperationResult<ClaimCashbackBonusError>;
|
|
925
|
+
export interface Site {
|
|
926
|
+
id: string;
|
|
927
|
+
name: string;
|
|
928
|
+
logo?: string;
|
|
929
|
+
}
|
|
930
|
+
export type SiteReturn = OperationResult<never, Site>;
|
|
924
931
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OperationResult } from '../utils/types';
|
|
2
|
+
import { Game, GamesQueryVariables, PaginatedQueryResult, Site } from './types';
|
|
3
|
+
|
|
4
|
+
export interface CmsPortalServiceConfig {
|
|
5
|
+
url: string;
|
|
6
|
+
site: string;
|
|
7
|
+
platform: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class CmsPortalService {
|
|
10
|
+
private url;
|
|
11
|
+
private siteId;
|
|
12
|
+
private platformId;
|
|
13
|
+
constructor(config: CmsPortalServiceConfig);
|
|
14
|
+
siteInfo(): Promise<OperationResult<never, Site>>;
|
|
15
|
+
games(variables?: GamesQueryVariables): Promise<OperationResult<never, PaginatedQueryResult<Game>>>;
|
|
16
|
+
game(id: string): Promise<OperationResult<never, Game | null | undefined>>;
|
|
17
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GraphQLClient } from '../utils/graphql-client';
|
|
2
2
|
import { OperationResult } from '../utils/types';
|
|
3
|
-
import { CreateGameSessionError, CreateGameSessionMutationVariables, EndGameSessionError__Legacy, EndGameSessionMutationVariables, Game, GamesByNameQueryVariables,
|
|
3
|
+
import { CreateGameSessionError, CreateGameSessionMutationVariables, EndGameSessionError__Legacy, EndGameSessionMutationVariables, Game, GamesByNameQueryVariables, GameSession__Legacy, GameSessionQueryVariables, GamesQueryVariables, PaginatedQueryResult } from './types';
|
|
4
4
|
|
|
5
5
|
export declare class GameService {
|
|
6
6
|
private client;
|
|
@@ -14,7 +14,7 @@ export declare class GameService {
|
|
|
14
14
|
ok: true;
|
|
15
15
|
data: Game[];
|
|
16
16
|
}>;
|
|
17
|
-
gameSession(variables: GameSessionQueryVariables): Promise<OperationResult<never,
|
|
17
|
+
gameSession(variables: GameSessionQueryVariables): Promise<OperationResult<never, GameSession__Legacy | null | undefined>>;
|
|
18
18
|
createGameSession(variables: CreateGameSessionMutationVariables): Promise<OperationResult<CreateGameSessionError>>;
|
|
19
19
|
endGameSession(variables: EndGameSessionMutationVariables): Promise<OperationResult<EndGameSessionError__Legacy>>;
|
|
20
20
|
}
|
|
@@ -10,6 +10,7 @@ export declare const GAMES_BY_NAME_QUERY: string;
|
|
|
10
10
|
export declare const GAME_SESSION_QUERY: string;
|
|
11
11
|
export declare const CREATE_GAME_SESSION_MUTATION: string;
|
|
12
12
|
export declare const END_GAME_SESSION_MUTATION: string;
|
|
13
|
+
export declare const GAME_SESSION_QUERY_LEGACY: string;
|
|
13
14
|
export declare const END_GAME_SESSION_MUTATION__LEGACY: string;
|
|
14
15
|
export declare const ANNOUNCEMENTS_QUERY: string;
|
|
15
16
|
export declare const WITHDRAWAL_RECORDS_QUERY: string;
|
package/dist/services/types.d.ts
CHANGED
|
@@ -18,6 +18,9 @@ export interface PaginatedQueryResult<T> {
|
|
|
18
18
|
totalCount: number;
|
|
19
19
|
}
|
|
20
20
|
export type PaginatedQuery<Key extends string, T> = Record<Key, PaginatedQueryResult<T>>;
|
|
21
|
+
export type WithCursor<T> = T & {
|
|
22
|
+
cursor: string;
|
|
23
|
+
};
|
|
21
24
|
export interface ObjectIdFilterField {
|
|
22
25
|
equal?: string;
|
|
23
26
|
notEqual?: string;
|
|
@@ -30,7 +33,6 @@ export interface StringFilterField {
|
|
|
30
33
|
in?: string[];
|
|
31
34
|
notIn?: string[];
|
|
32
35
|
contains?: string;
|
|
33
|
-
startsWith?: string;
|
|
34
36
|
}
|
|
35
37
|
export interface NumberFilterField {
|
|
36
38
|
equal?: number;
|
|
@@ -134,7 +136,6 @@ export interface GamesQueryVariables {
|
|
|
134
136
|
after?: string;
|
|
135
137
|
first?: number;
|
|
136
138
|
filter?: {
|
|
137
|
-
id?: ObjectIdFilterField;
|
|
138
139
|
name?: StringFilterField;
|
|
139
140
|
type?: EnumFilterField<GameType>;
|
|
140
141
|
provider?: EnumFilterField<GameProvider>;
|
|
@@ -150,6 +151,14 @@ export interface GamesByNameQueryVariables {
|
|
|
150
151
|
export interface GamesByNameQuery {
|
|
151
152
|
gamesByName: Game[];
|
|
152
153
|
}
|
|
154
|
+
export interface GamesQuery__Next {
|
|
155
|
+
data: WithCursor<Game>[];
|
|
156
|
+
next?: string | null;
|
|
157
|
+
totalCount: number;
|
|
158
|
+
}
|
|
159
|
+
export interface GameQuery__Next {
|
|
160
|
+
data?: Game | null;
|
|
161
|
+
}
|
|
153
162
|
export type GameSessionStatus = 'PENDING' | 'STARTING' | 'READY' | 'ENDED' | 'CANCELLED';
|
|
154
163
|
export interface GameSession {
|
|
155
164
|
id: string;
|
|
@@ -185,6 +194,19 @@ export interface EndGameSessionMutationVariables {
|
|
|
185
194
|
id: string;
|
|
186
195
|
};
|
|
187
196
|
}
|
|
197
|
+
export interface GameSession__Legacy {
|
|
198
|
+
id: string;
|
|
199
|
+
game: {
|
|
200
|
+
id: string;
|
|
201
|
+
};
|
|
202
|
+
status: GameSessionStatus;
|
|
203
|
+
launchUrl?: string | null;
|
|
204
|
+
dateTimeCreated: DateString;
|
|
205
|
+
dateTimeLastUpdated: DateString;
|
|
206
|
+
}
|
|
207
|
+
export interface GameSessionQuery__Legacy {
|
|
208
|
+
node?: GameSession__Legacy | null;
|
|
209
|
+
}
|
|
188
210
|
export type EndGameSessionError__Legacy = 'GameSessionDoesNotExistError' | 'GameSessionAlreadyClosedError' | 'GameProviderError';
|
|
189
211
|
export interface EndGameSessionMutation__Legacy {
|
|
190
212
|
endGameSession?: null | {
|
|
@@ -727,12 +749,12 @@ export interface UpdateMemberVerificationMutationVariables {
|
|
|
727
749
|
};
|
|
728
750
|
}
|
|
729
751
|
export interface ProfileCompletion {
|
|
730
|
-
completionPercentage
|
|
731
|
-
personalInformation
|
|
732
|
-
accountVerification
|
|
733
|
-
mobileNumberVerification
|
|
734
|
-
transactionPassword
|
|
735
|
-
accountPassword
|
|
752
|
+
completionPercentage?: Decimal | null;
|
|
753
|
+
personalInformation?: boolean | null;
|
|
754
|
+
accountVerification?: boolean | null;
|
|
755
|
+
mobileNumberVerification?: boolean | null;
|
|
756
|
+
transactionPassword?: boolean | null;
|
|
757
|
+
accountPassword?: boolean | null;
|
|
736
758
|
}
|
|
737
759
|
export interface ProfileCompletionQuery {
|
|
738
760
|
profileCompletion: ProfileCompletion;
|
|
@@ -840,3 +862,11 @@ export interface MayaSessionQuery {
|
|
|
840
862
|
export interface MayaSessionQueryVariables {
|
|
841
863
|
id: string;
|
|
842
864
|
}
|
|
865
|
+
export interface Site {
|
|
866
|
+
id: string;
|
|
867
|
+
name: string;
|
|
868
|
+
logo?: string | null;
|
|
869
|
+
}
|
|
870
|
+
export interface SiteQuery {
|
|
871
|
+
data: Site;
|
|
872
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function compact<T>(obj: Record<string, any>): T;
|