neonctl 2.27.0 → 2.28.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.
Files changed (151) hide show
  1. package/LICENSE.md +178 -0
  2. package/README.md +33 -1
  3. package/{analytics.js → dist/analytics.js} +21 -5
  4. package/dist/api.js +665 -0
  5. package/dist/cli.js +9 -0
  6. package/{commands → dist/commands}/auth.js +7 -0
  7. package/{commands → dist/commands}/branches.js +7 -4
  8. package/{commands → dist/commands}/bucket.js +69 -37
  9. package/{commands → dist/commands}/checkout.js +3 -3
  10. package/{commands → dist/commands}/config.js +22 -0
  11. package/{commands → dist/commands}/connection_string.js +1 -1
  12. package/{commands → dist/commands}/data_api.js +5 -6
  13. package/{commands → dist/commands}/databases.js +6 -3
  14. package/{commands → dist/commands}/functions.js +7 -9
  15. package/{commands → dist/commands}/index.js +2 -0
  16. package/{commands → dist/commands}/link.js +10 -17
  17. package/{commands → dist/commands}/neon_auth.js +8 -11
  18. package/{commands → dist/commands}/projects.js +4 -4
  19. package/{commands → dist/commands}/psql.js +1 -1
  20. package/{commands → dist/commands}/roles.js +6 -3
  21. package/{commands → dist/commands}/schema_diff.js +3 -4
  22. package/dist/commands/status.js +40 -0
  23. package/{context.js → dist/context.js} +16 -0
  24. package/dist/current_branch_fast_path.js +55 -0
  25. package/dist/errors.js +80 -0
  26. package/{functions_api.js → dist/functions_api.js} +1 -1
  27. package/{index.js → dist/index.js} +21 -20
  28. package/{parameters.gen.js → dist/parameters.gen.js} +14 -14
  29. package/{psql → dist/psql}/cli.js +0 -0
  30. package/{storage_api.js → dist/storage_api.js} +7 -8
  31. package/{test_utils → dist/test_utils}/fixtures.js +45 -15
  32. package/dist/utils/api_enums.js +33 -0
  33. package/{utils → dist/utils}/branch_picker.js +1 -1
  34. package/{utils → dist/utils}/enrichers.js +11 -4
  35. package/package.json +64 -67
  36. package/api.js +0 -35
  37. package/cli.js +0 -2
  38. package/errors.js +0 -17
  39. /package/{auth.js → dist/auth.js} +0 -0
  40. /package/{callback.html → dist/callback.html} +0 -0
  41. /package/{commands → dist/commands}/bootstrap.js +0 -0
  42. /package/{commands → dist/commands}/deploy.js +0 -0
  43. /package/{commands → dist/commands}/dev.js +0 -0
  44. /package/{commands → dist/commands}/env.js +0 -0
  45. /package/{commands → dist/commands}/init.js +0 -0
  46. /package/{commands → dist/commands}/ip_allow.js +0 -0
  47. /package/{commands → dist/commands}/operations.js +0 -0
  48. /package/{commands → dist/commands}/orgs.js +0 -0
  49. /package/{commands → dist/commands}/set_context.js +0 -0
  50. /package/{commands → dist/commands}/user.js +0 -0
  51. /package/{commands → dist/commands}/vpc_endpoints.js +0 -0
  52. /package/{config.js → dist/config.js} +0 -0
  53. /package/{config_format.js → dist/config_format.js} +0 -0
  54. /package/{dev → dist/dev}/env.js +0 -0
  55. /package/{dev → dist/dev}/functions.js +0 -0
  56. /package/{dev → dist/dev}/inputs.js +0 -0
  57. /package/{dev → dist/dev}/runtime.js +0 -0
  58. /package/{env.js → dist/env.js} +0 -0
  59. /package/{env_file.js → dist/env_file.js} +0 -0
  60. /package/{help.js → dist/help.js} +0 -0
  61. /package/{log.js → dist/log.js} +0 -0
  62. /package/{pkg.js → dist/pkg.js} +0 -0
  63. /package/{psql → dist/psql}/command/cmd_cond.js +0 -0
  64. /package/{psql → dist/psql}/command/cmd_connect.js +0 -0
  65. /package/{psql → dist/psql}/command/cmd_copy.js +0 -0
  66. /package/{psql → dist/psql}/command/cmd_describe.js +0 -0
  67. /package/{psql → dist/psql}/command/cmd_format.js +0 -0
  68. /package/{psql → dist/psql}/command/cmd_io.js +0 -0
  69. /package/{psql → dist/psql}/command/cmd_lo.js +0 -0
  70. /package/{psql → dist/psql}/command/cmd_meta.js +0 -0
  71. /package/{psql → dist/psql}/command/cmd_misc.js +0 -0
  72. /package/{psql → dist/psql}/command/cmd_pipeline.js +0 -0
  73. /package/{psql → dist/psql}/command/cmd_restrict.js +0 -0
  74. /package/{psql → dist/psql}/command/cmd_show.js +0 -0
  75. /package/{psql → dist/psql}/command/dispatch.js +0 -0
  76. /package/{psql → dist/psql}/command/inputQueue.js +0 -0
  77. /package/{psql → dist/psql}/command/shared.js +0 -0
  78. /package/{psql → dist/psql}/complete/filenames.js +0 -0
  79. /package/{psql → dist/psql}/complete/index.js +0 -0
  80. /package/{psql → dist/psql}/complete/matcher.js +0 -0
  81. /package/{psql → dist/psql}/complete/psqlVars.js +0 -0
  82. /package/{psql → dist/psql}/complete/queries.js +0 -0
  83. /package/{psql → dist/psql}/complete/rules.js +0 -0
  84. /package/{psql → dist/psql}/core/common.js +0 -0
  85. /package/{psql → dist/psql}/core/help.js +0 -0
  86. /package/{psql → dist/psql}/core/mainloop.js +0 -0
  87. /package/{psql → dist/psql}/core/prompt.js +0 -0
  88. /package/{psql → dist/psql}/core/settings.js +0 -0
  89. /package/{psql → dist/psql}/core/sqlHelp.js +0 -0
  90. /package/{psql → dist/psql}/core/startup.js +0 -0
  91. /package/{psql → dist/psql}/core/syncVars.js +0 -0
  92. /package/{psql → dist/psql}/core/variables.js +0 -0
  93. /package/{psql → dist/psql}/describe/formatters.js +0 -0
  94. /package/{psql → dist/psql}/describe/processNamePattern.js +0 -0
  95. /package/{psql → dist/psql}/describe/queries.js +0 -0
  96. /package/{psql → dist/psql}/describe/versionGate.js +0 -0
  97. /package/{psql → dist/psql}/index.js +0 -0
  98. /package/{psql → dist/psql}/io/history.js +0 -0
  99. /package/{psql → dist/psql}/io/input.js +0 -0
  100. /package/{psql → dist/psql}/io/lineEditor/buffer.js +0 -0
  101. /package/{psql → dist/psql}/io/lineEditor/complete.js +0 -0
  102. /package/{psql → dist/psql}/io/lineEditor/filename.js +0 -0
  103. /package/{psql → dist/psql}/io/lineEditor/index.js +0 -0
  104. /package/{psql → dist/psql}/io/lineEditor/keymap.js +0 -0
  105. /package/{psql → dist/psql}/io/lineEditor/vt100.js +0 -0
  106. /package/{psql → dist/psql}/io/pgpass.js +0 -0
  107. /package/{psql → dist/psql}/io/pgservice.js +0 -0
  108. /package/{psql → dist/psql}/io/psqlrc.js +0 -0
  109. /package/{psql → dist/psql}/print/aligned.js +0 -0
  110. /package/{psql → dist/psql}/print/asciidoc.js +0 -0
  111. /package/{psql → dist/psql}/print/crosstab.js +0 -0
  112. /package/{psql → dist/psql}/print/csv.js +0 -0
  113. /package/{psql → dist/psql}/print/html.js +0 -0
  114. /package/{psql → dist/psql}/print/json.js +0 -0
  115. /package/{psql → dist/psql}/print/latex.js +0 -0
  116. /package/{psql → dist/psql}/print/pager.js +0 -0
  117. /package/{psql → dist/psql}/print/troff.js +0 -0
  118. /package/{psql → dist/psql}/print/unaligned.js +0 -0
  119. /package/{psql → dist/psql}/print/units.js +0 -0
  120. /package/{psql → dist/psql}/scanner/slash.js +0 -0
  121. /package/{psql → dist/psql}/scanner/sql.js +0 -0
  122. /package/{psql → dist/psql}/scanner/stringutils.js +0 -0
  123. /package/{psql → dist/psql}/types/backslash.js +0 -0
  124. /package/{psql → dist/psql}/types/connection.js +0 -0
  125. /package/{psql → dist/psql}/types/index.js +0 -0
  126. /package/{psql → dist/psql}/types/printer.js +0 -0
  127. /package/{psql → dist/psql}/types/repl.js +0 -0
  128. /package/{psql → dist/psql}/types/scanner.js +0 -0
  129. /package/{psql → dist/psql}/types/settings.js +0 -0
  130. /package/{psql → dist/psql}/types/variables.js +0 -0
  131. /package/{psql → dist/psql}/wire/connection.js +0 -0
  132. /package/{psql → dist/psql}/wire/copy.js +0 -0
  133. /package/{psql → dist/psql}/wire/notify.js +0 -0
  134. /package/{psql → dist/psql}/wire/pipeline.js +0 -0
  135. /package/{psql → dist/psql}/wire/protocol.js +0 -0
  136. /package/{psql → dist/psql}/wire/sasl.js +0 -0
  137. /package/{psql → dist/psql}/wire/tls.js +0 -0
  138. /package/{test_utils → dist/test_utils}/oauth_server.js +0 -0
  139. /package/{types.js → dist/types.js} +0 -0
  140. /package/{utils → dist/utils}/auth.js +0 -0
  141. /package/{utils → dist/utils}/branch_notice.js +0 -0
  142. /package/{utils → dist/utils}/compute_units.js +0 -0
  143. /package/{utils → dist/utils}/esbuild.js +0 -0
  144. /package/{utils → dist/utils}/formats.js +0 -0
  145. /package/{utils → dist/utils}/middlewares.js +0 -0
  146. /package/{utils → dist/utils}/point_in_time.js +0 -0
  147. /package/{utils → dist/utils}/psql.js +0 -0
  148. /package/{utils → dist/utils}/string.js +0 -0
  149. /package/{utils → dist/utils}/ui.js +0 -0
  150. /package/{utils → dist/utils}/zip.js +0 -0
  151. /package/{writer.js → dist/writer.js} +0 -0
