@opexa/portal-sdk 0.0.72 → 0.0.74

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/sdk/sdk.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AccountReturn, ActivityRecordsInput, ActivityRecordsReturn, AnnouncementsInput, AnnouncementsReturn, AuthenticateInput, AuthenticateReturn, AvailablePromosReturn, BetRecordsInput, BetRecordsReturn, BonusReturn, CashbackBonusReturn, CashbacksReturn, ClaimCashbackBonusReturn, CreateAccountInput, CreateAccountInput__Next, CreateAccountReturn, CreateDepositInput, CreateDepositReturn, CreateGameSessionInput, CreateGameSessionReturn, CreateWithdrawalInput, CreateWithdrawalReturn, DeleteAccountReturn, DepositRecordsInput, DepositRecordsReturn, DepositReturn, DepositsCountReturn, EndGameSessionReturn, EndGameSessionReturn__Legacy, FileReturn, GameReturn__Next, GameSessionReturn, GamesByNameInput, GamesByNameReturn, GamesInput, GamesReturn, GamesReturn__Next, LatestBetRecordsReturn, MayaSignInInput, MayaSignInReturn, MobileNumberSignInInput, MobileNumberSignInReturn, NameAndPasswordSignInInput, NameAndPasswordSignInReturn, PlatformReturn, PointsToCashConversionReturn, PointsWalletReturn, PointsWalletTransactionsInput, PointsWalletTransactionsReturn, ProfileCompletionReturn, PromosReturn, ReferralCodeReturn, ReferralsInput, ReferralsReturn, RegisterMayaAccountInput, RegisterMayaAccountReturn, RemainingDailyWithdrawalsCountReturn, ResetPasswordInput, ResetPasswordReturn, SendAuthenticationCodeReturn, SendVerificationCodeReturn, SendVerificationCodeReturn__Next, SessionReturn, SiteReturn, SubmitVerificationDetailsInput, SubmitVerificationDetailsReturn, TransactionRecordsInput, TransactionRecordsReturn, UpdateAccountInput, UpdateAccountReturn, UpdateReferralCodeInput, UpdateReferralCodeReturn, UpdateVerificationDetailsInput, UpdateVerificationDetailsReturn, UploadImageFileInput, UploadImageFileReturn, ValidateMayaSessionReturn, VerificationDetailsReturn, VerifyMobileNumberReturn, WalletReturn, WatchSessionInput, WithdrawalRecordsInput, WithdrawalRecordsReturn } from './types';
1
+ import { AccountReturn, ActivityRecordsInput, ActivityRecordsReturn, AnnouncementsInput, AnnouncementsReturn, AuthenticateInput, AuthenticateReturn, AvailablePromosReturn, BetRecordsInput, BetRecordsReturn, BonusReturn, CashbackBonusReturn, CashbacksReturn, ClaimCashbackBonusReturn, CreateAccountInput, CreateAccountInput__Next, CreateAccountReturn, CreateDepositInput, CreateDepositReturn, CreateGameSessionInput, CreateGameSessionReturn, CreateWithdrawalInput, CreateWithdrawalReturn, DeleteAccountReturn, DepositRecordsInput, DepositRecordsReturn, DepositReturn, DepositsCountReturn, EndGameSessionReturn, EndGameSessionReturn__Legacy, FileReturn, GameReturn__Next, GameSessionReturn, GamesByNameInput, GamesByNameReturn, GamesInput, GamesReturn, GamesReturn__Next, LatestBetRecordsReturn, MayaSignInInput, MayaSignInReturn, MobileNumberSignInInput, MobileNumberSignInReturn, NameAndPasswordSignInInput, NameAndPasswordSignInReturn, PlatformReturn, PointsToCashConversionReturn, PointsWalletReturn, PointsWalletTransactionsInput, PointsWalletTransactionsReturn, ProfileCompletionReturn, PromosReturn, ReferralCodeReturn, ReferralsInput, ReferralsReturn, RegisterMayaAccountInput, RegisterMayaAccountReturn, RemainingDailyWithdrawalsCountReturn, ResetPasswordInput, ResetPasswordReturn, SendVerificationCodeReturn, SendVerificationCodeReturn__Next, SessionReturn, SiteReturn, SubmitVerificationDetailsInput, SubmitVerificationDetailsReturn, TransactionRecordsInput, TransactionRecordsReturn, UpdateAccountInput, UpdateAccountReturn, UpdateReferralCodeInput, UpdateReferralCodeReturn, UpdateVerificationDetailsInput, UpdateVerificationDetailsReturn, UploadImageFileInput, UploadImageFileReturn, ValidateMayaSessionReturn, VerificationDetailsReturn, VerifyMobileNumberReturn, WalletReturn, WatchSessionInput, WithdrawalRecordsInput, WithdrawalRecordsReturn } from './types';
2
2
 
