@forge/cli
12.11.012.12.0-next.9
out/environment/list-environment.jsout/environment/list-environment.js+14−3
Index: package/out/environment/list-environment.js
===================================================================
--- package/out/environment/list-environment.js
+++ package/out/environment/list-environment.js
@@ -7,13 +7,24 @@
constructor(client, getAppConfig) {
this.client = client;
this.getAppConfig = getAppConfig;
}
- async execute() {
+ async fetchPage(before) {
const { id: appId } = await this.getAppConfig();
- return this.client.listEnvironment({
- appId
+ return this.client.listEnvironmentPage({
+ appId,
+ before
});
}
+ async fetchAll() {
+ const allEnvironments = [];
+ let cursor;
+ do {
+ const { environments, hasPreviousPage, startCursor } = await this.fetchPage(cursor);
+ allEnvironments.push(...environments);
+ cursor = hasPreviousPage ? startCursor : undefined;
+ } while (cursor);
+ return allEnvironments;
+ }
}
exports.ListEnvironmentCommand = ListEnvironmentCommand;
//# sourceMappingURL=list-environment.js.map
\ No newline at end of file