@opexa/portal-sdk 0.4.1 → 0.6.0

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/index.cjs CHANGED
@@ -358,6 +358,9 @@ var CREATE_GCASH_WITHDRAWAL_MUTATION = gql`
358
358
  ... on WalletDoesNotExistError {
359
359
  __typename
360
360
  }
361
+ ... on TransactionPasswordNotSetError {
362
+ __typename
363
+ }
361
364
  }
362
365
  }
363
366
  `;
@@ -406,6 +409,9 @@ var CREATE_MAYA_APP_WITHDRAWAL_MUTATION = gql`
406
409
  ... on WalletDoesNotExistError {
407
410
  __typename
408
411
  }
412
+ ... on TransactionPasswordNotSetError {
413
+ __typename
414
+ }
409
415
  }
410
416
  }
411
417
  `;
@@ -439,6 +445,9 @@ var CREATE_AIO_INSTAPAY_WITHDRAWAL_MUTATION = gql`
439
445
  ... on WalletDoesNotExistError {
440
446
  __typename
441
447
  }
448
+ ... on TransactionPasswordNotSetError {
449
+ __typename
450
+ }
442
451
  }
443
452
  }
444
453
  `;
@@ -727,6 +736,9 @@ var CREATE_MANUAL_UPI_DEPOSIT_MUTATION = gql`
727
736
  ... on WalletDoesNotExistError {
728
737
  __typename
729
738
  }
739
+ ... on UPIReferenceNotAvailableError {
740
+ __typename
741
+ }
730
742
  }
731
743
  }
732
744
  `;
@@ -1994,12 +2006,10 @@ var UNMARK_GAME_AS_FAVORITE = gql`
1994
2006
  }
1995
2007
  `;
1996
2008
  var FAVORITE_GAMES_QUERY = gql`
1997
- query favoriteGames {
1998
- id
1999
- name
2000
- type
2001
- provider
2002
- favorite
2009
+ query FavoriteGames {
2010
+ favoriteGames {
2011
+ id
2012
+ }
2003
2013
  }
2004
2014
  `;
2005
2015
 
@@ -2060,7 +2070,9 @@ function createOperationError(code) {
2060
2070
  RateLimitExceededError: "Maximum number of requests reached",
2061
2071
  RewardAlreadyClaimedError: "Reward is already claimed",
2062
2072
  ReCAPTCHAVerificationFailedError: "Invalid reCAPTCHA",
2063
- AccountSuspendedError: "Account is suspended"
2073
+ AccountSuspendedError: "Account is suspended",
2074
+ TransactionPasswordNotSetError: "Transaction password is not set",
2075
+ UPIReferenceNotAvailableError: "UPI reference is no longer available"
2064
2076
  };
2065
2077
  return {
2066
2078
  name: code,
@@ -5367,6 +5379,9 @@ var Sdk = class {
5367
5379
  });
5368
5380
  }
