squarefi-bff-api-module 1.36.45 → 1.36.47

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.
@@ -13,6 +13,19 @@ export declare const frontend: {
13
13
  list: ({ status, ...params }?: API.Frontend.Issuing.Cards.List.Request) => Promise<API.Frontend.Issuing.Cards.List.Response>;
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
+ getById: ({ card_id, }: API.Frontend.Issuing.Cards.Get.Request) => Promise<API.Frontend.Issuing.Cards.Get.Response>;
17
+ /** Rename (and other editable card fields). */
18
+ update: ({ card_id, ...data }: API.Frontend.Issuing.Cards.Update.Request) => Promise<API.Frontend.Issuing.Cards.Update.Response>;
19
+ /** Terminal, unlike freeze — a closed card cannot be reopened. */
20
+ close: ({ card_id, }: API.Frontend.Issuing.Cards.Close.Request) => Promise<API.Frontend.Issuing.Cards.Close.Response>;
21
+ freeze: ({ card_id, }: API.Frontend.Issuing.Cards.Freeze.Request) => Promise<API.Frontend.Issuing.Cards.Freeze.Response>;
22
+ unfreeze: ({ card_id, }: API.Frontend.Issuing.Cards.Unfreeze.Request) => Promise<API.Frontend.Issuing.Cards.Unfreeze.Response>;
23
+ limits: {
24
+ update: ({ card_id, ...data }: API.Frontend.Issuing.Cards.Limits.Request) => Promise<API.Frontend.Issuing.Cards.Limits.Response>;
25
+ };
26
+ /** Card PAN/CVV, encrypted for the caller's key. */
27
+ sensitive: ({ card_id, }: API.Frontend.Issuing.Cards.Sensitive.Request) => Promise<API.Frontend.Issuing.Cards.Sensitive.Response>;
28
+ transactions: ({ card_id, ...params }: API.Frontend.Issuing.Cards.Transactions.Request) => Promise<API.Frontend.Issuing.Cards.Transactions.Response>;
16
29
  create: (data: API.Frontend.Issuing.Cards.Create.Request) => Promise<API.Frontend.Issuing.Cards.Create.Response>;
17
30
  };
18
31
  cardholders: {
@@ -30,6 +43,10 @@ export declare const frontend: {
30
43
  };
31
44
  };
32
45
  subAccounts: {
46
+ getAll: (params?: API.Frontend.Issuing.SubAccounts.List.Request) => Promise<API.Frontend.Issuing.SubAccounts.List.Response>;
47
+ getById: ({ sub_account_id, }: API.Frontend.Issuing.SubAccounts.Get.Request) => Promise<API.Frontend.Issuing.SubAccounts.Get.Response>;
48
+ create: (data: API.Frontend.Issuing.SubAccounts.Create.Request) => Promise<API.Frontend.Issuing.SubAccounts.Create.Response>;
49
+ transactions: ({ sub_account_id, ...params }: API.Frontend.Issuing.SubAccounts.Transactions.Request) => Promise<API.Frontend.Issuing.SubAccounts.Transactions.Response>;
33
50
  deposit: ({ sub_account_id, ...data }: API.Frontend.Issuing.SubAccounts.Deposit.Request) => Promise<API.Frontend.Issuing.SubAccounts.Deposit.Response>;
34
51
  withdraw: ({ sub_account_id, ...data }: API.Frontend.Issuing.SubAccounts.Withdraw.Request) => Promise<API.Frontend.Issuing.SubAccounts.Withdraw.Response>;
35
52
  };
