@opexa/portal-sdk 0.59.17 → 0.59.18

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
@@ -1636,6 +1636,18 @@ var CLAIM_CASHBACK_BONUS_MUTATION = gql`
1636
1636
  }
1637
1637
  }
1638
1638
  `;
1639
+ var CLAIM_REBATE_MUTATION = gql`
1640
+ mutation ClaimRebate($input: ClaimRebateInput!) {
1641
+ claimRebate(input: $input) {
1642
+ ... on RebateDoesNotExistError {
1643
+ __typename
1644
+ }
1645
+ ... on RebateNotClaimableError {
1646
+ __typename
1647
+ }
1648
+ }
1649
+ }
1650
+ `;
1639
1651
  var MEMBER_QUERY = gql`
1640
1652
  query Member {
1641
1653
  member {
@@ -3486,6 +3498,8 @@ function createOperationError(code) {
3486
3498
  AccountNotFoundError: "Account does not exist",
3487
3499
  AccountNotVerifiedError: "Account is not verified",
3488
3500
  CashbackBonusDoesNotExistError: "Cashback bonus does not exists",
3501
+ RebateDoesNotExistError: "Rebate does not exist",
3502
+ RebateNotClaimableError: "This rebate cannot be claimed",
3489
3503
  DepositPromoMaximumAmountExceededError: "Deposit amount exceeds maximum amount for selected promo",
3490
3504
  DepositPromoMinimumAmountNotMetError: "Deposit amount does not meet minimum amount for selected promo",
3491
3505
  EmailAddressNotAvailableError: "Email is no longer available",
@@ -5144,6 +5158,24 @@ var WalletService = class {
5144
5158
  ok: true
5145
5159
  };
5146
5160
  }
5161
+ async claimRebate(variables) {
5162
+ const res = await this.client.request(CLAIM_REBATE_MUTATION, variables);
5163
+ if (!res.ok) {
5164
+ return {
5165
+ ok: res.ok,
5166
+ error: res.error
5167
+ };
5168
+ }
5169
+ if (res.data.claimRebate) {
5170
+ return {
5171
+ ok: false,
5172
+ error: createOperationError(res.data.claimRebate.__typename)
5173
+ };
5174
+ }
5175
+ return {
5176
+ ok: true
5177
+ };
5178
+ }
5147
5179
  async bonus() {
5148
5180
  const res = await this.client.request(BONUS_QUERY);
5149
5181
  return res.ok ? { ok: res.ok, data: res.data.bonus } : res;
@@ -10637,6 +10669,9 @@ var Sdk = class {
10637
10669
  async claimCashbackBonus(id) {
10638
10670
  return await this.walletService.claimCashbackBonus({ input: { id } });
10639
10671
  }
10672
+ async claimRebate(id) {
10673
+ return await this.walletService.claimRebate({ input: { id } });
10674
+ }
10640
10675
  async claimSpotBonus(code) {
10641
10676
  return await this.walletService.claimSpotBonus({ code });
10642
10677
  }