squarefi-bff-api-module 1.36.12 → 1.36.14
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/orders.d.ts +1 -0
- package/dist/api/orders.js +4 -1
- package/dist/api/types/autogen/apiV1Frontend.types.d.ts +30 -5
- package/dist/api/types/autogen/apiV1Tenant.types.d.ts +1 -9
- package/dist/api/types/types.d.ts +14 -1
- package/dist/utils/apiClientFactory.d.ts +5 -0
- package/dist/utils/apiClientFactory.js +6 -1
- package/package.json +1 -1
package/dist/api/orders.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const orders: {
|
|
|
17
17
|
WITHDRAW_CARD_SUBACCOUNT: (data: API.Orders.Create.ByOrderType.WITHDRAW_CARD_SUBACCOUNT.Request) => Promise<API.Orders.Create.ByOrderType.WITHDRAW_CARD_SUBACCOUNT.Response>;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
+
setComment: ({ order_id, ...data }: API.Orders.Comment.Request) => Promise<API.Orders.Comment.Response>;
|
|
20
21
|
v2: {
|
|
21
22
|
calc: ({ signal, ...params }: API.Orders.V2.Calc.Request) => Promise<API.Orders.V2.Calc.Response>;
|
|
22
23
|
orderTypes: {
|
package/dist/api/orders.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { apiClientV1 } from '../utils/apiClientFactory';
|
|
1
|
+
import { apiClientV1, apiClientV1Frontend } from '../utils/apiClientFactory';
|
|
2
2
|
import { OrderType } from '../constants';
|
|
3
3
|
export const orders = {
|
|
4
4
|
calc: ({ signal, ...params }) => apiClientV1.getRequest('/orders/calc', {
|
|
@@ -33,6 +33,9 @@ export const orders = {
|
|
|
33
33
|
[OrderType.WITHDRAW_CARD_SUBACCOUNT]: (data) => apiClientV1.postRequest('/orders/WITHDRAW_CARD_SUBACCOUNT', { data }),
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
|
+
setComment: ({ order_id, ...data }) => apiClientV1Frontend.putRequest(`/frontend/orders/${order_id}/comment`, {
|
|
37
|
+
data,
|
|
38
|
+
}),
|
|
36
39
|
v2: {
|
|
37
40
|
calc: ({ signal, ...params }) => apiClientV1.getRequest('/v2/orders/calc', {
|
|
38
41
|
params,
|
|
@@ -1312,10 +1312,7 @@ export interface paths {
|
|
|
1312
1312
|
/** Delete destination */
|
|
1313
1313
|
delete: {
|
|
1314
1314
|
parameters: {
|
|
1315
|
-
query
|
|
1316
|
-
/** @description OTP verification request ID */
|
|
1317
|
-
request_id: string;
|
|
1318
|
-
};
|
|
1315
|
+
query?: never;
|
|
1319
1316
|
header?: never;
|
|
1320
1317
|
path: {
|
|
1321
1318
|
id: string;
|
|
@@ -1340,7 +1337,7 @@ export interface paths {
|
|
|
1340
1337
|
};
|
|
1341
1338
|
};
|
|
1342
1339
|
};
|
|
1343
|
-
/** @description Access denied
|
|
1340
|
+
/** @description Access denied */
|
|
1344
1341
|
403: {
|
|
1345
1342
|
headers: {
|
|
1346
1343
|
[name: string]: unknown;
|
|
@@ -7695,6 +7692,13 @@ export interface paths {
|
|
|
7695
7692
|
};
|
|
7696
7693
|
content?: never;
|
|
7697
7694
|
};
|
|
7695
|
+
/** @description Operation already in progress — a concurrent accept/decline for this invite code is being processed */
|
|
7696
|
+
409: {
|
|
7697
|
+
headers: {
|
|
7698
|
+
[name: string]: unknown;
|
|
7699
|
+
};
|
|
7700
|
+
content?: never;
|
|
7701
|
+
};
|
|
7698
7702
|
};
|
|
7699
7703
|
};
|
|
7700
7704
|
delete?: never;
|
|
@@ -7777,6 +7781,13 @@ export interface paths {
|
|
|
7777
7781
|
};
|
|
7778
7782
|
content?: never;
|
|
7779
7783
|
};
|
|
7784
|
+
/** @description Operation already in progress — a concurrent accept/decline for this invite code is being processed */
|
|
7785
|
+
409: {
|
|
7786
|
+
headers: {
|
|
7787
|
+
[name: string]: unknown;
|
|
7788
|
+
};
|
|
7789
|
+
content?: never;
|
|
7790
|
+
};
|
|
7780
7791
|
};
|
|
7781
7792
|
};
|
|
7782
7793
|
delete?: never;
|
|
@@ -9875,6 +9886,13 @@ export interface paths {
|
|
|
9875
9886
|
};
|
|
9876
9887
|
content?: never;
|
|
9877
9888
|
};
|
|
9889
|
+
/** @description Operation already in progress — a concurrent invite for the same email is being processed */
|
|
9890
|
+
409: {
|
|
9891
|
+
headers: {
|
|
9892
|
+
[name: string]: unknown;
|
|
9893
|
+
};
|
|
9894
|
+
content?: never;
|
|
9895
|
+
};
|
|
9878
9896
|
};
|
|
9879
9897
|
};
|
|
9880
9898
|
delete?: never;
|
|
@@ -9992,6 +10010,13 @@ export interface paths {
|
|
|
9992
10010
|
};
|
|
9993
10011
|
content?: never;
|
|
9994
10012
|
};
|
|
10013
|
+
/** @description Operation already in progress — a concurrent cancel for this invite is being processed */
|
|
10014
|
+
409: {
|
|
10015
|
+
headers: {
|
|
10016
|
+
[name: string]: unknown;
|
|
10017
|
+
};
|
|
10018
|
+
content?: never;
|
|
10019
|
+
};
|
|
9995
10020
|
};
|
|
9996
10021
|
};
|
|
9997
10022
|
options?: never;
|
|
@@ -595,11 +595,6 @@ export interface paths {
|
|
|
595
595
|
requestBody: {
|
|
596
596
|
content: {
|
|
597
597
|
"application/json": {
|
|
598
|
-
/**
|
|
599
|
-
* Format: uuid
|
|
600
|
-
* @description OTP verification request ID
|
|
601
|
-
*/
|
|
602
|
-
request_id: string;
|
|
603
598
|
/** Format: uuid */
|
|
604
599
|
counterparty_account_id: string;
|
|
605
600
|
/** @enum {string} */
|
|
@@ -730,10 +725,7 @@ export interface paths {
|
|
|
730
725
|
/** Delete destination */
|
|
731
726
|
delete: {
|
|
732
727
|
parameters: {
|
|
733
|
-
query
|
|
734
|
-
/** @description OTP verification request ID */
|
|
735
|
-
request_id: string;
|
|
736
|
-
};
|
|
728
|
+
query?: never;
|
|
737
729
|
header?: never;
|
|
738
730
|
path: {
|
|
739
731
|
id: string;
|
|
@@ -449,8 +449,9 @@ export declare namespace API {
|
|
|
449
449
|
type Response = Detail.DestinationDetailItem;
|
|
450
450
|
}
|
|
451
451
|
namespace Delete {
|
|
452
|
-
type Request =
|
|
452
|
+
type Request = {
|
|
453
453
|
counterparty_destination_id: string;
|
|
454
|
+
request_id?: string;
|
|
454
455
|
wallet_id?: string;
|
|
455
456
|
counterparty_account_id?: string;
|
|
456
457
|
};
|
|
@@ -912,6 +913,17 @@ export declare namespace API {
|
|
|
912
913
|
}
|
|
913
914
|
}
|
|
914
915
|
namespace Orders {
|
|
916
|
+
namespace Comment {
|
|
917
|
+
type Request = {
|
|
918
|
+
order_id: string;
|
|
919
|
+
wallet_id: string;
|
|
920
|
+
comment?: string | null;
|
|
921
|
+
};
|
|
922
|
+
type Response = {
|
|
923
|
+
success: boolean;
|
|
924
|
+
data: API.Orders.V2.List.ByWallet.OrderItem;
|
|
925
|
+
};
|
|
926
|
+
}
|
|
915
927
|
namespace Create {
|
|
916
928
|
namespace ByOrderType {
|
|
917
929
|
namespace INTERNAL_TRANSFER {
|
|
@@ -1632,6 +1644,7 @@ export declare namespace API {
|
|
|
1632
1644
|
sub_account_id?: string | null;
|
|
1633
1645
|
meta: OrderMeta;
|
|
1634
1646
|
info?: string | null;
|
|
1647
|
+
comment?: string | null;
|
|
1635
1648
|
}
|
|
1636
1649
|
type Response = {
|
|
1637
1650
|
data: OrderItem[];
|
|
@@ -7,6 +7,7 @@ type CreateApiClientOptions = {
|
|
|
7
7
|
export declare const createApiClient: ({ baseURL, isBearerToken, tenantId }: CreateApiClientOptions) => {
|
|
8
8
|
patchRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
9
9
|
postRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
10
|
+
putRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
10
11
|
deleteRequest: (url: string, config?: AxiosRequestConfig) => Promise<any>;
|
|
11
12
|
getRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
12
13
|
};
|
|
@@ -30,6 +31,7 @@ export declare const createFetchApiClient: ({ baseURL, isBearerToken, tenantId }
|
|
|
30
31
|
export declare const apiClientV1: {
|
|
31
32
|
patchRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
32
33
|
postRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
34
|
+
putRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
33
35
|
deleteRequest: (url: string, config?: AxiosRequestConfig) => Promise<any>;
|
|
34
36
|
getRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
35
37
|
};
|
|
@@ -42,18 +44,21 @@ export declare const apiClientV1Native: {
|
|
|
42
44
|
export declare const apiClientV2: {
|
|
43
45
|
patchRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
44
46
|
postRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
47
|
+
putRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
45
48
|
deleteRequest: (url: string, config?: AxiosRequestConfig) => Promise<any>;
|
|
46
49
|
getRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
47
50
|
};
|
|
48
51
|
export declare const apiClientV1Frontend: {
|
|
49
52
|
patchRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
50
53
|
postRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
54
|
+
putRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
51
55
|
deleteRequest: (url: string, config?: AxiosRequestConfig) => Promise<any>;
|
|
52
56
|
getRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
53
57
|
};
|
|
54
58
|
export declare const apiClientTOTP: {
|
|
55
59
|
patchRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
56
60
|
postRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
61
|
+
putRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
57
62
|
deleteRequest: (url: string, config?: AxiosRequestConfig) => Promise<any>;
|
|
58
63
|
getRequest: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
59
64
|
};
|
|
@@ -110,6 +110,11 @@ export const createApiClient = ({ baseURL, isBearerToken, tenantId }) => {
|
|
|
110
110
|
const res = await instance.post(url, data, restConfig);
|
|
111
111
|
return res.data;
|
|
112
112
|
};
|
|
113
|
+
const putRequest = async (url, config) => {
|
|
114
|
+
const { data = {}, ...restConfig } = config ?? {};
|
|
115
|
+
const res = await instance.put(url, data, restConfig);
|
|
116
|
+
return res.data;
|
|
117
|
+
};
|
|
113
118
|
const deleteRequest = async (url, config) => {
|
|
114
119
|
const { data = {}, ...restConfig } = config ?? {};
|
|
115
120
|
const res = await instance.delete(url, { data, ...restConfig });
|
|
@@ -120,7 +125,7 @@ export const createApiClient = ({ baseURL, isBearerToken, tenantId }) => {
|
|
|
120
125
|
const res = await instance.get(url, { params, ...restConfig });
|
|
121
126
|
return res.data;
|
|
122
127
|
};
|
|
123
|
-
return { patchRequest, postRequest, deleteRequest, getRequest };
|
|
128
|
+
return { patchRequest, postRequest, putRequest, deleteRequest, getRequest };
|
|
124
129
|
};
|
|
125
130
|
/**
|
|
126
131
|
* Native fetch-based API client.
|