@@ -96,8 +96,10 @@ export type ComponentConfigureResponse = {
9696} ; 
9797
9898export  type  RelationOpts  =  { 
99-   limit ?: number 
100- } 
99+   after ?: string ; 
100+   before ?: string ; 
101+   limit ?: number ; 
102+ } ; 
101103
102104/** 
103105 * Parameters for the retrieval of apps from the Connect API 
@@ -523,9 +525,7 @@ export abstract class BaseClient {
523525    if  ( opts ?. q )  { 
524526      params . q  =  opts . q ; 
525527    } 
526-     if  ( opts ?. limit  !=  null )  { 
527-       params . limit  =  ""  +  opts . limit 
528-     } 
528+     this . addRelationOpts ( params ,  opts ) ; 
529529    const  resp  =  await  this . makeAuthorizedRequest < AppsRequestResponse > ( 
530530      "/apps" , 
531531      { 
@@ -553,7 +553,7 @@ export abstract class BaseClient {
553553    if  ( opts ?. q )  { 
554554      params . q  =  opts . q ; 
555555    } 
556-     params . limit   =   ""   +   ( opts ?. limit   ??   20 ) 
556+     this . addRelationOpts ( params ,   opts ,   20 ) ; 
557557    // XXX can just use /components and ?type instead when supported 
558558    let  path  =  "/components" ; 
559559    if  ( opts ?. componentType  ===  "trigger" )  { 
@@ -871,4 +871,19 @@ export abstract class BaseClient {
871871      HTTPAuthType . OAuth , 
872872    ) ;  // OAuth auth is required for invoking workflows for external users 
873873  } 
874+ 
875+   private  addRelationOpts ( params : Record < string ,  string > ,  opts ?: RelationOpts ,  defaultLimit ?: number )  { 
876+     if  ( opts ?. limit  !=  null )  { 
877+       params . limit  =  ""  +  opts . limit ; 
878+     } 
879+     if  ( defaultLimit  !=  null  &&  ! params . limit )  { 
880+       params . limit  =  ""  +  defaultLimit ; 
881+     } 
882+     if  ( opts ?. after )  { 
883+       params . after  =  opts . after ; 
884+     } 
885+     if  ( opts ?. before )  { 
886+       params . before  =  opts . before ; 
887+     } 
888+   } 
874889} 
0 commit comments