@opexa/portal-sdk 0.0.1 → 0.0.3
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/graphql/session.d.ts +8 -7
- package/dist/graphql/static.service.d.ts +2 -2
- package/dist/index.js +28 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +300 -232
- package/dist/index.mjs.map +1 -1
- package/dist/sdk.d.ts +5 -1
- package/dist/session-service.d.ts +12 -16
- package/dist/types.d.ts +13 -1
- package/package.json +1 -1
package/dist/sdk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountReturn, AnnouncementsInput, AnnouncementsReturn, AvailablePromosReturn, BetRecordsInput, BetRecordsReturn, BonusReturn, CashbackBonusReturn, CashbacksReturn, ClaimCashbackBonusReturn, CreateAccountInput, CreateAccountReturn, CreateDepositInput, CreateDepositReturn, CreateGameSessionInput, CreateGameSessionReturn, CreateWithdrawalInput, CreateWithdrawalReturn, DeleteAccountReturn, DepositRecordsInput, DepositRecordsReturn, DepositReturn, DepositsCountReturn, EndGameSessionReturn, FileReturn, GameSessionReturn, GamesByNameInput, GamesByNameInput__Next, GamesByNameReturn, GamesInput, GamesInput__Next, GamesReturn, LatestBetRecordsReturn, PlatformReturn, PointsToCashConversionReturn, PointsWalletReturn, ProfileCompletionReturn, PromosReturn, RemainingDailyWithdrawalsCountReturn, ResetPasswordInput, ResetPasswordReturn, SendVerificationCodeReturn, SessionReturn, SignInInput, SignInReturn, SubmitVerificationDetailsInput, SubmitVerificationDetailsReturn, TransactionRecordsInput, TransactionRecordsReturn, UpdateAccountInput, UpdateAccountReturn, UpdateVerificationDetailsInput, UpdateVerificationDetailsReturn, UploadImageFileInput, UploadImageFileReturn, VerificationDetailsReturn, VerifyMobileNumberReturn, WalletReturn, WithdrawalRecordsInput, WithdrawalRecordsReturn } from './types';
|
|
1
|
+
import { AccountReturn, AnnouncementsInput, AnnouncementsReturn, AvailablePromosReturn, BetRecordsInput, BetRecordsReturn, BonusReturn, CashbackBonusReturn, CashbacksReturn, ClaimCashbackBonusReturn, CreateAccountInput, CreateAccountReturn, CreateDepositInput, CreateDepositReturn, CreateGameSessionInput, CreateGameSessionReturn, CreateWithdrawalInput, CreateWithdrawalReturn, DeleteAccountReturn, DepositRecordsInput, DepositRecordsReturn, DepositReturn, DepositsCountReturn, EndGameSessionReturn, FileReturn, GameSessionReturn, GamesByNameInput, GamesByNameInput__Next, GamesByNameReturn, GamesInput, GamesInput__Next, GamesReturn, LatestBetRecordsReturn, PlatformReturn, PointsToCashConversionReturn, PointsWalletReturn, ProfileCompletionReturn, PromosReturn, RemainingDailyWithdrawalsCountReturn, ResetPasswordInput, ResetPasswordReturn, SendVerificationCodeReturn, SessionReturn, SignInInput, SignInReturn, 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;
|
|
@@ -27,6 +27,10 @@ export declare class Sdk {
|
|
|
27
27
|
private get authMiddleware();
|
|
28
28
|
signIn(input: SignInInput): Promise<SignInReturn>;
|
|
29
29
|
signOut(): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* @returns Unsubscribe function
|
|
32
|
+
*/
|
|
33
|
+
watchSession(input: WatchSessionInput): () => void;
|
|
30
34
|
session(): Promise<SessionReturn>;
|
|
31
35
|
platform(): Promise<PlatformReturn>;
|
|
32
36
|
account(): Promise<AccountReturn>;
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
import { AuthServiceConfig, CreateSessionInput } from './graphql';
|
|
2
|
-
import { Session } from './types';
|
|
1
|
+
import { AuthServiceConfig, CreateSessionError, CreateSessionInput, OperationResult, RefreshSessionError, Session } from './graphql';
|
|
3
2
|
|
|
3
|
+
interface Data {
|
|
4
|
+
session: Session;
|
|
5
|
+
accessToken: string;
|
|
6
|
+
accessTokenExpiresAt: number;
|
|
7
|
+
refreshToken: string;
|
|
8
|
+
refreshTokenExpiresAt: number;
|
|
9
|
+
}
|
|
4
10
|
export declare class SessionService {
|
|
5
11
|
private logger;
|
|
6
12
|
private storageKey;
|
|
7
13
|
private authService;
|
|
8
14
|
constructor(config: AuthServiceConfig);
|
|
9
|
-
create(input: CreateSessionInput): Promise<
|
|
10
|
-
|
|
11
|
-
data?: never;
|
|
12
|
-
error: import('./utils/http-error').HttpError | import('./graphql').CreateSessionError;
|
|
13
|
-
} | {
|
|
14
|
-
ok: true;
|
|
15
|
-
}>;
|
|
16
|
-
session(): Promise<{
|
|
17
|
-
session: Session;
|
|
18
|
-
accessToken: string;
|
|
19
|
-
accessTokenExpiresAt: number;
|
|
20
|
-
refreshToken: string;
|
|
21
|
-
refreshTokenExpiresAt: number;
|
|
22
|
-
} | null>;
|
|
15
|
+
create(input: CreateSessionInput): Promise<OperationResult<CreateSessionError>>;
|
|
16
|
+
session(): Promise<OperationResult<RefreshSessionError, Data | null>>;
|
|
23
17
|
destroy(): Promise<void>;
|
|
18
|
+
verify(): Promise<boolean>;
|
|
24
19
|
private get isServer();
|
|
25
20
|
}
|
|
21
|
+
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -32,7 +32,15 @@ export interface Session {
|
|
|
32
32
|
id: string;
|
|
33
33
|
dateTimeCreated: Date;
|
|
34
34
|
}
|
|
35
|
-
export type
|
|
35
|
+
export type SessionError = Internal.RefreshSessionError;
|
|
36
|
+
export type SessionReturn = Internal.OperationResult<SessionError, Session | null>;
|
|
37
|
+
export interface WatchSessionInput {
|
|
38
|
+
/**
|
|
39
|
+
* @default 30000
|
|
40
|
+
*/
|
|
41
|
+
interval?: number;
|
|
42
|
+
onInvalid: () => void | Promise<void>;
|
|
43
|
+
}
|
|
36
44
|
export interface File__UploadingOrFailed {
|
|
37
45
|
id: string;
|
|
38
46
|
url?: never;
|
|
@@ -369,7 +377,11 @@ export interface Game {
|
|
|
369
377
|
id: string;
|
|
370
378
|
name: string;
|
|
371
379
|
type: GameType;
|
|
380
|
+
/**
|
|
381
|
+
* @deprecated use `images` instead
|
|
382
|
+
*/
|
|
372
383
|
image: string;
|
|
384
|
+
images: string[];
|
|
373
385
|
provider: GameProvider;
|
|
374
386
|
}
|
|
375
387
|
export interface GamesInput {
|