5369
5381
  async signIn(input) {
5382
+ if (input.type === "TOKEN") {
5383
+ console.warn("'TOKEN (signIn)' is deprecated. Please use 'SOCIALS' instead.");
5384
+ }
5370
5385
  switch (input.type) {
5371
5386
  case "NAME_AND_PASSWORD": {
5372
5387
  const res = await this.sessionManager.create({
@@ -5496,6 +5511,7 @@ var Sdk = class {
5496
5511
  /**/
5497
5512
  /** @deprecated */
5498
5513
  async platform() {
5514
+ console.warn("'platform' is deprecated. Please use 'platform__next' instead.");
5499
5515
  const res = await this.accountService.platform();
5500
5516
  if (!res.ok) return res;
5501
5517
  return {
@@ -5536,6 +5552,7 @@ var Sdk = class {
5536
5552
  * @deprecated use `createAccount__next`
5537
5553
  */
5538
5554
  async createAccount(input) {
5555
+ console.warn("'createAccount' is deprecated. Please use 'createAccount__next' instead.");
5539
5556
  const id = input.id ?? objectId.ObjectId.generate(ObjectType.Account).toString();
5540
5557
  const res = await this.accountService.registerMemberAccount({
5541
5558
  input: {
@@ -5689,6 +5706,9 @@ var Sdk = class {
5689
5706
  * @deprecated use `sendVerificationCode__next`
5690
5707
  */
5691
5708
  async sendVerificationCode(mobileNumber) {
5709
+ console.warn(
5710
+ "'sendVerificationCode' is deprecated. Please use 'sendVerificationCode__next' instead."
5711
+ );
5692
5712
  return await this.accountService.sendVerificationCode({
5693
5713
  input: {
5694
5714
  channel: "SMS",
@@ -6142,6 +6162,7 @@ var Sdk = class {
6142
6162
  }
6143
6163
  /** @deprecated */
6144
6164
  async bonus() {
6165
+ console.warn("'bonus' is deprecated. Please use 'bonuses' instead.");
6145
6166
  const res = await this.walletService.bonus();
6146
6167
  if (!res.ok) return res;
6147
6168
  return {
@@ -6149,6 +6170,14 @@ var Sdk = class {
6149
6170
  data: res.data ? this.transformer.transform.bonus(res.data) : null
6150
6171
  };
6151
6172
  }
6173
+ async bonuses() {
6174
+ const res = await this.walletService.bonuses();
6175
+ if (!res.ok) return res;
6176
+ return {
6177
+ ok: true,
6178
+ data: res.data.map(this.transformer.transform.bonus)
6179
+ };
6180
+ }
6152
6181
  async cashbackBonuses() {
6153
6182
  const res = await this.walletService.cashbackBonuses();
6154
6183
  if (!res.ok) return res;
@@ -6184,7 +6213,9 @@ var Sdk = class {
6184
6213
  data: res.data ? this.transformer.transform.game(res.data) : null
6185
6214
  };
6186
6215
  }
6216
+ /** @deprecated */
6187
6217
  async games(input) {
6218
+ console.warn("'games' is deprecated. Please use 'games__next' instead.");
6188
6219
  const res = await this.cmsPortalService.games(input);
6189
6220
  if (!res.ok) return res;
6190
6221
  return {
@@ -6329,7 +6360,29 @@ var Sdk = class {
6329
6360
  return await this.walletService.unmarkGameAsFavorite({ input });
6330
6361
  }
6331
6362
  async favoriteGames() {
6332
- return await this.walletService.favoriteGames();
6363
+ const res0 = await this.walletService.favoriteGames();
6364
+ const ids = res0.data?.length ? [...new Set(res0.data.map((e) => e.id))] : [];
6365
+ if (ids.length <= 0) {
6366
+ return {
6367
+ ok: true,
6368
+ data: []
6369
+ };
6370
+ }
6371
+ const res1 = await this.cmsPortalService.games({
6372
+ filter: {
6373
+ reference: {
6374
+ in: ids
6375
+ }
6376
+ }
6377
+ });
6378
+ if (!res1.ok) return res1;
6379
+ return {
6380
+ ok: true,
6381
+ data: res0.data?.map(({ id }) => {
6382
+ const game = res1.data.edges.find((e) => id === e.node.reference)?.node;
6383
+ return game ? this.transformer.transform.game(game) : null;
6384
+ }).filter(Boolean) ?? []
6385
+ };
6333
6386
  }
6334
6387
  /**/
6335
6388
  /*+----------------------------------------+*/
@@ -6508,14 +6561,6 @@ var Sdk = class {
6508
6561
  async claimReward(id) {
6509
6562
  return await this.triggerService.claimReward({ id });
6510
6563
  }
6511
- async bonuses() {
6512
- const res = await this.walletService.bonuses();
6513
- if (!res.ok) return res;
6514
- return {
6515
- ok: true,
6516
- data: res.data.map(this.transformer.transform.bonus)
6517
- };
6518
- }
6519
6564
  /**/
6520
6565
  /*+----------------------------------------+*/
6521
6566
  /*+ ONBOARDING +*/