neonctl 2.28.0 → 2.29.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/README.md +2 -2
- package/dist/analytics.js +35 -33
- package/dist/api.js +34 -34
- package/dist/auth.js +50 -44
- package/dist/cli.js +2 -2
- package/dist/commands/auth.js +58 -52
- package/dist/commands/bootstrap.js +115 -157
- package/dist/commands/branches.js +154 -147
- package/dist/commands/bucket.js +124 -118
- package/dist/commands/checkout.js +49 -49
- package/dist/commands/config.js +212 -88
- package/dist/commands/connection_string.js +62 -62
- package/dist/commands/data_api.js +96 -96
- package/dist/commands/databases.js +23 -23
- package/dist/commands/deploy.js +12 -12
- package/dist/commands/dev.js +114 -114
- package/dist/commands/env.js +43 -43
- package/dist/commands/functions.js +97 -98
- package/dist/commands/index.js +26 -26
- package/dist/commands/init.js +23 -22
- package/dist/commands/ip_allow.js +29 -29
- package/dist/commands/link.js +223 -166
- package/dist/commands/neon_auth.js +381 -363
- package/dist/commands/operations.js +11 -11
- package/dist/commands/orgs.js +8 -8
- package/dist/commands/projects.js +101 -99
- package/dist/commands/psql.js +31 -31
- package/dist/commands/roles.js +21 -21
- package/dist/commands/schema_diff.js +23 -23
- package/dist/commands/set_context.js +17 -17
- package/dist/commands/status.js +17 -17
- package/dist/commands/user.js +5 -5
- package/dist/commands/vpc_endpoints.js +50 -50
- package/dist/config.js +7 -7
- package/dist/config_format.js +5 -5
- package/dist/context.js +23 -16
- package/dist/current_branch_fast_path.js +6 -6
- package/dist/dev/env.js +33 -33
- package/dist/dev/functions.js +4 -4
- package/dist/dev/inputs.js +6 -6
- package/dist/dev/runtime.js +25 -25
- package/dist/env.js +14 -14
- package/dist/env_file.js +13 -13
- package/dist/errors.js +19 -19
- package/dist/functions_api.js +10 -10
- package/dist/help.js +15 -15
- package/dist/index.js +94 -92
- package/dist/log.js +2 -2
- package/dist/pkg.js +5 -5
- package/dist/psql/cli.js +4 -2
- package/dist/psql/command/cmd_cond.js +61 -61
- package/dist/psql/command/cmd_connect.js +159 -154
- package/dist/psql/command/cmd_copy.js +107 -97
- package/dist/psql/command/cmd_describe.js +368 -363
- package/dist/psql/command/cmd_format.js +276 -263
- package/dist/psql/command/cmd_io.js +269 -263
- package/dist/psql/command/cmd_lo.js +74 -66
- package/dist/psql/command/cmd_meta.js +148 -148
- package/dist/psql/command/cmd_misc.js +17 -17
- package/dist/psql/command/cmd_pipeline.js +142 -135
- package/dist/psql/command/cmd_restrict.js +25 -25
- package/dist/psql/command/cmd_show.js +183 -168
- package/dist/psql/command/dispatch.js +26 -26
- package/dist/psql/command/shared.js +14 -14
- package/dist/psql/complete/filenames.js +16 -16
- package/dist/psql/complete/index.js +4 -4
- package/dist/psql/complete/matcher.js +33 -32
- package/dist/psql/complete/psqlVars.js +173 -173
- package/dist/psql/complete/queries.js +5 -3
- package/dist/psql/complete/rules.js +900 -863
- package/dist/psql/core/common.js +136 -133
- package/dist/psql/core/help.js +343 -343
- package/dist/psql/core/mainloop.js +160 -153
- package/dist/psql/core/prompt.js +126 -123
- package/dist/psql/core/settings.js +111 -111
- package/dist/psql/core/sqlHelp.js +150 -150
- package/dist/psql/core/startup.js +211 -205
- package/dist/psql/core/syncVars.js +14 -14
- package/dist/psql/core/variables.js +24 -24
- package/dist/psql/describe/formatters.js +302 -289
- package/dist/psql/describe/processNamePattern.js +28 -28
- package/dist/psql/describe/queries.js +656 -651
- package/dist/psql/index.js +436 -411
- package/dist/psql/io/history.js +36 -36
- package/dist/psql/io/input.js +15 -15
- package/dist/psql/io/lineEditor/buffer.js +27 -25
- package/dist/psql/io/lineEditor/complete.js +15 -15
- package/dist/psql/io/lineEditor/filename.js +22 -22
- package/dist/psql/io/lineEditor/index.js +65 -62
- package/dist/psql/io/lineEditor/keymap.js +325 -318
- package/dist/psql/io/lineEditor/vt100.js +60 -60
- package/dist/psql/io/pgpass.js +18 -18
- package/dist/psql/io/pgservice.js +14 -14
- package/dist/psql/io/psqlrc.js +46 -46
- package/dist/psql/print/aligned.js +175 -166
- package/dist/psql/print/asciidoc.js +51 -51
- package/dist/psql/print/crosstab.js +34 -31
- package/dist/psql/print/csv.js +25 -22
- package/dist/psql/print/html.js +54 -54
- package/dist/psql/print/json.js +12 -12
- package/dist/psql/print/latex.js +118 -118
- package/dist/psql/print/pager.js +28 -26
- package/dist/psql/print/troff.js +48 -48
- package/dist/psql/print/unaligned.js +15 -14
- package/dist/psql/print/units.js +17 -17
- package/dist/psql/scanner/slash.js +48 -46
- package/dist/psql/scanner/sql.js +88 -84
- package/dist/psql/scanner/stringutils.js +21 -17
- package/dist/psql/types/index.js +7 -7
- package/dist/psql/types/scanner.js +8 -8
- package/dist/psql/wire/connection.js +341 -327
- package/dist/psql/wire/copy.js +7 -7
- package/dist/psql/wire/pipeline.js +26 -24
- package/dist/psql/wire/protocol.js +102 -102
- package/dist/psql/wire/sasl.js +62 -62
- package/dist/psql/wire/tls.js +79 -73
- package/dist/storage_api.js +15 -15
- package/dist/test_utils/fixtures.js +34 -31
- package/dist/test_utils/oauth_server.js +5 -5
- package/dist/utils/api_enums.js +13 -13
- package/dist/utils/branch_notice.js +5 -5
- package/dist/utils/branch_picker.js +26 -26
- package/dist/utils/compute_units.js +4 -4
- package/dist/utils/enrichers.js +20 -15
- package/dist/utils/esbuild.js +28 -28
- package/dist/utils/formats.js +1 -1
- package/dist/utils/middlewares.js +3 -3
- package/dist/utils/package_manager.js +68 -0
- package/dist/utils/point_in_time.js +12 -12
- package/dist/utils/psql.js +30 -30
- package/dist/utils/string.js +2 -2
- package/dist/utils/ui.js +9 -9
- package/dist/utils/zip.js +1 -1
- package/dist/writer.js +17 -17
- package/package.json +6 -7
package/dist/commands/init.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { detectAgent, enrichResponse, interactiveInit, orchestrate, routeDataStep, } from
|
|
2
|
-
import { sendError } from
|
|
3
|
-
import { log } from
|
|
4
|
-
export const command =
|
|
5
|
-
export const describe =
|
|
1
|
+
import { detectAgent, enrichResponse, interactiveInit, orchestrate, routeDataStep, } from "neon-init";
|
|
2
|
+
import { sendError } from "../analytics.js";
|
|
3
|
+
import { log } from "../log.js";
|
|
4
|
+
export const command = "init";
|
|
5
|
+
export const describe = "Initialize a project with Neon using your AI coding assistant";
|
|
6
6
|
export const builder = (yargs) => yargs
|
|
7
|
-
.option(
|
|
7
|
+
.option("context-file", {
|
|
8
8
|
hidden: true,
|
|
9
9
|
})
|
|
10
|
-
.option(
|
|
11
|
-
alias:
|
|
12
|
-
type:
|
|
10
|
+
.option("agent", {
|
|
11
|
+
alias: "a",
|
|
12
|
+
type: "boolean",
|
|
13
13
|
default: false,
|
|
14
|
-
describe:
|
|
14
|
+
describe: "Enable agent/JSON mode (agent type is auto-detected).",
|
|
15
15
|
})
|
|
16
|
-
.option(
|
|
17
|
-
type:
|
|
16
|
+
.option("data", {
|
|
17
|
+
type: "string",
|
|
18
18
|
describe: 'JSON object with a "step" field to route to a specific phase and phase-specific options.',
|
|
19
19
|
})
|
|
20
|
-
.option(
|
|
21
|
-
type:
|
|
20
|
+
.option("skip-migrations", {
|
|
21
|
+
type: "boolean",
|
|
22
22
|
default: false,
|
|
23
|
-
describe:
|
|
23
|
+
describe: "Skip the migrations phase.",
|
|
24
24
|
})
|
|
25
|
-
.option(
|
|
26
|
-
type:
|
|
25
|
+
.option("preview", {
|
|
26
|
+
type: "boolean",
|
|
27
27
|
default: false,
|
|
28
|
-
describe:
|
|
28
|
+
describe: "Enable preview features (e.g. project bootstrapping from templates).",
|
|
29
29
|
})
|
|
30
30
|
.strict(false);
|
|
31
31
|
export const handler = async (argv) => {
|
|
@@ -33,7 +33,8 @@ export const handler = async (argv) => {
|
|
|
33
33
|
// Auto-detect agent from environment. When --agent is explicitly passed,
|
|
34
34
|
// always detect (the user asked for agent mode). Otherwise, require
|
|
35
35
|
// non-TTY stdin to distinguish agent from human in terminal.
|
|
36
|
-
const agent = (argv.agent || !process.stdin.isTTY ? detectAgent() : null) ||
|
|
36
|
+
const agent = (argv.agent || !process.stdin.isTTY ? detectAgent() : null) ||
|
|
37
|
+
undefined;
|
|
37
38
|
const isAgentMode = argv.agent || agent !== undefined;
|
|
38
39
|
// --data with a "step" field routes to the appropriate phase
|
|
39
40
|
if (argv.data && isAgentMode) {
|
|
@@ -42,11 +43,11 @@ export const handler = async (argv) => {
|
|
|
42
43
|
data = JSON.parse(argv.data);
|
|
43
44
|
}
|
|
44
45
|
catch {
|
|
45
|
-
log.error(
|
|
46
|
+
log.error("Invalid JSON in --data flag. Expected a JSON object.");
|
|
46
47
|
process.exit(1);
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
|
-
if (typeof data.step ===
|
|
50
|
+
if (typeof data.step === "string") {
|
|
50
51
|
const result = await routeDataStep(data, agent);
|
|
51
52
|
log.info(JSON.stringify(enrichResponse(result), null, 2));
|
|
52
53
|
return;
|
|
@@ -66,7 +67,7 @@ export const handler = async (argv) => {
|
|
|
66
67
|
}
|
|
67
68
|
catch {
|
|
68
69
|
const exitError = new Error(`failed to run neon-init`);
|
|
69
|
-
sendError(exitError,
|
|
70
|
+
sendError(exitError, "NEON_INIT_FAILED");
|
|
70
71
|
process.exit(1);
|
|
71
72
|
}
|
|
72
73
|
};
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { log } from "../log.js";
|
|
2
|
+
import { projectUpdateRequest } from "../parameters.gen.js";
|
|
3
|
+
import { fillSingleProject } from "../utils/enrichers.js";
|
|
4
|
+
import { writer } from "../writer.js";
|
|
5
5
|
const IP_ALLOW_FIELDS = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
"id",
|
|
7
|
+
"name",
|
|
8
|
+
"IP_addresses",
|
|
9
|
+
"protected_branches_only",
|
|
10
10
|
];
|
|
11
|
-
export const command =
|
|
12
|
-
export const describe =
|
|
11
|
+
export const command = "ip-allow";
|
|
12
|
+
export const describe = "Manage IP Allow";
|
|
13
13
|
export const builder = (argv) => {
|
|
14
14
|
return argv
|
|
15
|
-
.usage(
|
|
15
|
+
.usage("$0 ip-allow <sub-command> [options]")
|
|
16
16
|
.options({
|
|
17
|
-
|
|
18
|
-
describe:
|
|
19
|
-
type:
|
|
17
|
+
"project-id": {
|
|
18
|
+
describe: "Project ID",
|
|
19
|
+
type: "string",
|
|
20
20
|
},
|
|
21
21
|
})
|
|
22
22
|
.middleware(fillSingleProject)
|
|
23
|
-
.command(
|
|
23
|
+
.command("list", "List the IP allowlist", (yargs) => yargs, async (args) => {
|
|
24
24
|
await list(args);
|
|
25
25
|
})
|
|
26
|
-
.command(
|
|
27
|
-
.usage(
|
|
28
|
-
.positional(
|
|
29
|
-
describe:
|
|
30
|
-
type:
|
|
26
|
+
.command("add [ips...]", "Add IP addresses to the IP allowlist", (yargs) => yargs
|
|
27
|
+
.usage("$0 ip-allow add [ips...]")
|
|
28
|
+
.positional("ips", {
|
|
29
|
+
describe: "The list of IP addresses to add",
|
|
30
|
+
type: "string",
|
|
31
31
|
default: [],
|
|
32
32
|
array: true,
|
|
33
33
|
})
|
|
34
34
|
.options({
|
|
35
|
-
|
|
36
|
-
describe: projectUpdateRequest[
|
|
37
|
-
type:
|
|
35
|
+
"protected-only": {
|
|
36
|
+
describe: projectUpdateRequest["project.settings.allowed_ips.protected_branches_only"].description,
|
|
37
|
+
type: "boolean",
|
|
38
38
|
},
|
|
39
39
|
}), async (args) => {
|
|
40
40
|
await add(args);
|
|
41
41
|
})
|
|
42
|
-
.command(
|
|
43
|
-
describe:
|
|
44
|
-
type:
|
|
42
|
+
.command("remove [ips...]", "Remove IP addresses from the IP allowlist", (yargs) => yargs.usage("$0 ip-allow remove [ips...]").positional("ips", {
|
|
43
|
+
describe: "The list of IP addresses to remove",
|
|
44
|
+
type: "string",
|
|
45
45
|
default: [],
|
|
46
46
|
array: true,
|
|
47
47
|
}), async (args) => {
|
|
48
48
|
await remove(args);
|
|
49
49
|
})
|
|
50
|
-
.command(
|
|
51
|
-
describe:
|
|
52
|
-
type:
|
|
50
|
+
.command("reset [ips...]", "Reset the IP allowlist", (yargs) => yargs.usage("$0 ip-allow reset [ips...]").positional("ips", {
|
|
51
|
+
describe: "The list of IP addresses to reset",
|
|
52
|
+
type: "string",
|
|
53
53
|
default: [],
|
|
54
54
|
array: true,
|
|
55
55
|
}), async (args) => {
|