web3-banking-system-sdk 1.0.8 → 1.0.9

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.
@@ -1,12 +1,12 @@
1
1
  import { BaseService } from "./baseService";
2
- import type { ApiResponse } from "../../types/api/common";
3
2
  import type { GGEZGiftRewards, PromotionDetails, PromotionIncrementResult, PromotionServiceParameters, TwitterSpotlightPostIdsResult } from "../../types";
4
3
  declare class PromotionService extends BaseService {
5
4
  protected endpoint: string;
6
5
  constructor(data: PromotionServiceParameters);
7
6
  private onPromotionRequest;
8
- getPromotionByCode(promotionCode: string): Promise<ApiResponse<PromotionDetails>>;
9
- getTwitterSpotlightPostIds(): Promise<ApiResponse<TwitterSpotlightPostIdsResult>>;
10
- incrementPromotionParticipants(data: GGEZGiftRewards): Promise<ApiResponse<PromotionIncrementResult>>;
7
+ private onPromotionResponse;
8
+ getPromotionByCode(promotionCode: string): Promise<import("../..").ApiResponse<PromotionDetails>>;
9
+ getTwitterSpotlightPostIds(): Promise<import("../..").ApiResponse<TwitterSpotlightPostIdsResult>>;
10
+ incrementPromotionParticipants(data: GGEZGiftRewards): Promise<import("../..").ApiResponse<PromotionIncrementResult>>;
11
11
  }
12
12
  export { PromotionService };
@@ -5,12 +5,17 @@ class PromotionService extends BaseService {
5
5
  constructor(data) {
6
6
  super(data);
7
7
  this.axiosInstance.interceptors.request.use((req) => this.onPromotionRequest(req));
8
+ this.axiosInstance.interceptors.response.use((res) => this.onPromotionResponse(res));
8
9
  }
9
10
  // #region "Interceptors Handlers"
10
11
  async onPromotionRequest(req) {
11
12
  req.baseURL = this.context.getNodeUrl();
12
13
  return req;
13
14
  }
15
+ async onPromotionResponse(res) {
16
+ const data = res?.data?.data;
17
+ return { ...res, data };
18
+ }
14
19
  // #endregion
15
20
  // #region "GET"
16
21
  async getPromotionByCode(promotionCode) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web3-banking-system-sdk",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "TypeScript SDK used for interacting with the Web3 applications that uses Banking System API. ",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",