neon 5.0.0 → 5.0.1
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/dist/commands/auth.js +9 -2
- package/dist/commands/config.js +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/commands/auth.js
CHANGED
|
@@ -14,6 +14,8 @@ import { ClaimableClient, ClaimableServiceError } from "../claimable/api.js";
|
|
|
14
14
|
import { assertionHasExpired, claimableCredentialsExist, claimableCredentialsPath, readLinkedClaimableCredentials, shouldUseClaimableCredentials } from "../claimable/state.js";
|
|
15
15
|
import { withExclusiveLock } from "../refresh_lock.js";
|
|
16
16
|
import { readOutgoingCredential, retirePreviousCredential } from "../retire_credential.js";
|
|
17
|
+
import { getCliName } from "../utils/cli_name.js";
|
|
18
|
+
import { helpEpilogue, helpWidth, wrapHelpText } from "../utils/help_text.js";
|
|
17
19
|
import { existsSync } from "node:fs";
|
|
18
20
|
import { join } from "node:path";
|
|
19
21
|
import { createHash } from "node:crypto";
|
|
@@ -45,11 +47,16 @@ const locationForAuth = (configDir, name, keyring, options = {}) => {
|
|
|
45
47
|
};
|
|
46
48
|
const command = "auth";
|
|
47
49
|
const aliases = ["login"];
|
|
48
|
-
const describe = "
|
|
50
|
+
const describe = "Sign in with a browser. See --help for API keys and profiles";
|
|
51
|
+
const wrapAuthHelp = (text) => wrapHelpText(text, helpWidth());
|
|
52
|
+
const authHelpEpilogue = () => {
|
|
53
|
+
const cli = getCliName();
|
|
54
|
+
return helpEpilogue(wrapAuthHelp("Non-interactive (CI, scripts, agents):"), wrapAuthHelp("Use an existing API key or an API-key profile."), ` ${cli} projects list --profile agent`, wrapAuthHelp(`${cli} profile create <name> --mint needs a browser during setup, then stores an API key and drops the session. It cannot run in CI. Default key is account-wide; --org-id or --project-id (not both) restricts it.`), wrapAuthHelp(`A profile holds a browser session or an API key. Select it with --profile <name> or NEON_PROFILE. List profiles with ${cli} profile list.`), wrapAuthHelp("On commands that use a credential, --api-key or --profile overrides NEON_API_KEY and NEON_PROFILE. Pass either --api-key or --profile, not both. When neither flag is passed and both NEON_API_KEY and NEON_PROFILE are set, the key wins and stderr names the ignored profile. When no flag or environment variable selects a credential, DEFAULT is used."), wrapAuthHelp(`${cli} profile create <name> replaces an existing profile of that name and tries to revoke the credential it held. An imported key with no recorded id stays live. Pick a new name to keep the old profile.`), wrapAuthHelp(`See ${cli} profile --help and ${cli} profile create --help.`));
|
|
55
|
+
};
|
|
49
56
|
const builder = (yargs) => yargs.option("context-file", { hidden: true }).option("keyring", {
|
|
50
57
|
describe: "Store the credential in the OS keyring. Per profile; later auth without the flag stays there. See `neon profile list`.",
|
|
51
58
|
type: "boolean"
|
|
52
|
-
});
|
|
59
|
+
}).example("$0 auth", "Sign in with a browser").example("$0 auth --profile work", "Save a browser session in profile work").example("$0 projects list --api-key \"$KEY\"", "Use an existing API key for this command").example("NEON_API_KEY=\"$KEY\" $0 projects list", "Use an existing API key from the environment").example("$0 profile create agent --api-key \"$KEY\"", "Store an existing API key").example("echo \"$KEY\" | $0 profile create agent --api-key -", "Store a key read from stdin").example("$0 profile create ci --mint", "Sign in once in a browser and store a new API key").epilogue(authHelpEpilogue());
|
|
53
60
|
const handler = async (args) => {
|
|
54
61
|
await authFlow(args);
|
|
55
62
|
};
|
package/dist/commands/config.js
CHANGED
|
@@ -21,8 +21,8 @@ import { zipBundle } from "../utils/zip.js";
|
|
|
21
21
|
import { autoPullEnvAfterPin } from "./env.js";
|
|
22
22
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
23
23
|
import { dirname, join } from "node:path";
|
|
24
|
-
import { packagesToStage, previewGaWarningForConfig, resolveConfig } from "@neon/config";
|
|
25
24
|
import chalk from "chalk";
|
|
25
|
+
import { packagesToStage, previewGaWarningForConfig, resolveConfig } from "@neon/config";
|
|
26
26
|
import { PushConflictError, apply, assertZipWithinLimits, bundleAsIs, createBranch, describeNativeFinding, enforceLimits, findUndeclaredNativePackages, inspect, isPartialBranchCreateError, loadConfigFromFile as loadConfigFromFile$1, plan, resolveEsbuildEntry, traceNativePackages, zipFunctionBundle } from "@neon/config-runtime";
|
|
27
27
|
//#region src/commands/config.ts
|
|
28
28
|
var config_exports = /* @__PURE__ */ __exportAll({
|
package/dist/commands/init.js
CHANGED
|
@@ -4,9 +4,9 @@ import { contextBranch, readContextFile } from "../context.js";
|
|
|
4
4
|
import { recordCommandSuccessExtras } from "../analytics.js";
|
|
5
5
|
import { t as credentialInputs } from "../_chunks/auth_selection-pitMFzDe.js";
|
|
6
6
|
import { getCliName } from "../utils/cli_name.js";
|
|
7
|
+
import { helpCsv, helpEpilogue } from "../utils/help_text.js";
|
|
7
8
|
import { deprecatedServiceMessage, parseServices, servicesFlagValue, servicesOption } from "../neon_services.js";
|
|
8
9
|
import { CONFIG_INIT_NONE_MEANS, CONFIG_INIT_SERVICES, CONFIG_INIT_UNAVAILABLE } from "../config_template.js";
|
|
9
|
-
import { helpCsv, helpEpilogue } from "../utils/help_text.js";
|
|
10
10
|
import { fetchTemplates } from "../init/bootstrap.js";
|
|
11
11
|
import { initChildEnv, spawnCliChild } from "../init/child.js";
|
|
12
12
|
import { agentSetupLabel, configSummaryLabel, formatInitDone, printInitBanner, printInitDone, shouldPrintInitBanner } from "../init/chrome.js";
|
package/dist/index.js
CHANGED
|
@@ -8,9 +8,9 @@ import { currentContextFile, enrichFromContext } from "./context.js";
|
|
|
8
8
|
import { analyticsMiddleware, closeAnalytics, commandSuccessProperties, initAnalyticsClientMiddleware, sendError, takeCommandSuccessExtras, trackEvent } from "./analytics.js";
|
|
9
9
|
import { NETWORK_ERROR_MESSAGE, isNetworkError, matchErrorCode } from "./errors.js";
|
|
10
10
|
import { AuthRefreshError, defaultClientID } from "./auth.js";
|
|
11
|
+
import { getCliName } from "./utils/cli_name.js";
|
|
11
12
|
import { ensureAuth } from "./commands/auth.js";
|
|
12
13
|
import { recoverFrom401 } from "./auth_recovery.js";
|
|
13
|
-
import { getCliName } from "./utils/cli_name.js";
|
|
14
14
|
import { showHelp } from "./help.js";
|
|
15
15
|
import { rewriteUnknownAgentArg } from "./init/plan.js";
|
|
16
16
|
import commands_default from "./commands/index.js";
|