File tree Expand file tree Collapse file tree 5 files changed +47
-10
lines changed Expand file tree Collapse file tree 5 files changed +47
-10
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ export class Accounts extends BaseResource {
5454 ...( params ?. customerId && { "filter[customerId]" : params . customerId } ) ,
5555 ...( params ?. tags && { "filter[tags]" : params . tags } ) ,
5656 ...( params ?. include && { "include" : params . include } ) ,
57+ ...( params ?. fromBalance && { "filter[fromBalance]" : params . fromBalance } ) ,
58+ ...( params ?. toBalance && { "filter[toBalance]" : params . toBalance } ) ,
5759 }
5860
5961 if ( params ?. status )
@@ -108,4 +110,15 @@ export interface AccountListParams extends BaseListParams {
108110 * default: empty
109111 */
110112 include ?: string
113+
114+ /**
115+ * Optional. Filters Accounts that have balance higher or equal to the specified amount (in cents). e.g. 5000
116+ */
117+ fromBalance ?: number
118+
119+ /**
120+ * Optional. Filters Accounts that have balance lower or equal to the specified amount (in cents). e.g. 7000
121+ */
122+ toBalance ?: number
123+
111124}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export class Applications extends BaseResource {
99 }
1010
1111 public async list ( params ?: ApplicationListParams ) : Promise < UnitResponse < Application [ ] > > {
12- const parameters = {
12+ const parameters : any = {
1313 "page[limit]" : ( params ?. limit ? params ?. limit : 100 ) ,
1414 "page[offset]" : ( params ?. offset ? params ?. offset : 0 ) ,
1515 ...( params ?. query && { "filter[query]" : params ?. query } ) ,
@@ -18,6 +18,11 @@ export class Applications extends BaseResource {
1818 "sort" : params ?. sort ? params . sort : "-createdAt"
1919 }
2020
21+ if ( params ?. status )
22+ params . status . forEach ( ( s , idx ) => {
23+ parameters [ `filter[status][${ idx } ]` ] = s
24+ } )
25+
2126 return this . httpGet < UnitResponse < Application [ ] > > ( "" , { params : parameters } )
2227 }
2328
@@ -93,4 +98,9 @@ export interface ApplicationListParams extends BaseListParams {
9398 * default: sort=-createdAt
9499 */
95100 sort ?: string
101+
102+ /**
103+ * Optional. Filter Account by its status (Open, Frozen, or Closed). Usage example: filter[status][0]=Closed
104+ */
105+ status ?: string [ ]
96106}
Original file line number Diff line number Diff line change 1- import { Authorization , AuthorizationStatus } from "../types/authorization"
1+ import { Authorization , AuthorizationStatus } from "../types/authorization"
22import { Meta , UnitConfig , UnitResponse } from "../types/common"
33import { BaseResource } from "./baseResource"
44
@@ -43,9 +43,9 @@ export class Authorizations extends BaseResource {
4343
4444export interface AuthorizationQueryParams {
4545 /**
46- * Maximum number of resources that will be returned. Maximum is 1000 resources. [See Pagination](https://developers.unit.co/#intro-pagination).
47- * default: 100
48- */
46+ * Maximum number of resources that will be returned. Maximum is 1000 resources. [See Pagination](https://developers.unit.co/#intro-pagination).
47+ * default: 100
48+ */
4949 limit ?: number
5050
5151 /**
Original file line number Diff line number Diff line change @@ -61,7 +61,9 @@ export class Cards extends BaseResource {
6161 "page[offset]" : ( params ?. offset ? params . offset : 0 ) ,
6262 ...( params ?. accountId && { "filter[accountId]" : params . accountId } ) ,
6363 ...( params ?. customerId && { "filter[customerId]" : params . customerId } ) ,
64- ...( params ?. include && { "include" : params . include } )
64+ ...( params ?. include && { "include" : params . include } ) ,
65+ ...( params ?. tags && { "filter[tags]" : params ?. tags } ) ,
66+ "sort" : params ?. sort ? params . sort : "-createdAt"
6567 }
6668
6769 if ( params ?. status )
@@ -77,8 +79,8 @@ export class Cards extends BaseResource {
7779
7880 return await this . httpGet < UnitResponse < PinStatus > > ( path )
7981 }
80-
81- public async limits ( id : string ) : Promise < UnitResponse < CardLimits > > {
82+
83+ public async limits ( id : string ) : Promise < UnitResponse < CardLimits > > {
8284 return this . httpGet < UnitResponse < CardLimits > > ( `/${ id } /limits` )
8385 }
8486
@@ -110,4 +112,16 @@ export interface CardListParams extends BaseListParams {
110112 * Optional. Filter customers by status (Active, Archived). Usage example: *filter[status][0]=Active
111113 */
112114 status ?: string [ ]
115+
116+ /**
117+ * Optional. Filter Applications by Tags.
118+ * default: empty
119+ */
120+ tags ?: object
121+
122+ /**
123+ * Optional. sort=createdAt for ascending order or sort=-createdAt (leading minus sign) for descending order.
124+ * default: sort=-createdAt
125+ */
126+ sort ?: string
113127}
Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ export class Transactions extends BaseResource {
4040 ...( params ?. until && { "filter[until]" : params . until } ) ,
4141 ...( params ?. cardId && { "filter[cardId]" : params . cardId } ) ,
4242 ...( params ?. excludeFees && { "excludeFees" : params . excludeFees } ) ,
43- ...( params ?. fromAmount && { "fromAmount" : params . fromAmount } ) ,
44- ...( params ?. toAmount && { "toAmount" : params . toAmount } ) ,
43+ ...( params ?. fromAmount && { "filter[ fromAmount] " : params . fromAmount } ) ,
44+ ...( params ?. toAmount && { "filter[ toAmount] " : params . toAmount } ) ,
4545 "sort" : params ?. sort ? params . sort : "-createdAt" ,
4646 "include" : params ?. include ? params . include : ""
4747 }
You can’t perform that action at this time.
0 commit comments