squarefi-bff-api-module 1.36.38 → 1.36.40

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.
@@ -14,6 +14,18 @@ export declare const frontend: {
14
14
  deposit: ({ card_id, ...data }: API.Frontend.Issuing.Cards.Deposit.Request) => Promise<API.Frontend.Issuing.Cards.Deposit.Response>;
15
15
  withdraw: ({ card_id, ...data }: API.Frontend.Issuing.Cards.Withdraw.Request) => Promise<API.Frontend.Issuing.Cards.Withdraw.Response>;
16
16
  };
17
+ cardholders: {
18
+ list: (params?: API.Frontend.Issuing.Cardholders.List.Request) => Promise<API.Frontend.Issuing.Cardholders.List.Response>;
19
+ create: (data: API.Frontend.Issuing.Cardholders.Create.Request) => Promise<API.Frontend.Issuing.Cardholders.Create.Response>;
20
+ getById: ({ cardholder_id, ...params }: API.Frontend.Issuing.Cardholders.Get.Request) => Promise<API.Frontend.Issuing.Cardholders.Get.Response>;
21
+ delete: ({ cardholder_id, ...params }: API.Frontend.Issuing.Cardholders.Delete.Request) => Promise<API.Frontend.Issuing.Cardholders.Delete.Response>;
22
+ submit: ({ cardholder_id, ...params }: API.Frontend.Issuing.Cardholders.Submit.Request) => Promise<API.Frontend.Issuing.Cardholders.Submit.Response>;
23
+ documents: {
24
+ upload: ({ wallet_id, ...files }: API.Frontend.Issuing.Cardholders.Documents.Upload.Request) => Promise<API.Frontend.Issuing.Cardholders.Documents.Upload.Response>;
25
+ discard: ({ document_id, ...params }: API.Frontend.Issuing.Cardholders.Documents.Discard.Request) => Promise<void>;
26
+ attach: ({ cardholder_id, wallet_id, ...data }: API.Frontend.Issuing.Cardholders.Documents.Attach.Request) => Promise<API.Frontend.Issuing.Cardholders.Documents.Attach.Response>;
27
+ };
28
+ };
17
29
  subAccounts: {
18
30
  deposit: ({ sub_account_id, ...data }: API.Frontend.Issuing.SubAccounts.Deposit.Request) => Promise<API.Frontend.Issuing.SubAccounts.Deposit.Response>;
19
31
  withdraw: ({ sub_account_id, ...data }: API.Frontend.Issuing.SubAccounts.Withdraw.Request) => Promise<API.Frontend.Issuing.SubAccounts.Withdraw.Response>;
@@ -23,6 +23,43 @@ export const frontend = {
23
23
  deposit: ({ card_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/issuing/cards/${card_id}/deposit`, { data }),
24
24
  withdraw: ({ card_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/issuing/cards/${card_id}/withdraw`, { data }),
25
25
  },
26
+ // Cardholder create flow (see the OpenAPI spec for details):
27
+ // 1. `cardholders.create` — creates a DRAFT; no vendor is contacted. In `user_data_id` mode
28
+ // the KYC documents are seeded from the verified user, so step 2 is usually unnecessary.
29
+ // 2. `cardholders.documents.upload` (one file per request, before or after the draft exists)
30
+ // + `cardholders.documents.attach` — attach the returned upload ids to the draft.
31
+ // 3. `cardholders.submit` — registers at the vendor and flips the cardholder to ACTIVE.
32
+ // All write endpoints require the ADMIN role on the wallet; `wallet_id` travels as a query
33
+ // parameter for access validation.
34
+ cardholders: {
35
+ list: (params = {}) => apiClientV1Frontend.getRequest('/frontend/issuing/cardholders', { params }),
36
+ create: (data) => apiClientV1Frontend.postRequest('/frontend/issuing/cardholders', { data }),
37
+ getById: ({ cardholder_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/issuing/cardholders/${cardholder_id}`, { params }),
38
+ delete: ({ cardholder_id, ...params }) => apiClientV1Frontend.deleteRequest(`/frontend/issuing/cardholders/${cardholder_id}`, { params }),
39
+ // Retryable: a failed submit leaves the draft untouched, so it can be called again once the
40
+ // dossier is complete (a `400 CARDHOLDER_SUBMISSION_INCOMPLETE` lists what is missing in
41
+ // `error.details.missing`). While a review is running — or once the cardholder is live —
42
+ // another submit returns `409 CARDHOLDER_NOT_DRAFT`.
43
+ submit: ({ cardholder_id, ...params }) => apiClientV1Frontend.postRequest(`/frontend/issuing/cardholders/${cardholder_id}/submit`, { params }),
44
+ documents: {
45
+ // Send the file the camera produced, unchanged (no crop/resize/re-encode — the vendor's
46
+ // tampering check can flag a re-encoded photo as forgery), one file per request so the UI
47
+ // can show per-file progress and retry. Content-Type is set by the browser via FormData.
48
+ upload: ({ wallet_id, ...files }) => {
49
+ const formData = new FormData();
50
+ Object.entries(files).forEach(([type, file]) => {
51
+ if (file)
52
+ formData.append(type, file);
53
+ });
54
+ return apiClientV1Frontend.postRequest('/frontend/issuing/cardholder-documents', { data: formData, params: { wallet_id } });
55
+ },
56
+ // Only uploads not yet attached to a cardholder can be discarded (attached ones answer 409);
57
+ // an upload that is never attached is deleted by a cleanup sweep anyway.
58
+ discard: ({ document_id, ...params }) => apiClientV1Frontend.deleteRequest(`/frontend/issuing/cardholder-documents/${document_id}`, { params }),
59
+ // Attaching a document of a type the cardholder already has replaces the previous one.
60
+ attach: ({ cardholder_id, wallet_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/issuing/cardholders/${cardholder_id}/documents`, { data, params: { wallet_id } }),
61
+ },
62
+ },
26
63
  subAccounts: {
27
64
  deposit: ({ sub_account_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/issuing/sub-accounts/${sub_account_id}/deposit`, { data }),
28
65
  // Concurrent withdrawals on the same sub-account are rejected with `409`. The currency is
@@ -5013,8 +5013,16 @@ export interface paths {
5013
5013
  * @example b2f3d8c1-4a7e-4d22-9c5f-1e6a8d0b2a44
5014
5014
  */
5015
5015
  counterparty_destination_id: string;
5016
- /** @example 50 */
5016
+ /**
5017
+ * @description Amount to send, in `from_currency_id` units. With `is_reverse: true` — the amount the receiver must be credited.
5018
+ * @example 50
5019
+ */
5017
5020
  amount: number;
5021
+ /**
5022
+ * @description Optional. When true, `amount` is the receive-amount and the debited amount is grossed up with fees.
5023
+ * @default false
5024
+ */
5025
+ is_reverse?: boolean;
5018
5026
  /**
5019
5027
  * Format: date-time
5020
5028
  * @description Optional. Schedule the transfer for a future time (min 1 hour, max 90 days ahead). No funds are reserved; after approval the order waits in EXPECTED status and executes automatically.
@@ -5969,8 +5969,8 @@ export interface paths {
5969
5969
  cookie?: never;
5970
5970
  };
5971
5971
  /**
5972
- * Effective delivery-channel preferences
5973
- * @description Full channel list with defaults applied. `IN_APP` is always enabled (cannot be disabled).
5972
+ * Effective notification preferences
5973
+ * @description Both dimensions in full with defaults applied — delivery channels (`IN_APP` is always enabled) and notification categories (every category is user-configurable).
5974
5974
  */
5975
5975
  get: {
5976
5976
  parameters: {
@@ -5981,7 +5981,7 @@ export interface paths {
5981
5981
  };
5982
5982
  requestBody?: never;
5983
5983
  responses: {
5984
- /** @description Effective preference per channel. */
5984
+ /** @description Effective preference per channel and per category. */
5985
5985
  200: {
5986
5986
  headers: {
5987
5987
  [name: string]: unknown;
@@ -5992,6 +5992,7 @@ export interface paths {
5992
5992
  success?: boolean;
5993
5993
  data?: {
5994
5994
  preferences?: components["schemas"]["NotificationPreference"][];
5995
+ categories?: components["schemas"]["NotificationCategoryPreference"][];
5995
5996
  };
5996
5997
  };
5997
5998
  };
@@ -6000,8 +6001,8 @@ export interface paths {
6000
6001
  };
6001
6002
  };
6002
6003
  /**
6003
- * Update delivery-channel preferences
6004
- * @description Bulk upsert. Disabling `IN_APP` is rejected with 400 (`INBOX_CHANNEL_LOCKED`). Changes apply from the next delivery.
6004
+ * Update notification preferences
6005
+ * @description Bulk upsert of either or both dimensions. Disabling the `IN_APP` channel is rejected with 400 (`INBOX_CHANNEL_LOCKED`). A disabled category mutes push and email for its notifications; the inbox always receives them. Changes apply from the next delivery.
6005
6006
  */
6006
6007
  put: {
6007
6008
  parameters: {
@@ -6013,12 +6014,13 @@ export interface paths {
6013
6014
  requestBody: {
6014
6015
  content: {
6015
6016
  "application/json": {
6016
- preferences: components["schemas"]["NotificationPreference"][];
6017
+ preferences?: components["schemas"]["NotificationPreference"][];
6018
+ categories?: components["schemas"]["NotificationCategoryPreference"][];
6017
6019
  };
6018
6020
  };
6019
6021
  };
6020
6022
  responses: {
6021
- /** @description Effective preference list after the update. */
6023
+ /** @description Effective preferences of both dimensions after the update. */
6022
6024
  200: {
6023
6025
  headers: {
6024
6026
  [name: string]: unknown;
@@ -6029,6 +6031,7 @@ export interface paths {
6029
6031
  success?: boolean;
6030
6032
  data?: {
6031
6033
  preferences?: components["schemas"]["NotificationPreference"][];
6034
+ categories?: components["schemas"]["NotificationCategoryPreference"][];
6032
6035
  };
6033
6036
  };
6034
6037
  };
@@ -6598,7 +6601,13 @@ export interface paths {
6598
6601
  * @description Counterparty destination of type INTERNAL (points at the receiver wallet).
6599
6602
  */
6600
6603
  counterparty_destination_id: string;
6604
+ /** @description Amount to send, in `from_currency_id` units. With `is_reverse: true` — the amount the receiver must be credited. */
6601
6605
  amount: number;
6606
+ /**
6607
+ * @description When true, `amount` is the receive-amount and the debited amount is grossed up with fees.
6608
+ * @default false
6609
+ */
6610
+ is_reverse?: boolean;
6602
6611
  /**
6603
6612
  * Format: date-time
6604
6613
  * @description Optional. Schedule the transfer for a future time (min 1 hour, max 90 days ahead). No funds are reserved; after approval the order waits in EXPECTED status and executes automatically.
@@ -13005,7 +13014,12 @@ export interface components {
13005
13014
  };
13006
13015
  NotificationPreference: {
13007
13016
  /** @enum {string} */
13008
- channel: "IN_APP" | "PUSH";
13017
+ channel: "IN_APP" | "PUSH" | "EMAIL";
13018
+ enabled: boolean;
13019
+ };
13020
+ NotificationCategoryPreference: {
13021
+ /** @enum {string} */
13022
+ category: "TRANSACTIONS" | "COMPLIANCE";
13009
13023
  enabled: boolean;
13010
13024
  };
13011
13025
  };
@@ -2570,7 +2570,13 @@ export interface paths {
2570
2570
  * @description Counterparty destination of type INTERNAL (points at the receiver wallet).
2571
2571
  */
2572
2572
  counterparty_destination_id: string;
2573
+ /** @description Amount to send, in `from_currency_id` units. With `is_reverse: true` — the amount the receiver must be credited. */
2573
2574
  amount: number;
2575
+ /**
2576
+ * @description When true, `amount` is the receive-amount and the debited amount is grossed up with fees.
2577
+ * @default false
2578
+ */
2579
+ is_reverse?: boolean;
2574
2580
  /**
2575
2581
  * Format: date-time
2576
2582
  * @description Optional. Schedule the transfer for a future time (min 1 hour, max 90 days ahead). No funds are reserved; after approval the order waits in EXPECTED status and executes automatically.
@@ -676,6 +676,11 @@ export declare namespace API {
676
676
  type CardWithdrawRoot = pathsV1Frontend['/frontend/issuing/cards/{card_id}/withdraw'];
677
677
  type SubAccountDepositRoot = pathsV1Frontend['/frontend/issuing/sub-accounts/{sub_account_id}/deposit'];
678
678
  type SubAccountWithdrawRoot = pathsV1Frontend['/frontend/issuing/sub-accounts/{sub_account_id}/withdraw'];
679
+ type CardholdersRoot = pathsV1Frontend['/frontend/issuing/cardholders'];
680
+ type CardholderRoot = pathsV1Frontend['/frontend/issuing/cardholders/{cardholder_id}'];
681
+ type CardholderSubmitRoot = pathsV1Frontend['/frontend/issuing/cardholders/{cardholder_id}/submit'];
682
+ type CardholderDocumentsUploadRoot = pathsV1Frontend['/frontend/issuing/cardholder-documents'];
683
+ type CardholderAttachDocumentsRoot = pathsV1Frontend['/frontend/issuing/cardholders/{cardholder_id}/documents'];
679
684
  type WithOrderStatus<T extends {
680
685
  data?: {
681
686
  status?: string;
@@ -718,6 +723,64 @@ export declare namespace API {
718
723
  type Response = SubAccounts.Withdraw.Response;
719
724
  }
720
725
  }
726
+ export namespace Cardholders {
727
+ type Cardholder = componentsV1Frontend['schemas']['IssuingCardholder'];
728
+ namespace List {
729
+ type Request = NonNullable<CardholdersRoot['get']['parameters']['query']>;
730
+ type Response = CardholdersRoot['get']['responses']['200']['content']['application/json'];
731
+ }
732
+ namespace Create {
733
+ type Request = CardholdersRoot['post']['requestBody']['content']['application/json'];
734
+ type Response = CardholdersRoot['post']['responses']['201']['content']['application/json'];
735
+ }
736
+ namespace Get {
737
+ type Request = {
738
+ cardholder_id: string;
739
+ } & NonNullable<CardholderRoot['get']['parameters']['query']>;
740
+ type Response = CardholderRoot['get']['responses']['200']['content']['application/json'];
741
+ }
742
+ namespace Delete {
743
+ type Request = {
744
+ cardholder_id: string;
745
+ } & NonNullable<CardholderRoot['delete']['parameters']['query']>;
746
+ type Response = CardholderRoot['delete']['responses']['200']['content']['application/json'];
747
+ }
748
+ namespace Submit {
749
+ type Request = {
750
+ cardholder_id: string;
751
+ } & CardholderSubmitRoot['post']['parameters']['query'];
752
+ type Response = CardholderSubmitRoot['post']['responses']['200']['content']['application/json'];
753
+ }
754
+ namespace Documents {
755
+ type DocumentType = keyof CardholderDocumentsUploadRoot['post']['requestBody']['content']['multipart/form-data'];
756
+ namespace Upload {
757
+ type Request = {
758
+ wallet_id: string;
759
+ } & {
760
+ [K in DocumentType]?: File | Blob;
761
+ };
762
+ type Response = CardholderDocumentsUploadRoot['post']['responses']['201']['content']['application/json'];
763
+ type Document = NonNullable<NonNullable<Response['data']>['documents']>[number];
764
+ }
765
+ namespace Discard {
766
+ type Request = {
767
+ document_id: string;
768
+ wallet_id: string;
769
+ };
770
+ }
771
+ namespace Attach {
772
+ export type Request = {
773
+ cardholder_id: string;
774
+ wallet_id: string;
775
+ } & CardholderAttachDocumentsRoot['post']['requestBody']['content']['application/json'];
776
+ type RawResponse = CardholderAttachDocumentsRoot['post']['responses']['200']['content']['application/json'];
777
+ export type Response = Omit<RawResponse, 'data'> & {
778
+ data?: Cardholder;
779
+ };
780
+ export {};
781
+ }
782
+ }
783
+ }
721
784
  export {};
722
785
  }
723
786
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.36.38",
3
+ "version": "1.36.40",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",