squarefi-bff-api-module 1.8.0 → 1.8.2
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/CHANGELOG.md +88 -163
- package/README.md +1 -1
- package/dist/api/issuing.js +16 -1
- package/package.json +1 -1
- package/src/api/issuing.ts +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,40 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [1.
|
|
8
|
+
## [1.8.1] - 2025-03-26
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Enhanced card retrieval with fiat account data integration
|
|
13
|
+
|
|
14
|
+
## [1.8.0] - 2025-03-26
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Corrected default logout URL path in apiClientFactory
|
|
19
|
+
|
|
20
|
+
## [1.7.1] - 2025-03-26
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- Location module integration in API index
|
|
25
|
+
|
|
26
|
+
## [1.7.0] - 2025-03-26
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- Enhanced API client with logout URL functionality
|
|
31
|
+
- Updated API documentation
|
|
32
|
+
|
|
33
|
+
## [1.6.0] - 2025-03-26
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- New counterparties module with full CRUD operations
|
|
38
|
+
- New location module with country information
|
|
39
|
+
- Updated API types structure
|
|
40
|
+
|
|
41
|
+
## [1.5.17] - 2025-03-25
|
|
9
42
|
|
|
10
43
|
### Added
|
|
11
44
|
|
|
@@ -33,254 +66,146 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
33
66
|
- Improved type safety in API responses
|
|
34
67
|
- Enhanced error handling in API requests
|
|
35
68
|
|
|
36
|
-
## [1.5.16] -
|
|
69
|
+
## [1.5.16] - 2025-03-25
|
|
37
70
|
|
|
38
71
|
### Changed
|
|
39
72
|
|
|
40
73
|
- Updated API types and interfaces
|
|
41
74
|
- Improved documentation
|
|
42
75
|
|
|
43
|
-
## [1.5.15] -
|
|
76
|
+
## [1.5.15] - 2025-03-25
|
|
44
77
|
|
|
45
78
|
### Added
|
|
46
79
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
80
|
+
- Type property to SubAccount in API types for enhanced flexibility
|
|
81
|
+
- Refactored fiat_account type in IssuingCardDetailItem
|
|
49
82
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- Updated API response types
|
|
53
|
-
- Improved error handling
|
|
54
|
-
|
|
55
|
-
## [1.5.14] - 2024-03-25
|
|
56
|
-
|
|
57
|
-
### Added
|
|
58
|
-
|
|
59
|
-
- New authentication methods
|
|
60
|
-
- Enhanced security features
|
|
83
|
+
## [1.5.14] - 2025-03-25
|
|
61
84
|
|
|
62
85
|
### Changed
|
|
63
86
|
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
## [1.5.13] - 2024-03-25
|
|
68
|
-
|
|
69
|
-
### Added
|
|
87
|
+
- Refactored fiat_account type in IssuingCardListItem
|
|
88
|
+
- Updated currency type in API types from Currencies.Currency to Currencies.FiatCurrency
|
|
70
89
|
|
|
71
|
-
|
|
72
|
-
- Enhanced type definitions
|
|
90
|
+
## [1.5.13] - 2025-03-25
|
|
73
91
|
|
|
74
92
|
### Changed
|
|
75
93
|
|
|
76
|
-
- Updated API
|
|
77
|
-
- Improved error handling
|
|
94
|
+
- Updated currency type in API types for improved clarity and specificity
|
|
78
95
|
|
|
79
|
-
## [1.5.12] -
|
|
80
|
-
|
|
81
|
-
### Added
|
|
82
|
-
|
|
83
|
-
- New API endpoints support
|
|
84
|
-
- Enhanced type definitions
|
|
96
|
+
## [1.5.12] - 2025-03-25
|
|
85
97
|
|
|
86
98
|
### Changed
|
|
87
99
|
|
|
88
|
-
- Updated API
|
|
89
|
-
- Improved error handling
|
|
100
|
+
- Updated currency type in API types for improved clarity
|
|
90
101
|
|
|
91
|
-
## [1.5.11] -
|
|
102
|
+
## [1.5.11] - 2025-03-25
|
|
92
103
|
|
|
93
104
|
### Added
|
|
94
105
|
|
|
95
|
-
-
|
|
96
|
-
- Enhanced type definitions
|
|
97
|
-
|
|
98
|
-
### Changed
|
|
99
|
-
|
|
100
|
-
- Updated API response types
|
|
101
|
-
- Improved error handling
|
|
102
|
-
|
|
103
|
-
## [1.5.10] - 2024-03-25
|
|
106
|
+
- Optional security_code property to CardSensitiveData interface
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
- New API endpoints support
|
|
108
|
-
- Enhanced type definitions
|
|
108
|
+
## [1.5.10] - 2025-03-25
|
|
109
109
|
|
|
110
110
|
### Changed
|
|
111
111
|
|
|
112
|
-
-
|
|
113
|
-
-
|
|
112
|
+
- Refactored StandAloneRequest type to simplify structure
|
|
113
|
+
- Removed unnecessary properties while maintaining compatibility
|
|
114
114
|
|
|
115
|
-
## [1.5.9] -
|
|
115
|
+
## [1.5.9] - 2025-03-25
|
|
116
116
|
|
|
117
117
|
### Added
|
|
118
118
|
|
|
119
|
-
-
|
|
120
|
-
- Enhanced type
|
|
121
|
-
|
|
122
|
-
### Changed
|
|
123
|
-
|
|
124
|
-
- Updated API response types
|
|
125
|
-
- Improved error handling
|
|
119
|
+
- CommonRequest interface for shared properties
|
|
120
|
+
- Enhanced API type structure
|
|
126
121
|
|
|
127
|
-
## [1.5.8] -
|
|
122
|
+
## [1.5.8] - 2025-03-25
|
|
128
123
|
|
|
129
124
|
### Added
|
|
130
125
|
|
|
131
|
-
-
|
|
132
|
-
- Enhanced type definitions
|
|
133
|
-
|
|
134
|
-
### Changed
|
|
135
|
-
|
|
136
|
-
- Updated API response types
|
|
137
|
-
- Improved error handling
|
|
126
|
+
- Card issuing and fee properties to API types
|
|
138
127
|
|
|
139
|
-
## [1.5.7] -
|
|
140
|
-
|
|
141
|
-
### Added
|
|
142
|
-
|
|
143
|
-
- New API endpoints
|
|
144
|
-
- Enhanced type definitions
|
|
128
|
+
## [1.5.7] - 2025-03-25
|
|
145
129
|
|
|
146
130
|
### Changed
|
|
147
131
|
|
|
148
|
-
- Updated
|
|
149
|
-
-
|
|
150
|
-
|
|
151
|
-
## [1.5.6] - 2024-03-25
|
|
152
|
-
|
|
153
|
-
### Added
|
|
132
|
+
- Updated package dependencies to use caret versioning
|
|
133
|
+
- Made filter properties optional in API types
|
|
154
134
|
|
|
155
|
-
|
|
156
|
-
- Enhanced type definitions
|
|
135
|
+
## [1.5.6] - 2025-03-25
|
|
157
136
|
|
|
158
137
|
### Changed
|
|
159
138
|
|
|
160
|
-
- Updated API
|
|
161
|
-
- Improved error handling
|
|
139
|
+
- Updated API list filtering from array to object
|
|
162
140
|
|
|
163
|
-
## [1.5.5] -
|
|
164
|
-
|
|
165
|
-
### Added
|
|
166
|
-
|
|
167
|
-
- New API endpoints
|
|
168
|
-
- Enhanced type definitions
|
|
141
|
+
## [1.5.5] - 2025-03-25
|
|
169
142
|
|
|
170
143
|
### Changed
|
|
171
144
|
|
|
172
|
-
-
|
|
173
|
-
- Improved error handling
|
|
174
|
-
|
|
175
|
-
## [1.5.4] - 2024-03-25
|
|
176
|
-
|
|
177
|
-
### Added
|
|
145
|
+
- Refactored logout handling to use window.location.href for redirection
|
|
178
146
|
|
|
179
|
-
|
|
180
|
-
- Enhanced type definitions
|
|
147
|
+
## [1.5.4] - 2025-03-25
|
|
181
148
|
|
|
182
149
|
### Changed
|
|
183
150
|
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
|
|
187
|
-
## [1.5.3] - 2024-03-25
|
|
151
|
+
- Refactored authentication API types
|
|
152
|
+
- Replaced SupabaseGetSessionResponse with Tokens for sign-in and sign-up methods
|
|
188
153
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
- New API endpoints
|
|
192
|
-
- Enhanced type definitions
|
|
154
|
+
## [1.5.3] - 2025-03-25
|
|
193
155
|
|
|
194
156
|
### Changed
|
|
195
157
|
|
|
196
|
-
- Updated API
|
|
197
|
-
- Improved error handling
|
|
158
|
+
- Updated authentication API endpoints to include '/email' suffix
|
|
198
159
|
|
|
199
|
-
## [1.5.2] -
|
|
160
|
+
## [1.5.2] - 2025-03-25
|
|
200
161
|
|
|
201
162
|
### Added
|
|
202
163
|
|
|
203
|
-
- New
|
|
204
|
-
-
|
|
164
|
+
- New SortingDirection enum
|
|
165
|
+
- Updated types for issuing card details and limits
|
|
205
166
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
- Updated API response types
|
|
209
|
-
- Improved error handling
|
|
210
|
-
|
|
211
|
-
## [1.5.1] - 2024-03-25
|
|
212
|
-
|
|
213
|
-
### Added
|
|
214
|
-
|
|
215
|
-
- New API endpoints
|
|
216
|
-
- Enhanced type definitions
|
|
167
|
+
## [1.5.1] - 2025-03-25
|
|
217
168
|
|
|
218
169
|
### Changed
|
|
219
170
|
|
|
220
|
-
-
|
|
221
|
-
-
|
|
171
|
+
- Enhanced API types and wallet transactions structure
|
|
172
|
+
- Added DetailedTransaction interface
|
|
173
|
+
- Refactored transaction retrieval methods
|
|
222
174
|
|
|
223
|
-
## [1.5.0] -
|
|
224
|
-
|
|
225
|
-
### Added
|
|
226
|
-
|
|
227
|
-
- New API endpoints support
|
|
228
|
-
- Enhanced type definitions
|
|
175
|
+
## [1.5.0] - 2025-03-25
|
|
229
176
|
|
|
230
177
|
### Changed
|
|
231
178
|
|
|
232
|
-
- Updated API
|
|
233
|
-
-
|
|
234
|
-
|
|
235
|
-
## [1.4.0] - 2024-03-25
|
|
236
|
-
|
|
237
|
-
### Added
|
|
179
|
+
- Updated README and API exports
|
|
180
|
+
- Enhanced documentation with installation, usage examples, and security practices
|
|
238
181
|
|
|
239
|
-
|
|
240
|
-
- Enhanced type definitions
|
|
182
|
+
## [1.4.0] - 2025-03-25
|
|
241
183
|
|
|
242
184
|
### Changed
|
|
243
185
|
|
|
244
|
-
-
|
|
245
|
-
- Improved error handling
|
|
186
|
+
- Removed react-icons dependency
|
|
246
187
|
|
|
247
|
-
## [1.3.0] -
|
|
188
|
+
## [1.3.0] - 2025-03-25
|
|
248
189
|
|
|
249
190
|
### Added
|
|
250
191
|
|
|
251
|
-
-
|
|
252
|
-
- Enhanced type definitions
|
|
253
|
-
|
|
254
|
-
### Changed
|
|
255
|
-
|
|
256
|
-
- Updated API response types
|
|
257
|
-
- Improved error handling
|
|
258
|
-
|
|
259
|
-
## [1.2.0] - 2024-03-25
|
|
192
|
+
- Tenants module to API
|
|
260
193
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
- New API endpoints support
|
|
264
|
-
- Enhanced type definitions
|
|
194
|
+
## [1.2.0] - 2025-03-25
|
|
265
195
|
|
|
266
196
|
### Changed
|
|
267
197
|
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
|
|
271
|
-
## [1.1.0] - 2024-03-25
|
|
272
|
-
|
|
273
|
-
### Added
|
|
198
|
+
- Refactored API request methods
|
|
199
|
+
- Removed unnecessary promise chaining in exchange, issuing, list, orders, and wallets modules
|
|
274
200
|
|
|
275
|
-
|
|
276
|
-
- Enhanced type definitions
|
|
201
|
+
## [1.1.0] - 2025-03-25
|
|
277
202
|
|
|
278
203
|
### Changed
|
|
279
204
|
|
|
280
|
-
-
|
|
281
|
-
-
|
|
205
|
+
- Exported squarefiBffApiClient as a named export
|
|
206
|
+
- Refactored API client imports to use centralized apiClientFactory
|
|
282
207
|
|
|
283
|
-
## [1.0.2] -
|
|
208
|
+
## [1.0.2] - 2025-03-25
|
|
284
209
|
|
|
285
210
|
### Added
|
|
286
211
|
|
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ Access different API functionalities through the client:
|
|
|
112
112
|
| API_URL | Base URL for the Squarefi BFF API | Yes | `https://api-v1.url` |
|
|
113
113
|
| API_V2_URL | Base URL for the Squarefi BFF API | Yes | `https://api-v2.url` |
|
|
114
114
|
| TENANT_ID | Your tenant identifier | Yes | `tenant_12345` |
|
|
115
|
-
| LOGOUT_URL | Your logout route
|
|
115
|
+
| LOGOUT_URL | Your frontend-app logout route | No | '/auth/logout' |
|
|
116
116
|
|
|
117
117
|
## 🚀 Features
|
|
118
118
|
|
package/dist/api/issuing.js
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.issuing = void 0;
|
|
4
13
|
const apiClientFactory_1 = require("../utils/apiClientFactory");
|
|
5
14
|
const constants_1 = require("../constants");
|
|
15
|
+
const fiat_accounts_1 = require("./fiat_accounts");
|
|
6
16
|
exports.issuing = {
|
|
7
17
|
cards: {
|
|
8
18
|
create: {
|
|
@@ -16,7 +26,12 @@ exports.issuing = {
|
|
|
16
26
|
}),
|
|
17
27
|
getByFiatAccount: (params) => apiClientFactory_1.apiClientV1.getRequest('/issuing/cards', { params }),
|
|
18
28
|
},
|
|
19
|
-
getById: (card_id) =>
|
|
29
|
+
// getById: (card_id: string) => apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`),
|
|
30
|
+
getById: (card_id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
const card = yield apiClientFactory_1.apiClientV1.getRequest(`/issuing/cards/${card_id}`);
|
|
32
|
+
const fiatAccountData = yield fiat_accounts_1.fiat_accounts.getByUuid(card.fiat_account.id);
|
|
33
|
+
return Object.assign(Object.assign({}, card), { fiat_account: Object.assign(Object.assign({}, fiatAccountData), { type: card.fiat_account.type }) });
|
|
34
|
+
}),
|
|
20
35
|
sensitiveData: {
|
|
21
36
|
get: (card_id) => apiClientFactory_1.apiClientV1.getRequest(`/issuing/cards/${card_id}/sensitive`),
|
|
22
37
|
otp: {
|
package/package.json
CHANGED
package/src/api/issuing.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { API } from './types';
|
|
|
3
3
|
import { apiClientV1 } from '../utils/apiClientFactory';
|
|
4
4
|
|
|
5
5
|
import { defaultPaginationParams, SubAccountType } from '../constants';
|
|
6
|
+
import { fiat_accounts } from './fiat_accounts';
|
|
6
7
|
|
|
7
8
|
export const issuing = {
|
|
8
9
|
cards: {
|
|
@@ -22,7 +23,12 @@ export const issuing = {
|
|
|
22
23
|
getByFiatAccount: (params: API.Cards.CardsList.Request.ByFiatAccountAndWalletId) =>
|
|
23
24
|
apiClientV1.getRequest<API.Cards.CardsList.Response>('/issuing/cards', { params }),
|
|
24
25
|
},
|
|
25
|
-
getById: (card_id: string) => apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`),
|
|
26
|
+
// getById: (card_id: string) => apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`),
|
|
27
|
+
getById: async (card_id: string): Promise<API.Cards.IssuingCardDetailItem> => {
|
|
28
|
+
const card = await apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`);
|
|
29
|
+
const fiatAccountData = await fiat_accounts.getByUuid(card.fiat_account.id);
|
|
30
|
+
return { ...card, fiat_account: { ...fiatAccountData, type: card.fiat_account.type } };
|
|
31
|
+
},
|
|
26
32
|
sensitiveData: {
|
|
27
33
|
get: (card_id: string) => apiClientV1.getRequest<API.Cards.SensitiveData>(`/issuing/cards/${card_id}/sensitive`),
|
|
28
34
|
otp: {
|