neon 3.1.0 → 3.1.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/README.md +16 -5
- package/dist/{_shared/auth_selection.js → _chunks/auth_selection-DGgq6ifc.js} +3 -3
- package/dist/_chunks/cmd_pipeline-CUbBO9U_.js +2818 -0
- package/dist/{_shared/credentials.js → _chunks/credentials-MYdHdKah.js} +3 -3
- package/dist/_chunks/env-NbA61JR3.js +585 -0
- package/dist/{_shared/env-core/env.js → _chunks/env_services-Tz9G4JeT.js} +179 -43
- package/dist/{_shared/paths.js → _chunks/paths-DMq0Lt7a.js} +2 -2
- package/dist/{_shared/profiles.js → _chunks/profiles-Ir29rqns.js} +4 -13
- package/dist/_chunks/psql-DWH-kc69.js +2169 -0
- package/dist/{_virtual/_rolldown/runtime.js → _chunks/rolldown-runtime-D7D4PA-g.js} +1 -1
- package/dist/{_shared/secure_file.js → _chunks/secure_file-BucZj4yQ.js} +2 -4
- package/dist/analytics.js +2 -2
- package/dist/auth_context.js +1 -1
- package/dist/commands/api.js +2 -2
- package/dist/commands/api_keys.js +2 -2
- package/dist/commands/auth.js +6 -6
- package/dist/commands/bootstrap.js +3 -3
- package/dist/commands/branches.js +2 -2
- package/dist/commands/bucket.js +2 -2
- package/dist/commands/checkout.js +2 -2
- package/dist/commands/config.js +2 -2
- package/dist/commands/connection_string.js +2 -2
- package/dist/commands/data_api.js +2 -2
- package/dist/commands/databases.js +2 -2
- package/dist/commands/deploy.js +2 -2
- package/dist/commands/dev.js +3 -3
- package/dist/commands/diff.js +2 -2
- package/dist/commands/env.js +42 -32
- package/dist/commands/functions.js +2 -2
- package/dist/commands/index.js +33 -33
- package/dist/commands/init.js +3 -3
- package/dist/commands/inspect.js +2 -2
- package/dist/commands/ip_allow.js +2 -2
- package/dist/commands/link.js +2 -2
- package/dist/commands/logs.js +2 -2
- package/dist/commands/neon_auth.js +2 -2
- package/dist/commands/operations.js +2 -2
- package/dist/commands/orgs.js +2 -2
- package/dist/commands/profile.js +7 -7
- package/dist/commands/projects.js +2 -2
- package/dist/commands/psql.js +2 -2
- package/dist/commands/roles.js +2 -2
- package/dist/commands/set_context.js +2 -2
- package/dist/commands/snapshots.js +2 -2
- package/dist/commands/status.js +2 -2
- package/dist/commands/user.js +2 -2
- package/dist/commands/vpc_endpoints.js +2 -2
- package/dist/config.js +1 -1
- package/dist/dev/env.js +1 -364
- package/dist/env_services.js +2 -49
- package/dist/index.js +1 -1
- package/dist/init/auth.js +4 -4
- package/dist/psql/cli.js +1 -1
- package/dist/psql/command/cmd_copy.js +1 -1
- package/dist/psql/command/cmd_io.js +1 -1403
- package/dist/psql/command/cmd_pipeline.js +1 -595
- package/dist/psql/command/dispatch.js +1 -2
- package/dist/psql/core/common.js +1 -834
- package/dist/psql/core/mainloop.js +1 -2
- package/dist/psql/core/startup.js +1 -656
- package/dist/psql/index.js +1 -1516
- package/dist/psql/io/psqlrc.js +1 -1
- package/dist/psql/types/index.js +6 -0
- package/dist/utils/inspect_db.js +1 -1
- package/dist/utils/middlewares.js +2 -1
- package/package.json +6 -3
- package/dist/_shared/env-core/reuse-secrets.js +0 -179
package/README.md
CHANGED
|
@@ -421,9 +421,9 @@ The human-readable summary line goes to stderr and the diff body to stdout, so `
|
|
|
421
421
|
|
|
422
422
|
**What gets pulled**, in precedence order:
|
|
423
423
|
|
|
424
|
-
1. **`--service`**, when you pass
|
|
424
|
+
1. **`--service` and/or `--env`**, when you pass either — their union is the complete selection, ignoring `neon.ts` and unselected branch variables. `--service` adds a service's complete variable bundle; `--env` adds only the individual variables you name.
|
|
425
425
|
2. **`neon.ts`**, when the working directory has one — the policy is the source of truth, same as `neon dev` and `neon deploy`.
|
|
426
|
-
3. **Everything the branch has** otherwise — Postgres, Neon Auth, the Data API, and object storage read back from the branch, plus the AI Gateway. The gateway has no branch-level state to read back
|
|
426
|
+
3. **Everything the branch has** otherwise — Postgres, Neon Auth, the Data API, and object storage read back from the branch, plus the AI Gateway. The gateway has no branch-level state to read back, so a bare `env pull` asks for it rather than detecting it and may mint a branch credential. To leave it out, name only what you do want with `--service` and/or `--env`.
|
|
427
427
|
|
|
428
428
|
If the gateway can't be resolved, it is dropped with a warning and the rest of the pull still lands. Gateway variables already in your file for *this* branch are left alone — a pull that couldn't reach the gateway is no evidence the branch has stopped having one — while ones left over from a different branch are pruned like any other stale value.
|
|
429
429
|
|
|
@@ -440,6 +440,13 @@ neon env pull --service ai-gateway
|
|
|
440
440
|
# Repeat the flag or comma-separate; -s, --service and --services are all accepted
|
|
441
441
|
neon env pull -s postgres -s data-api
|
|
442
442
|
neon env pull -s postgres,auth
|
|
443
|
+
|
|
444
|
+
# Pull one exact variable; repeat -e or comma-separate for more
|
|
445
|
+
neon env pull -e DATABASE_URL
|
|
446
|
+
neon env pull -e DATABASE_URL,NEON_AUTH_BASE_URL
|
|
447
|
+
|
|
448
|
+
# The selectors compose as a union: all Auth vars plus DATABASE_URL
|
|
449
|
+
neon env pull -s auth -e DATABASE_URL
|
|
443
450
|
```
|
|
444
451
|
|
|
445
452
|
Every services flag in the CLI takes those three spellings, the same value syntax, and the same service names — see [`config init --services`](#getting-a-neonts-config-init).
|
|
@@ -452,11 +459,15 @@ Every services flag in the CLI takes those three spellings, the same value synta
|
|
|
452
459
|
| `object-storage` | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_ENDPOINT_URL_S3`, `AWS_REGION` |
|
|
453
460
|
| `ai-gateway` | `NEON_AI_GATEWAY_TOKEN`, `NEON_AI_GATEWAY_BASE_URL` |
|
|
454
461
|
|
|
455
|
-
`NEON_BRANCH` is written by
|
|
462
|
+
`-e, --env` accepts any variable in the table plus `NEON_BRANCH`. It is case-sensitive and rejects unknown names rather than silently widening the pull. `NEON_BRANCH` is written by unscoped and service-scoped pulls because it is branch identity, not a service; an env-only pull writes it only when you select it.
|
|
463
|
+
|
|
464
|
+
`--env` never narrows `--service`: `neon env pull -s postgres -e DATABASE_URL` still pulls the complete Postgres bundle (`DATABASE_URL`, `DATABASE_URL_UNPOOLED`, and `NEON_BRANCH`). The two selectors always form a union.
|
|
465
|
+
|
|
466
|
+
**A scoped pull is scoped in both directions.** An unscoped `env pull` owns the Neon-named variables: pointing a directory at a branch without Neon Auth prunes the stale `NEON_AUTH_*` lines. `--service` narrows that to the services you named, while `--env` narrows it to the exact keys you named, so `env pull -e DATABASE_URL` never touches `DATABASE_URL_UNPOOLED`. (`AWS_*` is never pruned by any pull: those names collide with credentials you may set yourself, so `env pull` only ever writes them.)
|
|
456
467
|
|
|
457
|
-
**A scoped pull
|
|
468
|
+
**A scoped pull also never revokes a credential.** Where an unscoped pull revokes the credential it replaces, a scoped one leaves the old one live — it can't tell which other variables still use it. It says so when it happens; revoke it in the Neon Console if nothing does.
|
|
458
469
|
|
|
459
|
-
|
|
470
|
+
`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` must be selected together. Neon issues them as one object-storage credential; pulling only one would pair a fresh half with whatever old half remains in the file.
|
|
460
471
|
|
|
461
472
|
Naming a service the branch does not have is an error, not an empty pull:
|
|
462
473
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./profiles.js";
|
|
2
|
-
//#region
|
|
1
|
+
import "./profiles-Ir29rqns.js";
|
|
2
|
+
//#region ../../internals/cli-core/dist/auth_selection.js
|
|
3
3
|
/**
|
|
4
4
|
* # Which credential an invocation authenticates with
|
|
5
5
|
*
|
|
@@ -80,4 +80,4 @@ function nonEmpty(value) {
|
|
|
80
80
|
return trimmed === "" ? void 0 : trimmed;
|
|
81
81
|
}
|
|
82
82
|
//#endregion
|
|
83
|
-
export {
|
|
83
|
+
export { selectCredential as i, displacedProfileWarning as n, recordCredentialInputs as r, credentialInputs as t };
|