neonctl 1.19.0 → 1.19.1

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.
@@ -82,8 +82,11 @@ const create = async (props) => {
82
82
  project,
83
83
  });
84
84
  const out = writer(props);
85
- out.write(data.project, { fields: PROJECT_FIELDS });
86
- out.write(data.connection_uris, { fields: ['connection_uri'] });
85
+ out.write(data.project, { fields: PROJECT_FIELDS, title: 'Project' });
86
+ out.write(data.connection_uris, {
87
+ fields: ['connection_uri'],
88
+ title: 'Connection URIs',
89
+ });
87
90
  out.end();
88
91
  };
89
92
  const deleteProject = async (props) => {
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.19.0",
8
+ "version": "1.19.1",
9
9
  "description": "CLI tool for NeonDB Cloud management",
10
10
  "main": "index.js",
11
11
  "author": "NeonDB",
@@ -0,0 +1,4 @@
1
+ export const toSnakeCase = (str) => str
2
+ .split(' ')
3
+ .map((word) => word.toLowerCase())
4
+ .join('_');
package/writer.js CHANGED
@@ -2,6 +2,7 @@ import YAML from 'yaml';
2
2
  import Table from 'cli-table';
3
3
  import chalk from 'chalk';
4
4
  import { isCi } from './env.js';
5
+ import { toSnakeCase } from './utils/string.js';
5
6
  /**
6
7
  *
7
8
  * Parses the output format, takes data and writes the output to stdout.
@@ -32,7 +33,7 @@ export const writer = (props) => {
32
33
  out.write(YAML.stringify(chunks.length === 1
33
34
  ? chunks[0].data
34
35
  : Object.fromEntries(chunks.map(({ config, data }, idx) => [
35
- config.title ?? idx,
36
+ config.title ? toSnakeCase(config.title) : idx,
36
37
  data,
37
38
  ])), null, 2));
38
39
  return;
@@ -41,7 +42,7 @@ export const writer = (props) => {
41
42
  out.write(JSON.stringify(chunks.length === 1
42
43
  ? chunks[0].data
43
44
  : Object.fromEntries(chunks.map(({ config, data }, idx) => [
44
- config.title ?? idx,
45
+ config.title ? toSnakeCase(config.title) : idx,
45
46
  data,
46
47
  ])), null, 2));
47
48
  return;