@neondatabase/config 0.5.0 → 0.7.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 +41 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -1
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/define-config.d.ts +27 -4
- package/dist/lib/define-config.d.ts.map +1 -1
- package/dist/lib/define-config.js +36 -1
- package/dist/lib/define-config.js.map +1 -1
- package/dist/lib/diff.d.ts +22 -8
- package/dist/lib/diff.d.ts.map +1 -1
- package/dist/lib/diff.js +101 -19
- package/dist/lib/diff.js.map +1 -1
- package/dist/lib/duration.js.map +1 -1
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/loader.js.map +1 -1
- package/dist/lib/neon-api-real.d.ts +6 -0
- package/dist/lib/neon-api-real.d.ts.map +1 -1
- package/dist/lib/neon-api-real.js +136 -42
- package/dist/lib/neon-api-real.js.map +1 -1
- package/dist/lib/neon-api.d.ts +35 -14
- package/dist/lib/neon-api.d.ts.map +1 -1
- package/dist/lib/patterns.js.map +1 -1
- package/dist/lib/schema.d.ts +78 -1
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/schema.js +73 -2
- package/dist/lib/schema.js.map +1 -1
- package/dist/lib/types.d.ts +136 -4
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +18 -1
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/wrap-neon-error.js.map +1 -1
- package/dist/v1.d.ts +69 -3
- package/dist/v1.d.ts.map +1 -1
- package/dist/v1.js +14 -5
- package/dist/v1.js.map +1 -1
- package/package.json +1 -1
package/dist/v1.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AppliedChange, BranchTarget, BranchTuning, BranchTuningFn, BucketAccessLevel, BucketDef, ComputeSettings, ComputeUnit, Config, ConflictReport, CredentialPrincipalType, CredentialScope, DurationString, DurationUnit, FunctionDef, FunctionDevConfig, FunctionRuntime, FunctionTuning, PostgresConfig, PreviewInput, PreviewTuning, PushResult, ResolvedBranchConfig, ResolvedBucketConfig, ResolvedFunctionConfig, ResolvedPreviewConfig, ServiceToggle, ServiceToggleInput } from "./lib/types.js";
|
|
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, PlatformError, PushAbortedError, PushConflictError, isPlatformError } from "./lib/errors.js";
|
|
3
|
-
import { CreateBranchInput, CreateBucketInput, CreateCredentialInput, CreateProjectInput, DeployFunctionInput, GetConnectionUriInput, NeonApi, NeonAuthSnapshot, NeonBranchSnapshot, NeonBranchStorageSnapshot, NeonBucketSnapshot, NeonCredentialMeta, NeonCredentialSecret, NeonDataApiSnapshot, NeonDatabaseSnapshot, NeonEndpointSnapshot, NeonFunctionDeploymentSnapshot, NeonFunctionSnapshot, NeonProjectSnapshot, NeonRoleSnapshot, UpdateBranchInput } from "./lib/neon-api.js";
|
|
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
4
|
import { createNeonApiFromOptions, resolveApiKey } from "./lib/auth.js";
|
|
5
5
|
import { CredentialFeatureFlags, credentialScopesSatisfied, deriveCredentialScopes } from "./lib/credentials.js";
|
|
6
6
|
import { defineConfig, resolveConfig } from "./lib/define-config.js";
|
|
@@ -55,6 +55,22 @@ declare const schemas: {
|
|
|
55
55
|
}, zod_v4_core0.$strict>]>>;
|
|
56
56
|
dataApi: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodBoolean, zod0.ZodObject<{
|
|
57
57
|
enabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
58
|
+
authProvider: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodLiteral<"neon">, zod0.ZodLiteral<"external">]>>;
|
|
59
|
+
jwksUrl: zod0.ZodOptional<zod0.ZodString>;
|
|
60
|
+
providerName: zod0.ZodOptional<zod0.ZodString>;
|
|
61
|
+
jwtAudience: zod0.ZodOptional<zod0.ZodString>;
|
|
62
|
+
settings: zod0.ZodOptional<zod0.ZodObject<{
|
|
63
|
+
dbAggregatesEnabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
64
|
+
dbAnonRole: zod0.ZodOptional<zod0.ZodString>;
|
|
65
|
+
dbExtraSearchPath: zod0.ZodOptional<zod0.ZodString>;
|
|
66
|
+
dbMaxRows: zod0.ZodOptional<zod0.ZodNumber>;
|
|
67
|
+
dbSchemas: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString>>;
|
|
68
|
+
jwtRoleClaimKey: zod0.ZodOptional<zod0.ZodString>;
|
|
69
|
+
jwtCacheMaxLifetime: zod0.ZodOptional<zod0.ZodNumber>;
|
|
70
|
+
openapiMode: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodLiteral<"ignore-privileges">, zod0.ZodLiteral<"disabled">]>>;
|
|
71
|
+
serverCorsAllowedOrigins: zod0.ZodOptional<zod0.ZodString>;
|
|
72
|
+
serverTimingEnabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
73
|
+
}, zod_v4_core0.$strict>>;
|
|
58
74
|
}, zod_v4_core0.$strict>]>>;
|
|
59
75
|
preview: zod0.ZodOptional<zod0.ZodObject<{
|
|
60
76
|
aiGateway: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodBoolean, zod0.ZodObject<{
|
|
@@ -99,6 +115,56 @@ declare const schemas: {
|
|
|
99
115
|
autoscalingLimitMaxCu: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodLiteral<0.25>, zod0.ZodLiteral<0.5>, zod0.ZodLiteral<1>, zod0.ZodLiteral<2>, zod0.ZodLiteral<4>, zod0.ZodLiteral<8>]>>;
|
|
100
116
|
suspendTimeout: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodLiteral<false>, zod0.ZodString, zod0.ZodNumber]>>;
|
|
101
117
|
}, zod_v4_core0.$strict>;
|
|
118
|
+
readonly dataApi: zod0.ZodObject<{
|
|
119
|
+
enabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
120
|
+
authProvider: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodLiteral<"neon">, zod0.ZodLiteral<"external">]>>;
|
|
121
|
+
jwksUrl: zod0.ZodOptional<zod0.ZodString>;
|
|
122
|
+
providerName: zod0.ZodOptional<zod0.ZodString>;
|
|
123
|
+
jwtAudience: zod0.ZodOptional<zod0.ZodString>;
|
|
124
|
+
settings: zod0.ZodOptional<zod0.ZodObject<{
|
|
125
|
+
dbAggregatesEnabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
126
|
+
dbAnonRole: zod0.ZodOptional<zod0.ZodString>;
|
|
127
|
+
dbExtraSearchPath: zod0.ZodOptional<zod0.ZodString>;
|
|
128
|
+
dbMaxRows: zod0.ZodOptional<zod0.ZodNumber>;
|
|
129
|
+
dbSchemas: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString>>;
|
|
130
|
+
jwtRoleClaimKey: zod0.ZodOptional<zod0.ZodString>;
|
|
131
|
+
jwtCacheMaxLifetime: zod0.ZodOptional<zod0.ZodNumber>;
|
|
132
|
+
openapiMode: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodLiteral<"ignore-privileges">, zod0.ZodLiteral<"disabled">]>>;
|
|
133
|
+
serverCorsAllowedOrigins: zod0.ZodOptional<zod0.ZodString>;
|
|
134
|
+
serverTimingEnabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
135
|
+
}, zod_v4_core0.$strict>>;
|
|
136
|
+
}, zod_v4_core0.$strict>;
|
|
137
|
+
readonly dataApiInput: zod0.ZodUnion<readonly [zod0.ZodBoolean, zod0.ZodObject<{
|
|
138
|
+
enabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
139
|
+
authProvider: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodLiteral<"neon">, zod0.ZodLiteral<"external">]>>;
|
|
140
|
+
jwksUrl: zod0.ZodOptional<zod0.ZodString>;
|
|
141
|
+
providerName: zod0.ZodOptional<zod0.ZodString>;
|
|
142
|
+
jwtAudience: zod0.ZodOptional<zod0.ZodString>;
|
|
143
|
+
settings: zod0.ZodOptional<zod0.ZodObject<{
|
|
144
|
+
dbAggregatesEnabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
145
|
+
dbAnonRole: zod0.ZodOptional<zod0.ZodString>;
|
|
146
|
+
dbExtraSearchPath: zod0.ZodOptional<zod0.ZodString>;
|
|
147
|
+
dbMaxRows: zod0.ZodOptional<zod0.ZodNumber>;
|
|
148
|
+
dbSchemas: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString>>;
|
|
149
|
+
jwtRoleClaimKey: zod0.ZodOptional<zod0.ZodString>;
|
|
150
|
+
jwtCacheMaxLifetime: zod0.ZodOptional<zod0.ZodNumber>;
|
|
151
|
+
openapiMode: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodLiteral<"ignore-privileges">, zod0.ZodLiteral<"disabled">]>>;
|
|
152
|
+
serverCorsAllowedOrigins: zod0.ZodOptional<zod0.ZodString>;
|
|
153
|
+
serverTimingEnabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
154
|
+
}, zod_v4_core0.$strict>>;
|
|
155
|
+
}, zod_v4_core0.$strict>]>;
|
|
156
|
+
readonly dataApiSettings: zod0.ZodObject<{
|
|
157
|
+
dbAggregatesEnabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
158
|
+
dbAnonRole: zod0.ZodOptional<zod0.ZodString>;
|
|
159
|
+
dbExtraSearchPath: zod0.ZodOptional<zod0.ZodString>;
|
|
160
|
+
dbMaxRows: zod0.ZodOptional<zod0.ZodNumber>;
|
|
161
|
+
dbSchemas: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString>>;
|
|
162
|
+
jwtRoleClaimKey: zod0.ZodOptional<zod0.ZodString>;
|
|
163
|
+
jwtCacheMaxLifetime: zod0.ZodOptional<zod0.ZodNumber>;
|
|
164
|
+
openapiMode: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodLiteral<"ignore-privileges">, zod0.ZodLiteral<"disabled">]>>;
|
|
165
|
+
serverCorsAllowedOrigins: zod0.ZodOptional<zod0.ZodString>;
|
|
166
|
+
serverTimingEnabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
167
|
+
}, zod_v4_core0.$strict>;
|
|
102
168
|
readonly function: zod0.ZodObject<{
|
|
103
169
|
name: zod0.ZodString;
|
|
104
170
|
source: zod0.ZodString;
|
|
@@ -141,5 +207,5 @@ declare const schemas: {
|
|
|
141
207
|
}, zod_v4_core0.$strict>]>;
|
|
142
208
|
};
|
|
143
209
|
//#endregion
|
|
144
|
-
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, type DeployFunctionInput, type DiffOptions, type DiffResult, type DurationString, type DurationUnit, 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, type PlanStep, PlatformError, type PostgresConfig, type PreviewInput, type PreviewTuning, PushAbortedError, PushConflictError, type PushResult, type RemotePreviewState, type RemoteServiceState, type RemoteState, type ResolvedBranchConfig, type ResolvedBucketConfig, type ResolvedFunctionConfig, type ResolvedPreviewConfig, type ServiceToggle, type ServiceToggleInput, type UpdateBranchInput, createNeonApiFromOptions, createRealNeonApi, credentialScopesSatisfied, defineConfig, deriveCredentialScopes, diffConfig, errors, isPlatformError, loadConfigFromFile, resolveApiKey, resolveConfig, schemas };
|
|
210
|
+
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, 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, isPlatformError, loadConfigFromFile, resolveApiKey, resolveConfig, schemas };
|
|
145
211
|
//# sourceMappingURL=v1.d.ts.map
|
package/dist/v1.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.d.ts","names":[],"sources":["../src/v1.ts"],"mappings":";;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"v1.d.ts","names":[],"sources":["../src/v1.ts"],"mappings":";;;;;;;;;;;;;;;;;;cAqEa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAYA;;mDAcH,IAAA,CAAA,UAAA"}
|
package/dist/v1.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ConfigLoadError, ConfigValidationError, ErrorCode, MissingContextError, PlatformError, PushAbortedError, PushConflictError, isPlatformError } from "./lib/errors.js";
|
|
2
|
-
import { branchTuningSchema, bucketDefSchema, computeSettingsSchema, configInputSchema, functionDefSchema, functionTuningSchema, postgresConfigSchema, previewInputSchema, serviceToggleInputSchema, serviceToggleSchema } from "./lib/schema.js";
|
|
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
4
|
import { createNeonApiFromOptions, resolveApiKey } 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";
|
|
8
8
|
import { loadConfigFromFile } from "./lib/loader.js";
|
|
9
|
+
import { DATA_API_AUTH_PROVIDERS } from "./lib/types.js";
|
|
9
10
|
//#region src/v1.ts
|
|
10
11
|
/**
|
|
11
12
|
* `@neondatabase/config/v1` — the v1 public API for Config-as-Code on the Neon Platform.
|
|
@@ -14,9 +15,14 @@ import { loadConfigFromFile } from "./lib/loader.js";
|
|
|
14
15
|
* ```ts
|
|
15
16
|
* import { defineConfig } from "@neondatabase/config/v1";
|
|
16
17
|
*
|
|
17
|
-
* export default defineConfig(
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* export default defineConfig({
|
|
19
|
+
* // Static: what *exists* on every branch (drives the typed env).
|
|
20
|
+
* auth: true,
|
|
21
|
+
* // Dynamic: per-branch tuning only — cannot add/remove services.
|
|
22
|
+
* branch: (branch) => ({
|
|
23
|
+
* protected: branch.name === "main",
|
|
24
|
+
* ...(branch.name === "main" ? {} : { parent: "main", ttl: "7d" }),
|
|
25
|
+
* }),
|
|
20
26
|
* });
|
|
21
27
|
* ```
|
|
22
28
|
*
|
|
@@ -60,6 +66,9 @@ const schemas = {
|
|
|
60
66
|
branchTuning: branchTuningSchema,
|
|
61
67
|
bucket: bucketDefSchema,
|
|
62
68
|
computeSettings: computeSettingsSchema,
|
|
69
|
+
dataApi: dataApiConfigSchema,
|
|
70
|
+
dataApiInput: dataApiInputSchema,
|
|
71
|
+
dataApiSettings: dataApiSettingsSchema,
|
|
63
72
|
function: functionDefSchema,
|
|
64
73
|
functionTuning: functionTuningSchema,
|
|
65
74
|
postgres: postgresConfigSchema,
|
|
@@ -68,6 +77,6 @@ const schemas = {
|
|
|
68
77
|
serviceInput: serviceToggleInputSchema
|
|
69
78
|
};
|
|
70
79
|
//#endregion
|
|
71
|
-
export { ConfigLoadError, ConfigValidationError, ErrorCode, MissingContextError, PlatformError, PushAbortedError, PushConflictError, createNeonApiFromOptions, createRealNeonApi, credentialScopesSatisfied, defineConfig, deriveCredentialScopes, diffConfig, errors, isPlatformError, loadConfigFromFile, resolveApiKey, resolveConfig, schemas };
|
|
80
|
+
export { ConfigLoadError, ConfigValidationError, DATA_API_AUTH_PROVIDERS, ErrorCode, MissingContextError, PlatformError, PushAbortedError, PushConflictError, createNeonApiFromOptions, createRealNeonApi, credentialScopesSatisfied, defineConfig, deriveCredentialScopes, diffConfig, errors, isPlatformError, loadConfigFromFile, resolveApiKey, resolveConfig, schemas };
|
|
72
81
|
|
|
73
82
|
//# 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 * `@neondatabase/config/v1` — the v1 public API for Config-as-Code on the Neon Platform.\n *\n * Usage in `neon.ts`:\n * ```ts\n * import { defineConfig } from \"@neondatabase/config/v1\";\n *\n * export default defineConfig((branch) => {\n *
|
|
1
|
+
{"version":3,"file":"v1.js","names":[],"sources":["../src/v1.ts"],"sourcesContent":["/**\n * `@neondatabase/config/v1` — the v1 public API for Config-as-Code on the Neon Platform.\n *\n * Usage in `neon.ts`:\n * ```ts\n * import { defineConfig } from \"@neondatabase/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 **`@neondatabase/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 \"@neondatabase/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\tisPlatformError,\n\tMissingContextError,\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\tisPlatformError,\n\tMissingContextError,\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, resolveApiKey } 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 @neondatabase/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\tisPlatformError,\n\tMissingContextError,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,MAAa,SAAS;CACrB;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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neondatabase/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Config-as-Code for the Neon Platform. Define a `neon.ts` policy and inspect/diff/deploy it against the Neon API as plain TypeScript functions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neon",
|