3
3
  export interface SdkConfig {
4
4
  site: string;
@@ -24,174 +24,21 @@ export declare class Sdk {
24
24
  signIn(input: NameAndPasswordSignInInput): Promise<NameAndPasswordSignInReturn>;
25
25
  signIn(input: MobileNumberSignInInput): Promise<MobileNumberSignInReturn>;
26
26
  signIn(input: MayaSignInInput): Promise<MayaSignInReturn>;
27
- /**
28
- * @deprecated use `sendVerificationCode__next`
29
- */
30
- sendAuthenticationCode(mobileNumber: string): Promise<SendAuthenticationCodeReturn>;
31
- /**
32
- * @example
33
- * ```ts
34
- * const signInResult = await signIn({
35
- * type: 'NAME_AND_PASSWORD',
36
- * name: data.name,
37
- * password: data.password,
38
- * });
39
- *
40
- * if (!signInResult.ok) {
41
- * return window.alert(signInResult.error.message);
42
- * }
43
- *
44
- * if (!signInResult.data) {
45
- * // Signed in. No more steps needed
46
- * return;
47
- * }
48
- *
49
- * const secretAnswer = window.prompt(SECRET_QUESTIONS_MAP[signInResult.secretQuestion]);
50
- *
51
- * const authResult = await sdk.authenticate({
52
- * type: 'SECURITY_QUESTION',
53
- * token: signInResult.token,
54
- * secretAnswer: secretAnswer,
55
- * });
56
- *
57
- * if (!authResult.ok) {
58
- * window.alert(res.error.message);
59
- * } else {
60
- * // Signed in
61
- * }
62
- * ```
63
- */
64
27
  authenticate(input: AuthenticateInput): Promise<AuthenticateReturn>;
65
28
  signOut(): Promise<void>;
66
- /**
67
- * @description Watches the session if it is still valid whenever signed in.
68
- * @returns Unsubscribe function
69
- * @example
70
- * ```tsx
71
- * import * as React from 'react';
72
- * import { useAuthenticated } from '@lib/stores';
73
- *
74
- * function WatchSession() {
75
- * const { setAuthenticated } = useAuthenticated();
76
- *
77
- * React.useEffect(() => {
78
- * const unsubscribe = sdk.watchSession({
79
- * interval: 30000,
80
- * onInvalid() {
81
- * setAuthenticated(false);
82
- * },
83
- * });
84
- *
85
- * return unsubscribe;
86
- * }, []);
87
- * }
88
- * ```
89
- */
90
29
  watchSession(input: WatchSessionInput): () => void;
91
30
  session(): Promise<SessionReturn>;
92
31
  validateMayaSession(): Promise<ValidateMayaSessionReturn>;
93
32
  site(): Promise<SiteReturn>;
94
33
  platform(): Promise<PlatformReturn>;
95
34
  account(): Promise<AccountReturn>;
96
- /**
97
- * @example
98
- * ```ts
99
- * const res = await sdk.createAccount({
100
- * id: ObjectId.generate(ObjectType.Account).toString(),
101
- * name: data.name,
102
- * password: data.password,
103
- * dateOfBirth: new Date(data.dateOfBirth),
104
- * mobileNumber: data.mobileNumber,
105
- * domain: data.domain,
106
- * verificationCode: data.verificationCode,
107
- * reCAPTCHAResponse: data.reCAPTCHAResponse,
108
- * });
109
- *
110
- * if (!res.ok) {
111
- * window.alert(res.error.message);
112
- * } else {
113
- * // Do something
114
- * }
115
- * ```
116
- */
117
35
  createAccount(input: CreateAccountInput): Promise<CreateAccountReturn>;
118
- /**
119
- * @example
120
- * ```ts
121
- * const res = await sdk.createAccount({
122
- * id: ObjectId.generate(ObjectType.Account).toString(),
123
- * name: data.name,
124
- * password: data.password,
125
- * dateOfBirth: new Date(data.dateOfBirth),
126
- * mobileNumber: data.mobileNumber,
127
- * domain: data.domain,
128
- * reCAPTCHAResponse: data.reCAPTCHAResponse,
129
- * });
130
- *
131
- * if (!res.ok) {
132
- * window.alert(res.error.message);
133
- * } else {
134
- * // Do something
135
- * }
136
- * ```
137
- */
138
36
  createAccount__next(input: CreateAccountInput__Next): Promise<CreateAccountReturn>;
139
37
  registerMayaAccount(input: RegisterMayaAccountInput): Promise<RegisterMayaAccountReturn>;
140
- /**
141
- * @example
142
- * ```ts
143
- * const res = await sdk.updateAccount(user.id, {
144
- * validId: data.validId,
145
- * realName: data.realName,
146
- * });
147
- *
148
- * if (!res.ok) {
149
- * window.alert(res.error.message);
150
- * } else {
151
- * // Do something
152
- * }
153
- * ```
154
- */
155
38
  updateAccount(id: string, input: UpdateAccountInput): Promise<UpdateAccountReturn>;
156
39
  deleteAccount(id: string): Promise<DeleteAccountReturn>;
157
40
  verificationDetails(): Promise<VerificationDetailsReturn>;
158
- /**
159
- * @example
160
- * ```ts
161
- * const res = await sdk.submitVerificationDetails({
162
- * id: ObjectId.generate(ObjectType.Verification).toString(),
163
- * idFrontImage: data.idFrontImage,
164
- * selfieImage: data.selfieImage,
165
- * address: data.address,
166
- * sourceOfIncome: data.sourceOfIncome,
167
- * natureOfWork: data.natureOfWork,
168
- * placeOfBirth: data.placeOfBirth,
169
- * nationality: data.nationality,
170
- * });
171
- *
172
- * if (!res.ok) {
173
- * window.alert(res.error.message);
174
- * } else {
175
- * // Do something
176
- * }
177
- * ```
178
- */
179
41
  submitVerificationDetails(input: SubmitVerificationDetailsInput): Promise<SubmitVerificationDetailsReturn>;
180
- /**
181
- * @example
182
- * ```ts
183
- * const res = await sdk.submitVerificationDetails(verificationDetails.id, {
184
- * idFrontImage: data.idFrontImage,
185
- * selfieImage: data.selfieImage,
186
- * });
187
- *
188
- * if (!res.ok) {
189
- * window.alert(res.error.message);
190
- * } else {
191
- * // Do something
192
- * }
193
- * ```
194
- */
195
42
  updateVerificationDetails(id: string, input: UpdateVerificationDetailsInput): Promise<UpdateVerificationDetailsReturn>;
196
43
  resetPassword(input: ResetPasswordInput): Promise<ResetPasswordReturn>;
197
44
  verifyMobileNumber(verificationCode: string): Promise<VerifyMobileNumberReturn>;
@@ -200,43 +47,9 @@ export declare class Sdk {
200
47
  sendVerificationCode__next(mobileNumber: string): Promise<SendVerificationCodeReturn__Next>;
201
48
  wallet(): Promise<WalletReturn>;
202
49
  announcements(input?: AnnouncementsInput): Promise<AnnouncementsReturn>;
203
- /**
204
- * @example
205
- * ```ts
206
- * const res = await sdk.createWithdrawal({
207
- * id: ObjectId.generate(ObjectType.Withdrawal).toString(),
208
- * type: 'BANK',
209
- * amount: data.amount,
210
- * transactionPassword: data.transactionPassword,
211
- * });
212
- *
213
- * if (!res.ok) {
214
- * window.alert(res.error.message);
215
- * } else {
216
- * // Do something
217
- * }
218
- * ```
219
- */
220
50
  createWithdrawal(input: CreateWithdrawalInput): Promise<CreateWithdrawalReturn>;
221
51
  withdrawalRecords(input?: WithdrawalRecordsInput): Promise<WithdrawalRecordsReturn>;
222
52
  remainingDailyWithdrawalsCount(): Promise<RemainingDailyWithdrawalsCountReturn>;
223
- /**
224
- * @example
225
- * ```ts
226
- * const res = await sdk.createDeposit({
227
- * id: ObjectId.generate(ObjectType.Deposit).toString(),
228
- * type: 'GCASH',
229
- * amount: data.amount,
230
- * promo: data.promo,
231
- * });
232
- *
233
- * if (!res.ok) {
234
- * window.alert(res.error.message);
235
- * } else {
236
- * // Do something
237
- * }
238
- * ```
239
- */
240
53
  createDeposit(input: CreateDepositInput): Promise<CreateDepositReturn>;
241
54
  deposit(id: string): Promise<DepositReturn>;
242
55
  depositRecords(input?: DepositRecordsInput): Promise<DepositRecordsReturn>;
@@ -275,22 +88,6 @@ export declare class Sdk {
275
88
  /** @deprecated use `gameSession__next` */
276
89
  gameSession__legacy(id: string): Promise<GameSessionReturn>;
277
90
  gameSession__next(id: string): Promise<GameSessionReturn>;
278
- /**
279
- * @deprecated use `createGameSession__next`
280
- * @example
281
- * ```ts
282
- * const res = await sdk.createGameSession({
283
- * id: ObjectId.generate(ObjectType.GameSession).toString(),
284
- * game: game.id,
285
- * });
286
- *
287
- * if (!res.ok) {
288
- * window.alert(res.error.message);
289
- * } else {
290
- * // Do something
291
- * }
292
- * ```
293
- */
294
91
  createGameSession(input: CreateGameSessionInput): Promise<CreateGameSessionReturn>;
295
92
  /** @deprecated use `createGameSession__next` */
296
93
  createGameSession__legacy(input: CreateGameSessionInput): Promise<CreateGameSessionReturn>;
@@ -301,21 +98,6 @@ export declare class Sdk {
301
98
  endGameSession__legacy(id: string): Promise<EndGameSessionReturn__Legacy>;
302
99
  endGameSession__next(id: string): Promise<EndGameSessionReturn__Legacy>;
303
100
  file(id: string): Promise<FileReturn>;
304
- /**
305
- * @example
306
- * ```ts
307
- * const res = await sdk.uploadImageFile({
308
- * id: ObjectId.generate(ObjectType.File).toString(),
309
- * file: data.file,
310
- * });
311
- *
312
- * if (!res.ok) {
313
- * window.alert(res.error.message);
314
- * } else {
315
- * // Do something
316
- * }
317
- * ```
318
- */
319
101
  uploadImageFile(input: UploadImageFileInput): Promise<UploadImageFileReturn>;
320
102
  pointsWallet(): Promise<PointsWalletReturn>;
321
103
  pointsToCashConversion(amount: number): Promise<PointsToCashConversionReturn>;