squarefi-bff-api-module 1.36.44 → 1.36.46

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.
@@ -30,6 +30,8 @@ export declare const frontend: {
30
30
  };
31
31
  };
32
32
  subAccounts: {
33
+ getAll: (params?: API.Frontend.Issuing.SubAccounts.List.Request) => Promise<API.Frontend.Issuing.SubAccounts.List.Response>;
34
+ getById: ({ sub_account_id, }: API.Frontend.Issuing.SubAccounts.Get.Request) => Promise<API.Frontend.Issuing.SubAccounts.Get.Response>;
33
35
  deposit: ({ sub_account_id, ...data }: API.Frontend.Issuing.SubAccounts.Deposit.Request) => Promise<API.Frontend.Issuing.SubAccounts.Deposit.Response>;
34
36
  withdraw: ({ sub_account_id, ...data }: API.Frontend.Issuing.SubAccounts.Withdraw.Request) => Promise<API.Frontend.Issuing.SubAccounts.Withdraw.Response>;
35
37
  };
@@ -80,6 +80,11 @@ export const frontend = {
80
80
  },
81
81
  },
82
82
  subAccounts: {
83
+ // Local-first list (`fiat_accounts` + computed balances + the program embed with its
84
+ // cardholder KYC bar). `ids` (comma-separated) makes it a targeted read of specific
85
+ // sub-accounts — prefer that over `getById`, whose shape varies with the vendor.
86
+ getAll: (params = {}) => apiClientV1Frontend.getRequest('/frontend/issuing/sub-accounts', { params }),
87
+ getById: ({ sub_account_id, }) => apiClientV1Frontend.getRequest(`/frontend/issuing/sub-accounts/${sub_account_id}`),
83
88
  deposit: ({ sub_account_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/issuing/sub-accounts/${sub_account_id}/deposit`, { data }),
84
89
  // Concurrent withdrawals on the same sub-account are rejected with `409`. The currency is
85
90
  // 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 */
@@ -3842,6 +3846,8 @@ export interface paths {
3842
3846
  offset?: number;
3843
3847
  /** @description Number of items to return */
3844
3848
  limit?: number;
3849
+ /** @description Wallet context — tariffs follow the wallet owner's group. */
3850
+ wallet_id?: string;
3845
3851
  };
3846
3852
  header?: never;
3847
3853
  path?: never;
@@ -3992,6 +3998,11 @@ export interface paths {
3992
3998
  get: {
3993
3999
  parameters: {
3994
4000
  query?: {
4001
+ /** @description Wallet context: tariffs follow the wallet owner's group, and a wallet that already
4002
+ * holds a sub-account on the program keeps it readable even when the rail visibility
4003
+ * filter would hide it from the listing.
4004
+ * */
4005
+ wallet_id?: string;
3995
4006
  /** @description Include extra UI fields (icon, card_design, consent_text, etc.) */
3996
4007
  detailed?: boolean;
3997
4008
  };
@@ -4017,6 +4028,19 @@ export interface paths {
4017
4028
  /** Format: uuid */
4018
4029
  id: string;
4019
4030
  name: string;
4031
+ /** @enum {string} */
4032
+ status: "ACTIVE" | "INACTIVE";
4033
+ /** @description Default card spending limit */
4034
+ card_limit: number;
4035
+ /** @description Whether card supports Apple/Google Pay */
4036
+ tokenizable: boolean;
4037
+ icon?: string | null;
4038
+ code?: string | null;
4039
+ initial_topup?: number | null;
4040
+ card_design?: Record<string, never> | null;
4041
+ consent_text?: string | null;
4042
+ card_issuing_fee?: number | null;
4043
+ card_monthly_fee?: number | null;
4020
4044
  description?: string | null;
4021
4045
  /** @enum {string} */
4022
4046
  form_factor: "VIRTUAL" | "PHYSICAL";
@@ -691,18 +691,39 @@ export declare namespace API {
691
691
  };
692
692
  };
693
693
  export namespace SubAccounts {
694
- namespace Deposit {
694
+ type SubAccountsRoot = pathsV1Frontend['/frontend/issuing/sub-accounts'];
695
+ type SubAccountRoot = pathsV1Frontend['/frontend/issuing/sub-accounts/{sub_account_id}'];
696
+ export namespace List {
697
+ /** `ids` is comma-separated — a targeted read of specific sub-accounts through the list shape. */
698
+ type Request = NonNullable<SubAccountsRoot['get']['parameters']['query']>;
699
+ type Response = SubAccountsRoot['get']['responses']['200']['content']['application/json'];
700
+ /**
701
+ * A `fiat_accounts` row enriched with computed balances, currency and the program embed.
702
+ * `issuing_program.cardholder_requirements` carries the program's cardholder KYC bar even
703
+ * when the program is hidden from the caller's config listing (rail visibility, group
704
+ * whitelist) — the sub-account payload is the one place it can always be read from.
705
+ */
706
+ type SubAccount = NonNullable<Response['data']>[number];
707
+ }
708
+ export namespace Get {
709
+ type Request = {
710
+ sub_account_id: string;
711
+ };
712
+ type Response = SubAccountRoot['get']['responses']['200']['content']['application/json'];
713
+ }
714
+ export namespace Deposit {
695
715
  type Request = {
696
716
  sub_account_id: string;
697
717
  } & SubAccountDepositRoot['post']['requestBody']['content']['application/json'];
698
718
  type Response = WithOrderStatus<SubAccountDepositRoot['post']['responses']['200']['content']['application/json']>;
699
719
  }
700
- namespace Withdraw {
720
+ export namespace Withdraw {
701
721
  type Request = {
702
722
  sub_account_id: string;
703
723
  } & SubAccountWithdrawRoot['post']['requestBody']['content']['application/json'];
704
724
  type Response = WithOrderStatus<SubAccountWithdrawRoot['post']['responses']['200']['content']['application/json']>;
705
725
  }
726
+ export {};
706
727
  }
707
728
  export namespace Cards {
708
729
  namespace List {
@@ -955,10 +976,7 @@ export declare namespace API {
955
976
  /** What each country changes about the cardholder dossier (a `country_rules` entry). */
956
977
  export type CountryRule = NonNullable<NonNullable<CardholderRequirements['country_rules']>[string]>;
957
978
  export namespace List {
958
- /** The spec omits `wallet_id`, but the handler reads it to resolve the tariff group. */
959
- type Request = NonNullable<ProgramsRoot['get']['parameters']['query']> & {
960
- wallet_id?: string;
961
- };
979
+ type Request = NonNullable<ProgramsRoot['get']['parameters']['query']>;
962
980
  type Response = ProgramsRoot['get']['responses']['200']['content']['application/json'];
963
981
  }
964
982
  export namespace Get {
@@ -966,6 +984,11 @@ export declare namespace API {
966
984
  id: string;
967
985
  } & NonNullable<ProgramByIdRoot['get']['parameters']['query']>;
968
986
  type Response = ProgramByIdRoot['get']['responses']['200']['content']['application/json'];
987
+ /**
988
+ * The byId payload: the same program fields as the list item, but `order_types` is the
989
+ * DETAILED form ({id, tokens}) — flatten to ids when a list-shaped Program is needed.
990
+ */
991
+ type Data = NonNullable<Response['data']>;
969
992
  }
970
993
  export {};
971
994
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.36.44",
3
+ "version": "1.36.46",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",