@neondatabase/config 0.11.0 → 0.12.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 +3 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lib/auth.d.ts +16 -51
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +27 -87
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/loader.js +1 -1
- package/dist/v1.d.ts +2 -2
- package/dist/v1.js +2 -2
- package/dist/v1.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -143,7 +143,9 @@ const live = await inspect(target);
|
|
|
143
143
|
| `plan(config, options)` | Returns the dry-run diff — what `apply` would do for the branch, with no mutations. Returns a `PushResult` whose `applied` holds the plan and `conflicts` holds blocking drift. |
|
|
144
144
|
| `apply(config, options)` | Reconciles your local `neon.ts` policy onto the branch. Pass `updateExisting` to auto-confirm overriding existing remote settings and `allowProtectedBranch` to auto-confirm applying to a protected branch. |
|
|
145
145
|
|
|
146
|
-
`options` requires both `projectId` and `branchId` (a Neon branch id, `br-…`). Resolve branch names to ids before calling.
|
|
146
|
+
`options` requires both `projectId` and `branchId` (a Neon branch id, `br-…`). Resolve branch names to ids before calling.
|
|
147
|
+
|
|
148
|
+
**Pass `apiKey` explicitly** (or inject your own `api` adapter). This package reads no environment variables and no files on your behalf — it will not pick up `NEON_API_KEY` or `~/.config/neonctl/credentials.json`, and omitting the key raises `PLATFORM_MISSING_API_KEY`. Resolving where a credential comes from belongs to the application or CLI embedding this package, because only it knows which ambient sources its users expect. `packages/cli` and `packages/env`'s `neon-env` both implement that chain; the latter's `src/lib/cli/resolve-api-key.ts` is a ~60-line reference implementation of flag → `NEON_API_KEY` → stored credentials.
|
|
147
149
|
|
|
148
150
|
## Lower-level engine
|
|
149
151
|
|
|
@@ -159,7 +161,6 @@ import {
|
|
|
159
161
|
pullConfig,
|
|
160
162
|
loadConfigFromFile,
|
|
161
163
|
createRealNeonApi,
|
|
162
|
-
resolveApiKey,
|
|
163
164
|
PlatformError,
|
|
164
165
|
ErrorCode,
|
|
165
166
|
errors,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AppliedChange, BranchTarget, BranchTuning, BranchTuningFn, BucketAccessLevel, BucketDef, ComputeSettings, ComputeUnit, Config, ConflictReport, CredentialPrincipalType, CredentialScope, DATA_API_AUTH_PROVIDERS, DataApiAuthProvider, DataApiConfig, DataApiExternalAuthConfig, DataApiInput, DataApiNeonAuthConfig, DataApiSettings, DurationString, DurationUnit, FunctionDef, FunctionDevConfig, FunctionRuntime, FunctionTuning, PostgresConfig, PreviewInput, PreviewTuning, PushResult, ResolvedBranchConfig, ResolvedBucketConfig, ResolvedDataApiConfig, ResolvedFunctionConfig, ResolvedPreviewConfig, ServiceEnabled, ServiceToggle, ServiceToggleInput } from "./lib/types.js";
|
|
2
2
|
import { ConfigLoadError, ConfigValidationError, ErrorCode, MissingContextError, PartialBranchCreateError, PlatformError, PushAbortedError, PushConflictError, isPartialBranchCreateError, isPlatformError } from "./lib/errors.js";
|
|
3
3
|
import { CreateBranchInput, CreateBucketInput, CreateCredentialInput, CreateProjectInput, DeployFunctionInput, EnableDataApiInput, GetConnectionUriInput, NeonApi, NeonAuthSnapshot, NeonBranchSnapshot, NeonBranchStorageSnapshot, NeonBucketSnapshot, NeonCredentialMeta, NeonCredentialSecret, NeonDataApiSnapshot, NeonDatabaseSnapshot, NeonEndpointSnapshot, NeonFunctionDeploymentSnapshot, NeonFunctionSnapshot, NeonProjectSnapshot, NeonRoleSnapshot, UpdateBranchInput } from "./lib/neon-api.js";
|
|
4
|
-
import { createNeonApiFromOptions
|
|
4
|
+
import { createNeonApiFromOptions } from "./lib/auth.js";
|
|
5
5
|
import { CredentialFeatureFlags, credentialScopesSatisfied, deriveCredentialScopes } from "./lib/credentials.js";
|
|
6
6
|
import { defineConfig, resolveConfig } from "./lib/define-config.js";
|
|
7
7
|
import { DiffOptions, DiffResult, PlanStep, RemotePreviewState, RemoteServiceState, RemoteState, diffConfig } from "./lib/diff.js";
|
|
8
8
|
import { LoadConfigOptions, loadConfigFromFile } from "./lib/loader.js";
|
|
9
9
|
import { createRealNeonApi } from "./lib/neon-api-real.js";
|
|
10
10
|
import { errors, schemas } from "./v1.js";
|
|
11
|
-
export { AppliedChange, BranchTarget, BranchTuning, BranchTuningFn, BucketAccessLevel, BucketDef, ComputeSettings, ComputeUnit, Config, ConfigLoadError, ConfigValidationError, ConflictReport, CreateBranchInput, CreateBucketInput, CreateCredentialInput, CreateProjectInput, CredentialFeatureFlags, CredentialPrincipalType, CredentialScope, DATA_API_AUTH_PROVIDERS, DataApiAuthProvider, DataApiConfig, DataApiExternalAuthConfig, DataApiInput, DataApiNeonAuthConfig, DataApiSettings, DeployFunctionInput, DiffOptions, DiffResult, DurationString, DurationUnit, EnableDataApiInput, ErrorCode, FunctionDef, FunctionDevConfig, FunctionRuntime, FunctionTuning, GetConnectionUriInput, LoadConfigOptions, MissingContextError, NeonApi, NeonAuthSnapshot, NeonBranchSnapshot, NeonBranchStorageSnapshot, NeonBucketSnapshot, NeonCredentialMeta, NeonCredentialSecret, NeonDataApiSnapshot, NeonDatabaseSnapshot, NeonEndpointSnapshot, NeonFunctionDeploymentSnapshot, NeonFunctionSnapshot, NeonProjectSnapshot, NeonRoleSnapshot, PartialBranchCreateError, PlanStep, PlatformError, PostgresConfig, PreviewInput, PreviewTuning, PushAbortedError, PushConflictError, PushResult, RemotePreviewState, RemoteServiceState, RemoteState, ResolvedBranchConfig, ResolvedBucketConfig, ResolvedDataApiConfig, ResolvedFunctionConfig, ResolvedPreviewConfig, ServiceEnabled, ServiceToggle, ServiceToggleInput, UpdateBranchInput, createNeonApiFromOptions, createRealNeonApi, credentialScopesSatisfied, defineConfig, deriveCredentialScopes, diffConfig, errors, isPartialBranchCreateError, isPlatformError, loadConfigFromFile,
|
|
11
|
+
export { AppliedChange, BranchTarget, BranchTuning, BranchTuningFn, BucketAccessLevel, BucketDef, ComputeSettings, ComputeUnit, Config, ConfigLoadError, ConfigValidationError, ConflictReport, CreateBranchInput, CreateBucketInput, CreateCredentialInput, CreateProjectInput, CredentialFeatureFlags, CredentialPrincipalType, CredentialScope, DATA_API_AUTH_PROVIDERS, DataApiAuthProvider, DataApiConfig, DataApiExternalAuthConfig, DataApiInput, DataApiNeonAuthConfig, DataApiSettings, DeployFunctionInput, DiffOptions, DiffResult, DurationString, DurationUnit, EnableDataApiInput, ErrorCode, FunctionDef, FunctionDevConfig, FunctionRuntime, FunctionTuning, GetConnectionUriInput, LoadConfigOptions, MissingContextError, NeonApi, NeonAuthSnapshot, NeonBranchSnapshot, NeonBranchStorageSnapshot, NeonBucketSnapshot, NeonCredentialMeta, NeonCredentialSecret, NeonDataApiSnapshot, NeonDatabaseSnapshot, NeonEndpointSnapshot, NeonFunctionDeploymentSnapshot, NeonFunctionSnapshot, NeonProjectSnapshot, NeonRoleSnapshot, PartialBranchCreateError, PlanStep, PlatformError, PostgresConfig, PreviewInput, PreviewTuning, PushAbortedError, PushConflictError, PushResult, RemotePreviewState, RemoteServiceState, RemoteState, ResolvedBranchConfig, ResolvedBucketConfig, ResolvedDataApiConfig, ResolvedFunctionConfig, ResolvedPreviewConfig, ServiceEnabled, ServiceToggle, ServiceToggleInput, UpdateBranchInput, createNeonApiFromOptions, createRealNeonApi, credentialScopesSatisfied, defineConfig, deriveCredentialScopes, diffConfig, errors, isPartialBranchCreateError, isPlatformError, loadConfigFromFile, resolveConfig, schemas };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ConfigLoadError, ConfigValidationError, ErrorCode, MissingContextError, PartialBranchCreateError, PlatformError, PushAbortedError, PushConflictError, isPartialBranchCreateError, isPlatformError } from "./lib/errors.js";
|
|
2
2
|
import { createRealNeonApi } from "./lib/neon-api-real.js";
|
|
3
|
-
import { createNeonApiFromOptions
|
|
3
|
+
import { createNeonApiFromOptions } from "./lib/auth.js";
|
|
4
4
|
import { credentialScopesSatisfied, deriveCredentialScopes } from "./lib/credentials.js";
|
|
5
5
|
import { defineConfig, resolveConfig } from "./lib/define-config.js";
|
|
6
6
|
import { diffConfig } from "./lib/diff.js";
|
|
7
7
|
import { loadConfigFromFile } from "./lib/loader.js";
|
|
8
8
|
import { DATA_API_AUTH_PROVIDERS } from "./lib/types.js";
|
|
9
9
|
import { errors, schemas } from "./v1.js";
|
|
10
|
-
export { ConfigLoadError, ConfigValidationError, DATA_API_AUTH_PROVIDERS, ErrorCode, MissingContextError, PartialBranchCreateError, PlatformError, PushAbortedError, PushConflictError, createNeonApiFromOptions, createRealNeonApi, credentialScopesSatisfied, defineConfig, deriveCredentialScopes, diffConfig, errors, isPartialBranchCreateError, isPlatformError, loadConfigFromFile,
|
|
10
|
+
export { ConfigLoadError, ConfigValidationError, DATA_API_AUTH_PROVIDERS, ErrorCode, MissingContextError, PartialBranchCreateError, PlatformError, PushAbortedError, PushConflictError, createNeonApiFromOptions, createRealNeonApi, credentialScopesSatisfied, defineConfig, deriveCredentialScopes, diffConfig, errors, isPartialBranchCreateError, isPlatformError, loadConfigFromFile, resolveConfig, schemas };
|
package/dist/lib/auth.d.ts
CHANGED
|
@@ -3,65 +3,30 @@ import { NeonApi } from "./neon-api.js";
|
|
|
3
3
|
//#region src/lib/auth.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Bearer token the Neon API accepts on the same endpoints `napi_*` API keys do.
|
|
9
|
-
*/
|
|
10
|
-
interface NeonctlCredentials {
|
|
11
|
-
access_token: string;
|
|
12
|
-
[key: string]: unknown;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Locate and read the OAuth credentials neonctl writes after `neon auth`.
|
|
16
|
-
*
|
|
17
|
-
* Resolution:
|
|
18
|
-
* 1. `options.configDir` (explicit override — mirrors neonctl's `--config-dir` flag).
|
|
19
|
-
* 2. `NEONCTL_CONFIG_DIR` environment variable.
|
|
20
|
-
* 3. `<home>/.config/neonctl/credentials.json` (the neonctl default; `home` reads
|
|
21
|
-
* `HOME`, falling back to `USERPROFILE` for Windows parity).
|
|
22
|
-
*
|
|
23
|
-
* Returns `null` (never throws) when the file is missing, unreadable, malformed, or has
|
|
24
|
-
* no `access_token` — so callers can use this as a quiet fallback in a resolution chain
|
|
25
|
-
* without try/catch noise.
|
|
26
|
-
*/
|
|
27
|
-
declare function readNeonctlCredentials(options?: {
|
|
28
|
-
configDir?: string;
|
|
29
|
-
}): NeonctlCredentials | null;
|
|
30
|
-
/**
|
|
31
|
-
* Resolution chain for the Bearer token sent to the Neon API. Each entry wins over the
|
|
32
|
-
* next:
|
|
33
|
-
*
|
|
34
|
-
* 1. `options.apiKey` (explicit).
|
|
35
|
-
* 2. `NEON_API_KEY` environment variable.
|
|
36
|
-
* 3. `access_token` from `~/.config/neonctl/credentials.json` (or `NEONCTL_CONFIG_DIR`).
|
|
6
|
+
* Build a real {@link NeonApi} adapter from an explicit API key, or throw a uniform
|
|
7
|
+
* `PLATFORM_MISSING_API_KEY` error when the caller didn't supply one.
|
|
37
8
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}): {
|
|
45
|
-
token: string;
|
|
46
|
-
source: "option" | "env" | "neonctl";
|
|
47
|
-
} | null;
|
|
48
|
-
/**
|
|
49
|
-
* Resolve the Neon API key via the standard chain (option → `NEON_API_KEY` env →
|
|
50
|
-
* `~/.config/neonctl/credentials.json`) and construct a real {@link NeonApi} adapter from
|
|
51
|
-
* it, or throw a uniform `PLATFORM_MISSING_API_KEY` error if no key can be found.
|
|
9
|
+
* **This function is pure with respect to its environment**: it reads no environment
|
|
10
|
+
* variables and no files. Everything it needs arrives in `options`. Resolving *where* a
|
|
11
|
+
* credential comes from — a flag, `NEON_API_KEY`, a credentials file on disk — is the
|
|
12
|
+
* caller's job, because only the caller knows which of those its users expect. See
|
|
13
|
+
* `packages/cli` (`ensureAuth` + `resolveApiKeyFromEnv`) and `packages/init`
|
|
14
|
+
* (`src/lib/auth.ts`) for the two implementations in this repo.
|
|
52
15
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
16
|
+
* `apiHost` stays **optional** and defaults to production
|
|
17
|
+
* (`https://console.neon.tech/api/v2`, applied by {@link createRealNeonApi}) — only pass it
|
|
18
|
+
* to target a non-production API. It is the *ambient* `NEON_API_HOST` lookup that's gone,
|
|
19
|
+
* not the default.
|
|
55
20
|
*
|
|
56
21
|
* Used by `pullConfig`, `pushConfig`, `fetchEnv`, and `branch` to build their default
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
22
|
+
* adapter when the caller doesn't inject one. `operation` is the calling function's name
|
|
23
|
+
* (e.g. `"pushConfig"`, `"branch"`) — it's prepended to the error message so users can tell
|
|
24
|
+
* which call surfaced the missing key.
|
|
60
25
|
*/
|
|
61
26
|
declare function createNeonApiFromOptions(operation: string, options?: {
|
|
62
27
|
apiKey?: string;
|
|
63
28
|
apiHost?: string;
|
|
64
29
|
}): NeonApi;
|
|
65
30
|
//#endregion
|
|
66
|
-
export {
|
|
31
|
+
export { createNeonApiFromOptions };
|
|
67
32
|
//# sourceMappingURL=auth.d.ts.map
|
package/dist/lib/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","names":[],"sources":["../../src/lib/auth.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","names":[],"sources":["../../src/lib/auth.ts"],"mappings":";;;;;;AA+BA;;;;;;;;;;;;;;;;;;;iBAAgB,wBAAA;;;IAMb"}
|
package/dist/lib/auth.js
CHANGED
|
@@ -1,107 +1,47 @@
|
|
|
1
1
|
import { ErrorCode, PlatformError } from "./errors.js";
|
|
2
2
|
import { createRealNeonApi } from "./neon-api-real.js";
|
|
3
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
-
import { resolve } from "node:path";
|
|
5
3
|
//#region src/lib/auth.ts
|
|
6
|
-
/**
|
|
7
|
-
* Locate and read the OAuth credentials neonctl writes after `neon auth`.
|
|
8
|
-
*
|
|
9
|
-
* Resolution:
|
|
10
|
-
* 1. `options.configDir` (explicit override — mirrors neonctl's `--config-dir` flag).
|
|
11
|
-
* 2. `NEONCTL_CONFIG_DIR` environment variable.
|
|
12
|
-
* 3. `<home>/.config/neonctl/credentials.json` (the neonctl default; `home` reads
|
|
13
|
-
* `HOME`, falling back to `USERPROFILE` for Windows parity).
|
|
14
|
-
*
|
|
15
|
-
* Returns `null` (never throws) when the file is missing, unreadable, malformed, or has
|
|
16
|
-
* no `access_token` — so callers can use this as a quiet fallback in a resolution chain
|
|
17
|
-
* without try/catch noise.
|
|
18
|
-
*/
|
|
19
|
-
function readNeonctlCredentials(options = {}) {
|
|
20
|
-
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
21
|
-
const configDir = options.configDir ?? process.env.NEONCTL_CONFIG_DIR ?? (home ? resolve(home, ".config", "neonctl") : void 0);
|
|
22
|
-
if (!configDir) return null;
|
|
23
|
-
const credentialsPath = resolve(configDir, "credentials.json");
|
|
24
|
-
if (!existsSync(credentialsPath)) return null;
|
|
25
|
-
let raw;
|
|
26
|
-
try {
|
|
27
|
-
raw = readFileSync(credentialsPath, "utf-8");
|
|
28
|
-
} catch {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
let parsed;
|
|
32
|
-
try {
|
|
33
|
-
parsed = JSON.parse(raw);
|
|
34
|
-
} catch {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
38
|
-
const obj = parsed;
|
|
39
|
-
if (typeof obj.access_token !== "string" || obj.access_token === "") return null;
|
|
40
|
-
return obj;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Resolution chain for the Bearer token sent to the Neon API. Each entry wins over the
|
|
44
|
-
* next:
|
|
45
|
-
*
|
|
46
|
-
* 1. `options.apiKey` (explicit).
|
|
47
|
-
* 2. `NEON_API_KEY` environment variable.
|
|
48
|
-
* 3. `access_token` from `~/.config/neonctl/credentials.json` (or `NEONCTL_CONFIG_DIR`).
|
|
49
|
-
*
|
|
50
|
-
* Returns `null` when no source provides one. Callers wrap the null case in a
|
|
51
|
-
* `PLATFORM_MISSING_API_KEY` error with a message tailored to the operation.
|
|
52
|
-
*/
|
|
53
|
-
function resolveApiKey(options = {}) {
|
|
54
|
-
if (options.apiKey && options.apiKey.trim() !== "") return {
|
|
55
|
-
token: options.apiKey.trim(),
|
|
56
|
-
source: "option"
|
|
57
|
-
};
|
|
58
|
-
const envKey = process.env.NEON_API_KEY;
|
|
59
|
-
if (typeof envKey === "string" && envKey.trim() !== "") return {
|
|
60
|
-
token: envKey.trim(),
|
|
61
|
-
source: "env"
|
|
62
|
-
};
|
|
63
|
-
const creds = readNeonctlCredentials(options.configDir ? { configDir: options.configDir } : {});
|
|
64
|
-
if (creds) return {
|
|
65
|
-
token: creds.access_token,
|
|
66
|
-
source: "neonctl"
|
|
67
|
-
};
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
4
|
/** Trim trailing slashes and surrounding whitespace; treat empty as unset. */
|
|
71
5
|
function normalizeApiHost(url) {
|
|
72
6
|
const trimmed = url?.trim().replace(/\/+$/, "");
|
|
73
7
|
return trimmed ? trimmed : void 0;
|
|
74
8
|
}
|
|
75
9
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
10
|
+
* Build a real {@link NeonApi} adapter from an explicit API key, or throw a uniform
|
|
11
|
+
* `PLATFORM_MISSING_API_KEY` error when the caller didn't supply one.
|
|
12
|
+
*
|
|
13
|
+
* **This function is pure with respect to its environment**: it reads no environment
|
|
14
|
+
* variables and no files. Everything it needs arrives in `options`. Resolving *where* a
|
|
15
|
+
* credential comes from — a flag, `NEON_API_KEY`, a credentials file on disk — is the
|
|
16
|
+
* caller's job, because only the caller knows which of those its users expect. See
|
|
17
|
+
* `packages/cli` (`ensureAuth` + `resolveApiKeyFromEnv`) and `packages/init`
|
|
18
|
+
* (`src/lib/auth.ts`) for the two implementations in this repo.
|
|
79
19
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
20
|
+
* `apiHost` stays **optional** and defaults to production
|
|
21
|
+
* (`https://console.neon.tech/api/v2`, applied by {@link createRealNeonApi}) — only pass it
|
|
22
|
+
* to target a non-production API. It is the *ambient* `NEON_API_HOST` lookup that's gone,
|
|
23
|
+
* not the default.
|
|
82
24
|
*
|
|
83
25
|
* Used by `pullConfig`, `pushConfig`, `fetchEnv`, and `branch` to build their default
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
26
|
+
* adapter when the caller doesn't inject one. `operation` is the calling function's name
|
|
27
|
+
* (e.g. `"pushConfig"`, `"branch"`) — it's prepended to the error message so users can tell
|
|
28
|
+
* which call surfaced the missing key.
|
|
87
29
|
*/
|
|
88
30
|
function createNeonApiFromOptions(operation, options = {}) {
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
...baseUrl ? { baseUrl } : {}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
throw new PlatformError(ErrorCode.MissingApiKey, [
|
|
98
|
-
`${operation} has no Neon API key to work with.`,
|
|
99
|
-
"Tried (in order): `apiKey` option, NEON_API_KEY env, and `~/.config/neonctl/credentials.json`.",
|
|
100
|
-
"Either pass `apiKey` directly, set NEON_API_KEY, run `npx neonctl auth` to populate the credentials file, or pass a custom `api` adapter (e.g. an in-memory fake for tests).",
|
|
31
|
+
const apiKey = options.apiKey?.trim();
|
|
32
|
+
if (!apiKey) throw new PlatformError(ErrorCode.MissingApiKey, [
|
|
33
|
+
`${operation} was not given a Neon API key.`,
|
|
34
|
+
"Pass `apiKey` explicitly, or inject your own `api` adapter (e.g. an in-memory fake for tests).",
|
|
35
|
+
"This package never reads NEON_API_KEY or a credentials file on your behalf — resolve the key in your own application or CLI and pass it in.",
|
|
101
36
|
"Generate a key at https://console.neon.tech/app/settings/api-keys."
|
|
102
37
|
].join(" "));
|
|
38
|
+
const baseUrl = normalizeApiHost(options.apiHost);
|
|
39
|
+
return createRealNeonApi({
|
|
40
|
+
apiKey,
|
|
41
|
+
...baseUrl ? { baseUrl } : {}
|
|
42
|
+
});
|
|
103
43
|
}
|
|
104
44
|
//#endregion
|
|
105
|
-
export { createNeonApiFromOptions
|
|
45
|
+
export { createNeonApiFromOptions };
|
|
106
46
|
|
|
107
47
|
//# sourceMappingURL=auth.js.map
|
package/dist/lib/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","names":[],"sources":["../../src/lib/auth.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"auth.js","names":[],"sources":["../../src/lib/auth.ts"],"sourcesContent":["import { ErrorCode, PlatformError } from \"./errors.js\";\nimport type { NeonApi } from \"./neon-api.js\";\nimport { createRealNeonApi } from \"./neon-api-real.js\";\n\n/** Trim trailing slashes and surrounding whitespace; treat empty as unset. */\nfunction normalizeApiHost(url: string | undefined): string | undefined {\n\tconst trimmed = url?.trim().replace(/\\/+$/, \"\");\n\treturn trimmed ? trimmed : undefined;\n}\n\n/**\n * Build a real {@link NeonApi} adapter from an explicit API key, or throw a uniform\n * `PLATFORM_MISSING_API_KEY` error when the caller didn't supply one.\n *\n * **This function is pure with respect to its environment**: it reads no environment\n * variables and no files. Everything it needs arrives in `options`. Resolving *where* a\n * credential comes from — a flag, `NEON_API_KEY`, a credentials file on disk — is the\n * caller's job, because only the caller knows which of those its users expect. See\n * `packages/cli` (`ensureAuth` + `resolveApiKeyFromEnv`) and `packages/init`\n * (`src/lib/auth.ts`) for the two implementations in this repo.\n *\n * `apiHost` stays **optional** and defaults to production\n * (`https://console.neon.tech/api/v2`, applied by {@link createRealNeonApi}) — only pass it\n * to target a non-production API. It is the *ambient* `NEON_API_HOST` lookup that's gone,\n * not the default.\n *\n * Used by `pullConfig`, `pushConfig`, `fetchEnv`, and `branch` to build their default\n * adapter when the caller doesn't inject one. `operation` is the calling function's name\n * (e.g. `\"pushConfig\"`, `\"branch\"`) — it's prepended to the error message so users can tell\n * which call surfaced the missing key.\n */\nexport function createNeonApiFromOptions(\n\toperation: string,\n\toptions: {\n\t\tapiKey?: string;\n\t\tapiHost?: string;\n\t} = {},\n): NeonApi {\n\tconst apiKey = options.apiKey?.trim();\n\tif (!apiKey) {\n\t\tthrow new PlatformError(\n\t\t\tErrorCode.MissingApiKey,\n\t\t\t[\n\t\t\t\t`${operation} was not given a Neon API key.`,\n\t\t\t\t\"Pass `apiKey` explicitly, or inject your own `api` adapter (e.g. an in-memory fake for tests).\",\n\t\t\t\t\"This package never reads NEON_API_KEY or a credentials file on your behalf — resolve the key in your own application or CLI and pass it in.\",\n\t\t\t\t\"Generate a key at https://console.neon.tech/app/settings/api-keys.\",\n\t\t\t].join(\" \"),\n\t\t);\n\t}\n\n\tconst baseUrl = normalizeApiHost(options.apiHost);\n\treturn createRealNeonApi({\n\t\tapiKey,\n\t\t...(baseUrl ? { baseUrl } : {}),\n\t});\n}\n"],"mappings":";;;;AAKA,SAAS,iBAAiB,KAA6C;CACtE,MAAM,UAAU,KAAK,KAAK,CAAC,CAAC,QAAQ,QAAQ,EAAE;CAC9C,OAAO,UAAU,UAAU,KAAA;AAC5B;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,yBACf,WACA,UAGI,CAAC,GACK;CACV,MAAM,SAAS,QAAQ,QAAQ,KAAK;CACpC,IAAI,CAAC,QACJ,MAAM,IAAI,cACT,UAAU,eACV;EACC,GAAG,UAAU;EACb;EACA;EACA;CACD,CAAC,CAAC,KAAK,GAAG,CACX;CAGD,MAAM,UAAU,iBAAiB,QAAQ,OAAO;CAChD,OAAO,kBAAkB;EACxB;EACA,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;CAC9B,CAAC;AACF"}
|
package/dist/lib/loader.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConfigLoadError, isPlatformError } from "./errors.js";
|
|
2
2
|
import { defineConfig } from "./define-config.js";
|
|
3
3
|
import { existsSync, statSync } from "node:fs";
|
|
4
|
-
import { dirname, isAbsolute, resolve } from "node:path";
|
|
5
4
|
import { homedir } from "node:os";
|
|
5
|
+
import { dirname, isAbsolute, resolve } from "node:path";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
//#region src/lib/loader.ts
|
|
8
8
|
/**
|
package/dist/v1.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppliedChange, BranchTarget, BranchTuning, BranchTuningFn, BucketAccessLevel, BucketDef, ComputeSettings, ComputeUnit, Config, ConflictReport, CredentialPrincipalType, CredentialScope, DATA_API_AUTH_PROVIDERS, DataApiAuthProvider, DataApiConfig, DataApiExternalAuthConfig, DataApiInput, DataApiNeonAuthConfig, DataApiSettings, DurationString, DurationUnit, FunctionDef, FunctionDevConfig, FunctionRuntime, FunctionTuning, PostgresConfig, PreviewInput, PreviewTuning, PushResult, ResolvedBranchConfig, ResolvedBucketConfig, ResolvedDataApiConfig, ResolvedFunctionConfig, ResolvedPreviewConfig, ServiceEnabled, ServiceToggle, ServiceToggleInput } from "./lib/types.js";
|
|
2
2
|
import { ConfigLoadError, ConfigValidationError, ErrorCode, MissingContextError, PartialBranchCreateError, PlatformError, PushAbortedError, PushConflictError, isPartialBranchCreateError, isPlatformError } from "./lib/errors.js";
|
|
3
3
|
import { CreateBranchInput, CreateBucketInput, CreateCredentialInput, CreateProjectInput, DeployFunctionInput, EnableDataApiInput, GetConnectionUriInput, NeonApi, NeonAuthSnapshot, NeonBranchSnapshot, NeonBranchStorageSnapshot, NeonBucketSnapshot, NeonCredentialMeta, NeonCredentialSecret, NeonDataApiSnapshot, NeonDatabaseSnapshot, NeonEndpointSnapshot, NeonFunctionDeploymentSnapshot, NeonFunctionSnapshot, NeonProjectSnapshot, NeonRoleSnapshot, UpdateBranchInput } from "./lib/neon-api.js";
|
|
4
|
-
import { createNeonApiFromOptions
|
|
4
|
+
import { createNeonApiFromOptions } from "./lib/auth.js";
|
|
5
5
|
import { CredentialFeatureFlags, credentialScopesSatisfied, deriveCredentialScopes } from "./lib/credentials.js";
|
|
6
6
|
import { defineConfig, resolveConfig } from "./lib/define-config.js";
|
|
7
7
|
import { DiffOptions, DiffResult, PlanStep, RemotePreviewState, RemoteServiceState, RemoteState, diffConfig } from "./lib/diff.js";
|
|
@@ -213,5 +213,5 @@ declare const schemas: {
|
|
|
213
213
|
}, zod_v4_core0.$strict>]>;
|
|
214
214
|
};
|
|
215
215
|
//#endregion
|
|
216
|
-
export { type AppliedChange, type BranchTarget, type BranchTuning, type BranchTuningFn, type BucketAccessLevel, type BucketDef, type ComputeSettings, type ComputeUnit, type Config, ConfigLoadError, ConfigValidationError, type ConflictReport, type CreateBranchInput, type CreateBucketInput, type CreateCredentialInput, type CreateProjectInput, type CredentialFeatureFlags, type CredentialPrincipalType, type CredentialScope, DATA_API_AUTH_PROVIDERS, type DataApiAuthProvider, type DataApiConfig, type DataApiExternalAuthConfig, type DataApiInput, type DataApiNeonAuthConfig, type DataApiSettings, type DeployFunctionInput, type DiffOptions, type DiffResult, type DurationString, type DurationUnit, type EnableDataApiInput, ErrorCode, type FunctionDef, type FunctionDevConfig, type FunctionRuntime, type FunctionTuning, type GetConnectionUriInput, type LoadConfigOptions, MissingContextError, type NeonApi, type NeonAuthSnapshot, type NeonBranchSnapshot, type NeonBranchStorageSnapshot, type NeonBucketSnapshot, type NeonCredentialMeta, type NeonCredentialSecret, type NeonDataApiSnapshot, type NeonDatabaseSnapshot, type NeonEndpointSnapshot, type NeonFunctionDeploymentSnapshot, type NeonFunctionSnapshot, type NeonProjectSnapshot, type NeonRoleSnapshot, PartialBranchCreateError, type PlanStep, PlatformError, type PostgresConfig, type PreviewInput, type PreviewTuning, PushAbortedError, PushConflictError, type PushResult, type RemotePreviewState, type RemoteServiceState, type RemoteState, type ResolvedBranchConfig, type ResolvedBucketConfig, type ResolvedDataApiConfig, type ResolvedFunctionConfig, type ResolvedPreviewConfig, type ServiceEnabled, type ServiceToggle, type ServiceToggleInput, type UpdateBranchInput, createNeonApiFromOptions, createRealNeonApi, credentialScopesSatisfied, defineConfig, deriveCredentialScopes, diffConfig, errors, isPartialBranchCreateError, isPlatformError, loadConfigFromFile,
|
|
216
|
+
export { type AppliedChange, type BranchTarget, type BranchTuning, type BranchTuningFn, type BucketAccessLevel, type BucketDef, type ComputeSettings, type ComputeUnit, type Config, ConfigLoadError, ConfigValidationError, type ConflictReport, type CreateBranchInput, type CreateBucketInput, type CreateCredentialInput, type CreateProjectInput, type CredentialFeatureFlags, type CredentialPrincipalType, type CredentialScope, DATA_API_AUTH_PROVIDERS, type DataApiAuthProvider, type DataApiConfig, type DataApiExternalAuthConfig, type DataApiInput, type DataApiNeonAuthConfig, type DataApiSettings, type DeployFunctionInput, type DiffOptions, type DiffResult, type DurationString, type DurationUnit, type EnableDataApiInput, ErrorCode, type FunctionDef, type FunctionDevConfig, type FunctionRuntime, type FunctionTuning, type GetConnectionUriInput, type LoadConfigOptions, MissingContextError, type NeonApi, type NeonAuthSnapshot, type NeonBranchSnapshot, type NeonBranchStorageSnapshot, type NeonBucketSnapshot, type NeonCredentialMeta, type NeonCredentialSecret, type NeonDataApiSnapshot, type NeonDatabaseSnapshot, type NeonEndpointSnapshot, type NeonFunctionDeploymentSnapshot, type NeonFunctionSnapshot, type NeonProjectSnapshot, type NeonRoleSnapshot, PartialBranchCreateError, type PlanStep, PlatformError, type PostgresConfig, type PreviewInput, type PreviewTuning, PushAbortedError, PushConflictError, type PushResult, type RemotePreviewState, type RemoteServiceState, type RemoteState, type ResolvedBranchConfig, type ResolvedBucketConfig, type ResolvedDataApiConfig, type ResolvedFunctionConfig, type ResolvedPreviewConfig, type ServiceEnabled, type ServiceToggle, type ServiceToggleInput, type UpdateBranchInput, createNeonApiFromOptions, createRealNeonApi, credentialScopesSatisfied, defineConfig, deriveCredentialScopes, diffConfig, errors, isPartialBranchCreateError, isPlatformError, loadConfigFromFile, resolveConfig, schemas };
|
|
217
217
|
//# sourceMappingURL=v1.d.ts.map
|
package/dist/v1.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfigLoadError, ConfigValidationError, ErrorCode, MissingContextError, PartialBranchCreateError, PlatformError, PushAbortedError, PushConflictError, isPartialBranchCreateError, isPlatformError } from "./lib/errors.js";
|
|
2
2
|
import { branchTuningSchema, bucketDefSchema, computeSettingsSchema, configInputSchema, dataApiConfigSchema, dataApiInputSchema, dataApiSettingsSchema, functionDefSchema, functionTuningSchema, postgresConfigSchema, previewInputSchema, serviceToggleInputSchema, serviceToggleSchema } from "./lib/schema.js";
|
|
3
3
|
import { createRealNeonApi } from "./lib/neon-api-real.js";
|
|
4
|
-
import { createNeonApiFromOptions
|
|
4
|
+
import { createNeonApiFromOptions } from "./lib/auth.js";
|
|
5
5
|
import { credentialScopesSatisfied, deriveCredentialScopes } from "./lib/credentials.js";
|
|
6
6
|
import { defineConfig, resolveConfig } from "./lib/define-config.js";
|
|
7
7
|
import { diffConfig } from "./lib/diff.js";
|
|
@@ -79,6 +79,6 @@ const schemas = {
|
|
|
79
79
|
serviceInput: serviceToggleInputSchema
|
|
80
80
|
};
|
|
81
81
|
//#endregion
|
|
82
|
-
export { ConfigLoadError, ConfigValidationError, DATA_API_AUTH_PROVIDERS, ErrorCode, MissingContextError, PartialBranchCreateError, PlatformError, PushAbortedError, PushConflictError, createNeonApiFromOptions, createRealNeonApi, credentialScopesSatisfied, defineConfig, deriveCredentialScopes, diffConfig, errors, isPartialBranchCreateError, isPlatformError, loadConfigFromFile,
|
|
82
|
+
export { ConfigLoadError, ConfigValidationError, DATA_API_AUTH_PROVIDERS, ErrorCode, MissingContextError, PartialBranchCreateError, PlatformError, PushAbortedError, PushConflictError, createNeonApiFromOptions, createRealNeonApi, credentialScopesSatisfied, defineConfig, deriveCredentialScopes, diffConfig, errors, isPartialBranchCreateError, isPlatformError, loadConfigFromFile, resolveConfig, schemas };
|
|
83
83
|
|
|
84
84
|
//# sourceMappingURL=v1.js.map
|
package/dist/v1.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.js","names":[],"sources":["../src/v1.ts"],"sourcesContent":["/**\n * `@neon/config/v1` — the v1 public API for Config-as-Code on Neon.\n *\n * Usage in `neon.ts`:\n * ```ts\n * import { defineConfig } from \"@neon/config/v1\";\n *\n * export default defineConfig({\n * // Static: what *exists* on every branch (drives the typed env).\n * auth: true,\n * // Dynamic: per-branch tuning only — cannot add/remove services.\n * branch: (branch) => ({\n * protected: branch.name === \"main\",\n * ...(branch.name === \"main\" ? {} : { parent: \"main\", ttl: \"7d\" }),\n * }),\n * });\n * ```\n *\n * This is the **authoring** surface — `defineConfig`, types, schemas, the pure diff engine,\n * and the Neon API adapter. It is intentionally free of heavy/native dependencies so that\n * importing it from `neon.ts` stays cheap and bundler-safe.\n *\n * The imperative operations (`inspect` / `plan` / `apply`, `pushConfig` / `pullConfig`) and\n * function bundling/deploy live in **`@neon/config-runtime`**, which depends on this\n * package and pulls in `esbuild`. Import that from your CLI / CI, not from `neon.ts`:\n * ```ts\n * import config from \"../neon\";\n * import { inspect, plan, apply } from \"@neon/config-runtime/v1\";\n * ```\n *\n * Surface guidelines:\n * - Top-level: `defineConfig` / `resolveConfig`, the pure `diffConfig` engine, the\n * `createRealNeonApi` adapter + `NeonApi` types, the config loader, the `PlatformError`\n * base class + `ErrorCode` enum, and the config types used in `neon.ts`.\n * - `errors` namespace: specific `PlatformError` subclasses (`ConfigLoadError`,\n * `PushConflictError`, …).\n * - `schemas` namespace: the zod schemas underlying `defineConfig`.\n */\n\nimport {\n\tConfigLoadError,\n\tConfigValidationError,\n\tErrorCode,\n\tisPartialBranchCreateError,\n\tisPlatformError,\n\tMissingContextError,\n\tPartialBranchCreateError,\n\tPlatformError,\n\tPushAbortedError,\n\tPushConflictError,\n} from \"./lib/errors.js\";\nimport {\n\tbranchTuningSchema,\n\tbucketDefSchema,\n\tcomputeSettingsSchema,\n\tconfigInputSchema,\n\tdataApiConfigSchema,\n\tdataApiInputSchema,\n\tdataApiSettingsSchema,\n\tfunctionDefSchema,\n\tfunctionTuningSchema,\n\tpostgresConfigSchema,\n\tpreviewInputSchema,\n\tserviceToggleInputSchema,\n\tserviceToggleSchema,\n} from \"./lib/schema.js\";\n\n/**\n * Specific `PlatformError` subclasses, grouped for `instanceof` / structured access.\n * Also available as top-level exports.\n */\nexport const errors = {\n\tConfigLoadError,\n\tConfigValidationError,\n\tErrorCode,\n\tisPartialBranchCreateError,\n\tisPlatformError,\n\tMissingContextError,\n\tPartialBranchCreateError,\n\tPlatformError,\n\tPushAbortedError,\n\tPushConflictError,\n} as const;\n\n/** The zod schemas underlying `defineConfig`, grouped under product-friendly names. */\nexport const schemas = {\n\tconfig: configInputSchema,\n\tbranchTuning: branchTuningSchema,\n\tbucket: bucketDefSchema,\n\tcomputeSettings: computeSettingsSchema,\n\tdataApi: dataApiConfigSchema,\n\tdataApiInput: dataApiInputSchema,\n\tdataApiSettings: dataApiSettingsSchema,\n\tfunction: functionDefSchema,\n\tfunctionTuning: functionTuningSchema,\n\tpostgres: postgresConfigSchema,\n\tpreview: previewInputSchema,\n\tservice: serviceToggleSchema,\n\tserviceInput: serviceToggleInputSchema,\n} as const;\n\n// ─── Lower-level adapters ──────────────────────────────────────────────────────\nexport { createNeonApiFromOptions
|
|
1
|
+
{"version":3,"file":"v1.js","names":[],"sources":["../src/v1.ts"],"sourcesContent":["/**\n * `@neon/config/v1` — the v1 public API for Config-as-Code on Neon.\n *\n * Usage in `neon.ts`:\n * ```ts\n * import { defineConfig } from \"@neon/config/v1\";\n *\n * export default defineConfig({\n * // Static: what *exists* on every branch (drives the typed env).\n * auth: true,\n * // Dynamic: per-branch tuning only — cannot add/remove services.\n * branch: (branch) => ({\n * protected: branch.name === \"main\",\n * ...(branch.name === \"main\" ? {} : { parent: \"main\", ttl: \"7d\" }),\n * }),\n * });\n * ```\n *\n * This is the **authoring** surface — `defineConfig`, types, schemas, the pure diff engine,\n * and the Neon API adapter. It is intentionally free of heavy/native dependencies so that\n * importing it from `neon.ts` stays cheap and bundler-safe.\n *\n * The imperative operations (`inspect` / `plan` / `apply`, `pushConfig` / `pullConfig`) and\n * function bundling/deploy live in **`@neon/config-runtime`**, which depends on this\n * package and pulls in `esbuild`. Import that from your CLI / CI, not from `neon.ts`:\n * ```ts\n * import config from \"../neon\";\n * import { inspect, plan, apply } from \"@neon/config-runtime/v1\";\n * ```\n *\n * Surface guidelines:\n * - Top-level: `defineConfig` / `resolveConfig`, the pure `diffConfig` engine, the\n * `createRealNeonApi` adapter + `NeonApi` types, the config loader, the `PlatformError`\n * base class + `ErrorCode` enum, and the config types used in `neon.ts`.\n * - `errors` namespace: specific `PlatformError` subclasses (`ConfigLoadError`,\n * `PushConflictError`, …).\n * - `schemas` namespace: the zod schemas underlying `defineConfig`.\n */\n\nimport {\n\tConfigLoadError,\n\tConfigValidationError,\n\tErrorCode,\n\tisPartialBranchCreateError,\n\tisPlatformError,\n\tMissingContextError,\n\tPartialBranchCreateError,\n\tPlatformError,\n\tPushAbortedError,\n\tPushConflictError,\n} from \"./lib/errors.js\";\nimport {\n\tbranchTuningSchema,\n\tbucketDefSchema,\n\tcomputeSettingsSchema,\n\tconfigInputSchema,\n\tdataApiConfigSchema,\n\tdataApiInputSchema,\n\tdataApiSettingsSchema,\n\tfunctionDefSchema,\n\tfunctionTuningSchema,\n\tpostgresConfigSchema,\n\tpreviewInputSchema,\n\tserviceToggleInputSchema,\n\tserviceToggleSchema,\n} from \"./lib/schema.js\";\n\n/**\n * Specific `PlatformError` subclasses, grouped for `instanceof` / structured access.\n * Also available as top-level exports.\n */\nexport const errors = {\n\tConfigLoadError,\n\tConfigValidationError,\n\tErrorCode,\n\tisPartialBranchCreateError,\n\tisPlatformError,\n\tMissingContextError,\n\tPartialBranchCreateError,\n\tPlatformError,\n\tPushAbortedError,\n\tPushConflictError,\n} as const;\n\n/** The zod schemas underlying `defineConfig`, grouped under product-friendly names. */\nexport const schemas = {\n\tconfig: configInputSchema,\n\tbranchTuning: branchTuningSchema,\n\tbucket: bucketDefSchema,\n\tcomputeSettings: computeSettingsSchema,\n\tdataApi: dataApiConfigSchema,\n\tdataApiInput: dataApiInputSchema,\n\tdataApiSettings: dataApiSettingsSchema,\n\tfunction: functionDefSchema,\n\tfunctionTuning: functionTuningSchema,\n\tpostgres: postgresConfigSchema,\n\tpreview: previewInputSchema,\n\tservice: serviceToggleSchema,\n\tserviceInput: serviceToggleInputSchema,\n} as const;\n\n// ─── Lower-level adapters ──────────────────────────────────────────────────────\nexport { createNeonApiFromOptions } from \"./lib/auth.js\";\n// ─── Credentials (pure scope derivation; Preview) ─────────────────────────────\nexport type { CredentialFeatureFlags } from \"./lib/credentials.js\";\nexport {\n\tcredentialScopesSatisfied,\n\tderiveCredentialScopes,\n} from \"./lib/credentials.js\";\nexport { defineConfig, resolveConfig } from \"./lib/define-config.js\";\n// ─── Diff engine (pure; consumed by @neon/config-runtime) ─────────────\nexport type {\n\tDiffOptions,\n\tDiffResult,\n\tPlanStep,\n\tRemotePreviewState,\n\tRemoteServiceState,\n\tRemoteState,\n} from \"./lib/diff.js\";\nexport { diffConfig } from \"./lib/diff.js\";\n// ─── Errors ────────────────────────────────────────────────────────────────────\nexport {\n\tConfigLoadError,\n\tConfigValidationError,\n\tErrorCode,\n\tisPartialBranchCreateError,\n\tisPlatformError,\n\tMissingContextError,\n\tPartialBranchCreateError,\n\tPlatformError,\n\tPushAbortedError,\n\tPushConflictError,\n} from \"./lib/errors.js\";\nexport type { LoadConfigOptions } from \"./lib/loader.js\";\nexport { loadConfigFromFile } from \"./lib/loader.js\";\n// ─── NeonApi types (needed by callers implementing their own adapters) ────────\nexport type {\n\tCreateBranchInput,\n\tCreateBucketInput,\n\tCreateCredentialInput,\n\tCreateProjectInput,\n\tDeployFunctionInput,\n\tEnableDataApiInput,\n\tGetConnectionUriInput,\n\tNeonApi,\n\tNeonAuthSnapshot,\n\tNeonBranchSnapshot,\n\tNeonBranchStorageSnapshot,\n\tNeonBucketSnapshot,\n\tNeonCredentialMeta,\n\tNeonCredentialSecret,\n\tNeonDataApiSnapshot,\n\tNeonDatabaseSnapshot,\n\tNeonEndpointSnapshot,\n\tNeonFunctionDeploymentSnapshot,\n\tNeonFunctionSnapshot,\n\tNeonProjectSnapshot,\n\tNeonRoleSnapshot,\n\tUpdateBranchInput,\n} from \"./lib/neon-api.js\";\nexport { createRealNeonApi } from \"./lib/neon-api-real.js\";\nexport type {\n\tAppliedChange,\n\tBranchTarget,\n\tBranchTuning,\n\tBranchTuningFn,\n\tBucketAccessLevel,\n\tBucketDef,\n\tComputeSettings,\n\tComputeUnit,\n\tConfig,\n\tConflictReport,\n\tCredentialPrincipalType,\n\tCredentialScope,\n\tDataApiAuthProvider,\n\tDataApiConfig,\n\tDataApiExternalAuthConfig,\n\tDataApiInput,\n\tDataApiNeonAuthConfig,\n\tDataApiSettings,\n\tDurationString,\n\tDurationUnit,\n\tFunctionDef,\n\tFunctionDevConfig,\n\tFunctionRuntime,\n\tFunctionTuning,\n\tPostgresConfig,\n\tPreviewInput,\n\tPreviewTuning,\n\tPushResult,\n\tResolvedBranchConfig,\n\tResolvedBucketConfig,\n\tResolvedDataApiConfig,\n\tResolvedFunctionConfig,\n\tResolvedPreviewConfig,\n\tServiceEnabled,\n\tServiceToggle,\n\tServiceToggleInput,\n} from \"./lib/types.js\";\n// ─── Config types (used in neon.ts and in operation return values) ────────────\nexport { DATA_API_AUTH_PROVIDERS } from \"./lib/types.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa,SAAS;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAGA,MAAa,UAAU;CACtB,QAAQ;CACR,cAAc;CACd,QAAQ;CACR,iBAAiB;CACjB,SAAS;CACT,cAAc;CACd,iBAAiB;CACjB,UAAU;CACV,gBAAgB;CAChB,UAAU;CACV,SAAS;CACT,SAAS;CACT,cAAc;AACf"}
|
package/package.json
CHANGED