@@ -95,10 +95,14 @@ export type ComponentConfigureResponse = {
9595 errors : string [ ] ;
9696} ;
9797
98+ export type RelationOpts = {
99+ limit ?: number
100+ }
101+
98102/**
99103 * Parameters for the retrieval of apps from the Connect API
100104 */
101- export type GetAppsOpts = {
105+ export type GetAppsOpts = RelationOpts & {
102106 /**
103107 * A search query to filter the apps.
104108 */
@@ -108,7 +112,7 @@ export type GetAppsOpts = {
108112/**
109113 * Parameters for the retrieval of accounts from the Connect API
110114 */
111- export type GetAccountOpts = {
115+ export type GetAccountOpts = RelationOpts & {
112116 /**
113117 * The ID or name slug of the app, in case you want to only retrieve the
114118 * accounts for a specific app.
@@ -201,7 +205,7 @@ export type ComponentConfigureOpts = {
201205 query ?: string ;
202206} ;
203207
204- export type GetComponentOpts = {
208+ export type GetComponentOpts = RelationOpts & {
205209 q ?: string ;
206210 app ?: string ;
207211 componentType ?: "trigger" | "action" ;
@@ -519,6 +523,9 @@ export abstract class BaseClient {
519523 if ( opts ?. q ) {
520524 params . q = opts . q ;
521525 }
526+ if ( opts ?. limit != null ) {
527+ params . limit = "" + opts . limit
528+ }
522529 const resp = await this . makeAuthorizedRequest < AppsRequestResponse > (
523530 "/apps" ,
524531 {
@@ -539,15 +546,14 @@ export abstract class BaseClient {
539546
540547 // XXX only here while need project auth
541548 public async components ( opts ?: GetComponentOpts ) {
542- const params : Record < string , string > = {
543- limit : "20" ,
544- } ;
549+ const params : Record < string , string > = { } ;
545550 if ( opts ?. app ) {
546551 params . app = opts . app ;
547552 }
548553 if ( opts ?. q ) {
549554 params . q = opts . q ;
550555 }
556+ params . limit = "" + ( opts ?. limit ?? 20 )
551557 // XXX can just use /components and ?type instead when supported
552558 let path = "/components" ;
553559 if ( opts ?. componentType === "trigger" ) {
0 commit comments