squarefi-bff-api-module 1.35.3 → 1.36.0

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.
@@ -9,9 +9,9 @@ export declare const issuing: {
9
9
  subAccountCard: (data: API.Cards.Create.SubAccountRequest) => Promise<API.Cards.Create.ExtendedSubAccountResponse>;
10
10
  };
11
11
  byWalletUuid: {
12
- getAll: (params: API.Cards.CardsList.Request.ByWalletUuid) => Promise<API.Cards.CardsList.Response>;
13
- getBySubaccountType: (params: API.Cards.CardsList.Request.BySubaccountAndWalletUuid) => Promise<API.Cards.CardsList.Response>;
14
- getBySubAccount: (params: API.Cards.CardsList.Request.BySubAccountAndWalletId) => Promise<API.Cards.CardsList.Response>;
12
+ getAll: ({ limit, offset, ...rest }: API.Cards.CardsList.Request.ByWalletUuid) => Promise<API.Cards.CardsList.Response>;
13
+ getBySubaccountType: ({ limit, offset, ...rest }: API.Cards.CardsList.Request.BySubaccountAndWalletUuid) => Promise<API.Cards.CardsList.Response>;
14
+ getBySubAccount: ({ limit, offset, ...rest }: API.Cards.CardsList.Request.BySubAccountAndWalletId) => Promise<API.Cards.CardsList.Response>;
15
15
  };
16
16
  getById: (card_id: string) => Promise<API.Cards.IssuingCardDetailItem>;
