neon 8.7.1 → 8.8.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 +4 -1
- package/dist/claimable/api.js +2 -0
- package/dist/commands/claim.js +7 -1
- package/dist/commands/dev.js +3 -3
- package/dist/commands/env.js +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/subscribe.js +1 -1
- package/dist/init/copy.js +1 -1
- package/dist/init/run.js +7 -4
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -89,6 +89,9 @@ neon claim create
|
|
|
89
89
|
|
|
90
90
|
# Request Managed Better Auth and the Data API too
|
|
91
91
|
neon claim create --service auth --service data-api
|
|
92
|
+
|
|
93
|
+
# Create the project in another region (default: aws-us-east-2)
|
|
94
|
+
neon claim create --region-id aws-eu-central-1
|
|
92
95
|
```
|
|
93
96
|
|
|
94
97
|
When the current directory has a `neon.ts`, `claim create` also requests every service
|
|
@@ -895,7 +898,7 @@ $ neon init -y --agent cursor --project-id <project-id> \
|
|
|
895
898
|
--mcp-auth oauth --mcp-config-location project --mcp-project-scoped
|
|
896
899
|
```
|
|
897
900
|
|
|
898
|
-
Without a TTY, pass `-y` or enough flags to answer every question. `-y` alone is Recommended. `-y` with `--skill`, MCP flags, `--no-agent-setup`, or `--claimable` is Custom: those flags, Recommended defaults for the rest. `--skill` selects skills (not the plugin). MCP flags select skills and MCP. `--agent` skips agent selection and, without `-y`, selects Custom. `--no-link` skips project linking without asking. `--no-config` skips `neon.ts`. `--services` implies creating `neon.ts`. `--org-id`, `--project-id`, `--project-name`, `--region-id`, and `--branch` select linking.
|
|
901
|
+
Without a TTY, pass `-y` or enough flags to answer every question. `-y` alone is Recommended. `-y` with `--skill`, MCP flags, `--no-agent-setup`, or `--claimable` is Custom: those flags, Recommended defaults for the rest. `--skill` selects skills (not the plugin). MCP flags select skills and MCP. `--agent` skips agent selection and, without `-y`, selects Custom. `--no-link` skips project linking without asking. `--no-config` skips `neon.ts`. `--services` implies creating `neon.ts`. `--org-id`, `--project-id`, `--project-name`, `--region-id`, and `--branch` select linking. With `--claimable`, `--region-id` picks the claimable project's region.
|
|
899
902
|
|
|
900
903
|
`--project-id`, `--org-id`, `--project-name`, `--region-id`, and `--branch` are forwarded to `link`. They select linking. A linked directory is not relinked unless you pass one of those flags.
|
|
901
904
|
|
package/dist/claimable/api.js
CHANGED
|
@@ -72,6 +72,7 @@ const parseRegistrationResponse = (value) => {
|
|
|
72
72
|
project: {
|
|
73
73
|
id: stringField(project, "id", action),
|
|
74
74
|
branchId: stringField(project, "branch_id", action),
|
|
75
|
+
regionId: stringField(project, "region_id", action),
|
|
75
76
|
expiresAt: stringField(project, "expires_at", action)
|
|
76
77
|
},
|
|
77
78
|
capabilities: capabilities.map((item) => parseCapabilityDecision(item, action))
|
|
@@ -180,6 +181,7 @@ var ClaimableClient = class {
|
|
|
180
181
|
type: "anonymous",
|
|
181
182
|
capabilities: input.capabilities,
|
|
182
183
|
source: input.source,
|
|
184
|
+
...input.regionId !== void 0 ? { region_id: input.regionId } : {},
|
|
183
185
|
...input.dataApi !== void 0 ? { data_api: input.dataApi } : {}
|
|
184
186
|
}
|
|
185
187
|
}));
|
package/dist/commands/claim.js
CHANGED
|
@@ -90,6 +90,7 @@ const CLAIM_LIST_FIELDS = [
|
|
|
90
90
|
const CLAIM_CREATE_FIELDS = [
|
|
91
91
|
"project_id",
|
|
92
92
|
"branch_id",
|
|
93
|
+
"region_id",
|
|
93
94
|
"state",
|
|
94
95
|
"project_expires_at",
|
|
95
96
|
"granted_capabilities",
|
|
@@ -110,7 +111,10 @@ const builder = (argv) => argv.usage("$0 claim <sub-command> [options]").option(
|
|
|
110
111
|
allowed: CLAIMABLE_SERVICES,
|
|
111
112
|
describe: "Services to request for the claimable project",
|
|
112
113
|
also: "Postgres is always included. Services unavailable before claim are recorded and reported."
|
|
113
|
-
})).option("
|
|
114
|
+
})).option("region-id", {
|
|
115
|
+
describe: "Region ID for the new project (e.g. aws-eu-central-1). Defaults to aws-us-east-2",
|
|
116
|
+
type: "string"
|
|
117
|
+
}).option("file", {
|
|
114
118
|
describe: "Target dotenv file. Defaults to an existing .env, otherwise .env.local",
|
|
115
119
|
type: "string"
|
|
116
120
|
}).option("config", {
|
|
@@ -206,6 +210,7 @@ const create = async (props) => {
|
|
|
206
210
|
const registration = await client.register({
|
|
207
211
|
capabilities: claimableCapabilities(props.services ?? []),
|
|
208
212
|
source: "neon_cli",
|
|
213
|
+
...props.regionId !== void 0 ? { regionId: props.regionId } : {},
|
|
209
214
|
...props.dataApi ? { dataApi: props.dataApi } : {}
|
|
210
215
|
});
|
|
211
216
|
const stored = {
|
|
@@ -263,6 +268,7 @@ const create = async (props) => {
|
|
|
263
268
|
writer(props).end({
|
|
264
269
|
project_id: registration.project.id,
|
|
265
270
|
branch_id: registration.project.branchId,
|
|
271
|
+
region_id: registration.project.regionId,
|
|
266
272
|
state: "unclaimed",
|
|
267
273
|
project_expires_at: registration.project.expiresAt,
|
|
268
274
|
granted_capabilities: granted,
|
package/dist/commands/dev.js
CHANGED
|
@@ -4,12 +4,12 @@ import { isClaimableEnvTarget } from "../claimable/state.js";
|
|
|
4
4
|
import { getCliName } from "../utils/cli_name.js";
|
|
5
5
|
import { defaultDevEnvFiles, readEnvFile, resolveEnvFilePath } from "../env_file.js";
|
|
6
6
|
import { l as functionBaseUrlKey } from "../_chunks/env-BpP3Dqpe.js";
|
|
7
|
-
import { a as resolveDevEnv } from "../_chunks/env-BNm69Qh8.js";
|
|
8
|
-
import { findConfigFunctionBySource, resolveFunctionsFromConfig } from "../dev/functions.js";
|
|
9
|
-
import { resolveWatchInputs } from "../dev/inputs.js";
|
|
10
7
|
import { branchIdResolve } from "../utils/enrichers.js";
|
|
11
8
|
import { bundleEntry } from "../utils/esbuild.js";
|
|
9
|
+
import { a as resolveDevEnv } from "../_chunks/env-BNm69Qh8.js";
|
|
12
10
|
import { envFlag } from "./config.js";
|
|
11
|
+
import { findConfigFunctionBySource, resolveFunctionsFromConfig } from "../dev/functions.js";
|
|
12
|
+
import { resolveWatchInputs } from "../dev/inputs.js";
|
|
13
13
|
import { existsSync, mkdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
14
14
|
import { basename, dirname, join, relative, resolve } from "node:path";
|
|
15
15
|
import { fileURLToPath } from "node:url";
|
package/dist/commands/env.js
CHANGED
|
@@ -7,9 +7,9 @@ import { deprecatedServiceMessage, parseServices, servicesFlagValue, servicesOpt
|
|
|
7
7
|
import { mergeEnvFile, readEnvFile, resolveEnvFilePath } from "../env_file.js";
|
|
8
8
|
import { t as NEON_ENV_VAR_KEYS, u as isFunctionBaseUrlKey } from "../_chunks/env-BpP3Dqpe.js";
|
|
9
9
|
import { ENV_PULL_KEY_HELP, ENV_PULL_SERVICES, envKeysForSelection, envPullFlagValue, ownedEnvServiceKeys, parseEnvPullKeys } from "../env_services.js";
|
|
10
|
-
import { i as dropClaimableUnsupported, o as resolveNeonEnvVars } from "../_chunks/env-BNm69Qh8.js";
|
|
11
10
|
import { fillSingleProject, resolveBranchRef } from "../utils/enrichers.js";
|
|
12
11
|
import { warnAiGateway } from "../utils/ai_gateway_notice.js";
|
|
12
|
+
import { i as dropClaimableUnsupported, o as resolveNeonEnvVars } from "../_chunks/env-BNm69Qh8.js";
|
|
13
13
|
import { formatPulledEnv, pulledBranch } from "./env_output.js";
|
|
14
14
|
import { existsSync } from "node:fs";
|
|
15
15
|
import chalk from "chalk";
|
package/dist/commands/init.js
CHANGED
|
@@ -64,7 +64,7 @@ const builder = (yargs) => yargs.usage("$0 init [options]").option("context-file
|
|
|
64
64
|
describe: "Forwarded to link: name for a new project",
|
|
65
65
|
type: "string"
|
|
66
66
|
}).option("region-id", {
|
|
67
|
-
describe: "
|
|
67
|
+
describe: "Region for a new project, forwarded to link or to the claimable project",
|
|
68
68
|
type: "string"
|
|
69
69
|
}).option("branch", {
|
|
70
70
|
alias: "branch-id",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { writer } from "../writer.js";
|
|
2
|
-
import { o as resolveNeonEnvVars } from "../_chunks/env-BNm69Qh8.js";
|
|
3
2
|
import { branchIdFromProps } from "../utils/enrichers.js";
|
|
3
|
+
import { o as resolveNeonEnvVars } from "../_chunks/env-BNm69Qh8.js";
|
|
4
4
|
import YAML from "yaml";
|
|
5
5
|
//#region src/commands/subscribe.ts
|
|
6
6
|
const builder = (argv) => argv.usage("$0 realtime subscribe \"<query>\" [options]").positional("query", {
|
package/dist/init/copy.js
CHANGED
|
@@ -35,7 +35,7 @@ const MCP_AUTH_API_KEY_TITLE = "Use a Neon API key";
|
|
|
35
35
|
const MCP_AUTH_API_KEY_DESCRIPTION = "Reuse an existing MCP key or create a key after CLI authentication.";
|
|
36
36
|
const CLAIMABLE_MCP_API_KEY = "Claimable project setup cannot create an account API key for MCP. Use --mcp-auth oauth.";
|
|
37
37
|
const CLAIMABLE_NO_LINK = "--claimable cannot be combined with --no-link.";
|
|
38
|
-
const CLAIMABLE_ACCOUNT_FLAGS = "--claimable cannot be combined with --org-id, --project-id, --project-name,
|
|
38
|
+
const CLAIMABLE_ACCOUNT_FLAGS = "--claimable cannot be combined with --org-id, --project-id, --project-name, or --branch.";
|
|
39
39
|
const CLAIMABLE_ALREADY_LINKED = "--claimable cannot run in a directory that is already linked. Omit --claimable, or unlink first.";
|
|
40
40
|
const PROJECT_SETUP_MESSAGE = "How would you like to get a Neon project?";
|
|
41
41
|
const PROJECT_SETUP_LINK_TITLE = "Sign in to Neon";
|
package/dist/init/run.js
CHANGED
|
@@ -149,7 +149,8 @@ const defaultCreateClaimable = async (input) => {
|
|
|
149
149
|
apiKey: input.apiKey,
|
|
150
150
|
envPull: false,
|
|
151
151
|
cwd: input.cwd,
|
|
152
|
-
...input.profile !== void 0 ? { profile: input.profile } : {}
|
|
152
|
+
...input.profile !== void 0 ? { profile: input.profile } : {},
|
|
153
|
+
...input.regionId !== void 0 ? { regionId: input.regionId } : {}
|
|
153
154
|
});
|
|
154
155
|
};
|
|
155
156
|
const runInit = async (props) => {
|
|
@@ -191,7 +192,8 @@ const runInit = async (props) => {
|
|
|
191
192
|
...props.regionId ? { regionId: props.regionId } : {},
|
|
192
193
|
...props.branch ? { branch: props.branch } : {}
|
|
193
194
|
};
|
|
194
|
-
const
|
|
195
|
+
const hasAccountLinkInputs = props.orgId !== void 0 || props.projectId !== void 0 || props.projectName !== void 0 || props.branch !== void 0;
|
|
196
|
+
const hasExplicitLinkInputs = hasAccountLinkInputs || props.regionId !== void 0;
|
|
195
197
|
const funnel = createInitFunnel();
|
|
196
198
|
let outcome = "error";
|
|
197
199
|
let printed = false;
|
|
@@ -241,7 +243,7 @@ const runInit = async (props) => {
|
|
|
241
243
|
const claimableExisting = alreadyLinked && readLinkedClaimableCredentials(configDir, readContextFile(contextFile)) !== null;
|
|
242
244
|
if (props.claimable === true) {
|
|
243
245
|
if (props.link === false) throw new Error(CLAIMABLE_NO_LINK);
|
|
244
|
-
if (
|
|
246
|
+
if (hasAccountLinkInputs) throw new Error(CLAIMABLE_ACCOUNT_FLAGS);
|
|
245
247
|
if (alreadyLinked) throw new Error(CLAIMABLE_ALREADY_LINKED);
|
|
246
248
|
}
|
|
247
249
|
const recommended = mode === "recommended";
|
|
@@ -424,7 +426,8 @@ const runInit = async (props) => {
|
|
|
424
426
|
contextFile,
|
|
425
427
|
output: props.output,
|
|
426
428
|
apiKey: props.apiKey,
|
|
427
|
-
...props.profile !== void 0 ? { profile: props.profile } : {}
|
|
429
|
+
...props.profile !== void 0 ? { profile: props.profile } : {},
|
|
430
|
+
...props.regionId !== void 0 ? { regionId: props.regionId } : {}
|
|
428
431
|
});
|
|
429
432
|
funnel.link = "claimable";
|
|
430
433
|
claimExpiresAt = readLinkedClaimableCredentials(configDir, readContextFile(contextFile))?.expiresAt;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neon",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.8.0",
|
|
4
4
|
"description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neon",
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
"yaml": "^2.9.0",
|
|
71
71
|
"yargs": "17.7.2",
|
|
72
72
|
"yoctocolors": "^2.1.2",
|
|
73
|
-
"@neon/config": "1.9.
|
|
74
|
-
"@neon/
|
|
75
|
-
"@neon/
|
|
76
|
-
"@neon/
|
|
73
|
+
"@neon/config": "1.9.2",
|
|
74
|
+
"@neon/config-runtime": "1.10.1",
|
|
75
|
+
"@neon/realtime": "0.1.1",
|
|
76
|
+
"@neon/sdk": "7.3.0"
|
|
77
77
|
},
|
|
78
78
|
"optionalDependencies": {
|
|
79
79
|
"@napi-rs/keyring": "1.3.0",
|
|
@@ -110,10 +110,10 @@
|
|
|
110
110
|
"typescript": "^5.9.0",
|
|
111
111
|
"vitest": "^3.0.9",
|
|
112
112
|
"@neon-internals/cli-core": "0.0.0",
|
|
113
|
-
"@neon-internals/env-core": "0.0.
|
|
114
|
-
"@neon/
|
|
115
|
-
"@neon/
|
|
116
|
-
"@neon/
|
|
113
|
+
"@neon-internals/env-core": "0.0.33",
|
|
114
|
+
"@neon/e2e-harness": "0.0.0",
|
|
115
|
+
"@neon/env": "1.6.3",
|
|
116
|
+
"@neon/functions": "0.11.0"
|
|
117
117
|
},
|
|
118
118
|
"publishConfig": {
|
|
119
119
|
"access": "public",
|