squarefi-bff-api-module 1.14.0 → 1.16.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.
@@ -32,6 +32,10 @@ export declare const issuing: {
32
32
  transactions: {
33
33
  getByCardId: (card_id: string, limit?: number, offset?: number) => Promise<API.Cards.TransactionsList>;
34
34
  getByFiatAccountId: (fiat_account_id: string, limit?: number, offset?: number) => Promise<API.Cards.TransactionsList>;
35
+ csv: {
36
+ getByCardId: (card_id: string) => Promise<string>;
37
+ getByFiatAccountId: (fiat_account_id: string) => Promise<string>;
38
+ };
35
39
  };
36
40
  config: {
37
41
  programs: {
@@ -75,6 +75,14 @@ exports.issuing = {
75
75
  getByFiatAccountId: (fiat_account_id, limit = constants_1.defaultPaginationParams.limit, offset = constants_1.defaultPaginationParams.offset) => apiClientFactory_1.apiClientV1.getRequest(`/issuing/transactions/`, {
76
76
  params: { limit, offset, fiat_account_id, new_scheme: true },
77
77
  }),
78
+ csv: {
79
+ getByCardId: (card_id) => apiClientFactory_1.apiClientV1.getRequest(`/issuing/transactions/csv`, {
80
+ params: { card_id },
81
+ }),
82
+ getByFiatAccountId: (fiat_account_id) => apiClientFactory_1.apiClientV1.getRequest(`/issuing/transactions/csv`, {
83
+ params: { fiat_account_id },
84
+ }),
85
+ },
78
86
  },
79
87
  config: {
80
88
  programs: {
@@ -17,5 +17,8 @@ export declare const wallets: {
17
17
  getAll: ({ wallet_uuid, limit, offset, ...params }: API.Wallets.WalletTransactions.TransactionList.Request) => Promise<API.Wallets.WalletTransactions.TransactionList.Response>;
18
18
  getByUuid: ({ wallet_uuid, uuid }: API.Wallets.WalletTransactions.GetByUuid.Request) => Promise<API.Wallets.WalletTransactions.DetailedTransaction>;
19
19
  };
20
+ csv: {
21
+ getByWalletUuid: (wallet_uuid: string) => Promise<string>;
22
+ };
20
23
  };
21
24
  };
@@ -47,5 +47,8 @@ exports.wallets = {
47
47
  }),
48
48
  getByUuid: ({ wallet_uuid, uuid }) => apiClientFactory_1.apiClientV2.getRequest(`/wallets/${wallet_uuid}/transactions/${uuid}`),
49
49
  },
50
+ csv: {
51
+ getByWalletUuid: (wallet_uuid) => apiClientFactory_1.apiClientV1.getRequest(`/wallets/transactions/${wallet_uuid}/csv`),
52
+ },
50
53
  },
51
54
  };