package/package.json CHANGED
@@ -1,28 +1,66 @@
1
1
  {
2
2
  "name": "neonctl",
3
+ "version": "2.28.0",
4
+ "description": "CLI tool for Neon Serverless Postgres",
5
+ "keywords": [
6
+ "neon",
7
+ "neonctl",
8
+ "cli",
9
+ "postgres",
10
+ "database",
11
+ "serverless"
12
+ ],
3
13
  "repository": {
4
14
  "type": "git",
5
- "url": "git+ssh://git@github.com/neondatabase/neonctl.git"
15
+ "url": "git+https://github.com/neondatabase/neon-pkgs.git"
6
16
  },
7
- "type": "module",
8
- "version": "2.27.0",
9
- "description": "CLI tool for NeonDB Cloud management",
10
- "main": "index.js",
11
- "author": "NeonDB",
12
17
  "license": "Apache-2.0",
13
- "private": false,
14
- "engines": {
15
- "node": ">=18"
18
+ "author": {
19
+ "name": "Neon",
20
+ "url": "https://neon.com"
16
21
  },
17
- "packageManager": "pnpm@9.15.9",
22
+ "type": "module",
23
+ "main": "dist/index.js",
18
24
  "bin": {
19
- "neonctl": "cli.js",
20
- "neon": "cli.js"
25
+ "neonctl": "dist/cli.js",
26
+ "neon": "dist/cli.js"
27
+ },
28
+ "files": [
29
+ "README.md",
30
+ "dist/",
31
+ "package.json"
32
+ ],
33
+ "engines": {
34
+ "node": ">=22"
35
+ },
36
+ "dependencies": {
37
+ "@hono/node-server": "2.0.4",
38
+ "@segment/analytics-node": "1.3.0",
39
+ "chalk": "5.3.0",
40
+ "chokidar": "5.0.0",
41
+ "cli-table": "0.3.11",
42
+ "cliui": "8.0.1",
43
+ "diff": "5.2.0",
44
+ "fflate": "^0.8.3",
45
+ "neon-init": "0.19.0",
46
+ "open": "10.1.0",
47
+ "openid-client": "6.8.1",
48
+ "pg-protocol": "^1.14.0",
49
+ "prompts": "2.4.2",
50
+ "undici": "^8.5.0",
51
+ "which": "3.0.1",
52
+ "yaml": "2.4.5",
53
+ "yargs": "17.7.2",
54
+ "@neon/sdk": "0.1.0",
55
+ "@neondatabase/config": "0.8.1",
56
+ "@neondatabase/config-runtime": "0.8.1",
57
+ "@neondatabase/env": "0.8.1"
58
+ },
59
+ "optionalDependencies": {
60
+ "esbuild": "0.28.0"
21
61
  },
22
62
  "devDependencies": {
23
63
  "@apidevtools/swagger-parser": "12.1.0",
24
- "@commitlint/cli": "17.8.1",
25
- "@commitlint/config-conventional": "17.8.1",
26
64
  "@eslint/js": "9.29.0",
27
65
  "@rollup/plugin-commonjs": "25.0.8",
28
66
  "@rollup/plugin-json": "6.1.0",
@@ -36,15 +74,14 @@
36
74
  "@types/prompts": "2.4.9",
37
75
  "@types/which": "3.0.4",
38
76
  "@types/yargs": "17.0.32",
77
+ "@vitest/coverage-v8": "1.6.1",
39
78
  "@yao-pkg/pkg": "6.10.0",
40
79
  "emocks": "3.0.4",
41
- "esbuild": "0.28.0",
42
80
  "eslint": "9.29.0",
43
81
  "express": "4.19.2",
44
- "husky": "8.0.3",
45
- "lint-staged": "13.3.0",
46
82
  "node-pty": "1.1.0",
47
83
  "oauth2-mock-server": "8.1.0",
84
+ "openapi-types": "12.1.3",
48
85
  "prettier": "3.3.3",
49
86
  "rollup": "3.29.4",
50
87
  "strip-ansi": "7.1.0",
@@ -53,41 +90,13 @@
53
90
  "typescript-eslint": "8.28.0",
54
91
  "vitest": "1.6.1"
55
92
  },
56
- "optionalDependencies": {
57
- "esbuild": "0.28.0"
58
- },
59
- "dependencies": {
60
- "@hono/node-server": "2.0.4",
61
- "@neondatabase/api-client": "2.7.1",
62
- "@neondatabase/config": "0.8.0",
63
- "@neondatabase/config-runtime": "0.8.0",
64
- "@neondatabase/env": "0.7.0",
65
- "@segment/analytics-node": "1.3.0",
66
- "axios": "1.7.2",
67
- "axios-debug-log": "1.0.0",
68
- "chalk": "5.3.0",
69
- "chokidar": "5.0.0",
70
- "cli-table": "0.3.11",
71
- "cliui": "8.0.1",
72
- "diff": "5.2.0",
73
- "fflate": "^0.8.3",
74
- "neon-init": "0.19.0",
75
- "open": "10.1.0",
76
- "openid-client": "6.8.1",
77
- "pg-protocol": "^1.14.0",
78
- "prompts": "2.4.2",
79
- "which": "3.0.1",
80
- "yaml": "2.4.5",
81
- "yargs": "17.7.2"
82
- },
83
93
  "publishConfig": {
84
94
  "access": "public",
85
- "registry": "https://registry.npmjs.org/"
95
+ "provenance": false
86
96
  },
87
97
  "pkg": {
88
98
  "assets": [
89
- "callback.html",
90
- "package.json"
99
+ "callback.html"
91
100
  ],
92
101
  "scripts": [
93
102
  "bundle/*.js"
@@ -100,27 +109,15 @@
100
109
  ]
101
110
  },
102
111
  "scripts": {
103
- "watch": "tsc --watch",
112
+ "generateParams": "tsx generateOptionsFromSpec.ts",
113
+ "clean": "rm -rf dist",
114
+ "build": "pnpm generateParams && pnpm clean && tsc -p tsconfig.build.json && cp src/*.html ./dist",
115
+ "bundle": "node pkg.js",
104
116
  "typecheck": "tsc --noEmit",
105
117
  "lint": "pnpm typecheck && eslint src && prettier --check .",
106
118
  "lint:fix": "pnpm typecheck && eslint src --fix && prettier --w .",
107
- "build": "pnpm generateParams && pnpm clean && tsc -p tsconfig.build.json && cp src/*.html package*.json README.md ./dist",
108
- "clean": "rm -rf dist",
109
- "generateParams": "tsx generateOptionsFromSpec.ts",
110
- "start": "node dist/index.js",
111
- "pretest": "pnpm build",
112
- "test": "vitest run",
113
- "test:conformance": "vitest run --config tests/psql-conformance/vitest.config.ts",
114
- "test:conformance:matrix": "tsx tests/psql-conformance/scripts/run-local-matrix.ts",
115
- "prepare": "test -d .git && husky install || true"
116
- },
117
- "lint-staged": {
118
- ".{cjs,js,json,md,html}": [
119
- "prettier --write"
120
- ],
121
- "*.ts": [
122
- "eslint --cache --fix",
123
- "prettier --write"
124
- ]
119
+ "test": "pnpm build && vitest run",
120
+ "test:ci": "pnpm build && vitest run",
121
+ "test:conformance": "vitest run --config tests/psql-conformance/vitest.config.ts"
125
122
  }
126
- }
123
+ }
package/api.js DELETED
@@ -1,35 +0,0 @@
1
- import { createApiClient } from '@neondatabase/api-client';
2
- import { isAxiosError } from 'axios';
3
- import { log } from './log.js';
4
- import pkg from './pkg.js';
5
- export const getApiClient = ({ apiKey, apiHost }) => createApiClient({
6
- apiKey,
7
- baseURL: apiHost,
8
- timeout: 60000,
9
- headers: {
10
- 'User-Agent': `neonctl v${pkg.version}`,
11
- },
12
- });
13
- const RETRY_COUNT = 5;
14
- const RETRY_DELAY = 3000;
15
- export const retryOnLock = async (fn) => {
16
- let attempt = 0;
17
- let errOut;
18
- while (attempt < RETRY_COUNT) {
19
- try {
20
- return await fn();
21
- }
22
- catch (err) {
23
- errOut = err;
24
- if (isAxiosError(err) && err.response?.status === 423) {
25
- attempt++;
26
- log.info(`Resource is locked. Waiting ${RETRY_DELAY}ms before retrying...`);
27
- await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY));
28
- }
29
- else {
30
- throw err;
31
- }
32
- }
33
- }
34
- throw errOut;
35
- };
package/cli.js DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import './index.js';
package/errors.js DELETED
@@ -1,17 +0,0 @@
1
- const ERROR_MATCHERS = [
2
- [/^Unknown command: (.*)$/, 'UNKNOWN_COMMAND'],
3
- [/^Missing required argument: (.*)$/, 'MISSING_ARGUMENT'],
4
- [/^Failed to open web browser. (.*)$/, 'AUTH_BROWSER_FAILED'],
5
- ];
6
- export const matchErrorCode = (message) => {
7
- if (!message) {
8
- return 'UNKNOWN_ERROR';
9
- }
10
- for (const [matcher, code] of ERROR_MATCHERS) {
11
- const match = message.match(matcher);
12
- if (match) {
13
- return code;
14
- }
15
- }
16
- return 'UNKNOWN_ERROR';
17
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes