squarefi-bff-api-module 1.36.77 → 1.36.78
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/rfi.d.ts +11 -0
- package/dist/api/rfi.js +26 -0
- package/dist/api/types/types.d.ts +46 -0
- package/package.json +1 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { list } from './list';
|
|
|
10
10
|
import { massPayouts } from './mass-payouts';
|
|
11
11
|
import { orders } from './orders';
|
|
12
12
|
import { referrals } from './referrals';
|
|
13
|
+
import { rfi } from './rfi';
|
|
13
14
|
import { statements } from './statements';
|
|
14
15
|
import { storage } from './storage';
|
|
15
16
|
import { tenants } from './tenants';
|
|
@@ -30,6 +31,7 @@ type Api = {
|
|
|
30
31
|
massPayouts: typeof massPayouts;
|
|
31
32
|
orders: typeof orders;
|
|
32
33
|
referrals: typeof referrals;
|
|
34
|
+
rfi: typeof rfi;
|
|
33
35
|
statements: typeof statements;
|
|
34
36
|
storage: typeof storage;
|
|
35
37
|
tenants: typeof tenants;
|
package/dist/api/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { list } from './list';
|
|
|
10
10
|
import { massPayouts } from './mass-payouts';
|
|
11
11
|
import { orders } from './orders';
|
|
12
12
|
import { referrals } from './referrals';
|
|
13
|
+
import { rfi } from './rfi';
|
|
13
14
|
import { statements } from './statements';
|
|
14
15
|
import { storage } from './storage';
|
|
15
16
|
import { tenants } from './tenants';
|
|
@@ -30,6 +31,7 @@ export const squarefi_bff_api_client = {
|
|
|
30
31
|
massPayouts,
|
|
31
32
|
orders,
|
|
32
33
|
referrals,
|
|
34
|
+
rfi,
|
|
33
35
|
statements,
|
|
34
36
|
storage,
|
|
35
37
|
tenants,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { API } from './types/types';
|
|
2
|
+
/**
|
|
3
|
+
* Requests for information from compliance (SFI-2280), scoped by `wallet_id`. The client can only
|
|
4
|
+
* read and answer them: the spec declares no method to close, edit or delete one.
|
|
5
|
+
*/
|
|
6
|
+
export declare const rfi: {
|
|
7
|
+
list: ({ wallet_id, ...params }: API.Rfi.List.Request) => Promise<API.Rfi.List.Response>;
|
|
8
|
+
getById: ({ wallet_id, case_id }: API.Rfi.GetById.Request) => Promise<API.Rfi.GetById.Response>;
|
|
9
|
+
reply: ({ wallet_id, case_id, body, files, signal, timeout, }: API.Rfi.Reply.Request) => Promise<API.Rfi.Reply.Response>;
|
|
10
|
+
getAttachmentLink: ({ wallet_id, case_id, attachment_id, }: API.Rfi.GetAttachmentLink.Request) => Promise<API.Rfi.GetAttachmentLink.Response>;
|
|
11
|
+
};
|
package/dist/api/rfi.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { apiClientV1Frontend } from '../utils/apiClientFactory';
|
|
2
|
+
/**
|
|
3
|
+
* Requests for information from compliance (SFI-2280), scoped by `wallet_id`. The client can only
|
|
4
|
+
* read and answer them: the spec declares no method to close, edit or delete one.
|
|
5
|
+
*/
|
|
6
|
+
export const rfi = {
|
|
7
|
+
list: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/rfi/${wallet_id}`, { params }),
|
|
8
|
+
getById: ({ wallet_id, case_id }) => apiClientV1Frontend.getRequest(`/frontend/rfi/${wallet_id}/${case_id}`),
|
|
9
|
+
// Each file is its own part named `files` (repeated, not `files[]`) — the form verified live.
|
|
10
|
+
// Content-Type is left to the browser, which adds the multipart boundary. A reply carries up to
|
|
11
|
+
// 10 files of 20 MB, which the client's 60 s default timeout may not cover: pass `timeout`.
|
|
12
|
+
reply: ({ wallet_id, case_id, body, files, signal, timeout, }) => {
|
|
13
|
+
const formData = new FormData();
|
|
14
|
+
if (body)
|
|
15
|
+
formData.append('body', body);
|
|
16
|
+
files?.forEach((file) => formData.append('files', file));
|
|
17
|
+
return apiClientV1Frontend.postRequest(`/frontend/rfi/${wallet_id}/${case_id}/messages`, {
|
|
18
|
+
data: formData,
|
|
19
|
+
signal,
|
|
20
|
+
timeout,
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
// The signed link lives `expires_in` seconds (about 120): open it right away and request a new
|
|
24
|
+
// one for every download instead of storing it.
|
|
25
|
+
getAttachmentLink: ({ wallet_id, case_id, attachment_id, }) => apiClientV1Frontend.getRequest(`/frontend/rfi/${wallet_id}/${case_id}/attachments/${attachment_id}`),
|
|
26
|
+
};
|
|
@@ -1661,6 +1661,52 @@ export declare namespace API {
|
|
|
1661
1661
|
}
|
|
1662
1662
|
export {};
|
|
1663
1663
|
}
|
|
1664
|
+
/**
|
|
1665
|
+
* Requests for information (RFI, SFI-2280): compliance's questions about an account or its
|
|
1666
|
+
* transactions, answered by the account's team with text and files.
|
|
1667
|
+
*
|
|
1668
|
+
* Every path is scoped by `wallet_id`, so each Request carries it. Responses are the frontend
|
|
1669
|
+
* `{ success, data }` envelope as the spec declares it. Every `Rfi*` field is optional for now
|
|
1670
|
+
* because the spec declares no `required`; the types tighten on the regeneration that adds it.
|
|
1671
|
+
*/
|
|
1672
|
+
namespace Rfi {
|
|
1673
|
+
type CasesRoot = pathsV1Frontend['/frontend/rfi/{wallet_id}'];
|
|
1674
|
+
type CaseRoot = pathsV1Frontend['/frontend/rfi/{wallet_id}/{case_id}'];
|
|
1675
|
+
type CaseMessagesRoot = pathsV1Frontend['/frontend/rfi/{wallet_id}/{case_id}/messages'];
|
|
1676
|
+
type CaseAttachmentRoot = pathsV1Frontend['/frontend/rfi/{wallet_id}/{case_id}/attachments/{attachment_id}'];
|
|
1677
|
+
export type Case = componentsV1Frontend['schemas']['RfiCase'];
|
|
1678
|
+
export type CaseDetail = componentsV1Frontend['schemas']['RfiCaseDetail'];
|
|
1679
|
+
export type Message = componentsV1Frontend['schemas']['RfiMessage'];
|
|
1680
|
+
export type Attachment = componentsV1Frontend['schemas']['RfiAttachment'];
|
|
1681
|
+
export type Transaction = componentsV1Frontend['schemas']['RfiTransaction'];
|
|
1682
|
+
export type CaseStatus = NonNullable<Case['status']>;
|
|
1683
|
+
export type CaseType = NonNullable<Case['type']>;
|
|
1684
|
+
export type MessageAuthor = NonNullable<Message['author']>;
|
|
1685
|
+
/** The list's `status` filter. `open` = `action_required` + `awaiting_compliance`; no case has it. */
|
|
1686
|
+
export type ListStatus = NonNullable<List.Request['status']>;
|
|
1687
|
+
export type Summary = NonNullable<NonNullable<List.Response['data']>['summary']>;
|
|
1688
|
+
export namespace List {
|
|
1689
|
+
type Request = CasesRoot['get']['parameters']['path'] & NonNullable<CasesRoot['get']['parameters']['query']>;
|
|
1690
|
+
type Response = CasesRoot['get']['responses']['200']['content']['application/json'];
|
|
1691
|
+
}
|
|
1692
|
+
export namespace GetById {
|
|
1693
|
+
type Request = CaseRoot['get']['parameters']['path'];
|
|
1694
|
+
type Response = CaseRoot['get']['responses']['200']['content']['application/json'];
|
|
1695
|
+
}
|
|
1696
|
+
export namespace Reply {
|
|
1697
|
+
type Request = CaseMessagesRoot['post']['parameters']['path'] & Omit<CaseMessagesRoot['post']['requestBody']['content']['multipart/form-data'], 'files'> & {
|
|
1698
|
+
files?: File[];
|
|
1699
|
+
signal?: AbortSignal;
|
|
1700
|
+
timeout?: number;
|
|
1701
|
+
};
|
|
1702
|
+
type Response = CaseMessagesRoot['post']['responses']['201']['content']['application/json'];
|
|
1703
|
+
}
|
|
1704
|
+
export namespace GetAttachmentLink {
|
|
1705
|
+
type Request = CaseAttachmentRoot['get']['parameters']['path'];
|
|
1706
|
+
type Response = CaseAttachmentRoot['get']['responses']['200']['content']['application/json'];
|
|
1707
|
+
}
|
|
1708
|
+
export {};
|
|
1709
|
+
}
|
|
1664
1710
|
namespace Orders {
|
|
1665
1711
|
namespace Create {
|
|
1666
1712
|
namespace ByOrderType {
|