@@ -16,6 +16,7 @@ import { filterArray } from "../../filter.ts";
1616import {
1717 confirm ,
1818 ensureApiException ,
19+ getAllPaginated ,
1920 inform ,
2021 logError ,
2122 logErrorAndExit ,
@@ -35,7 +36,9 @@ const deploymentsList = new Command()
3536 const app = await getSelectedAppOrExit ( options ) ;
3637 let deployments : AppLocationSetting [ ] = [ ] ;
3738 try {
38- deployments = await apiClient . getAppLocationSettings ( app . id ) ;
39+ deployments = await getAllPaginated ( ( page ) =>
40+ apiClient . getAppLocationSettings ( app . id , 50 , page )
41+ ) ;
3942 } catch ( error ) {
4043 ensureApiException ( error ) ;
4144 logErrorAndExit (
@@ -76,7 +79,9 @@ export const getDeploymentDetails = new Command()
7679 if ( ! deploymentId ) {
7780 let deployments : AppLocationSetting [ ] = [ ] ;
7881 try {
79- deployments = await apiClient . getAppLocationSettings ( app . id ) ;
82+ deployments = await getAllPaginated ( ( page ) =>
83+ apiClient . getAppLocationSettings ( app . id , 50 , page )
84+ ) ;
8085 } catch ( error ) {
8186 ensureApiException ( error ) ;
8287 logErrorAndExit (
@@ -154,7 +159,9 @@ export const createDeployment = new Command()
154159 // Select Location
155160 let locations : Location [ ] = [ ] ;
156161 try {
157- locations = await apiClient . getLocations ( ) ;
162+ locations = await getAllPaginated ( ( page ) =>
163+ apiClient . getLocations ( 50 , page )
164+ ) ;
158165 } catch ( error ) {
159166 ensureApiException ( error ) ;
160167 logErrorAndExit (
@@ -186,7 +193,9 @@ export const createDeployment = new Command()
186193
187194 let configs : ServerConfig [ ] = [ ] ;
188195 try {
189- configs = await apiClient . getServerConfigs ( app . id ) ;
196+ configs = await getAllPaginated ( ( page ) =>
197+ apiClient . getServerConfigs ( app . id , 50 , page )
198+ ) ;
190199 } catch ( error ) {
191200 ensureApiException ( error ) ;
192201 logErrorAndExit (
@@ -234,7 +243,9 @@ export const createDeployment = new Command()
234243 // Try to find the correct location using the specified options (--city, --country and --password)
235244 let locations : Location [ ] = [ ] ;
236245 try {
237- locations = await apiClient . getLocations ( ) ;
246+ locations = await getAllPaginated ( ( page ) =>
247+ apiClient . getLocations ( 50 , page )
248+ ) ;
238249 } catch ( error ) {
239250 ensureApiException ( error ) ;
240251 logErrorAndExit (
@@ -337,7 +348,9 @@ const updateDeployment = new Command()
337348 let deploymentId = options . deploymentId ;
338349 let deployments : AppLocationSetting [ ] = [ ] ;
339350 try {
340- deployments = await apiClient . getAppLocationSettings ( selectedApp . id ) ;
351+ deployments = await getAllPaginated ( ( page ) =>
352+ apiClient . getAppLocationSettings ( selectedApp . id , 50 , page )
353+ ) ;
341354 } catch ( error ) {
342355 ensureApiException ( error ) ;
343356 logErrorAndExit (
@@ -416,7 +429,9 @@ const deleteDeployment = new Command()
416429 let deploymentId = options . deploymentId ;
417430 let deployments : AppLocationSetting [ ] = [ ] ;
418431 try {
419- deployments = await apiClient . getAppLocationSettings ( selectedApp . id ) ;
432+ deployments = await getAllPaginated ( ( page ) =>
433+ apiClient . getAppLocationSettings ( selectedApp . id , 50 , page )
434+ ) ;
420435 } catch ( error ) {
421436 ensureApiException ( error ) ;
422437 logErrorAndExit (
0 commit comments