@neondatabase/config 1.9.5 → 1.10.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 +2 -0
- package/dist/lib/auth.d.ts +1 -2
- package/dist/lib/auth.js +1 -2
- package/dist/lib/authored-services.d.ts +1 -2
- package/dist/lib/authored-services.js +1 -2
- package/dist/lib/credentials.d.ts +1 -2
- package/dist/lib/credentials.js +1 -2
- package/dist/lib/custom-domain.d.ts +0 -2
- package/dist/lib/custom-domain.d.ts.map +1 -1
- package/dist/lib/custom-domain.js +1 -2
- package/dist/lib/define-config.d.ts +1 -2
- package/dist/lib/define-config.js +1 -2
- package/dist/lib/diff.d.ts +1 -2
- package/dist/lib/diff.js +1 -2
- package/dist/lib/duration.d.ts +1 -2
- package/dist/lib/duration.js +1 -2
- package/dist/lib/errors.d.ts +1 -2
- package/dist/lib/errors.js +1 -2
- package/dist/lib/external-packages.d.ts +1 -2
- package/dist/lib/external-packages.js +1 -2
- package/dist/lib/function-entries.d.ts +0 -2
- package/dist/lib/function-entries.d.ts.map +1 -1
- package/dist/lib/function-entries.js +1 -2
- package/dist/lib/loader.d.ts +1 -2
- package/dist/lib/loader.js +1 -2
- package/dist/lib/neon-api-real.d.ts +1 -2
- package/dist/lib/neon-api-real.d.ts.map +1 -1
- package/dist/lib/neon-api-real.js +11 -2
- package/dist/lib/neon-api-real.js.map +1 -1
- package/dist/lib/neon-api.d.ts +19 -3
- package/dist/lib/neon-api.d.ts.map +1 -1
- package/dist/lib/patterns.d.ts +0 -2
- package/dist/lib/patterns.d.ts.map +1 -1
- package/dist/lib/patterns.js +1 -2
- package/dist/lib/schema.d.ts +1 -2
- package/dist/lib/schema.js +1 -2
- package/dist/lib/types.d.ts +0 -2
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +1 -2
- package/dist/lib/wrap-neon-error.d.ts +1 -2
- package/dist/lib/wrap-neon-error.js +1 -2
- package/dist/v1.d.ts +1 -2
- package/dist/v1.js +1 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -210,6 +210,8 @@ Two invariants are enforced **both** at author time (TypeScript) and at runtime
|
|
|
210
210
|
|
|
211
211
|
The auth wiring (`authProvider`, `jwksUrl`, …) is set when the Data API is first **enabled** and is immutable afterwards. The runtime `settings` are reconcilable: changing them is treated as an **update** and requires `updateExisting: true` (`apply`) / `--update-existing` (CLI), like compute/TTL/`protected` drift.
|
|
212
212
|
|
|
213
|
+
Because the provider cannot change, `neon init --services data-api` and `config pull` declare what the live Data API has rather than assuming Neon Auth: when the linked branch's Data API verifies an external IdP (or the API does not say and Neon Auth is off on the branch), they write `dataApi: { authProvider: "external", … }` with whatever wiring the API reports and leave `auth` alone. Otherwise they write `dataApi: true` with `auth: true`.
|
|
214
|
+
|
|
213
215
|
## Functions
|
|
214
216
|
|
|
215
217
|
The three operations mirror the Terraform mental model: **`inspect`** (read live state), **`plan`** (dry-run diff), **`apply`** (reconcile).
|
package/dist/lib/auth.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NeonApi } from "./neon-api.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/lib/auth.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Build a real {@link NeonApi} adapter from an explicit API key, or throw a uniform
|
|
@@ -25,6 +25,5 @@ declare function createNeonApiFromOptions(operation: string, options?: {
|
|
|
25
25
|
apiKey?: string;
|
|
26
26
|
apiHost?: string;
|
|
27
27
|
}): NeonApi;
|
|
28
|
-
//#endregion
|
|
29
28
|
export { createNeonApiFromOptions };
|
|
30
29
|
//# sourceMappingURL=auth.d.ts.map
|
package/dist/lib/auth.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ErrorCode, PlatformError } from "./errors.js";
|
|
2
2
|
import { createRealNeonApi } from "./neon-api-real.js";
|
|
3
|
-
|
|
3
|
+
// src/lib/auth.ts
|
|
4
4
|
/** Trim trailing slashes and surrounding whitespace; treat empty as unset. */
|
|
5
5
|
function normalizeApiHost(url) {
|
|
6
6
|
const trimmed = url?.trim().replace(/\/+$/, "");
|
|
@@ -39,7 +39,6 @@ function createNeonApiFromOptions(operation, options = {}) {
|
|
|
39
39
|
...baseUrl ? { baseUrl } : {}
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
//#endregion
|
|
43
42
|
export { createNeonApiFromOptions };
|
|
44
43
|
|
|
45
44
|
//# sourceMappingURL=auth.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BranchTarget, BranchTuning, BucketDef, Config, FunctionDef, PreviewInput, ServiceToggleInput } from "./types.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/lib/authored-services.d.ts
|
|
4
4
|
/** The home a static service can be authored in. */
|
|
5
5
|
type AuthoredServiceKey = "aiGateway" | "functions" | "buckets";
|
|
6
6
|
declare function authoredFunctions(config: Pick<Config, "functions" | "preview">): Record<string, FunctionDef> | undefined;
|
|
@@ -32,6 +32,5 @@ declare function previewGaWarningMessage(keys: readonly string[]): string;
|
|
|
32
32
|
* target, only static `preview.*` keys are reported.
|
|
33
33
|
*/
|
|
34
34
|
declare function previewGaWarningForConfig(config: Config, target?: BranchTarget): string | null;
|
|
35
|
-
//#endregion
|
|
36
35
|
export { AuthoredServiceKey, authoredAiGateway, authoredBuckets, authoredFunctionTuning, authoredFunctions, deprecatedPreviewAuthoring, mergeAuthoredPreview, previewGaWarningForConfig, previewGaWarningMessage };
|
|
37
36
|
//# sourceMappingURL=authored-services.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { branchTuningSchema } from "./schema.js";
|
|
2
|
-
|
|
2
|
+
// src/lib/authored-services.ts
|
|
3
3
|
const PREVIEW_PATH = {
|
|
4
4
|
aiGateway: "preview.aiGateway",
|
|
5
5
|
functions: "preview.functions",
|
|
@@ -85,7 +85,6 @@ function previewGaWarningForConfig(config, target) {
|
|
|
85
85
|
if (keys.size === 0) return null;
|
|
86
86
|
return previewGaWarningMessage([...keys]);
|
|
87
87
|
}
|
|
88
|
-
//#endregion
|
|
89
88
|
export { authoredAiGateway, authoredBuckets, authoredFunctionTuning, authoredFunctions, deprecatedPreviewAuthoring, mergeAuthoredPreview, previewGaWarningForConfig, previewGaWarningMessage };
|
|
90
89
|
|
|
91
90
|
//# sourceMappingURL=authored-services.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CredentialScope } from "./types.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/lib/credentials.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Which branch-scoped Preview features a policy enables, reduced to the booleans that drive
|
|
@@ -32,6 +32,5 @@ declare function deriveCredentialScopes(flags: CredentialFeatureFlags): Credenti
|
|
|
32
32
|
* credential).
|
|
33
33
|
*/
|
|
34
34
|
declare function credentialScopesSatisfied(granted: readonly CredentialScope[], desired: readonly CredentialScope[]): boolean;
|
|
35
|
-
//#endregion
|
|
36
35
|
export { CredentialFeatureFlags, credentialScopesSatisfied, deriveCredentialScopes };
|
|
37
36
|
//# sourceMappingURL=credentials.d.ts.map
|
package/dist/lib/credentials.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/credentials.ts
|
|
2
2
|
/**
|
|
3
3
|
* Derive the set of {@link CredentialScope}s a branch credential needs from the policy's
|
|
4
4
|
* enabled Preview features. Deterministic and order-stable (handy for diffing / round-trip
|
|
@@ -24,7 +24,6 @@ function credentialScopesSatisfied(granted, desired) {
|
|
|
24
24
|
const grantedSet = new Set(granted);
|
|
25
25
|
return desired.every((scope) => grantedSet.has(scope));
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { credentialScopesSatisfied, deriveCredentialScopes };
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=credentials.js.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
//#region src/lib/custom-domain.d.ts
|
|
2
1
|
declare function normalizeCustomDomain(value: string): string;
|
|
3
2
|
/** `undefined` when `value` is a usable custom domain; otherwise the schema message. */
|
|
4
3
|
declare function customDomainValidationError(value: string): string | undefined;
|
|
5
|
-
//#endregion
|
|
6
4
|
export { customDomainValidationError, normalizeCustomDomain };
|
|
7
5
|
//# sourceMappingURL=custom-domain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-domain.d.ts","names":["normalizeCustomDomain","customDomainValidationError","normalizeCustomDomain","value","customDomainValidationError"],"sources":["../../src/lib/custom-domain.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"custom-domain.d.ts","names":["normalizeCustomDomain","customDomainValidationError","normalizeCustomDomain","value","customDomainValidationError"],"sources":["../../src/lib/custom-domain.ts"],"mappings":"A,iBAAgBA,qBAAAA,C;AAAhB;AAYgBC,iBAAAA,2BAAAA,CAA2BE,KAAA,EAAA,MAAA,CAAA,EAAA,MAAA,GAAA,SAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/custom-domain.ts
|
|
2
2
|
function normalizeCustomDomain(value) {
|
|
3
3
|
return value.trim().toLowerCase().replace(/\.$/, "");
|
|
4
4
|
}
|
|
@@ -14,7 +14,6 @@ function customDomainValidationError(value) {
|
|
|
14
14
|
if (normalized.length < MIN_NORMALIZED_CUSTOM_DOMAIN_LENGTH || normalized.length > MAX_NORMALIZED_CUSTOM_DOMAIN_LENGTH) return `custom domain ${JSON.stringify(value)} must be ${MIN_NORMALIZED_CUSTOM_DOMAIN_LENGTH}–${MAX_NORMALIZED_CUSTOM_DOMAIN_LENGTH} characters after normalizing`;
|
|
15
15
|
if (!CUSTOM_DOMAIN_RE.test(normalized)) return `custom domain ${JSON.stringify(value)} is not a DNS hostname`;
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
export { customDomainValidationError, normalizeCustomDomain };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=custom-domain.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BranchTarget, BranchTuningFn, BucketDef, Config, DataApiInput, ExperimentalInput, FunctionDef, FunctionTriggerDef, PreviewInput, ResolvedBranchConfig, ServiceEnabled, ServiceToggleInput } from "./types.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/lib/define-config.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Whether a `dataApi` toggle is **enabled and verified by Neon Auth** at the type level: it is
|
|
@@ -127,6 +127,5 @@ declare function resolveConfig(config: Config, branch: BranchTarget): ResolvedBr
|
|
|
127
127
|
* NeonApi adapter.
|
|
128
128
|
*/
|
|
129
129
|
declare function normalizeRegion(region: string): string;
|
|
130
|
-
//#endregion
|
|
131
130
|
export { DataApiField, NeonAuthRequiredHint, defineConfig, normalizeRegion, resolveConfig };
|
|
132
131
|
//# sourceMappingURL=define-config.d.ts.map
|
|
@@ -4,7 +4,7 @@ import { parseBranchTtl } from "./duration.js";
|
|
|
4
4
|
import { normalizeExternalPackage } from "./external-packages.js";
|
|
5
5
|
import { branchTuningSchema, configInputSchema, formatZodIssues } from "./schema.js";
|
|
6
6
|
import { authoredFunctionTuning, mergeAuthoredPreview } from "./authored-services.js";
|
|
7
|
-
|
|
7
|
+
// src/lib/define-config.ts
|
|
8
8
|
/** Default deploy parameters applied to functions that omit them in `neon.ts`. */
|
|
9
9
|
const DEFAULT_FUNCTION_RUNTIME = "nodejs24";
|
|
10
10
|
const DEFAULT_FUNCTION_BUNDLER = "esbuild";
|
|
@@ -226,7 +226,6 @@ function normalizeRegion(region) {
|
|
|
226
226
|
if (REGION_PREFIX.test(region)) return region;
|
|
227
227
|
return `aws-${region}`;
|
|
228
228
|
}
|
|
229
|
-
//#endregion
|
|
230
229
|
export { defineConfig, normalizeRegion, resolveConfig };
|
|
231
230
|
|
|
232
231
|
//# sourceMappingURL=define-config.js.map
|
package/dist/lib/diff.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BucketAccessLevel, ComputeSettings, ConflictReport, DataApiSettings, ResolvedBranchConfig, ResolvedFunctionConfig, ResolvedFunctionTrigger } from "./types.js";
|
|
2
2
|
import { ConfigureRealtimeInput, EnableDataApiInput, NeonBranchSnapshot, NeonBucketSnapshot, NeonCustomDomainSnapshot, NeonEndpointSnapshot, NeonFunctionSnapshot, NeonRealtimeSnapshot, NeonTriggerSnapshot } from "./neon-api.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/lib/diff.d.ts
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A planned action to perform a single mutation against the Neon API. The diff engine
|
|
@@ -168,6 +168,5 @@ interface DiffResult {
|
|
|
168
168
|
* Diff desired branch policy against the selected remote branch. Pure function.
|
|
169
169
|
*/
|
|
170
170
|
declare function diffConfig(config: ResolvedBranchConfig, remote: RemoteState, options: DiffOptions): DiffResult;
|
|
171
|
-
//#endregion
|
|
172
171
|
export { DiffOptions, DiffResult, PlanStep, RemotePreviewState, RemoteServiceState, RemoteState, diffConfig };
|
|
173
172
|
//# sourceMappingURL=diff.d.ts.map
|
package/dist/lib/diff.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/diff.ts
|
|
2
2
|
/**
|
|
3
3
|
* Diff desired branch policy against the selected remote branch. Pure function.
|
|
4
4
|
*/
|
|
@@ -473,7 +473,6 @@ function computeDriftBetween(desired, endpoint) {
|
|
|
473
473
|
desired: desiredDrift
|
|
474
474
|
} : null;
|
|
475
475
|
}
|
|
476
|
-
//#endregion
|
|
477
476
|
export { diffConfig };
|
|
478
477
|
|
|
479
478
|
//# sourceMappingURL=diff.js.map
|
package/dist/lib/duration.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DurationString } from "./types.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/lib/duration.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Parse a duration value into whole seconds.
|
|
@@ -63,6 +63,5 @@ declare function parseSuspendTimeout(input: false | string | number | undefined)
|
|
|
63
63
|
* Returns `false` for -1 (never suspend), `undefined` for 0 (default), or a duration string.
|
|
64
64
|
*/
|
|
65
65
|
declare function formatSuspendTimeout(seconds: number): false | DurationString | undefined;
|
|
66
|
-
//#endregion
|
|
67
66
|
export { MAX_BRANCH_TTL_SECONDS, formatDurationSeconds, formatSuspendTimeout, parseBranchTtl, parseDuration, parseSuspendTimeout };
|
|
68
67
|
//# sourceMappingURL=duration.d.ts.map
|
package/dist/lib/duration.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/duration.ts
|
|
2
2
|
/**
|
|
3
3
|
* Parse a duration value into whole seconds.
|
|
4
4
|
*
|
|
@@ -105,7 +105,6 @@ function formatSuspendTimeout(seconds) {
|
|
|
105
105
|
if (seconds === 0) return void 0;
|
|
106
106
|
return formatDurationSeconds(seconds);
|
|
107
107
|
}
|
|
108
|
-
//#endregion
|
|
109
108
|
export { MAX_BRANCH_TTL_SECONDS, formatDurationSeconds, formatSuspendTimeout, parseBranchTtl, parseDuration, parseSuspendTimeout };
|
|
110
109
|
|
|
111
110
|
//# sourceMappingURL=duration.js.map
|
package/dist/lib/errors.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConflictReport } from "./types.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/lib/errors.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Every code a {@link PlatformError} can carry. Stable identifiers — consumers can rely on
|
|
@@ -167,6 +167,5 @@ declare class ConfigLoadError extends PlatformError {
|
|
|
167
167
|
cause?: unknown;
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
//#endregion
|
|
171
170
|
export { ConfigLoadError, ConfigValidationError, ErrorCode, MissingContextError, PartialBranchCreateError, PlatformError, PushAbortedError, PushConflictError, bugReportFooter, isPartialBranchCreateError, isPlatformError };
|
|
172
171
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/lib/errors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/errors.ts
|
|
2
2
|
/**
|
|
3
3
|
* Every code a {@link PlatformError} can carry. Stable identifiers — consumers can rely on
|
|
4
4
|
* these for `instanceof PlatformError && err.code === ErrorCode.…` style checks instead of
|
|
@@ -236,7 +236,6 @@ function formatValue(value) {
|
|
|
236
236
|
if (typeof value === "object" && value !== null) return JSON.stringify(value);
|
|
237
237
|
return String(value);
|
|
238
238
|
}
|
|
239
|
-
//#endregion
|
|
240
239
|
export { ConfigLoadError, ConfigValidationError, ErrorCode, MissingContextError, PartialBranchCreateError, PlatformError, PushAbortedError, PushConflictError, bugReportFooter, isPartialBranchCreateError, isPlatformError };
|
|
241
240
|
|
|
242
241
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExternalPackageEntry, ResolvedExternalPackage } from "./types.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/lib/external-packages.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The package a specifier belongs to, dropping any subpath: `sharp` from `sharp/lib/x`,
|
|
@@ -27,6 +27,5 @@ declare const normalizeExternalPackage: (entry: ExternalPackageEntry) => Resolve
|
|
|
27
27
|
* which is always the whole package.
|
|
28
28
|
*/
|
|
29
29
|
declare const packagesToStage: (entries: readonly ResolvedExternalPackage[]) => string[];
|
|
30
|
-
//#endregion
|
|
31
30
|
export { externalPackageRoot, normalizeExternalPackage, packagesToStage };
|
|
32
31
|
//# sourceMappingURL=external-packages.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/external-packages.ts
|
|
2
2
|
/**
|
|
3
3
|
* The package a specifier belongs to, dropping any subpath: `sharp` from `sharp/lib/x`,
|
|
4
4
|
* `@scope/pkg` from `@scope/pkg/sub`.
|
|
@@ -41,7 +41,6 @@ const packagesToStage = (entries) => {
|
|
|
41
41
|
}
|
|
42
42
|
return specifiers;
|
|
43
43
|
};
|
|
44
|
-
//#endregion
|
|
45
44
|
export { externalPackageRoot, normalizeExternalPackage, packagesToStage };
|
|
46
45
|
|
|
47
46
|
//# sourceMappingURL=external-packages.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/lib/function-entries.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Search order for a directory `source` under esbuild. Shared by apply and
|
|
4
3
|
* `neon function deploy --src`. `.mjs` is last so it never implies skip-esbuild.
|
|
@@ -11,6 +10,5 @@ type FunctionArchiveEntry = (typeof FUNCTION_ARCHIVE_ENTRIES)[number];
|
|
|
11
10
|
/** `existing` is names the caller counted as files, so a directory named `index.ts` cannot win. */
|
|
12
11
|
declare const pickFunctionSourceEntry: (existing: Iterable<string>) => FunctionSourceEntry | undefined;
|
|
13
12
|
declare const isFunctionArchiveEntry: (name: string) => name is FunctionArchiveEntry;
|
|
14
|
-
//#endregion
|
|
15
13
|
export { FUNCTION_ARCHIVE_ENTRIES, FUNCTION_SOURCE_ENTRIES, FunctionArchiveEntry, FunctionSourceEntry, isFunctionArchiveEntry, pickFunctionSourceEntry };
|
|
16
14
|
//# sourceMappingURL=function-entries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-entries.d.ts","names":["FUNCTION_SOURCE_ENTRIES","FunctionSourceEntry","FUNCTION_ARCHIVE_ENTRIES","FunctionArchiveEntry","pickFunctionSourceEntry","Iterable","isFunctionArchiveEntry","FUNCTION_SOURCE_ENTRIES","FunctionSourceEntry","FUNCTION_ARCHIVE_ENTRIES","FunctionArchiveEntry","pickFunctionSourceEntry","existing","Iterable","isFunctionArchiveEntry","name"],"sources":["../../src/lib/function-entries.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"function-entries.d.ts","names":["FUNCTION_SOURCE_ENTRIES","FunctionSourceEntry","FUNCTION_ARCHIVE_ENTRIES","FunctionArchiveEntry","pickFunctionSourceEntry","Iterable","isFunctionArchiveEntry","FUNCTION_SOURCE_ENTRIES","FunctionSourceEntry","FUNCTION_ARCHIVE_ENTRIES","FunctionArchiveEntry","pickFunctionSourceEntry","existing","Iterable","isFunctionArchiveEntry","name"],"sources":["../../src/lib/function-entries.ts"],"mappings":";AAIA;AAMA;AAGA;AAEYG,cAXCH,uBAW8BE,EAAAA,SAAAA,CAAAA,UAAwB,EAAA,UAAA,EAAA,WAAA,CAAA;AAGtDE,KARDH,mBAAAA,GAaX,CAAA,OAbyCD,uBAazC,CAAA,CAAA,MAAA,CAAA;AAAA;AAJUK,cANEH,wBAMFG,EAAAA,SAAAA,CAAAA,WAAAA,EAAAA,UAAAA,CAAAA;AACRJ,KALSE,oBAAAA,GAKTF,CAAAA,OALwCC,wBAKxCD,CAAAA,CAAAA,MAAAA,CAAAA;AAAmB;AAKTK,cAPAF,uBASFD,EAAAA,CAAAA,QAAAA,EARAE,QAQmE,CAAA,MAAA,CAAA,EAAA,GAP3EJ,mBAO2E,GAAA,SAAA;A,cAFjEK,sB,4BAEFH,oB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/function-entries.ts
|
|
2
2
|
/**
|
|
3
3
|
* Search order for a directory `source` under esbuild. Shared by apply and
|
|
4
4
|
* `neon function deploy --src`. `.mjs` is last so it never implies skip-esbuild.
|
|
@@ -16,7 +16,6 @@ const pickFunctionSourceEntry = (existing) => {
|
|
|
16
16
|
return FUNCTION_SOURCE_ENTRIES.find((name) => names.has(name));
|
|
17
17
|
};
|
|
18
18
|
const isFunctionArchiveEntry = (name) => name === "index.mjs" || name === "index.js";
|
|
19
|
-
//#endregion
|
|
20
19
|
export { FUNCTION_ARCHIVE_ENTRIES, FUNCTION_SOURCE_ENTRIES, isFunctionArchiveEntry, pickFunctionSourceEntry };
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=function-entries.js.map
|
package/dist/lib/loader.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Config } from "./types.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/lib/loader.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Default file names tried (in order) when {@link loadConfigFromFile} is called without an
|
|
@@ -46,6 +46,5 @@ declare function loadConfigFromFile(options?: LoadConfigOptions): Promise<{
|
|
|
46
46
|
config: Config;
|
|
47
47
|
resolvedPath: string;
|
|
48
48
|
}>;
|
|
49
|
-
//#endregion
|
|
50
49
|
export { DEFAULT_CONFIG_FILENAMES, LoadConfigOptions, loadConfigFromFile };
|
|
51
50
|
//# sourceMappingURL=loader.d.ts.map
|
package/dist/lib/loader.js
CHANGED
|
@@ -4,7 +4,7 @@ import { existsSync, statSync } from "node:fs";
|
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { dirname, isAbsolute, resolve } from "node:path";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
|
-
|
|
7
|
+
// src/lib/loader.ts
|
|
8
8
|
/**
|
|
9
9
|
* Default file names tried (in order) when {@link loadConfigFromFile} is called without an
|
|
10
10
|
* explicit path. We accept `.ts` first because that's the documented format; `.mjs` and `.js`
|
|
@@ -206,7 +206,6 @@ function withoutFunctionEnvKeys(config, keys) {
|
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
//#endregion
|
|
210
209
|
export { DEFAULT_CONFIG_FILENAMES, loadConfigFromFile };
|
|
211
210
|
|
|
212
211
|
//# sourceMappingURL=loader.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeployFunctionInput, NeonApi } from "./neon-api.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/lib/neon-api-real.d.ts
|
|
4
4
|
interface CreateNeonAuthRestInput {
|
|
5
5
|
auth_provider: "better_auth";
|
|
6
6
|
database_name?: string;
|
|
@@ -96,6 +96,5 @@ declare function buildFunctionDeployForm(input: DeployFunctionInput): FormData;
|
|
|
96
96
|
* that simply isn't JSON degrades to text rather than crashing.
|
|
97
97
|
*/
|
|
98
98
|
declare function readJsonBody(res: Response): Promise<unknown>;
|
|
99
|
-
//#endregion
|
|
100
99
|
export { buildFunctionDeployForm, collectCursorPages, createNeonAuthRestInput, createRealNeonApi, customDomainsUnavailableError, isPreviewFeatureUnavailable, previewUnavailableError, readJsonBody, retryOnLocked };
|
|
101
100
|
//# sourceMappingURL=neon-api-real.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-api-real.d.ts","names":["DeployFunctionInput","NeonApi","CreateNeonAuthRestInput","createRealNeonApi","RetryConfig","retryOnLocked","T","Promise","collectCursorPages","isPreviewFeatureUnavailable","customDomainsUnavailableError","previewUnavailableError","createNeonAuthRestInput","buildFunctionDeployForm","FormData","readJsonBody","Response","DeployFunctionInput","NeonApi","CreateNeonAuthRestInput","auth_provider","database_name","createRealNeonApi","options","apiKey","baseUrl","retryOnLocked","maxAttempts","initialDelayMs","maxDelayMs","RetryConfig","fn","Promise","T","config","collectCursorPages","fetchPage","cursor","items","next","isPreviewFeatureUnavailable","err","customDomainsUnavailableError","previewUnavailableError","featureLabel","createNeonAuthRestInput","input","databaseName","buildFunctionDeployForm","FormData","readJsonBody","res","Response"],"sources":["../../src/lib/neon-api-real.ts"],"mappings":";;;A,
|
|
1
|
+
{"version":3,"file":"neon-api-real.d.ts","names":["DeployFunctionInput","NeonApi","CreateNeonAuthRestInput","createRealNeonApi","RetryConfig","retryOnLocked","T","Promise","collectCursorPages","isPreviewFeatureUnavailable","customDomainsUnavailableError","previewUnavailableError","createNeonAuthRestInput","buildFunctionDeployForm","FormData","readJsonBody","Response","DeployFunctionInput","NeonApi","CreateNeonAuthRestInput","auth_provider","database_name","createRealNeonApi","options","apiKey","baseUrl","retryOnLocked","maxAttempts","initialDelayMs","maxDelayMs","RetryConfig","fn","Promise","T","config","collectCursorPages","fetchPage","cursor","items","next","isPreviewFeatureUnavailable","err","customDomainsUnavailableError","previewUnavailableError","featureLabel","createNeonAuthRestInput","input","databaseName","buildFunctionDeployForm","FormData","readJsonBody","res","Response"],"sources":["../../src/lib/neon-api-real.ts"],"mappings":";;;A,UAgZUE,uBAAAA,C;;EAAAA,aAAAA,CAAAA,EAAAA,MAAAA;AAeV;AA4CC;AAeD;AAAmC;AAChBI;AAARC;AACFH,iBA7DOD,iBAAAA,CA6DPC,OAAAA,EAAAA;EACEE,MAAAA,EAAAA,MAAAA;EAARC,OAAAA,CAAAA,EAAAA,MAAAA;EAAO;AA6BV;AAAwC;AAGjBD;AAAjBC;EACKD,aAAAA,CAAAA,EAAAA;IAARC,WAAAA,CAAAA,EAAAA,MAAAA;IAAOqB,cAAA,CAAA,EAAA,MAAA;IAm6CMnB,UAAAA,CAAAA,EAAAA,MAAAA;EAgGAC,CAAAA;AAuDhB,CAAA,CAAA,EA5oDIT,OA4oDYU;AAqFhB,UAhsDUP,WAAAA,CAgsDMQ;EAoBAC,WAAAA,EAAAA,MAAAA;EAAuBe,cAAA,EAAA,MAAA;EAAQ5B,UAAAA,EAAAA,MAAAA;AAAsBc;AAAQ;AAwB7E;AAAkC;AAAME;AAAWT;AAAO;;A,iBA/tDpCF,a,cACXE,O,CAAQD,C,WACVF,W,GACNG,O,CAAQD,C;A,iBA6BWE,kB,+CAGhBD,O;E,OAAiBD,C;;A,KACpBC,O,CAAQD,C;;;;;;;;;;;;A,iBAm6CKG,2BAAAA,C;;;;;A,iBAgGAC,6BAAAA,C;;;;;;;;;;;;A,iBAuDAC,uBAAAA,C;A,iBAqFAC,uBAAAA,C;;A,IAEZV,uB;;;;;;;;;;;;A,iBAkBYW,uBAAAA,C,OAA+Bb,mB,GAAsBc,Q;;;;;;;;;;;A,iBAwB/CC,YAAAA,C,KAAkBC,Q,GAAWT,O"}
|
|
@@ -4,7 +4,7 @@ import { wrapNeonError } from "./wrap-neon-error.js";
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { createNeonClient } from "@neon/sdk";
|
|
6
6
|
import { createProject, createProjectBranch, createProjectBranchDataApi, deleteProjectBranchDataApi, disableProjectBranchRealtime, enableProjectBranchRealtime, getConnectionUri, getNeonAuth, getProject, getProjectBranchDataApi, getProjectBranchRealtime, getProjectBranchRealtimeSecret, listProjectBranchDatabases, listProjectBranchRoles, listProjectBranches, listProjectEndpoints, listProjects, updateProject, updateProjectBranch, updateProjectBranchDataApi, updateProjectEndpoint } from "@neon/sdk/raw";
|
|
7
|
-
|
|
7
|
+
// src/lib/neon-api-real.ts
|
|
8
8
|
const DEFAULT_NEON_API_BASE_URL = "https://console.neon.tech/api/v2";
|
|
9
9
|
/**
|
|
10
10
|
* Unwrap a `@neon/sdk` raw `{ data, error, response }` result into the bare body, throwing
|
|
@@ -79,12 +79,22 @@ function dataApiCreateRequest(input) {
|
|
|
79
79
|
}
|
|
80
80
|
return req;
|
|
81
81
|
}
|
|
82
|
+
const REMOTE_DATA_API_AUTH_PROVIDERS = /* @__PURE__ */ new Set([
|
|
83
|
+
"neon_auth",
|
|
84
|
+
"external",
|
|
85
|
+
"none"
|
|
86
|
+
]);
|
|
82
87
|
/** Map a `DataAPIReponse` (GET) onto our {@link NeonDataApiSnapshot}. */
|
|
83
88
|
function dataApiSnapshotFromResponse(data) {
|
|
84
89
|
const snapshot = { url: data.url };
|
|
85
90
|
if (data.status !== void 0) snapshot.status = data.status;
|
|
86
91
|
const settings = dataApiSettingsFromApi(data.settings);
|
|
87
92
|
if (settings) snapshot.settings = settings;
|
|
93
|
+
const auth = data;
|
|
94
|
+
if (typeof auth.auth_provider === "string" && REMOTE_DATA_API_AUTH_PROVIDERS.has(auth.auth_provider)) snapshot.authProvider = auth.auth_provider;
|
|
95
|
+
if (typeof auth.jwks_url === "string") snapshot.jwksUrl = auth.jwks_url;
|
|
96
|
+
if (typeof auth.provider_name === "string") snapshot.providerName = auth.provider_name;
|
|
97
|
+
if (typeof auth.jwt_audience === "string") snapshot.jwtAudience = auth.jwt_audience;
|
|
88
98
|
return snapshot;
|
|
89
99
|
}
|
|
90
100
|
function realtimeOptionsToApi(input) {
|
|
@@ -1352,7 +1362,6 @@ function defaultsToComputeSettings(defaults) {
|
|
|
1352
1362
|
if (defaults.suspend_timeout_seconds !== void 0) out.suspendTimeout = formatSuspendTimeout(defaults.suspend_timeout_seconds);
|
|
1353
1363
|
return Object.keys(out).length > 0 ? out : void 0;
|
|
1354
1364
|
}
|
|
1355
|
-
//#endregion
|
|
1356
1365
|
export { buildFunctionDeployForm, collectCursorPages, createNeonAuthRestInput, createRealNeonApi, customDomainsUnavailableError, isPreviewFeatureUnavailable, previewUnavailableError, readJsonBody, retryOnLocked };
|
|
1357
1366
|
|
|
1358
1367
|
//# sourceMappingURL=neon-api-real.js.map
|