@@ -29,6 +29,19 @@ export const frontend = {
29
29
  // first through `cardholders.*` — an unlinked user gets `400 CARDHOLDER_NOT_LINKED`).
30
30
  // Issuing fee / initial top-up follow the group tariff; pass `currency_id` (and optionally
31
31
  // `initial_topup`) whenever the tariff carries money.
32
+ getById: ({ card_id, }) => apiClientV1Frontend.getRequest(`/frontend/issuing/cards/${card_id}`),
33
+ /** Rename (and other editable card fields). */
34
+ update: ({ card_id, ...data }) => apiClientV1Frontend.patchRequest(`/frontend/issuing/cards/${card_id}`, { data }),
35
+ /** Terminal, unlike freeze — a closed card cannot be reopened. */
36
+ close: ({ card_id, }) => apiClientV1Frontend.deleteRequest(`/frontend/issuing/cards/${card_id}`),
37
+ freeze: ({ card_id, }) => apiClientV1Frontend.putRequest(`/frontend/issuing/cards/${card_id}/freeze`),
38
+ unfreeze: ({ card_id, }) => apiClientV1Frontend.putRequest(`/frontend/issuing/cards/${card_id}/unfreeze`),
39
+ limits: {
40
+ update: ({ card_id, ...data }) => apiClientV1Frontend.putRequest(`/frontend/issuing/cards/${card_id}/limits`, { data }),
41
+ },
42
+ /** Card PAN/CVV, encrypted for the caller's key. */
43
+ sensitive: ({ card_id, }) => apiClientV1Frontend.getRequest(`/frontend/issuing/cards/${card_id}/sensitive`),
44
+ transactions: ({ card_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/issuing/cards/${card_id}/transactions`, { params }),
32
45
  create: (data) => apiClientV1Frontend.postRequest('/frontend/issuing/cards', {
33
46
  data,
34
47
  }),
@@ -80,6 +93,13 @@ export const frontend = {
80
93
  },
81
94
  },
82
95
  subAccounts: {
96
+ // Local-first list (`fiat_accounts` + computed balances + the program embed with its
97
+ // cardholder KYC bar). `ids` (comma-separated) makes it a targeted read of specific
98
+ // sub-accounts — prefer that over `getById`, whose shape varies with the vendor.
99
+ getAll: (params = {}) => apiClientV1Frontend.getRequest('/frontend/issuing/sub-accounts', { params }),
100
+ getById: ({ sub_account_id, }) => apiClientV1Frontend.getRequest(`/frontend/issuing/sub-accounts/${sub_account_id}`),
101
+ create: (data) => apiClientV1Frontend.postRequest('/frontend/issuing/sub-accounts', { data }),
102
+ transactions: ({ sub_account_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/issuing/sub-accounts/${sub_account_id}/transactions`, { params }),
83
103
  deposit: ({ sub_account_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/issuing/sub-accounts/${sub_account_id}/deposit`, { data }),
84
104
  // Concurrent withdrawals on the same sub-account are rejected with `409`. The currency is
85
105
  // taken from the sub-account, so only the amount is needed.
@@ -3129,6 +3129,10 @@ export interface paths {
3129
3129
  wallet_id?: string;
3130
3130
  /** @description Filter sub-accounts by program ID */
3131
3131
  program_id?: string;
3132
+ /** @description Comma-separated sub-account ids to fetch (targeted read through the list shape) */
3133
+ ids?: string;
3134
+ /** @description Filter sub-accounts by type */
3135
+ type?: "balance" | "prepaid";
3132
3136
  /** @description Filter sub-accounts by status */
3133
3137
  status?: "ACTIVE" | "INACTIVE" | "SUSPENDED";
3134
3138
  /** @description Number of items to skip */
@@ -672,6 +672,13 @@ export declare namespace API {
672
672
  }
673
673
  namespace Issuing {
674
674
  type CardsRoot = pathsV1Frontend['/frontend/issuing/cards'];
675
+ type CardRoot = pathsV1Frontend['/frontend/issuing/cards/{card_id}'];
676
+ type CardFreezeRoot = pathsV1Frontend['/frontend/issuing/cards/{card_id}/freeze'];
677
+ type CardUnfreezeRoot = pathsV1Frontend['/frontend/issuing/cards/{card_id}/unfreeze'];
678
+ type CardLimitsRoot = pathsV1Frontend['/frontend/issuing/cards/{card_id}/limits'];
679
+ type CardSensitiveRoot = pathsV1Frontend['/frontend/issuing/cards/{card_id}/sensitive'];
680
+ type CardTransactionsRoot = pathsV1Frontend['/frontend/issuing/cards/{card_id}/transactions'];
681
+ type SubAccountTransactionsRoot = pathsV1Frontend['/frontend/issuing/sub-accounts/{sub_account_id}/transactions'];
675
682
  type CardDepositRoot = pathsV1Frontend['/frontend/issuing/cards/{card_id}/deposit'];
676
683
  type CardWithdrawRoot = pathsV1Frontend['/frontend/issuing/cards/{card_id}/withdraw'];
677
684
  type SubAccountDepositRoot = pathsV1Frontend['/frontend/issuing/sub-accounts/{sub_account_id}/deposit'];
@@ -691,18 +698,50 @@ export declare namespace API {
691
698
  };
692
699
  };
693
700
  export namespace SubAccounts {
694
- namespace Deposit {
701
+ type SubAccountsRoot = pathsV1Frontend['/frontend/issuing/sub-accounts'];
702
+ type SubAccountRoot = pathsV1Frontend['/frontend/issuing/sub-accounts/{sub_account_id}'];
703
+ export namespace List {
704
+ /** `ids` is comma-separated — a targeted read of specific sub-accounts through the list shape. */
705
+ type Request = NonNullable<SubAccountsRoot['get']['parameters']['query']>;
706
+ type Response = SubAccountsRoot['get']['responses']['200']['content']['application/json'];
707
+ /**
708
+ * A `fiat_accounts` row enriched with computed balances, currency and the program embed.
709
+ * `issuing_program.cardholder_requirements` carries the program's cardholder KYC bar even
710
+ * when the program is hidden from the caller's config listing (rail visibility, group
711
+ * whitelist) — the sub-account payload is the one place it can always be read from.
712
+ */
713
+ type SubAccount = NonNullable<Response['data']>[number];
714
+ }
715
+ export namespace Get {
716
+ type Request = {
717
+ sub_account_id: string;
718
+ };
719
+ type Response = SubAccountRoot['get']['responses']['200']['content']['application/json'];
720
+ }
721
+ export namespace Create {
722
+ type Request = SubAccountsRoot['post']['requestBody']['content']['application/json'];
723
+ type Response = SubAccountsRoot['post']['responses']['201']['content']['application/json'];
724
+ }
725
+ export namespace Transactions {
726
+ type Request = {
727
+ sub_account_id: string;
728
+ } & NonNullable<SubAccountTransactionsRoot['get']['parameters']['query']>;
729
+ type Response = SubAccountTransactionsRoot['get']['responses']['200']['content']['application/json'];
730
+ type Transaction = NonNullable<Response['data']>[number];
731
+ }
732
+ export namespace Deposit {
695
733
  type Request = {
696
734
  sub_account_id: string;
697
735
  } & SubAccountDepositRoot['post']['requestBody']['content']['application/json'];
698
736
  type Response = WithOrderStatus<SubAccountDepositRoot['post']['responses']['200']['content']['application/json']>;
699
737
  }
700
- namespace Withdraw {
738
+ export namespace Withdraw {
701
739
  type Request = {
702
740
  sub_account_id: string;
703
741
  } & SubAccountWithdrawRoot['post']['requestBody']['content']['application/json'];
704
742
  type Response = WithOrderStatus<SubAccountWithdrawRoot['post']['responses']['200']['content']['application/json']>;
705
743
  }
744
+ export {};
706
745
  }
707
746
  export namespace Cards {
708
747
  namespace List {
@@ -710,6 +749,59 @@ export declare namespace API {
710
749
  type Response = CardsRoot['get']['responses']['200']['content']['application/json'];
711
750
  type Card = NonNullable<Response['data']>[number];
712
751
  }
752
+ namespace Get {
753
+ type Request = {
754
+ card_id: string;
755
+ };
756
+ type Response = CardRoot['get']['responses']['200']['content']['application/json'];
757
+ type Card = NonNullable<Response['data']>;
758
+ }
759
+ /** Rename (and other editable card fields). */
760
+ namespace Update {
761
+ type Request = {
762
+ card_id: string;
763
+ } & CardRoot['patch']['requestBody']['content']['application/json'];
764
+ type Response = CardRoot['patch']['responses']['200']['content']['application/json'];
765
+ }
766
+ /** Close the card — terminal, unlike freeze. */
767
+ namespace Close {
768
+ type Request = {
769
+ card_id: string;
770
+ };
771
+ type Response = CardRoot['delete']['responses']['200']['content']['application/json'];
772
+ }
773
+ namespace Freeze {
774
+ type Request = {
775
+ card_id: string;
776
+ };
777
+ type Response = CardFreezeRoot['put']['responses']['200']['content']['application/json'];
778
+ }
779
+ namespace Unfreeze {
780
+ type Request = {
781
+ card_id: string;
782
+ };
783
+ type Response = CardUnfreezeRoot['put']['responses']['200']['content']['application/json'];
784
+ }
785
+ namespace Limits {
786
+ type Request = {
787
+ card_id: string;
788
+ } & CardLimitsRoot['put']['requestBody']['content']['application/json'];
789
+ type Response = CardLimitsRoot['put']['responses']['200']['content']['application/json'];
790
+ }
791
+ /** Card PAN/CVV, encrypted for the caller's key. */
792
+ namespace Sensitive {
793
+ type Request = {
794
+ card_id: string;
795
+ };
796
+ type Response = CardSensitiveRoot['get']['responses']['200']['content']['application/json'];
797
+ }
798
+ namespace Transactions {
799
+ type Request = {
800
+ card_id: string;
801
+ } & NonNullable<CardTransactionsRoot['get']['parameters']['query']>;
802
+ type Response = CardTransactionsRoot['get']['responses']['200']['content']['application/json'];
803
+ type Transaction = NonNullable<Response['data']>[number];
804
+ }
713
805
  namespace Create {
714
806
  type Request = Omit<CardsRoot['post']['requestBody']['content']['application/json'], 'cardholder_id'> & {
715
807
  cardholder_id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.36.45",
3
+ "version": "1.36.47",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",