@opexa/portal-sdk 0.0.23 → 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 +62 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +654 -440
- 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/types.d.ts +25 -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
|
+
}
|
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;
|
|
@@ -740,12 +749,12 @@ export interface UpdateMemberVerificationMutationVariables {
|
|
|
740
749
|
};
|
|
741
750
|
}
|
|
742
751
|
export interface ProfileCompletion {
|
|
743
|
-
completionPercentage
|
|
744
|
-
personalInformation
|
|
745
|
-
accountVerification
|
|
746
|
-
mobileNumberVerification
|
|
747
|
-
transactionPassword
|
|
748
|
-
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;
|
|
749
758
|
}
|
|
750
759
|
export interface ProfileCompletionQuery {
|
|
751
760
|
profileCompletion: ProfileCompletion;
|
|
@@ -853,3 +862,11 @@ export interface MayaSessionQuery {
|
|
|
853
862
|
export interface MayaSessionQueryVariables {
|
|
854
863
|
id: string;
|
|
855
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;
|