neonctl 1.27.3 → 1.27.4
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 +13 -13
- package/commands/ip_allow.js +2 -4
- package/commands/ip_allow.test.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,19 +64,19 @@ The Neon CLI supports autocompletion, which you can configure in a few easy step
|
|
|
64
64
|
|
|
65
65
|
## Commands
|
|
66
66
|
|
|
67
|
-
| Command
|
|
68
|
-
|
|
|
69
|
-
| [auth](https://neon.tech/docs/reference/cli-auth)
|
|
70
|
-
| [projects](https://neon.tech/docs/reference/cli-projects)
|
|
71
|
-
| [ip-allow](https://neon.tech/docs/reference/cli-ip-allow)
|
|
72
|
-
| [me](https://neon.tech/docs/reference/cli-me)
|
|
73
|
-
| [branches](https://neon.tech/docs/reference/cli-branches)
|
|
74
|
-
| [databases](https://neon.tech/docs/reference/cli-databases)
|
|
75
|
-
| [roles](https://neon.tech/docs/reference/cli-roles)
|
|
76
|
-
| [operations](https://neon.tech/reference/cli-operations) | `list` | Manage operations |
|
|
77
|
-
| [connection-string](https://neon.tech/reference/cli-connection-string) | | Get connection string |
|
|
78
|
-
| [set-context](https://neon.tech/reference/cli-set-context) | | Set context for session |
|
|
79
|
-
| [completion](https://neon.tech/reference/cli-completion) | | Generate a completion script |
|
|
67
|
+
| Command | Subcommands | Description |
|
|
68
|
+
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ---------------------------- |
|
|
69
|
+
| [auth](https://neon.tech/docs/reference/cli-auth) | | Authenticate |
|
|
70
|
+
| [projects](https://neon.tech/docs/reference/cli-projects) | `list`, `create`, `update`, `delete`, `get` | Manage projects |
|
|
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 |
|
|
73
|
+
| [branches](https://neon.tech/docs/reference/cli-branches) | `list`, `create`, `rename`, `add-compute`, `set-primary`, `delete`, `get` | Manage branches |
|
|
74
|
+
| [databases](https://neon.tech/docs/reference/cli-databases) | `list`, `create`, `delete` | Manage databases |
|
|
75
|
+
| [roles](https://neon.tech/docs/reference/cli-roles) | `list`, `create`, `delete` | Manage roles |
|
|
76
|
+
| [operations](https://neon.tech/docs/reference/cli-operations) | `list` | Manage operations |
|
|
77
|
+
| [connection-string](https://neon.tech/docs/reference/cli-connection-string) | | Get connection string |
|
|
78
|
+
| [set-context](https://neon.tech/docs/reference/cli-set-context) | | Set context for session |
|
|
79
|
+
| [completion](https://neon.tech/docs/reference/cli-completion) | | Generate a completion script |
|
|
80
80
|
|
|
81
81
|
## Global options
|
|
82
82
|
|
package/commands/ip_allow.js
CHANGED
|
@@ -67,9 +67,8 @@ const list = async (props) => {
|
|
|
67
67
|
};
|
|
68
68
|
const add = async (props) => {
|
|
69
69
|
if (props.ips.length <= 0) {
|
|
70
|
-
|
|
70
|
+
throw new Error(`Enter individual IP addresses, define ranges with a dash, or use CIDR notation for more flexibility.
|
|
71
71
|
Example: neonctl ip-allow add 192.168.1.1, 192.168.1.20-192.168.1.50, 192.168.1.0/24 --project-id <id>`);
|
|
72
|
-
return;
|
|
73
72
|
}
|
|
74
73
|
const project = {};
|
|
75
74
|
const { data } = await props.apiClient.getProject(props.projectId);
|
|
@@ -89,8 +88,7 @@ const add = async (props) => {
|
|
|
89
88
|
};
|
|
90
89
|
const remove = async (props) => {
|
|
91
90
|
if (props.ips.length <= 0) {
|
|
92
|
-
|
|
93
|
-
return;
|
|
91
|
+
throw new Error(`Remove individual IP addresses and ranges. Example: neonctl ip-allow remove 192.168.1.1 --project-id <id>`);
|
|
94
92
|
}
|
|
95
93
|
const project = {};
|
|
96
94
|
const { data } = await props.apiClient.getProject(props.projectId);
|
|
@@ -20,6 +20,7 @@ describe('ip-allow', () => {
|
|
|
20
20
|
name: 'Add IP allow - Error',
|
|
21
21
|
args: ['ip-allow', 'add', '--projectId', 'test'],
|
|
22
22
|
expected: {
|
|
23
|
+
code: 1,
|
|
23
24
|
stderr: `ERROR: Enter individual IP addresses, define ranges with a dash, or use CIDR notation for more flexibility.
|
|
24
25
|
Example: neonctl ip-allow add 192.168.1.1, 192.168.1.20-192.168.1.50, 192.168.1.0/24 --project-id <id>`,
|
|
25
26
|
},
|
|
@@ -43,6 +44,7 @@ describe('ip-allow', () => {
|
|
|
43
44
|
name: 'Remove IP allow - Error',
|
|
44
45
|
args: ['ip-allow', 'remove', '--project-id', 'test'],
|
|
45
46
|
expected: {
|
|
47
|
+
code: 1,
|
|
46
48
|
stderr: `ERROR: Remove individual IP addresses and ranges. Example: neonctl ip-allow remove 192.168.1.1 --project-id <id>`,
|
|
47
49
|
},
|
|
48
50
|
});
|