@@ -54,7 +54,7 @@ const createApiClient = ({ baseURL, isBearerToken, tenantId }) => {
54
54
  let isTokenRefreshing = false;
55
55
  let requestQueue = [];
56
56
  instance.interceptors.response.use((response) => response, (error) => {
57
- var _a, _b, _c, _d;
57
+ var _a, _b;
58
58
  if (typeof window === 'undefined') {
59
59
  return Promise.reject(error);
60
60
  }
@@ -63,14 +63,8 @@ const createApiClient = ({ baseURL, isBearerToken, tenantId }) => {
63
63
  const refreshToken = (0, storage_1.getFromLocalStorage)('refresh_token');
64
64
  const isRetryRequest = failedRequest.headers['X-Retry-Request'];
65
65
  const isRefreshTokenRequest = (_b = response === null || response === void 0 ? void 0 : response.config) === null || _b === void 0 ? void 0 : _b.url.includes(auth_1.refreshTokenPath);
66
- const isTelegramSignInRequest = (_c = response === null || response === void 0 ? void 0 : response.config) === null || _c === void 0 ? void 0 : _c.url.includes(auth_1.telegramSignInPath);
67
- const isTelegramSignUpRequest = (_d = response === null || response === void 0 ? void 0 : response.config) === null || _d === void 0 ? void 0 : _d.url.includes(auth_1.telegramSignUpPath);
68
- const isRefreshNotRequired = !refreshToken && !(0, sdk_react_1.isTMA)();
69
- const isLogoutNeccesary = isRefreshNotRequired ||
70
- isTelegramSignInRequest ||
71
- isTelegramSignUpRequest ||
72
- isRefreshTokenRequest ||
73
- isRetryRequest;
66
+ const isRefreshNotRequired = !refreshToken;
67
+ const isLogoutNeccesary = isRefreshNotRequired || isRefreshTokenRequest || isRetryRequest;
74
68
  const isRefreshAvailable = (!isTokenRefreshing && typeof refreshToken === 'string') || (0, sdk_react_1.isTMA)();
75
69
  if (isLogoutNeccesary) {
76
70
  if (typeof window !== 'undefined') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.14.0",
3
+ "version": "1.16.0",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -83,6 +83,16 @@ export const issuing = {
83
83
  apiClientV1.getRequest<API.Cards.TransactionsList>(`/issuing/transactions/`, {
84
84
  params: { limit, offset, fiat_account_id, new_scheme: true },
85
85
  }),
86
+ csv: {
87
+ getByCardId: (card_id: string) =>
88
+ apiClientV1.getRequest<string>(`/issuing/transactions/csv`, {
89
+ params: { card_id },
90
+ }),
91
+ getByFiatAccountId: (fiat_account_id: string) =>
92
+ apiClientV1.getRequest<string>(`/issuing/transactions/csv`, {
93
+ params: { fiat_account_id },
94
+ }),
95
+ },
86
96
  },
87
97
  config: {
88
98
  programs: {
@@ -1,6 +1,6 @@
1
1
  import { API } from './types';
2
2
 
3
- import { apiClientV2 } from '../utils/apiClientFactory';
3
+ import { apiClientV1, apiClientV2 } from '../utils/apiClientFactory';
4
4
 
5
5
  import { defaultPaginationParams, WalletTypeValues } from '../constants';
6
6
 
@@ -39,5 +39,9 @@ export const wallets = {
39
39
  `/wallets/${wallet_uuid}/transactions/${uuid}`
40
40
  ),
41
41
  },
42
+ csv: {
43
+ getByWalletUuid: (wallet_uuid: string) =>
44
+ apiClientV1.getRequest<string>(`/wallets/transactions/${wallet_uuid}/csv`),
45
+ },
42
46
  },
43
47
  };
@@ -66,15 +66,8 @@ export const createApiClient = ({ baseURL, isBearerToken, tenantId }: CreateApiC
66
66
  const isRetryRequest = failedRequest.headers['X-Retry-Request'];
67
67
 
68
68
  const isRefreshTokenRequest = response?.config?.url.includes(refreshTokenPath);
69
- const isTelegramSignInRequest = response?.config?.url.includes(telegramSignInPath);
70
- const isTelegramSignUpRequest = response?.config?.url.includes(telegramSignUpPath);
71
- const isRefreshNotRequired = !refreshToken && !isTMA();
72
- const isLogoutNeccesary =
73
- isRefreshNotRequired ||
74
- isTelegramSignInRequest ||
75
- isTelegramSignUpRequest ||
76
- isRefreshTokenRequest ||
77
- isRetryRequest;
69
+ const isRefreshNotRequired = !refreshToken;
70
+ const isLogoutNeccesary = isRefreshNotRequired || isRefreshTokenRequest || isRetryRequest;
78
71
 
79
72
  const isRefreshAvailable = (!isTokenRefreshing && typeof refreshToken === 'string') || isTMA();
80
73