@opexa/portal-sdk 0.0.23 → 0.0.25

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.
@@ -4,6 +4,7 @@ export declare const ObjectType: {
4
4
  Withdrawal: number;
5
5
  Verification: number;
6
6
  File: number;
7
+ Game: number;
7
8
  GameSession: number;
8
9
  MayaSession: number;
9
10
  };
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__Next, GamesByNameInput, GamesByNameReturn, GameSessionReturn, GamesInput, GamesReturn, GamesReturn__Next, 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,13 +221,33 @@ export declare class Sdk {
225
221
  bonus(): Promise<BonusReturn>;
226
222
  cashbackBonuses(): Promise<CashbackBonusReturn>;
227
223
  claimCashbackBonus(id: string): Promise<ClaimCashbackBonusReturn>;
224
+ /** @deprecated use `game__next` */
225
+ game(id: string): Promise<{
226
+ ok: false;
227
+ data?: never;
228
+ error: import('../utils/types').OperationError<import('../utils/types').HttpError | "UnknownError"> | import('../utils/types').OperationError<never>;
229
+ } | {
230
+ ok: true;
231
+ data: import('./types').Game__Next | null;
232
+ error?: never;
233
+ }>;
234
+ game__next(id: string): Promise<GameReturn__Next>;
235
+ /** @deprecated use `games__next` */
228
236
  games(input?: GamesInput): Promise<GamesReturn>;
237
+ games__next(input?: GamesInput): Promise<GamesReturn__Next>;
238
+ /** @deprecated use `games__next` */
229
239
  games__legacy(input?: GamesInput): Promise<GamesReturn>;
240
+ /** @deprecated use `games__next` */
230
241
  gamesByName(input?: GamesByNameInput): Promise<GamesByNameReturn>;
242
+ /** @deprecated use `games__next` */
231
243
  gamesByName__legacy(input?: GamesByNameInput): Promise<GamesByNameReturn>;
244
+ /** @deprecated use `gameSession__next` */
232
245
  gameSession(id: string): Promise<GameSessionReturn>;
246
+ /** @deprecated use `gameSession__next` */
233
247
  gameSession__legacy(id: string): Promise<GameSessionReturn>;
248
+ gameSession__next(id: string): Promise<GameSessionReturn>;
234
249
  /**
250
+ * @deprecated use `createGameSession__next`
235
251
  * @example
236
252
  * ```ts
237
253
  * const res = await sdk.createGameSession({
@@ -247,9 +263,14 @@ export declare class Sdk {
247
263
  * ```
248
264
  */
249
265
  createGameSession(input: CreateGameSessionInput): Promise<CreateGameSessionReturn>;
266
+ /** @deprecated use `createGameSession__next` */
250
267
  createGameSession__legacy(input: CreateGameSessionInput): Promise<CreateGameSessionReturn>;
268
+ createGameSession__next(input: CreateGameSessionInput): Promise<CreateGameSessionReturn>;
269
+ /** @deprecated use `endGameSession__next` */
251
270
  endGameSession(id: string): Promise<EndGameSessionReturn>;
271
+ /** @deprecated use `endGameSession__next` */
252
272
  endGameSession__legacy(id: string): Promise<EndGameSessionReturn__Legacy>;
273
+ endGameSession__next(id: string): Promise<EndGameSessionReturn__Legacy>;
253
274
  file(id: string): Promise<FileReturn>;
254
275
  /**
255
276
  * @example
@@ -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;
@@ -19,7 +20,9 @@ export declare class Transformer {
19
20
  betRecord: (data: Internal.BetRecord) => External.BetRecord;
20
21
  latestBetRecord: (data: Internal.LatestBetRecord) => External.LatestBetRecord;
21
22
  transactionRecord: (data: Internal.TransactionRecord) => External.TransactionRecord;
23
+ /** @deprecated */
22
24
  game: (data: Internal.Game) => External.Game;
25
+ game__next: (data: Internal.Game__Next) => External.Game__Next;
23
26
  gameSession: (data: Internal.GameSession) => External.GameSession;
24
27
  promo: (data: Internal.Promo) => External.Promo;
25
28
  cashback: (data: Internal.Cashback) => External.Cashback;
@@ -28,6 +31,7 @@ export declare class Transformer {
28
31
  file: (data: Internal.File) => External.File;
29
32
  pointsWallet: (data: Internal.PointsWallet) => External.PointsWallet;
30
33
  };
34
+ private site;
31
35
  private platform;
32
36
  private account;
33
37
  private wallet;
@@ -41,6 +45,7 @@ export declare class Transformer {
41
45
  private latestBetRecord;
42
46
  private transactionRecord;
43
47
  private game;
48
+ private game__next;
44
49
  private gameSession;
45
50
  private promo;
46
51
  private cashback;
@@ -398,6 +398,7 @@ export type PointsToCashConversionError = UnionAlias<Internal.PointsToCashConver
398
398
  export type PointsToCashConversionReturn = OperationResult<PointsToCashConversionError>;
399
399
  export type GameType = UnionAlias<Internal.GameType>;
400
400
  export type GameProvider = UnionAlias<Internal.GameProvider>;
401
+ /** @deprecated use `Games__Next` */
401
402
  export interface Game {
402
403
  id: string;
403
404
  name: string;
@@ -405,12 +406,22 @@ export interface Game {
405
406
  images: string[];
406
407
  provider: GameProvider;
407
408
  }
409
+ export interface Game__Next extends Game {
410
+ externalId: string;
411
+ }
408
412
  export interface GamesInput extends Internal.GamesQueryVariables {
409
413
  }
414
+ /** @deprecated use `GamesReturn__Next` */
410
415
  export type GamesReturn = OperationResult<never, PaginatedQueryResult<'games', Game>>;
416
+ export type GamesReturn__Next = OperationResult<never, PaginatedQueryResult<'games', Game__Next>>;
417
+ /** @deprecated */
411
418
  export interface GamesByNameInput extends Internal.GamesByNameQueryVariables {
412
419
  }
420
+ /** @deprecated */
413
421
  export type GamesByNameReturn = OperationResult<never, Game[]>;
422
+ /** @deprecated use `GameReturn__Next` */
423
+ export type GameReturn = OperationResult<never, Game | null>;
424
+ export type GameReturn__Next = OperationResult<never, Game__Next | null>;
414
425
  export type GameSessionStatus = UnionAlias<Internal.GameSessionStatus>;
415
426
  export type GameSession = {
416
427
  id: string;
@@ -921,4 +932,10 @@ export interface CashbackBonus {
921
932
  export type CashbackBonusReturn = OperationResult<never, CashbackBonus[]>;
922
933
  export type ClaimCashbackBonusError = UnionAlias<Internal.ClaimCashbackBonusError>;
923
934
  export type ClaimCashbackBonusReturn = OperationResult<ClaimCashbackBonusError>;
935
+ export interface Site {
936
+ id: string;
937
+ name: string;
938
+ logo?: string;
939
+ }
940
+ export type SiteReturn = OperationResult<never, Site>;
924
941
  export {};
@@ -0,0 +1,18 @@
1
+ import { OperationResult } from '../utils/types';
2
+ import { Game__Next, 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
+ self(): Promise<OperationResult<never, Site>>;
15
+ games(variables?: GamesQueryVariables): Promise<OperationResult<never, PaginatedQueryResult<Game__Next>>>;
16
+ game(id: string): Promise<OperationResult<never, Game__Next | null | undefined>>;
17
+ private getJson;
18
+ }
@@ -5,7 +5,9 @@ import { CreateGameSessionError, CreateGameSessionMutationVariables, EndGameSess
5
5
  export declare class GameService {
6
6
  private client;
7
7
  constructor(client: GraphQLClient);
8
+ /** @deprecated */
8
9
  games(variables?: GamesQueryVariables): Promise<OperationResult<never, PaginatedQueryResult<Game>>>;
10
+ /** @deprecated */
9
11
  gamesByName(variables?: GamesByNameQueryVariables): Promise<{
10
12
  ok: false;
11
13
  data?: never;
@@ -30,7 +30,6 @@ export interface StringFilterField {
30
30
  in?: string[];
31
31
  notIn?: string[];
32
32
  contains?: string;
33
- startsWith?: string;
34
33
  }
35
34
  export interface NumberFilterField {
36
35
  equal?: number;
@@ -118,15 +117,30 @@ export interface AnnouncementsQueryVariables {
118
117
  }
119
118
  export type GameType = 'SLOTS' | 'SPORTS' | 'BINGO' | 'FISHING' | 'LIVE' | 'GAMES' | 'TABLE';
120
119
  export type GameProvider = 'JILI' | 'PGSOFT' | 'FACHAI' | 'PLAYTECH' | 'CQ9' | 'JDB' | 'BOOONGO' | 'HABANERO' | 'RELAXGAMING' | 'DG' | 'E2E' | 'BTI' | 'DARWIN' | 'MEGABALL' | 'DRBINGO' | 'RTG';
120
+ export type GameStatus = 'ACTIVE' | 'INACTIVE';
121
+ /** @deprecated */
121
122
  export interface Game {
122
123
  id: string;
123
124
  name: string;
124
125
  type: GameType;
125
126
  provider: GameProvider;
126
127
  }
128
+ export interface Game__Next extends Game {
129
+ game: string;
130
+ tags: string[];
131
+ rank: Decimal;
132
+ site: string;
133
+ cursor: string;
134
+ status: GameStatus;
135
+ platform: string;
136
+ externalId: string;
137
+ dateTimeCreated: DateString;
138
+ dateTimeLastUpdated: DateString;
139
+ }
127
140
  export interface GameQueryVariables {
128
141
  id: string;
129
142
  }
143
+ /** @deprecated */
130
144
  export interface GameQuery {
131
145
  node?: Game | null;
132
146
  }
@@ -134,12 +148,12 @@ export interface GamesQueryVariables {
134
148
  after?: string;
135
149
  first?: number;
136
150
  filter?: {
137
- id?: ObjectIdFilterField;
138
151
  name?: StringFilterField;
139
152
  type?: EnumFilterField<GameType>;
140
153
  provider?: EnumFilterField<GameProvider>;
141
154
  };
142
155
  }
156
+ /** @deprecated */
143
157
  export interface GamesQuery extends PaginatedQuery<'games', Game> {
144
158
  }
145
159
  export interface GamesByNameQueryVariables {
@@ -147,9 +161,18 @@ export interface GamesByNameQueryVariables {
147
161
  search: string;
148
162
  filter?: GamesQueryVariables['filter'];
149
163
  }
164
+ /** @deprecated */
150
165
  export interface GamesByNameQuery {
151
166
  gamesByName: Game[];
152
167
  }
168
+ export interface GamesQuery__Next {
169
+ data: Game__Next[];
170
+ next?: string | null;
171
+ totalCount: number;
172
+ }
173
+ export interface GameQuery__Next {
174
+ data?: Game__Next | null;
175
+ }
153
176
  export type GameSessionStatus = 'PENDING' | 'STARTING' | 'READY' | 'ENDED' | 'CANCELLED';
154
177
  export interface GameSession {
155
178
  id: string;
@@ -740,12 +763,12 @@ export interface UpdateMemberVerificationMutationVariables {
740
763
  };
741
764
  }
742
765
  export interface ProfileCompletion {
743
- completionPercentage: Decimal;
744
- personalInformation: boolean;
745
- accountVerification: boolean;
746
- mobileNumberVerification: boolean;
747
- transactionPassword: boolean;
748
- accountPassword: boolean;
766
+ completionPercentage?: Decimal | null;
767
+ personalInformation?: boolean | null;
768
+ accountVerification?: boolean | null;
769
+ mobileNumberVerification?: boolean | null;
770
+ transactionPassword?: boolean | null;
771
+ accountPassword?: boolean | null;
749
772
  }
750
773
  export interface ProfileCompletionQuery {
751
774
  profileCompletion: ProfileCompletion;
@@ -853,3 +876,11 @@ export interface MayaSessionQuery {
853
876
  export interface MayaSessionQueryVariables {
854
877
  id: string;
855
878
  }
879
+ export interface Site {
880
+ id: string;
881
+ name: string;
882
+ logo?: string | null;
883
+ }
884
+ export interface SiteQuery {
885
+ data: Site;
886
+ }
@@ -24,7 +24,9 @@ export declare class WalletService {
24
24
  pointsWallet(): Promise<OperationResult<never, PointsWallet | null | undefined>>;
25
25
  pointsToCashConversion(variables: PointsToCashConversionMutationVariables): Promise<OperationResult<PointsToCashConversionError>>;
26
26
  mayaSession(variables: MayaSessionQueryVariables): Promise<OperationResult<never, MayaSession | null | undefined>>;
27
+ /** @deprecated */
27
28
  games(variables?: GamesQueryVariables): Promise<OperationResult<never, PaginatedQueryResult<Game>>>;
29
+ /** @deprecated */
28
30
  gamesByName(variables?: GamesByNameQueryVariables): Promise<{
29
31
  ok: false;
30
32
  data?: never;
@@ -0,0 +1 @@
1
+ export declare function compact<T>(obj: Record<string, any>): T;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opexa/portal-sdk",
3
3
  "type": "module",
4
- "version": "0.0.23",
4
+ "version": "0.0.25",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "typings": "dist/index.d.ts",