@opexa/portal-sdk 0.0.72 → 0.0.73

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
@@ -28,170 +28,21 @@ export declare class Sdk {
28
28
  * @deprecated use `sendVerificationCode__next`
29
29
  */
30
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
31
  authenticate(input: AuthenticateInput): Promise<AuthenticateReturn>;
65
32
  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
33
  watchSession(input: WatchSessionInput): () => void;
91
34
  session(): Promise<SessionReturn>;
92
35
  validateMayaSession(): Promise<ValidateMayaSessionReturn>;
93
36
  site(): Promise<SiteReturn>;
94
37
  platform(): Promise<PlatformReturn>;
95
38
  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
39
  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
40
  createAccount__next(input: CreateAccountInput__Next): Promise<CreateAccountReturn>;
139
41
  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
42
  updateAccount(id: string, input: UpdateAccountInput): Promise<UpdateAccountReturn>;
156
43
  deleteAccount(id: string): Promise<DeleteAccountReturn>;
157
44
  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
45
  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
46
  updateVerificationDetails(id: string, input: UpdateVerificationDetailsInput): Promise<UpdateVerificationDetailsReturn>;
196
47
  resetPassword(input: ResetPasswordInput): Promise<ResetPasswordReturn>;
197
48
  verifyMobileNumber(verificationCode: string): Promise<VerifyMobileNumberReturn>;
@@ -200,43 +51,9 @@ export declare class Sdk {
200
51
  sendVerificationCode__next(mobileNumber: string): Promise<SendVerificationCodeReturn__Next>;
201
52
  wallet(): Promise<WalletReturn>;
202
53
  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
54
  createWithdrawal(input: CreateWithdrawalInput): Promise<CreateWithdrawalReturn>;
221
55
  withdrawalRecords(input?: WithdrawalRecordsInput): Promise<WithdrawalRecordsReturn>;
222
56
  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
57
  createDeposit(input: CreateDepositInput): Promise<CreateDepositReturn>;
241
58
  deposit(id: string): Promise<DepositReturn>;
242
59
  depositRecords(input?: DepositRecordsInput): Promise<DepositRecordsReturn>;
@@ -275,22 +92,6 @@ export declare class Sdk {
275
92
  /** @deprecated use `gameSession__next` */
276
93
  gameSession__legacy(id: string): Promise<GameSessionReturn>;
277
94
  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
95
  createGameSession(input: CreateGameSessionInput): Promise<CreateGameSessionReturn>;
295
96
  /** @deprecated use `createGameSession__next` */
296
97
  createGameSession__legacy(input: CreateGameSessionInput): Promise<CreateGameSessionReturn>;
@@ -301,21 +102,6 @@ export declare class Sdk {
301
102
  endGameSession__legacy(id: string): Promise<EndGameSessionReturn__Legacy>;
302
103
  endGameSession__next(id: string): Promise<EndGameSessionReturn__Legacy>;
303
104
  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
105
  uploadImageFile(input: UploadImageFileInput): Promise<UploadImageFileReturn>;
320
106
  pointsWallet(): Promise<PointsWalletReturn>;
321
107
  pointsToCashConversion(amount: number): Promise<PointsToCashConversionReturn>;