squarefi-bff-api-module 1.5.3 → 1.5.5
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/api/issuing.js +10 -0
- package/dist/api/types.d.ts +2 -2
- package/dist/utils/apiClientFactory.js +2 -2
- package/dist/utils/storage.js +1 -1
- package/package.json +1 -1
- package/src/api/issuing.ts +12 -1
- package/src/api/types.ts +2 -2
- package/src/utils/apiClientFactory.ts +2 -2
- package/src/utils/storage.ts +1 -1
package/dist/api/issuing.js
CHANGED
package/dist/api/types.d.ts
CHANGED
|
@@ -256,7 +256,7 @@ export declare namespace API {
|
|
|
256
256
|
wallet_uuid: string;
|
|
257
257
|
}
|
|
258
258
|
interface BySubaccountAndWalletUuid extends ByWalletUuid {
|
|
259
|
-
filter:
|
|
259
|
+
filter: Record<'fiat_account', Record<'type', SubAccountType>>;
|
|
260
260
|
}
|
|
261
261
|
type ByFiatAccountAndWalletId = ByWalletUuid & {
|
|
262
262
|
fiat_account_id: string;
|
|
@@ -353,7 +353,7 @@ export declare namespace API {
|
|
|
353
353
|
}
|
|
354
354
|
namespace Filtering {
|
|
355
355
|
interface Request<T> {
|
|
356
|
-
filter: Partial<Record<keyof T, any
|
|
356
|
+
filter: Partial<Record<keyof T, any>>;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
}
|
|
@@ -73,7 +73,7 @@ const createApiClient = ({ baseURL, isBearerToken, tenantId }) => {
|
|
|
73
73
|
const isRefreshAvailable = (!isTokenRefreshing && typeof refreshToken === 'string') || (0, sdk_react_1.isTMA)();
|
|
74
74
|
if (isLogoutNeccesary) {
|
|
75
75
|
if (typeof window !== 'undefined') {
|
|
76
|
-
|
|
76
|
+
window.location.href = '/logout';
|
|
77
77
|
(0, tokensFactory_1.deleteTokens)();
|
|
78
78
|
}
|
|
79
79
|
requestQueue = [];
|
|
@@ -89,7 +89,7 @@ const createApiClient = ({ baseURL, isBearerToken, tenantId }) => {
|
|
|
89
89
|
})
|
|
90
90
|
.catch((tokenRefreshError) => {
|
|
91
91
|
if (typeof window !== 'undefined') {
|
|
92
|
-
|
|
92
|
+
window.location.href = '/logout';
|
|
93
93
|
(0, tokensFactory_1.deleteTokens)();
|
|
94
94
|
}
|
|
95
95
|
requestQueue = [];
|
package/dist/utils/storage.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.deleteFromLocalStorage = exports.setToLocalStorage = exports.getFromLoca
|
|
|
4
4
|
const getFromLocalStorage = (key) => {
|
|
5
5
|
if (typeof window === 'undefined') {
|
|
6
6
|
// eslint-disable-next-line no-console
|
|
7
|
-
console.error('call getFromLocalStorage in server side');
|
|
7
|
+
// console.error('call getFromLocalStorage in server side');
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
return localStorage.getItem(key);
|
package/package.json
CHANGED
package/src/api/issuing.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { API } from './types';
|
|
|
2
2
|
|
|
3
3
|
import { apiClientV1 } from '../utils/apiClientFactory';
|
|
4
4
|
|
|
5
|
-
import { defaultPaginationParams } from '../constants';
|
|
5
|
+
import { defaultPaginationParams, SubAccountType } from '../constants';
|
|
6
6
|
|
|
7
7
|
export const issuing = {
|
|
8
8
|
cards: {
|
|
@@ -65,3 +65,14 @@ export const issuing = {
|
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
};
|
|
68
|
+
|
|
69
|
+
issuing.cards.byWalletUuid.getBySubaccountType({
|
|
70
|
+
wallet_uuid: '123',
|
|
71
|
+
limit: 10,
|
|
72
|
+
offset: 0,
|
|
73
|
+
filter: {
|
|
74
|
+
fiat_account: {
|
|
75
|
+
type: SubAccountType.BALANCE,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
});
|
package/src/api/types.ts
CHANGED
|
@@ -294,7 +294,7 @@ export namespace API {
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
export interface BySubaccountAndWalletUuid extends ByWalletUuid {
|
|
297
|
-
filter:
|
|
297
|
+
filter: Record<'fiat_account', Record<'type', SubAccountType>>;
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
export type ByFiatAccountAndWalletId = ByWalletUuid & {
|
|
@@ -407,7 +407,7 @@ export namespace API {
|
|
|
407
407
|
|
|
408
408
|
export namespace Filtering {
|
|
409
409
|
export interface Request<T> {
|
|
410
|
-
filter: Partial<Record<keyof T, any
|
|
410
|
+
filter: Partial<Record<keyof T, any>>;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
}
|
|
@@ -79,7 +79,7 @@ export const createApiClient = ({ baseURL, isBearerToken, tenantId }: CreateApiC
|
|
|
79
79
|
|
|
80
80
|
if (isLogoutNeccesary) {
|
|
81
81
|
if (typeof window !== 'undefined') {
|
|
82
|
-
|
|
82
|
+
window.location.href = '/logout';
|
|
83
83
|
deleteTokens();
|
|
84
84
|
}
|
|
85
85
|
requestQueue = [];
|
|
@@ -95,7 +95,7 @@ export const createApiClient = ({ baseURL, isBearerToken, tenantId }: CreateApiC
|
|
|
95
95
|
})
|
|
96
96
|
.catch((tokenRefreshError) => {
|
|
97
97
|
if (typeof window !== 'undefined') {
|
|
98
|
-
|
|
98
|
+
window.location.href = '/logout';
|
|
99
99
|
deleteTokens();
|
|
100
100
|
}
|
|
101
101
|
requestQueue = [];
|
package/src/utils/storage.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const getFromLocalStorage = (key: string) => {
|
|
2
2
|
if (typeof window === 'undefined') {
|
|
3
3
|
// eslint-disable-next-line no-console
|
|
4
|
-
console.error('call getFromLocalStorage in server side');
|
|
4
|
+
// console.error('call getFromLocalStorage in server side');
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
7
7
|
|