neonctl 1.27.0-beta.1 → 1.27.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.
@@ -91,19 +91,19 @@ export const builder = (argv) => argv
91
91
  .example([
92
92
  [
93
93
  '$0 branches restore main br-source-branch-123456',
94
- 'Restore main to the head of the branch with id br-source-branch-123456',
94
+ 'Restores main to the head of the branch with id br-source-branch-123456',
95
95
  ],
96
96
  [
97
97
  '$0 branches restore main source@2021-01-01T00:00:00Z',
98
- 'Restore main to the timestamp 2021-01-01T00:00:00Z of the source branch',
98
+ 'Restores main to the timestamp 2021-01-01T00:00:00Z of the source branch',
99
99
  ],
100
100
  [
101
101
  '$0 branches restore my-branch ^self@0/123456',
102
- 'Restore my-branch to the LSN 0/123456 of the branch itself',
102
+ 'Restores my-branch to the LSN 0/123456 from its own history',
103
103
  ],
104
104
  [
105
105
  '$0 branches restore my-branch ^parent',
106
- 'Restore my-branch to the head of the parent branch',
106
+ 'Restore my-branch to the head of its parent branch',
107
107
  ],
108
108
  ]), async (args) => await restore(args))
109
109
  .command('rename <id|name> <new-name>', 'Rename a branch', (yargs) => yargs, async (args) => await rename(args))
@@ -2,6 +2,7 @@ import { EndpointType } from '@neondatabase/api-client';
2
2
  import { branchIdFromProps, fillSingleProject } from '../utils/enrichers.js';
3
3
  import { writer } from '../writer.js';
4
4
  import { psql } from '../utils/psql.js';
5
+ const SSL_MODES = ['require', 'verify-ca', 'verify-full', 'omit'];
5
6
  export const command = 'connection-string [branch]';
6
7
  export const aliases = ['cs'];
7
8
  export const describe = 'Get connection string';
@@ -50,9 +51,10 @@ export const builder = (argv) => {
50
51
  default: false,
51
52
  },
52
53
  ssl: {
53
- type: 'boolean',
54
- describe: 'Add sslmode=require to the connection string',
55
- default: true,
54
+ type: 'string',
55
+ choices: SSL_MODES,
56
+ default: 'require',
57
+ describe: 'SSL mode',
56
58
  },
57
59
  })
58
60
  .middleware(fillSingleProject);
@@ -112,8 +114,8 @@ export const handler = async (props) => {
112
114
  connectionString.searchParams.set('pgbouncer', 'true');
113
115
  }
114
116
  }
115
- if (props.ssl) {
116
- connectionString.searchParams.set('sslmode', 'require');
117
+ if (props.ssl !== 'omit') {
118
+ connectionString.searchParams.set('sslmode', props.ssl);
117
119
  }
118
120
  if (props.psql) {
119
121
  const psqlArgs = props['--'];
@@ -177,7 +177,25 @@ describe('connection_string', () => {
177
177
  '--role-name',
178
178
  'test_role',
179
179
  '--ssl',
180
- 'false',
180
+ 'omit',
181
+ ],
182
+ expected: {
183
+ snapshot: true,
184
+ },
185
+ });
186
+ testCliCommand({
187
+ name: 'connection_string with ssl verify full',
188
+ args: [
189
+ 'connection-string',
190
+ 'test_branch',
191
+ '--project-id',
192
+ 'test',
193
+ '--database-name',
194
+ 'test_db',
195
+ '--role-name',
196
+ 'test_role',
197
+ '--ssl',
198
+ 'verify-full',
181
199
  ],
182
200
  expected: {
183
201
  snapshot: true,
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.27.0-beta.1",
8
+ "version": "1.27.1",
9
9
  "description": "CLI tool for NeonDB Cloud management",
10
10
  "main": "index.js",
11
11
  "author": "NeonDB",