neon 8.23.4 → 9.1.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 +67 -8
- package/dist/_chunks/{checkout-OEE3GTc_.js → checkout-B_gbS0nD.js} +3 -3
- package/dist/_chunks/{claim-C-9or54_.js → claim-BVEwQ65H.js} +1 -1
- package/dist/_chunks/{config-DPuP7ywm.js → config-BClSMzco.js} +1 -1
- package/dist/_chunks/{deploy-CpF33Ij-.js → deploy-CJ22hy3i.js} +1 -1
- package/dist/_chunks/{dev-BE5TL7ZH.js → dev-CSoQfCuS.js} +19 -20
- package/dist/_chunks/{env-CIFMBEon.js → env-CFBmcKyo.js} +18 -45
- package/dist/_chunks/{env-C4-EYFmE.js → env-DxcO3oJk.js} +21 -23
- package/dist/_chunks/{env-JgoSsmyt.js → env-EJU-0InB.js} +49 -110
- package/dist/_chunks/{git-R8RebFpF.js → git-C6XPViK5.js} +2 -2
- package/dist/_chunks/{link-PLk7-vwB.js → link-n40BxbmK.js} +2 -2
- package/dist/_chunks/{logs-BB4uvblR.js → logs-Zf8mcRVE.js} +7 -4
- package/dist/_chunks/{status-BjaHpnTV.js → status-TDYLPWRO.js} +1 -1
- package/dist/api.js +1 -0
- package/dist/commands/checkout.js +1 -1
- package/dist/commands/claim.js +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/env.js +1 -1
- package/dist/commands/env_output.js +4 -4
- package/dist/commands/functions_new.js +1 -1
- package/dist/commands/git.js +1 -1
- package/dist/commands/index.js +10 -10
- package/dist/commands/link.js +1 -1
- package/dist/commands/logs.js +1 -1
- package/dist/commands/loki.js +125 -0
- package/dist/commands/manifest.js +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/subscribe.js +1 -1
- package/dist/dev/env.js +1 -1
- package/dist/env_services.js +30 -23
- package/dist/errors.js +2 -1
- package/dist/init/auth.js +1 -1
- package/dist/init/choices.js +8 -6
- package/dist/init/deploy.js +1 -1
- package/dist/init/link.js +1 -1
- package/dist/init/run.js +3 -3
- package/dist/utils/hooks.js +9 -4
- package/package.json +8 -8
package/dist/env_services.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { NEON_SERVICES } from "./neon_services.js";
|
|
2
|
-
import {
|
|
2
|
+
import { n as NEON_ENV_VAR_KEYS } from "./_chunks/env-EJU-0InB.js";
|
|
3
3
|
// src/env_services.ts
|
|
4
4
|
const ENV_PULL_SERVICES = NEON_SERVICES;
|
|
5
5
|
const ENV_PULL_KEYS = [
|
|
6
6
|
...Object.values(NEON_ENV_VAR_KEYS.postgres),
|
|
7
7
|
NEON_ENV_VAR_KEYS.branch.name,
|
|
8
|
+
NEON_ENV_VAR_KEYS.branch.id,
|
|
9
|
+
NEON_ENV_VAR_KEYS.branch.functionHostSuffix,
|
|
8
10
|
...Object.values(NEON_ENV_VAR_KEYS.auth),
|
|
9
11
|
...Object.values(NEON_ENV_VAR_KEYS.dataApi),
|
|
10
12
|
...Object.values(NEON_ENV_VAR_KEYS.realtime),
|
|
11
13
|
...Object.values(NEON_ENV_VAR_KEYS.storage),
|
|
12
14
|
...Object.values(NEON_ENV_VAR_KEYS.aiGateway)
|
|
13
15
|
];
|
|
14
|
-
const ENV_PULL_KEY_HELP =
|
|
16
|
+
const ENV_PULL_KEY_HELP = ENV_PULL_KEYS.join(", ");
|
|
17
|
+
/**
|
|
18
|
+
* The per-function URL vars earlier releases wrote (`NEON_FUNCTION_<SLUG>_BASE_URL`), replaced
|
|
19
|
+
* by `NEON_BRANCH_ID` + `NEON_FUNCTION_HOST_SUFFIX`. Recognized only to prune them from a
|
|
20
|
+
* pulled file and to point `--env` callers at `functionBaseUrl`.
|
|
21
|
+
*/
|
|
22
|
+
const isLegacyFunctionBaseUrlKey = (key) => /^NEON_FUNCTION_[A-Z0-9]{1,20}_BASE_URL$/.test(key);
|
|
15
23
|
/** The OS-level env vars each service contributes to a pulled `.env`. */
|
|
16
24
|
const SERVICE_ENV_KEYS = {
|
|
17
25
|
postgres: Object.values(NEON_ENV_VAR_KEYS.postgres),
|
|
@@ -20,29 +28,29 @@ const SERVICE_ENV_KEYS = {
|
|
|
20
28
|
realtime: Object.values(NEON_ENV_VAR_KEYS.realtime),
|
|
21
29
|
"object-storage": Object.values(NEON_ENV_VAR_KEYS.storage),
|
|
22
30
|
"ai-gateway": Object.values(NEON_ENV_VAR_KEYS.aiGateway),
|
|
23
|
-
functions: []
|
|
31
|
+
functions: [NEON_ENV_VAR_KEYS.branch.functionHostSuffix]
|
|
24
32
|
};
|
|
25
33
|
/**
|
|
26
34
|
* The subset of {@link SERVICE_ENV_KEYS} a pull *owns*, and so may prune from the target file
|
|
27
35
|
* when the branch no longer has it. Object storage is deliberately absent: it is emitted under
|
|
28
36
|
* the third-party `AWS_*` names, which collide with credentials a user may set by hand, so
|
|
29
|
-
* `env pull` only ever writes them.
|
|
30
|
-
* discovered at runtime.
|
|
37
|
+
* `env pull` only ever writes them.
|
|
31
38
|
*/
|
|
32
39
|
const SERVICE_OWNED_ENV_KEYS = {
|
|
33
40
|
...SERVICE_ENV_KEYS,
|
|
34
|
-
"object-storage": []
|
|
35
|
-
functions: []
|
|
41
|
+
"object-storage": []
|
|
36
42
|
};
|
|
37
43
|
/**
|
|
38
|
-
* Branch identity. Not a service — every branch has a name — so a scoped pull
|
|
39
|
-
* alongside whatever services were selected.
|
|
44
|
+
* Branch identity. Not a service — every branch has a name and an id — so a scoped pull
|
|
45
|
+
* refreshes it alongside whatever services were selected.
|
|
40
46
|
*/
|
|
41
|
-
const
|
|
47
|
+
const BRANCH_ENV_KEYS = [NEON_ENV_VAR_KEYS.branch.name, NEON_ENV_VAR_KEYS.branch.id];
|
|
42
48
|
const ENV_KEY_SERVICE = {
|
|
43
49
|
DATABASE_URL: "postgres",
|
|
44
50
|
DATABASE_URL_UNPOOLED: "postgres",
|
|
45
51
|
NEON_BRANCH: null,
|
|
52
|
+
NEON_BRANCH_ID: null,
|
|
53
|
+
NEON_FUNCTION_HOST_SUFFIX: "functions",
|
|
46
54
|
NEON_AUTH_BASE_URL: "auth",
|
|
47
55
|
NEON_AUTH_JWKS_URL: "auth",
|
|
48
56
|
NEON_DATA_API_URL: "data-api",
|
|
@@ -55,12 +63,12 @@ const ENV_KEY_SERVICE = {
|
|
|
55
63
|
NEON_AI_GATEWAY_TOKEN: "ai-gateway",
|
|
56
64
|
NEON_AI_GATEWAY_BASE_URL: "ai-gateway"
|
|
57
65
|
};
|
|
58
|
-
const serviceForEnvKey = (key) =>
|
|
66
|
+
const serviceForEnvKey = (key) => ENV_KEY_SERVICE[key];
|
|
59
67
|
/** Services that must be resolved to produce the selected env keys. */
|
|
60
68
|
const servicesForEnvKeys = (keys) => ENV_PULL_SERVICES.filter((service) => keys.some((key) => serviceForEnvKey(key) === service));
|
|
61
69
|
/** Every env var the selected services contribute, plus branch identity. */
|
|
62
70
|
const envServiceKeys = (services) => {
|
|
63
|
-
const keys =
|
|
71
|
+
const keys = new Set(BRANCH_ENV_KEYS);
|
|
64
72
|
for (const service of services) for (const key of SERVICE_ENV_KEYS[service]) keys.add(key);
|
|
65
73
|
return keys;
|
|
66
74
|
};
|
|
@@ -68,34 +76,34 @@ const envServiceKeys = (services) => {
|
|
|
68
76
|
* The env vars a pull scoped to `services` may prune. Narrower than the unscoped set on
|
|
69
77
|
* purpose: `env pull -s ai-gateway` says nothing about `DATABASE_URL`, so it must leave it
|
|
70
78
|
* alone rather than treat its absence from this pull as "the branch no longer has it".
|
|
71
|
-
* Function URL keys cannot live here because slugs are discovered at runtime.
|
|
72
79
|
*/
|
|
73
80
|
const ownedEnvServiceKeys = (services) => services.flatMap((service) => SERVICE_OWNED_ENV_KEYS[service]);
|
|
74
81
|
const envKeysForSelection = (services, envKeys) => {
|
|
75
82
|
const selected = services.length > 0 ? envServiceKeys(services) : /* @__PURE__ */ new Set();
|
|
76
83
|
for (const key of envKeys) selected.add(key);
|
|
77
84
|
if (selected.has(NEON_ENV_VAR_KEYS.storage.accessKeyId) !== selected.has(NEON_ENV_VAR_KEYS.storage.secretAccessKey)) throw new Error("AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY must be selected together: they are two halves of one newly issued object-storage credential. Add the missing key to --env, or use --service object-storage.");
|
|
78
|
-
|
|
79
|
-
const functionKeys = [...selected].filter(isFunctionBaseUrlKey).sort((left, right) => left.localeCompare(right));
|
|
80
|
-
return [...staticKeys, ...functionKeys];
|
|
85
|
+
return ENV_PULL_KEYS.filter((key) => selected.has(key));
|
|
81
86
|
};
|
|
82
87
|
/** Parse repeated or comma-separated `--env` values into canonical env-key order. */
|
|
83
88
|
const parseEnvPullKeys = (raw, flag) => {
|
|
84
89
|
const names = raw.flatMap((value) => value.split(",")).map((name) => name.trim()).filter((name) => name !== "");
|
|
85
90
|
const supported = `Supported values: ${ENV_PULL_KEY_HELP}.`;
|
|
86
91
|
if (names.length === 0) throw new Error(`${flag} needs at least one env variable. ${supported}`);
|
|
87
|
-
const
|
|
92
|
+
const legacy = names.filter(isLegacyFunctionBaseUrlKey);
|
|
93
|
+
if (legacy.length > 0) {
|
|
94
|
+
const slug = (legacy[0] ?? "").slice(14, -9).toLowerCase();
|
|
95
|
+
throw new Error(`${legacy.join(", ")} ${legacy.length === 1 ? "is" : "are"} no longer pulled. Pull NEON_BRANCH_ID and NEON_FUNCTION_HOST_SUFFIX with \`--service functions\`, then build the URL with \`functionBaseUrl("${slug}")\` from @neon/env.`);
|
|
96
|
+
}
|
|
97
|
+
const unknown = names.filter((name) => !ENV_PULL_KEYS.some((key) => key === name));
|
|
88
98
|
if (unknown.length > 0) {
|
|
89
99
|
const displayNames = unknown.map(redactUnknownEnvValue);
|
|
90
100
|
const suggestions = [...new Set(unknown.map(suggestEnvPullKey).filter((key) => key !== null))];
|
|
91
101
|
const suggestion = suggestions.length > 0 ? ` Did you mean ${suggestions.join(" or ")}?` : "";
|
|
92
102
|
throw new Error(`Unknown env variable${unknown.length === 1 ? "" : "s"} ${displayNames.join(", ")}.${suggestion} ${supported}`);
|
|
93
103
|
}
|
|
94
|
-
|
|
95
|
-
const functionKeys = [...new Set(names.filter(isFunctionBaseUrlKey))].sort((left, right) => left.localeCompare(right));
|
|
96
|
-
return [...staticKeys, ...functionKeys];
|
|
104
|
+
return ENV_PULL_KEYS.filter((key) => names.includes(key));
|
|
97
105
|
};
|
|
98
|
-
const isKnownEnvPullKey = (key) => ENV_PULL_KEYS.some((supportedKey) => supportedKey === key)
|
|
106
|
+
const isKnownEnvPullKey = (key) => ENV_PULL_KEYS.some((supportedKey) => supportedKey === key);
|
|
99
107
|
const redactUnknownEnvValue = (value) => {
|
|
100
108
|
const separator = value.indexOf("=");
|
|
101
109
|
if (separator !== -1) {
|
|
@@ -106,7 +114,6 @@ const redactUnknownEnvValue = (value) => {
|
|
|
106
114
|
};
|
|
107
115
|
const suggestEnvPullKey = (value) => {
|
|
108
116
|
if (value.includes("=")) return null;
|
|
109
|
-
if (parseFunctionBaseUrlKey(value) !== null) return null;
|
|
110
117
|
const closest = ENV_PULL_KEYS.map((key) => [key, editDistance(value, key)]).sort((a, b) => a[1] - b[1])[0];
|
|
111
118
|
return closest && closest[1] <= 2 ? closest[0] : null;
|
|
112
119
|
};
|
|
@@ -121,4 +128,4 @@ const editDistance = (left, right) => {
|
|
|
121
128
|
};
|
|
122
129
|
/** Narrow yargs' array option value without accepting any other runtime shape. */
|
|
123
130
|
const envPullFlagValue = (value) => Array.isArray(value) ? value.map(String) : void 0;
|
|
124
|
-
export {
|
|
131
|
+
export { BRANCH_ENV_KEYS, ENV_PULL_KEYS, ENV_PULL_KEY_HELP, ENV_PULL_SERVICES, envKeysForSelection, envPullFlagValue, envServiceKeys, isLegacyFunctionBaseUrlKey, ownedEnvServiceKeys, parseEnvPullKeys, serviceForEnvKey, servicesForEnvKeys };
|
package/dist/errors.js
CHANGED
|
@@ -19,7 +19,8 @@ const ERROR_MATCHERS = [
|
|
|
19
19
|
[/^(Failed to install Neon agent skills|skills CLI failed)/, "SKILLS_CLI_FAILED"],
|
|
20
20
|
[/^Cannot install the Neon plugin for /, "AGENT_COMMAND_UNAVAILABLE"],
|
|
21
21
|
[/^(Failed to install the Neon plugin for: |plugins CLI (failed|timed out))/, "PLUGINS_CLI_FAILED"],
|
|
22
|
-
[/^Could not install the Neon dependencies/, "DEPENDENCY_INSTALL_FAILED"]
|
|
22
|
+
[/^Could not install the Neon dependencies/, "DEPENDENCY_INSTALL_FAILED"],
|
|
23
|
+
[/ (is|are) no longer pulled\. Pull NEON_BRANCH_ID /, "LEGACY_FUNCTION_ENV_KEY"]
|
|
23
24
|
];
|
|
24
25
|
const matchErrorCode = (message) => {
|
|
25
26
|
if (!message) return "UNKNOWN_ERROR";
|
package/dist/init/auth.js
CHANGED
|
@@ -4,7 +4,7 @@ import "../config.js";
|
|
|
4
4
|
import "../auth.js";
|
|
5
5
|
import { c as ensureAuth, l as existingApiClient } from "../_chunks/auth-rup6nemJ.js";
|
|
6
6
|
import { recoverFrom401 } from "../auth_recovery.js";
|
|
7
|
-
import { c as pull } from "../_chunks/env-
|
|
7
|
+
import { c as pull } from "../_chunks/env-DxcO3oJk.js";
|
|
8
8
|
import { c as setupNeonMcp } from "../_chunks/mcp-SvqWzHnT.js";
|
|
9
9
|
// src/init/auth.ts
|
|
10
10
|
const isUnauthorized = (error) => isNeonApiError(error) && error.status === 401;
|
package/dist/init/choices.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { FUNCTION_SLUG } from "../config_template.js";
|
|
2
|
-
import { l as functionBaseUrlKey } from "../_chunks/env-JgoSsmyt.js";
|
|
3
1
|
// src/init/choices.ts
|
|
4
2
|
const INIT_CONFIG_SERVICES_CONFLICT = "--no-config cannot be combined with --services.";
|
|
5
3
|
const resolveInitConfigChoice = (input) => {
|
|
@@ -25,8 +23,8 @@ const configPlanFromResolution = (resolution, accepted) => {
|
|
|
25
23
|
};
|
|
26
24
|
/**
|
|
27
25
|
* A neon.ts policy pull fails while the branch lacks a declared service. These two need
|
|
28
|
-
* no `deploy`: the AI Gateway exists on every branch, and function
|
|
29
|
-
* branch host.
|
|
26
|
+
* no `deploy`: the AI Gateway exists on every branch, and the function host suffix derives
|
|
27
|
+
* from the branch's compute host.
|
|
30
28
|
*/
|
|
31
29
|
const DEPLOY_FREE_SERVICES = /* @__PURE__ */ new Set(["ai-gateway", "functions"]);
|
|
32
30
|
const needsDeploy = (declared) => declared.some((service) => !DEPLOY_FREE_SERVICES.has(service));
|
|
@@ -37,8 +35,12 @@ const initEnvPullAfterConfig = (input) => {
|
|
|
37
35
|
if (!needsDeploy(input.declared)) return { kind: "policy" };
|
|
38
36
|
return {
|
|
39
37
|
kind: "services",
|
|
40
|
-
services:
|
|
41
|
-
|
|
38
|
+
services: [
|
|
39
|
+
"postgres",
|
|
40
|
+
...input.declared.includes("ai-gateway") ? ["ai-gateway"] : [],
|
|
41
|
+
...input.declared.includes("functions") ? ["functions"] : []
|
|
42
|
+
],
|
|
43
|
+
envKeys: []
|
|
42
44
|
};
|
|
43
45
|
};
|
|
44
46
|
export { INIT_CONFIG_SERVICES_CONFLICT, configPlanFromResolution, initEnvPullAfterConfig, resolveInitConfigChoice };
|
package/dist/init/deploy.js
CHANGED
|
@@ -4,7 +4,7 @@ import { c as ensureAuth } from "../_chunks/auth-rup6nemJ.js";
|
|
|
4
4
|
import { recoverFrom401 } from "../auth_recovery.js";
|
|
5
5
|
import { loadProjectConfig } from "../project.js";
|
|
6
6
|
import { loadEnvFileIntoProcess } from "../env_file.js";
|
|
7
|
-
import { r as applyCmd } from "../_chunks/config-
|
|
7
|
+
import { r as applyCmd } from "../_chunks/config-BClSMzco.js";
|
|
8
8
|
import { authContext } from "./auth.js";
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
10
10
|
// src/init/deploy.ts
|
package/dist/init/link.js
CHANGED
|
@@ -4,7 +4,7 @@ import "../config.js";
|
|
|
4
4
|
import "../auth.js";
|
|
5
5
|
import { c as ensureAuth } from "../_chunks/auth-rup6nemJ.js";
|
|
6
6
|
import { recoverFrom401 } from "../auth_recovery.js";
|
|
7
|
-
import { s as runLink } from "../_chunks/link-
|
|
7
|
+
import { s as runLink } from "../_chunks/link-n40BxbmK.js";
|
|
8
8
|
// src/init/link.ts
|
|
9
9
|
const isUnauthorized = (error) => isNeonApiError(error) && error.status === 401;
|
|
10
10
|
const authenticationFailed = () => /* @__PURE__ */ new Error("Authentication failed.");
|
package/dist/init/run.js
CHANGED
|
@@ -14,8 +14,8 @@ import { getAgentDisplayName } from "../mcp/agents.js";
|
|
|
14
14
|
import { missingPluginsCommands, pluginsCommandProblemText, pluginsInstallableAgents, unusablePluginsCommands } from "../plugins/targets.js";
|
|
15
15
|
import { AGENTS_NOT_INSTALLED, CANCELLED_BODY, CLAIMABLE_ACCOUNT_FLAGS, CLAIMABLE_ALREADY_LINKED, CLAIMABLE_MCP_API_KEY, CLAIMABLE_NO_LINK, MCP_API_KEY_NEEDS_AUTH, MCP_SCOPED_NEEDS_PROJECT, NON_TTY_LINK_NEEDS_AUTH, NO_AGENTS_FALLBACK_STATUS, PROGRESS, PROJECT_PINNED_OFFLINE, claimableNext, claimableThenServicesNext, configInitNext, envPullFailedNext, existingConfigNext, installFailedNext, mcpAfterLinkNext, mcpConfigLocationSkipped, mcpConfigLocationUnavailable, mcpKeyFailedNext, namedAgentsUnavailable, newConfigNext, offlinePinNext, skippedLinkNext, toolingFailedNext, unattendedUnauthedNext } from "./copy.js";
|
|
16
16
|
import { agentsRowValue, configRowValue, formatInitDone, headingForKind, printInitBanner, printInitDone, printInitProgress, projectRowValue, shouldPrintInitBanner } from "./chrome.js";
|
|
17
|
-
import { h as initCmd, t as ConfigInstallFailed } from "../_chunks/config-
|
|
18
|
-
import { o as quoteFlagValue, s as runLink } from "../_chunks/link-
|
|
17
|
+
import { h as initCmd, t as ConfigInstallFailed } from "../_chunks/config-BClSMzco.js";
|
|
18
|
+
import { o as quoteFlagValue, s as runLink } from "../_chunks/link-n40BxbmK.js";
|
|
19
19
|
import { runAuthenticatedLink } from "./link.js";
|
|
20
20
|
import { mcpInstallableAgents } from "../mcp/targets.js";
|
|
21
21
|
import { skillsInstallableAgents } from "../skills/targets.js";
|
|
@@ -25,7 +25,7 @@ import { pullInitEnv, resolveInitConfigApi } from "./auth.js";
|
|
|
25
25
|
import { InitCancelled, raceSigint, restoreCursor } from "./cancelled.js";
|
|
26
26
|
import { pickAgentSetupInteractively, pickInitAgentsInteractively, pickInitConfigInteractively, pickInitMcpAuthInteractively, pickInitMcpConfigLocationInteractively, pickInitModeInteractively, pickInitPackageManagerInteractively, pickInitProjectSetupInteractively, pickInitServicesInteractively, pickInitSkillsInteractively } from "./wizard.js";
|
|
27
27
|
import { runToolingSteps, toolingStepCommandText } from "./tooling.js";
|
|
28
|
-
import { l as create } from "../_chunks/claim-
|
|
28
|
+
import { l as create } from "../_chunks/claim-BVEwQ65H.js";
|
|
29
29
|
import { INIT_CONFIG_SERVICES_CONFLICT, configPlanFromResolution, initEnvPullAfterConfig, resolveInitConfigChoice } from "./choices.js";
|
|
30
30
|
import { detectInitEnvironment } from "./detect.js";
|
|
31
31
|
import { createInitFunnel, emitInitStart, finishInitFunnel, initStartProperties, recordInitError, recordInitExit } from "./funnel.js";
|
package/dist/utils/hooks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { log } from "../log.js";
|
|
2
2
|
import { loadProjectConfig } from "../project.js";
|
|
3
|
-
import {
|
|
3
|
+
import { c as fetchEnvKeys } from "../_chunks/env-EJU-0InB.js";
|
|
4
4
|
import { runHook } from "@neon/config-runtime";
|
|
5
5
|
// src/utils/hooks.ts
|
|
6
6
|
/**
|
|
@@ -170,7 +170,11 @@ const shapeHookEnv = (resolved) => ({
|
|
|
170
170
|
databaseUrl: resolved.postgres?.databaseUrl ?? "",
|
|
171
171
|
databaseUrlUnpooled: resolved.postgres?.databaseUrlUnpooled ?? ""
|
|
172
172
|
},
|
|
173
|
-
...resolved.branch?.name ? { branch: {
|
|
173
|
+
...resolved.branch?.name ? { branch: {
|
|
174
|
+
name: resolved.branch.name,
|
|
175
|
+
...resolved.branch.id ? { id: resolved.branch.id } : {},
|
|
176
|
+
...resolved.branch.functionHostSuffix ? { functionHostSuffix: resolved.branch.functionHostSuffix } : {}
|
|
177
|
+
} } : {},
|
|
174
178
|
...resolved.auth?.baseUrl !== void 0 && resolved.auth.jwksUrl !== void 0 ? { auth: {
|
|
175
179
|
baseUrl: resolved.auth.baseUrl,
|
|
176
180
|
jwksUrl: resolved.auth.jwksUrl
|
|
@@ -185,8 +189,7 @@ const shapeHookEnv = (resolved) => ({
|
|
|
185
189
|
...resolved.aiGateway?.apiKey !== void 0 && resolved.aiGateway.baseUrl !== void 0 ? { aiGateway: {
|
|
186
190
|
apiKey: resolved.aiGateway.apiKey,
|
|
187
191
|
baseUrl: resolved.aiGateway.baseUrl
|
|
188
|
-
} } : {}
|
|
189
|
-
...resolved.functions ? { functions: Object.fromEntries(Object.entries(resolved.functions).map(([slug, fn]) => [slug, { baseUrl: fn.baseUrl }])) } : {}
|
|
192
|
+
} } : {}
|
|
190
193
|
});
|
|
191
194
|
/** Re-derive the OS-level env vars from a {@link HookEnv} for shell-hook injection. */
|
|
192
195
|
const hookEnvToProcessEnv = (env) => {
|
|
@@ -195,6 +198,8 @@ const hookEnvToProcessEnv = (env) => {
|
|
|
195
198
|
DATABASE_URL_UNPOOLED: env.postgres.databaseUrlUnpooled
|
|
196
199
|
};
|
|
197
200
|
if (env.branch?.name) out.NEON_BRANCH = env.branch.name;
|
|
201
|
+
if (env.branch?.id) out.NEON_BRANCH_ID = env.branch.id;
|
|
202
|
+
if (env.branch?.functionHostSuffix) out.NEON_FUNCTION_HOST_SUFFIX = env.branch.functionHostSuffix;
|
|
198
203
|
if (env.auth) {
|
|
199
204
|
out.NEON_AUTH_BASE_URL = env.auth.baseUrl;
|
|
200
205
|
out.NEON_AUTH_JWKS_URL = env.auth.jwksUrl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neon",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neon",
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"yaml": "^2.9.0",
|
|
74
74
|
"yargs": "17.7.2",
|
|
75
75
|
"yoctocolors": "^2.1.2",
|
|
76
|
-
"@neon/config
|
|
76
|
+
"@neon/config": "1.12.1",
|
|
77
|
+
"@neon/config-runtime": "1.11.9",
|
|
77
78
|
"@neon/realtime": "0.2.0",
|
|
78
|
-
"@neon/
|
|
79
|
-
"@neon/sdk": "7.10.0"
|
|
79
|
+
"@neon/sdk": "7.11.0"
|
|
80
80
|
},
|
|
81
81
|
"optionalDependencies": {
|
|
82
82
|
"@napi-rs/keyring": "1.3.0",
|
|
@@ -113,10 +113,10 @@
|
|
|
113
113
|
"typescript": "^5.9.0",
|
|
114
114
|
"vitest": "^3.0.9",
|
|
115
115
|
"@neon-internals/cli-core": "0.0.0",
|
|
116
|
-
"@neon-internals/env-core": "0.0.
|
|
117
|
-
"@neon/
|
|
118
|
-
"@neon/
|
|
119
|
-
"@neon/
|
|
116
|
+
"@neon-internals/env-core": "0.0.47",
|
|
117
|
+
"@neon/e2e-harness": "0.0.0",
|
|
118
|
+
"@neon/env": "2.0.1",
|
|
119
|
+
"@neon/functions": "0.11.0"
|
|
120
120
|
},
|
|
121
121
|
"publishConfig": {
|
|
122
122
|
"access": "public",
|