17
17
  sensitiveData: {
@@ -33,8 +33,8 @@ export declare const issuing: {
33
33
  rename: (card_id: string, nick_name: string) => Promise<API.Cards.IssuingCardDetailItem>;
34
34
  };
35
35
  transactions: {
36
- getByCardId: (card_id: string, limit?: number, offset?: number) => Promise<API.Cards.TransactionsList>;
37
- getBySubAccountId: (fiat_account_id: string, limit?: number, offset?: number) => Promise<API.Cards.TransactionsList>;
36
+ getByCardId: ({ card_id, limit, offset, transaction_type, status, from, to, }: API.Cards.Transactions.List.ByCardIdRequest) => Promise<API.Cards.TransactionsList>;
37
+ getBySubAccountId: ({ fiat_account_id, limit, offset, transaction_type, status, from, to, }: API.Cards.Transactions.List.BySubAccountIdRequest) => Promise<API.Cards.TransactionsList>;
38
38
  csv: {
39
39
  getByCardId: (card_id: string) => Promise<string>;
40
40
  getBySubAccountId: (sub_account_id: string) => Promise<string>;
@@ -31,14 +31,14 @@ export const issuing = {
31
31
  },
32
32
  },
33
33
  byWalletUuid: {
34
- getAll: (params) => apiClientV1.getRequest('/issuing/cards', {
35
- params,
34
+ getAll: ({ limit = defaultPaginationParams.limit, offset = defaultPaginationParams.offset, ...rest }) => apiClientV1.getRequest('/issuing/cards', {
35
+ params: { ...rest, limit, offset },
36
36
  }),
37
- getBySubaccountType: (params) => apiClientV1.getRequest('/issuing/cards', {
38
- params,
37
+ getBySubaccountType: ({ limit = defaultPaginationParams.limit, offset = defaultPaginationParams.offset, ...rest }) => apiClientV1.getRequest('/issuing/cards', {
38
+ params: { ...rest, limit, offset },
39
39
  }),
40
- getBySubAccount: (params) => apiClientV1.getRequest('/issuing/cards', {
41
- params,
40
+ getBySubAccount: ({ limit = defaultPaginationParams.limit, offset = defaultPaginationParams.offset, ...rest }) => apiClientV1.getRequest('/issuing/cards', {
41
+ params: { ...rest, limit, offset },
42
42
  }),
43
43
  },
44
44
  // getById: (card_id: string) => apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`),
@@ -86,11 +86,11 @@ export const issuing = {
86
86
  }),
87
87
  },
88
88
  transactions: {
89
- getByCardId: (card_id, limit = defaultPaginationParams.limit, offset = defaultPaginationParams.offset) => apiClientV1.getRequest(`/issuing/transactions/`, {
90
- params: { limit, offset, card_id, new_scheme: true },
89
+ getByCardId: ({ card_id, limit = defaultPaginationParams.limit, offset = defaultPaginationParams.offset, transaction_type, status, from, to, }) => apiClientV1.getRequest(`/issuing/transactions/`, {
90
+ params: { limit, offset, card_id, new_scheme: true, transaction_type, status, from, to },
91
91
  }),
92
- getBySubAccountId: (fiat_account_id, limit = defaultPaginationParams.limit, offset = defaultPaginationParams.offset) => apiClientV1.getRequest(`/issuing/transactions/`, {
93
- params: { limit, offset, fiat_account_id, new_scheme: true },
92
+ getBySubAccountId: ({ fiat_account_id, limit = defaultPaginationParams.limit, offset = defaultPaginationParams.offset, transaction_type, status, from, to, }) => apiClientV1.getRequest(`/issuing/transactions/`, {
93
+ params: { limit, offset, fiat_account_id, new_scheme: true, transaction_type, status, from, to },
94
94
  }),
95
95
  csv: {
96
96
  getByCardId: (card_id) => apiClientV1.getRequest(`/issuing/transactions/csv`, {
@@ -2011,6 +2011,8 @@ export interface paths {
2011
2011
  sub_account_type?: "prepaid" | "balance";
2012
2012
  /** @description Filter cards by status */
2013
2013
  status?: "ACTIVE" | "INACTIVE" | "SUSPENDED" | "CANCELED";
2014
+ /** @description Filter cards by exact last 4 digits of the card number */
2015
+ last4?: string;
2014
2016
  /** @description Number of items to skip */
2015
2017
  offset?: number;
2016
2018
  /** @description Number of items to return */
@@ -3229,7 +3231,81 @@ export interface paths {
3229
3231
  delete?: never;
3230
3232
  options?: never;
3231
3233
  head?: never;
3232
- patch?: never;
3234
+ /**
3235
+ * Update sub-account
3236
+ * @description Updates editable fields of a sub-account. Currently only the `nick_name` can be changed.
3237
+ *
3238
+ * **Authentication**: x-api-key header required
3239
+ *
3240
+ * **Access Control**: User must have access to the sub-account
3241
+ *
3242
+ */
3243
+ patch: {
3244
+ parameters: {
3245
+ query?: never;
3246
+ header?: never;
3247
+ path: {
3248
+ /** @description The ID of the sub-account to update */
3249
+ sub_account_id: string;
3250
+ };
3251
+ cookie?: never;
3252
+ };
3253
+ requestBody: {
3254
+ content: {
3255
+ "application/json": {
3256
+ /**
3257
+ * @description New nickname for the sub-account
3258
+ * @example Travel budget
3259
+ */
3260
+ nick_name: string;
3261
+ };
3262
+ };
3263
+ };
3264
+ responses: {
3265
+ /** @description Sub-account updated successfully */
3266
+ 200: {
3267
+ headers: {
3268
+ [name: string]: unknown;
3269
+ };
3270
+ content: {
3271
+ "application/json": {
3272
+ /** @example true */
3273
+ success?: boolean;
3274
+ data?: components["schemas"]["IssuingSubAccount"];
3275
+ /** @example Sub-account updated successfully */
3276
+ message?: string;
3277
+ };
3278
+ };
3279
+ };
3280
+ /** @description Bad Request - nick_name is required */
3281
+ 400: {
3282
+ headers: {
3283
+ [name: string]: unknown;
3284
+ };
3285
+ content: {
3286
+ "application/json": components["schemas"]["ApiErrorResponse"];
3287
+ };
3288
+ };
3289
+ /** @description Access denied to this sub-account */
3290
+ 403: {
3291
+ headers: {
3292
+ [name: string]: unknown;
3293
+ };
3294
+ content: {
3295
+ "application/json": components["schemas"]["ApiErrorResponse"];
3296
+ };
3297
+ };
3298
+ /** @description Sub-account not found */
3299
+ 404: {
3300
+ headers: {
3301
+ [name: string]: unknown;
3302
+ };
3303
+ content: {
3304
+ "application/json": components["schemas"]["ApiErrorResponse"];
3305
+ };
3306
+ };
3307
+ };
3308
+ };
3233
3309
  trace?: never;
3234
3310
  };
3235
3311
  "/api/issuing/sub-accounts/{sub_account_id}/transactions": {
@@ -1736,6 +1736,8 @@ export interface paths {
1736
1736
  sub_account_type?: "prepaid" | "balance";
1737
1737
  /** @description Filter cards by status */
1738
1738
  status?: "ACTIVE" | "INACTIVE" | "SUSPENDED" | "CANCELED";
1739
+ /** @description Filter cards by exact last 4 digits of the card number */
1740
+ last4?: string;
1739
1741
  /** @description Number of items to skip */
1740
1742
  offset?: number;
1741
1743
  /** @description Number of items to return */
@@ -3008,7 +3010,76 @@ export interface paths {
3008
3010
  delete?: never;
3009
3011
  options?: never;
3010
3012
  head?: never;
3011
- patch?: never;
3013
+ /**
3014
+ * Update sub-account
3015
+ * @description Updates editable fields of a sub-account. Currently only the `nick_name` can be changed.
3016
+ *
3017
+ * **Authentication**: Bearer token with x-tenant-id header required
3018
+ *
3019
+ * **Access Control**: User must have ADMIN role on the sub-account's wallet
3020
+ *
3021
+ */
3022
+ patch: {
3023
+ parameters: {
3024
+ query?: never;
3025
+ header?: never;
3026
+ path: {
3027
+ /** @description The ID of the sub-account to update */
3028
+ sub_account_id: string;
3029
+ };
3030
+ cookie?: never;
3031
+ };
3032
+ requestBody: {
3033
+ content: {
3034
+ "application/json": {
3035
+ /**
3036
+ * @description New nickname for the sub-account
3037
+ * @example Travel budget
3038
+ */
3039
+ nick_name: string;
3040
+ };
3041
+ };
3042
+ };
3043
+ responses: {
3044
+ /** @description Sub-account updated successfully */
3045
+ 200: {
3046
+ headers: {
3047
+ [name: string]: unknown;
3048
+ };
3049
+ content: {
3050
+ "application/json": {
3051
+ /** @example true */
3052
+ success?: boolean;
3053
+ /** @description Updated sub-account details */
3054
+ data?: Record<string, never>;
3055
+ /** @example Sub-account updated successfully */
3056
+ message?: string;
3057
+ };
3058
+ };
3059
+ };
3060
+ /** @description Bad Request - nick_name is required */
3061
+ 400: {
3062
+ headers: {
3063
+ [name: string]: unknown;
3064
+ };
3065
+ content?: never;
3066
+ };
3067
+ /** @description Access denied to this sub-account */
3068
+ 403: {
3069
+ headers: {
3070
+ [name: string]: unknown;
3071
+ };
3072
+ content?: never;
3073
+ };
3074
+ /** @description Sub-account not found */
3075
+ 404: {
3076
+ headers: {
3077
+ [name: string]: unknown;
3078
+ };
3079
+ content?: never;
3080
+ };
3081
+ };
3082
+ };
3012
3083
  trace?: never;
3013
3084
  };
3014
3085
  "/frontend/issuing/sub-accounts/{sub_account_id}/transactions": {
@@ -1260,13 +1260,18 @@ export interface paths {
1260
1260
  sort_by?: "card_id" | "nick_name" | "name_on_card" | "last4" | "card_status" | "created_at";
1261
1261
  /** @description Sort direction */
1262
1262
  sort_order?: "ASC" | "DESC";
1263
+ /**
1264
+ * @description Filter cards by exact last 4 digits of the card number (equality match against `issuing_cards.last4`).
1265
+ * @example 1234
1266
+ */
1267
+ "filter[last4]"?: string;
1263
1268
  /** @description Filter by specific card properties. Can be provided in three ways:
1264
1269
  * 1. As JSON object: `filter={"last4":"1234"}`
1265
1270
  * 2. As query params: `filter[last4]=1234`
1266
1271
  * 3. For nested filtering: `filter[fiat_account][type]=prepaid`
1267
1272
  *
1268
1273
  * Common filter fields:
1269
- * - `last4`: Filter by last 4 digits of card
1274
+ * - `last4`: Filter by last 4 digits of card (exact match)
1270
1275
  * - `card_status`: Filter by status (ACTIVE, INACTIVE, CANCELED)
1271
1276
  * - `fiat_account.type`: Filter by account type (prepaid, balance)
1272
1277
  * - `from_created_at`: Filter cards created on or after this date (ISO 8601 format)
@@ -2284,10 +2289,12 @@ export interface paths {
2284
2289
  new_scheme?: boolean;
2285
2290
  /** @description Filter by transaction type */
2286
2291
  transaction_type?: string;
2287
- /** @description Filter by start date */
2292
+ /** @description Filter by start date (ISO 8601). Sent to external provider as `from_timestamp` and post-filtered against `cleared_at`/`created_at`. */
2288
2293
  from?: string;
2289
- /** @description Filter by end date */
2294
+ /** @description Filter by end date (ISO 8601). Sent to external provider as `to_timestamp` and post-filtered against `cleared_at`/`created_at`. */
2290
2295
  to?: string;
2296
+ /** @description Filter by transaction status. Forwarded to external provider and applied as a post-filter on the combined result. */
2297
+ status?: "PENDING" | "APPROVED" | "DECLINED" | "CANCELED";
2291
2298
  };
2292
2299
  header?: never;
2293
2300
  path?: never;
@@ -6490,7 +6490,60 @@ export interface paths {
6490
6490
  delete?: never;
6491
6491
  options?: never;
6492
6492
  head?: never;
6493
- patch?: never;
6493
+ /**
6494
+ * Update sub-account
6495
+ * @description Updates editable fields of a sub-account. Currently only the `nick_name` can be changed.
6496
+ */
6497
+ patch: {
6498
+ parameters: {
6499
+ query?: never;
6500
+ header?: never;
6501
+ path: {
6502
+ sub_account_id: string;
6503
+ };
6504
+ cookie?: never;
6505
+ };
6506
+ requestBody: {
6507
+ content: {
6508
+ "application/json": {
6509
+ nick_name: string;
6510
+ };
6511
+ };
6512
+ };
6513
+ responses: {
6514
+ /** @description Sub-account updated */
6515
+ 200: {
6516
+ headers: {
6517
+ [name: string]: unknown;
6518
+ };
6519
+ content: {
6520
+ "application/json": {
6521
+ /** @example true */
6522
+ success?: boolean;
6523
+ data?: components["schemas"]["IssuingSubAccount"];
6524
+ };
6525
+ };
6526
+ };
6527
+ /** @description Bad Request — nick_name is required */
6528
+ 400: {
6529
+ headers: {
6530
+ [name: string]: unknown;
6531
+ };
6532
+ content: {
6533
+ "application/json": components["schemas"]["ErrorResponse"];
6534
+ };
6535
+ };
6536
+ /** @description Sub-account not found */
6537
+ 404: {
6538
+ headers: {
6539
+ [name: string]: unknown;
6540
+ };
6541
+ content: {
6542
+ "application/json": components["schemas"]["ErrorResponse"];
6543
+ };
6544
+ };
6545
+ };
6546
+ };
6494
6547
  trace?: never;
6495
6548
  };
6496
6549
  "/admin/issuing/sub-accounts/{sub_account_id}/transactions": {
@@ -1,6 +1,7 @@
1
1
  import { APIKeyRole, CardFormFactor, CardTransactionType, CardType, CurrencyType, IssuingProgramStatus, OrderType, SortingDirection, SubAccountType } from '../../constants';
2
2
  import { components, operations, paths } from './autogen/apiV2.types';
3
3
  import { components as componentsV1Frontend, paths as pathsV1Frontend } from './autogen/apiV1Frontend.types';
4
+ import { paths as pathsV1Legacy } from './autogen/apiV1Legacy.types';
4
5
  export declare namespace API {
5
6
  namespace Auth {
6
7
  namespace RefreshToken {
@@ -221,16 +222,11 @@ export declare namespace API {
221
222
  }
222
223
  namespace CardsList {
223
224
  namespace Request {
224
- type CardsListSortingFields = Partial<Pick<IssuingCardListItem, 'created_at' | 'card_status' | 'last4' | 'nick_name' | 'name_on_card' | 'card_id'>>;
225
- type CardsListFilteringFields = Partial<IssuingCardListItem>;
226
- type CardsListRequestCommonParams = API.Common.Pagination.Request & API.Common.Sorting.Request<CardsListSortingFields> & API.Common.Filtering.Request<CardsListFilteringFields>;
227
- interface ByWalletUuid extends CardsListRequestCommonParams {
228
- wallet_uuid: string;
229
- }
230
- interface BySubaccountAndWalletUuid extends ByWalletUuid {
225
+ type ByWalletUuid = NonNullable<pathsV1Legacy['/issuing/cards']['get']['parameters']['query']>;
226
+ type BySubaccountAndWalletUuid = ByWalletUuid & {
231
227
  filter?: Record<'fiat_account', Record<'type', SubAccountType>>;
232
- }
233
- type BySubAccountAndWalletId = ByWalletUuid & {
228
+ };
229
+ type BySubAccountAndWalletId = Omit<ByWalletUuid, 'fiat_account_id'> & {
234
230
  fiat_account_id: string;
235
231
  };
236
232
  }
@@ -271,6 +267,19 @@ export declare namespace API {
271
267
  has_more: boolean;
272
268
  count: number;
273
269
  }
270
+ namespace Transactions {
271
+ namespace List {
272
+ type Query = NonNullable<pathsV1Legacy['/issuing/transactions']['get']['parameters']['query']>;
273
+ export type StatusFilter = NonNullable<Query['status']>;
274
+ export type ByCardIdRequest = Omit<Query, 'card_id'> & {
275
+ card_id: string;
276
+ };
277
+ export type BySubAccountIdRequest = Omit<Query, 'fiat_account_id'> & {
278
+ fiat_account_id: string;
279
+ };
280
+ export {};
281
+ }
282
+ }
274
283
  interface SensitiveData {
275
284
  card_number: string;
276
285
  cvv: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.35.3",
3
+ "version": "1.36.0",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",