squarefi-bff-api-module 1.31.4 → 1.31.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/index.d.ts +2 -0
- package/dist/api/index.js +2 -0
- package/dist/api/storage.d.ts +8 -0
- package/dist/api/storage.js +19 -0
- package/dist/api/types/types.d.ts +20 -0
- package/package.json +1 -1
- package/src/api/index.ts +3 -0
- package/src/api/storage.ts +24 -0
- package/src/api/types/types.ts +26 -0
package/dist/api/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { kyc } from './kyc';
|
|
|
9
9
|
import { list } from './list';
|
|
10
10
|
import { orders } from './orders';
|
|
11
11
|
import { persona } from './persona';
|
|
12
|
+
import { storage } from './storage';
|
|
12
13
|
import { tenants } from './tenants';
|
|
13
14
|
import { totp } from './totp';
|
|
14
15
|
import { user } from './user';
|
|
@@ -26,6 +27,7 @@ type Api = {
|
|
|
26
27
|
list: typeof list;
|
|
27
28
|
orders: typeof orders;
|
|
28
29
|
persona: typeof persona;
|
|
30
|
+
storage: typeof storage;
|
|
29
31
|
tenants: typeof tenants;
|
|
30
32
|
totp: typeof totp;
|
|
31
33
|
user: typeof user;
|
package/dist/api/index.js
CHANGED
|
@@ -12,6 +12,7 @@ const kyc_1 = require("./kyc");
|
|
|
12
12
|
const list_1 = require("./list");
|
|
13
13
|
const orders_1 = require("./orders");
|
|
14
14
|
const persona_1 = require("./persona");
|
|
15
|
+
const storage_1 = require("./storage");
|
|
15
16
|
const tenants_1 = require("./tenants");
|
|
16
17
|
const totp_1 = require("./totp");
|
|
17
18
|
const user_1 = require("./user");
|
|
@@ -29,6 +30,7 @@ exports.squarefi_bff_api_client = {
|
|
|
29
30
|
list: list_1.list,
|
|
30
31
|
orders: orders_1.orders,
|
|
31
32
|
persona: persona_1.persona,
|
|
33
|
+
storage: storage_1.storage,
|
|
32
34
|
tenants: tenants_1.tenants,
|
|
33
35
|
totp: totp_1.totp,
|
|
34
36
|
user: user_1.user,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { API } from './types/types';
|
|
2
|
+
export declare const storage: {
|
|
3
|
+
kyc: {
|
|
4
|
+
upload: (file: File) => Promise<API.Storage.KYC.Upload.Response>;
|
|
5
|
+
getFileUrl: ({ path }: API.Storage.KYC.GetFileUrl.Request) => Promise<API.Storage.KYC.GetFileUrl.Response>;
|
|
6
|
+
getFileById: ({ folderId, fileId, }: API.Storage.KYC.GetFileById.Request) => Promise<API.Storage.KYC.GetFileById.Response>;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.storage = void 0;
|
|
4
|
+
const apiClientFactory_1 = require("../utils/apiClientFactory");
|
|
5
|
+
exports.storage = {
|
|
6
|
+
kyc: {
|
|
7
|
+
upload: (file) => {
|
|
8
|
+
const formData = new FormData();
|
|
9
|
+
formData.append('file', file);
|
|
10
|
+
return apiClientFactory_1.apiClientV2.postRequest('/storage/kyc', {
|
|
11
|
+
data: formData,
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
getFileUrl: ({ path }) => apiClientFactory_1.apiClientV2.getRequest('/storage/kyc', {
|
|
15
|
+
params: { path },
|
|
16
|
+
}),
|
|
17
|
+
getFileById: ({ folderId, fileId, }) => apiClientFactory_1.apiClientV2.getRequest(`/storage/kyc/${folderId}/${fileId}`),
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -2235,4 +2235,24 @@ export declare namespace API {
|
|
|
2235
2235
|
}
|
|
2236
2236
|
}
|
|
2237
2237
|
}
|
|
2238
|
+
namespace Storage {
|
|
2239
|
+
namespace KYC {
|
|
2240
|
+
namespace Upload {
|
|
2241
|
+
type Response = operations['StorageController_uploadKycFile']['responses']['201']['content']['application/json'];
|
|
2242
|
+
}
|
|
2243
|
+
namespace GetFileUrl {
|
|
2244
|
+
type Request = {
|
|
2245
|
+
path: string;
|
|
2246
|
+
};
|
|
2247
|
+
type Response = operations['StorageController_getFileUrl']['responses']['200']['content']['application/octet-stream'];
|
|
2248
|
+
}
|
|
2249
|
+
namespace GetFileById {
|
|
2250
|
+
interface Request {
|
|
2251
|
+
folderId: string;
|
|
2252
|
+
fileId: string;
|
|
2253
|
+
}
|
|
2254
|
+
type Response = operations['StorageController_getKycFile']['responses']['200']['content']['application/octet-stream'];
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2238
2258
|
}
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { kyc } from './kyc';
|
|
|
9
9
|
import { list } from './list';
|
|
10
10
|
import { orders } from './orders';
|
|
11
11
|
import { persona } from './persona';
|
|
12
|
+
import { storage } from './storage';
|
|
12
13
|
import { tenants } from './tenants';
|
|
13
14
|
import { totp } from './totp';
|
|
14
15
|
import { user } from './user';
|
|
@@ -27,6 +28,7 @@ type Api = {
|
|
|
27
28
|
list: typeof list;
|
|
28
29
|
orders: typeof orders;
|
|
29
30
|
persona: typeof persona;
|
|
31
|
+
storage: typeof storage;
|
|
30
32
|
tenants: typeof tenants;
|
|
31
33
|
totp: typeof totp;
|
|
32
34
|
user: typeof user;
|
|
@@ -46,6 +48,7 @@ export const squarefi_bff_api_client: Api = {
|
|
|
46
48
|
list,
|
|
47
49
|
orders,
|
|
48
50
|
persona,
|
|
51
|
+
storage,
|
|
49
52
|
tenants,
|
|
50
53
|
totp,
|
|
51
54
|
user,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { apiClientV2 } from '../utils/apiClientFactory';
|
|
2
|
+
import { API } from './types/types';
|
|
3
|
+
|
|
4
|
+
export const storage = {
|
|
5
|
+
kyc: {
|
|
6
|
+
upload: (file: File): Promise<API.Storage.KYC.Upload.Response> => {
|
|
7
|
+
const formData = new FormData();
|
|
8
|
+
formData.append('file', file);
|
|
9
|
+
|
|
10
|
+
return apiClientV2.postRequest<API.Storage.KYC.Upload.Response>('/storage/kyc', {
|
|
11
|
+
data: formData,
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
getFileUrl: ({ path }: API.Storage.KYC.GetFileUrl.Request): Promise<API.Storage.KYC.GetFileUrl.Response> =>
|
|
15
|
+
apiClientV2.getRequest<API.Storage.KYC.GetFileUrl.Response>('/storage/kyc', {
|
|
16
|
+
params: { path },
|
|
17
|
+
}),
|
|
18
|
+
getFileById: ({
|
|
19
|
+
folderId,
|
|
20
|
+
fileId,
|
|
21
|
+
}: API.Storage.KYC.GetFileById.Request): Promise<API.Storage.KYC.GetFileById.Response> =>
|
|
22
|
+
apiClientV2.getRequest<API.Storage.KYC.GetFileById.Response>(`/storage/kyc/${folderId}/${fileId}`),
|
|
23
|
+
},
|
|
24
|
+
};
|
package/src/api/types/types.ts
CHANGED
|
@@ -2791,4 +2791,30 @@ export namespace API {
|
|
|
2791
2791
|
}
|
|
2792
2792
|
}
|
|
2793
2793
|
}
|
|
2794
|
+
|
|
2795
|
+
export namespace Storage {
|
|
2796
|
+
export namespace KYC {
|
|
2797
|
+
export namespace Upload {
|
|
2798
|
+
export type Response =
|
|
2799
|
+
operations['StorageController_uploadKycFile']['responses']['201']['content']['application/json'];
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
export namespace GetFileUrl {
|
|
2803
|
+
export type Request = {
|
|
2804
|
+
path: string;
|
|
2805
|
+
};
|
|
2806
|
+
export type Response =
|
|
2807
|
+
operations['StorageController_getFileUrl']['responses']['200']['content']['application/octet-stream'];
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2810
|
+
export namespace GetFileById {
|
|
2811
|
+
export interface Request {
|
|
2812
|
+
folderId: string;
|
|
2813
|
+
fileId: string;
|
|
2814
|
+
}
|
|
2815
|
+
export type Response =
|
|
2816
|
+
operations['StorageController_getKycFile']['responses']['200']['content']['application/octet-stream'];
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2794
2820
|
}
|