neonctl 1.31.0 → 1.32.0
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/analytics.js +11 -0
- package/commands/auth.test.js +5 -10
- package/commands/bootstrap/index.js +562 -0
- package/commands/bootstrap/index.test.js +104 -0
- package/commands/bootstrap/is-folder-empty.js +56 -0
- package/commands/bootstrap/validate-pkg.js +15 -0
- package/commands/branches.js +12 -0
- package/commands/branches.test.js +63 -1
- package/commands/connection_string.test.js +1 -1
- package/commands/databases.test.js +1 -1
- package/commands/help.test.js +1 -1
- package/commands/index.js +2 -0
- package/commands/ip_allow.js +14 -1
- package/commands/ip_allow.test.js +18 -2
- package/commands/operations.test.js +1 -1
- package/commands/orgs.test.js +11 -0
- package/commands/projects.js +25 -2
- package/commands/projects.test.js +49 -1
- package/commands/roles.test.js +1 -1
- package/commands/set_context.test.js +1 -1
- package/index.js +5 -0
- package/package.json +15 -13
- package/test_utils/mock_server.js +1 -1
- package/test_utils/oauth_server.js +1 -1
- package/test_utils/test_cli_command.js +1 -1
- package/utils/compute_units.js +28 -0
- package/utils/formats.test.js +1 -1
- package/writer.test.js +1 -1
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "git+ssh://git@github.com/neondatabase/neonctl.git"
|
|
6
6
|
},
|
|
7
7
|
"type": "module",
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.32.0",
|
|
9
9
|
"description": "CLI tool for NeonDB Cloud management",
|
|
10
10
|
"main": "index.js",
|
|
11
11
|
"author": "NeonDB",
|
|
@@ -22,17 +22,18 @@
|
|
|
22
22
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
23
23
|
"@commitlint/cli": "^17.6.5",
|
|
24
24
|
"@commitlint/config-conventional": "^17.6.5",
|
|
25
|
-
"@jest/globals": "^29.5.0",
|
|
26
25
|
"@rollup/plugin-commonjs": "^25.0.2",
|
|
27
26
|
"@rollup/plugin-json": "^6.0.0",
|
|
28
27
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
|
29
28
|
"@semantic-release/exec": "^6.0.3",
|
|
30
29
|
"@semantic-release/git": "^10.0.1",
|
|
30
|
+
"@types/bun": "^1.1.4",
|
|
31
31
|
"@types/cli-table": "^0.3.0",
|
|
32
32
|
"@types/diff": "^5.2.1",
|
|
33
33
|
"@types/express": "^4.17.17",
|
|
34
|
-
"@types/inquirer": "^9.0.3",
|
|
35
34
|
"@types/node": "^18.7.13",
|
|
35
|
+
"@types/prompts": "2.4.9",
|
|
36
|
+
"@types/validate-npm-package-name": "4.0.2",
|
|
36
37
|
"@types/which": "^3.0.0",
|
|
37
38
|
"@types/yargs": "^17.0.24",
|
|
38
39
|
"@typescript-eslint/eslint-plugin": "^5.34.0",
|
|
@@ -41,7 +42,6 @@
|
|
|
41
42
|
"eslint": "^8.22.0",
|
|
42
43
|
"express": "^4.18.2",
|
|
43
44
|
"husky": "^8.0.3",
|
|
44
|
-
"jest": "^29.5.0",
|
|
45
45
|
"lint-staged": "^13.0.3",
|
|
46
46
|
"oauth2-mock-server": "^6.0.0",
|
|
47
47
|
"pkg": "^5.8.1",
|
|
@@ -49,9 +49,8 @@
|
|
|
49
49
|
"rollup": "^3.26.2",
|
|
50
50
|
"semantic-release": "^23.0.8",
|
|
51
51
|
"strip-ansi": "^7.1.0",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"typescript": "^4.7.4"
|
|
52
|
+
"typescript": "^4.7.4",
|
|
53
|
+
"vitest": "^1.6.0"
|
|
55
54
|
},
|
|
56
55
|
"dependencies": {
|
|
57
56
|
"@neondatabase/api-client": "1.9.0",
|
|
@@ -64,6 +63,8 @@
|
|
|
64
63
|
"inquirer": "^9.2.6",
|
|
65
64
|
"open": "^10.1.0",
|
|
66
65
|
"openid-client": "^5.6.5",
|
|
66
|
+
"prompts": "2.4.2",
|
|
67
|
+
"validate-npm-package-name": "5.0.1",
|
|
67
68
|
"which": "^3.0.1",
|
|
68
69
|
"yaml": "^2.1.1",
|
|
69
70
|
"yargs": "^17.7.2"
|
|
@@ -91,12 +92,12 @@
|
|
|
91
92
|
"watch": "tsc --watch",
|
|
92
93
|
"lint": "tsc --noEmit && eslint src --ext .ts && prettier --check .",
|
|
93
94
|
"lint:fix": "tsc --noEmit && eslint src --ext .ts --fix && prettier --w .",
|
|
94
|
-
"build": "
|
|
95
|
+
"build": "bun generateParams && bun clean && tsc && cp src/*.html package*.json README.md ./dist",
|
|
95
96
|
"clean": "rm -rf dist",
|
|
96
|
-
"generateParams": "
|
|
97
|
-
"start": "
|
|
98
|
-
"pretest": "
|
|
99
|
-
"test": "
|
|
97
|
+
"generateParams": "bun generateOptionsFromSpec.ts",
|
|
98
|
+
"start": "bun dist/index.js",
|
|
99
|
+
"pretest": "bun run build",
|
|
100
|
+
"test": "vitest run",
|
|
100
101
|
"prepare": "test -d .git && husky install || true"
|
|
101
102
|
},
|
|
102
103
|
"lint-staged": {
|
|
@@ -107,5 +108,6 @@
|
|
|
107
108
|
"eslint --cache --fix",
|
|
108
109
|
"prettier --write"
|
|
109
110
|
]
|
|
110
|
-
}
|
|
111
|
+
},
|
|
112
|
+
"packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a"
|
|
111
113
|
}
|
|
@@ -11,6 +11,6 @@ export const runMockServer = async (mockDir) => new Promise((resolve) => {
|
|
|
11
11
|
const server = app.listen(0);
|
|
12
12
|
server.on('listening', () => {
|
|
13
13
|
resolve(server);
|
|
14
|
-
log.
|
|
14
|
+
log.debug('Mock server listening at %d', server.address().port);
|
|
15
15
|
});
|
|
16
16
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const getComputeUnits = (autoscaling) => {
|
|
2
|
+
const fixedSizeAutoscaling = Number(autoscaling);
|
|
3
|
+
if (!isNaN(fixedSizeAutoscaling)) {
|
|
4
|
+
return {
|
|
5
|
+
autoscaling_limit_min_cu: fixedSizeAutoscaling,
|
|
6
|
+
autoscaling_limit_max_cu: fixedSizeAutoscaling,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
if (!autoscaling.includes('-')) {
|
|
10
|
+
throw new Error('Autoscaling should be either fixed size (e.g. 2) or min and max sizes delimited with a dash (e.g. "0.5-1")');
|
|
11
|
+
}
|
|
12
|
+
const [min, max] = autoscaling.split('-');
|
|
13
|
+
if (!min || !max) {
|
|
14
|
+
throw new Error('Autoscaling should be either fixed size (e.g. 2) or min and max sizes delimited with a dash (e.g. "0.5-1")');
|
|
15
|
+
}
|
|
16
|
+
const minAutoscaling = Number(min);
|
|
17
|
+
const maxAutoscaling = Number(max);
|
|
18
|
+
if (isNaN(minAutoscaling)) {
|
|
19
|
+
throw new Error('Autoscaling min should be a number');
|
|
20
|
+
}
|
|
21
|
+
if (isNaN(maxAutoscaling)) {
|
|
22
|
+
throw new Error('Autoscaling max should be a number');
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
autoscaling_limit_min_cu: minAutoscaling,
|
|
26
|
+
autoscaling_limit_max_cu: maxAutoscaling,
|
|
27
|
+
};
|
|
28
|
+
};
|
package/utils/formats.test.js
CHANGED
package/writer.test.js
CHANGED