neonctl 1.17.1 → 1.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/auth.js CHANGED
@@ -39,7 +39,7 @@ export const auth = async ({ oauthHost, clientId }) => {
39
39
  // Start HTTP server and wait till /callback is hit
40
40
  //
41
41
  const server = createServer();
42
- server.listen(0, function () {
42
+ server.listen(0, 'localhost', function () {
43
43
  log.info(`Listening on port ${this.address().port}`);
44
44
  });
45
45
  const listen_port = server.address().port;
@@ -96,5 +96,5 @@ export const handler = async (props) => {
96
96
  connectionString.searchParams.set('pgbouncer', 'true');
97
97
  }
98
98
  }
99
- process.stdout.write(connectionString.toString());
99
+ process.stdout.write(connectionString.toString() + '\n');
100
100
  };
@@ -1,3 +1,4 @@
1
+ import { log } from '../log.js';
1
2
  import { projectCreateRequest } from '../parameters.gen.js';
2
3
  import { commandFailHandler } from '../utils/middlewares.js';
3
4
  import { writer } from '../writer.js';
@@ -9,6 +10,7 @@ const REGIONS = [
9
10
  'aws-us-east-2',
10
11
  'aws-us-east-1',
11
12
  ];
13
+ const PROJECTS_LIST_LIMIT = 100;
12
14
  export const command = 'projects';
13
15
  export const describe = 'Manage projects';
14
16
  export const aliases = ['project'];
@@ -51,8 +53,22 @@ export const handler = (args) => {
51
53
  return args;
52
54
  };
53
55
  const list = async (props) => {
54
- const { data } = await props.apiClient.listProjects({});
55
- writer(props).end(data.projects, { fields: PROJECT_FIELDS });
56
+ const result = [];
57
+ let cursor;
58
+ let end = false;
59
+ while (!end) {
60
+ const { data } = await props.apiClient.listProjects({
61
+ limit: PROJECTS_LIST_LIMIT,
62
+ cursor,
63
+ });
64
+ result.push(...data.projects);
65
+ cursor = data.pagination?.cursor;
66
+ log.debug('Got %d projects, with cursor: %s', data.projects.length, cursor);
67
+ if (data.projects.length < PROJECTS_LIST_LIMIT) {
68
+ end = true;
69
+ }
70
+ }
71
+ writer(props).end(result, { fields: PROJECT_FIELDS });
56
72
  };
57
73
  const create = async (props) => {
58
74
  const project = {};
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git@github.com:neondatabase/neonctl.git"
6
6
  },
7
7
  "type": "module",
8
- "version": "1.17.1",
8
+ "version": "1.17.2",
9
9
  "description": "CLI tool for NeonDB Cloud management",
10
10
  "main": "index.js",
11
11
  "author": "NeonDB",