neonctl 1.26.0 → 1.26.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/README.md +2 -1
- package/commands/ip_allow.js +3 -1
- package/commands/ip_allow.test.js +8 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -68,7 +68,8 @@ The Neon CLI supports autocompletion, which you can configure in a few easy step
|
|
|
68
68
|
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------- | ---------------------------- |
|
|
69
69
|
| [auth](https://neon.tech/docs/reference/cli-auth) | | Authenticate |
|
|
70
70
|
| [projects](https://neon.tech/docs/reference/cli-projects) | `list`, `create`, `update`, `delete`, `get` | Manage projects |
|
|
71
|
-
| [
|
|
71
|
+
| [ip-allow](https://neon.tech/docs/reference/cli-ip-allow) | `list`, `add`, `remove`, `reset` | Manage IP Allow |
|
|
72
|
+
| [me](https://neon.tech/docs/reference/cli-me) | | Show current user |
|
|
72
73
|
| [branches](https://neon.tech/docs/reference/cli-branches) | `list`, `create`, `rename`, `add-compute`, `set-primary`, `delete`, `get` | Manage branches |
|
|
73
74
|
| [databases](https://neon.tech/docs/reference/cli-databases) | `list`, `create`, `delete` | Manage databases |
|
|
74
75
|
| [roles](https://neon.tech/docs/reference/cli-roles) | `list`, `create`, `delete` | Manage roles |
|
package/commands/ip_allow.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { writer } from '../writer.js';
|
|
2
|
+
import { fillSingleProject } from '../utils/enrichers.js';
|
|
2
3
|
import { projectUpdateRequest } from '../parameters.gen.js';
|
|
3
4
|
import { log } from '../log.js';
|
|
4
5
|
const IP_ALLOW_FIELDS = [
|
|
@@ -18,6 +19,7 @@ export const builder = (argv) => {
|
|
|
18
19
|
type: 'string',
|
|
19
20
|
},
|
|
20
21
|
})
|
|
22
|
+
.middleware(fillSingleProject)
|
|
21
23
|
.command('list', 'List the IP allowlist', (yargs) => yargs, async (args) => {
|
|
22
24
|
await list(args);
|
|
23
25
|
})
|
|
@@ -45,7 +47,7 @@ export const builder = (argv) => {
|
|
|
45
47
|
}), async (args) => {
|
|
46
48
|
await remove(args);
|
|
47
49
|
})
|
|
48
|
-
.command('reset [ips...]', 'Reset the IP allowlist', (yargs) => yargs.usage('$0 ip-allow
|
|
50
|
+
.command('reset [ips...]', 'Reset the IP allowlist', (yargs) => yargs.usage('$0 ip-allow reset [ips...]').positional('ips', {
|
|
49
51
|
describe: 'The list of IP addresses to reset',
|
|
50
52
|
type: 'string',
|
|
51
53
|
default: [],
|
|
@@ -8,6 +8,14 @@ describe('ip-allow', () => {
|
|
|
8
8
|
snapshot: true,
|
|
9
9
|
},
|
|
10
10
|
});
|
|
11
|
+
testCliCommand({
|
|
12
|
+
name: 'list IP Allow with single-project',
|
|
13
|
+
args: ['ip-allow', 'list'],
|
|
14
|
+
mockDir: 'single_project',
|
|
15
|
+
expected: {
|
|
16
|
+
snapshot: true,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
11
19
|
testCliCommand({
|
|
12
20
|
name: 'Add IP allow - Error',
|
|
13
21
|
args: ['ip-allow', 'add', '--projectId', 'test'],
|
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.26.
|
|
8
|
+
"version": "1.26.2",
|
|
9
9
|
"description": "CLI tool for NeonDB Cloud management",
|
|
10
10
|
"main": "index.js",
|
|
11
11
|
"author": "NeonDB",
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"scripts": {
|
|
87
87
|
"watch": "tsc --watch",
|
|
88
88
|
"lint": "tsc --noEmit && eslint src --ext .ts && prettier --check .",
|
|
89
|
+
"lint:fix": "tsc --noEmit && eslint src --ext .ts --fix && prettier --w .",
|
|
89
90
|
"build": "npm run generateParams && npm run clean && tsc && cp src/*.html package*.json README.md ./dist",
|
|
90
91
|
"clean": "rm -rf dist",
|
|
91
92
|
"generateParams": "node --loader ts-node/esm ./generateOptionsFromSpec.ts",
|