@gigadrive/network-config 4.3.7 → 4.5.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/dist/index.d.ts CHANGED
@@ -1,8 +1,40 @@
1
+ import { Schema, Effect, Layer } from 'effect';
1
2
  import { FileSystem, Path } from '@effect/platform';
2
- import { Effect, Schema, Layer } from 'effect';
3
3
  import * as _effect_platform_Path from '@effect/platform/Path';
4
4
  import * as _effect_platform_FileSystem from '@effect/platform/FileSystem';
5
5
 
6
+ declare const StaticAssetHeadersSchema: Schema.filter<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.filter<typeof Schema.String>, Schema.mutable<Schema.Array$<Schema.filter<typeof Schema.String>>>]>>>>;
7
+ type StaticAssetHeaders = Schema.Schema.Type<typeof StaticAssetHeadersSchema>;
8
+ /** One logical static asset whose source is relative to the project root. */
9
+ declare const StaticAssetManifestEntrySchema: Schema.mutable<Schema.Struct<{
10
+ source: Schema.filter<typeof Schema.String>;
11
+ path: Schema.filter<typeof Schema.String>;
12
+ status: Schema.optional<Schema.filter<typeof Schema.Int>>;
13
+ headers: Schema.optional<Schema.filter<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.filter<typeof Schema.String>, Schema.mutable<Schema.Array$<Schema.filter<typeof Schema.String>>>]>>>>>;
14
+ immutable: Schema.optional<typeof Schema.Boolean>;
15
+ }>>;
16
+ type StaticAssetManifestEntry = Schema.Schema.Type<typeof StaticAssetManifestEntrySchema>;
17
+ /** Portable manifest for declaring many logical assets without expanding deployment configuration. */
18
+ declare const StaticAssetManifestV1Schema: Schema.filter<Schema.mutable<Schema.Struct<{
19
+ version: Schema.Literal<[1]>;
20
+ assets: Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
21
+ source: Schema.filter<typeof Schema.String>;
22
+ path: Schema.filter<typeof Schema.String>;
23
+ status: Schema.optional<Schema.filter<typeof Schema.Int>>;
24
+ headers: Schema.optional<Schema.filter<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.filter<typeof Schema.String>, Schema.mutable<Schema.Array$<Schema.filter<typeof Schema.String>>>]>>>>>;
25
+ immutable: Schema.optional<typeof Schema.Boolean>;
26
+ }>>>>;
27
+ }>>>;
28
+ type StaticAssetManifestV1 = Schema.Schema.Type<typeof StaticAssetManifestV1Schema>;
29
+ type StaticAssetManifest = StaticAssetManifestV1;
30
+ /**
31
+ * Parses and validates a portable static asset manifest.
32
+ *
33
+ * @param content JSON manifest content.
34
+ * @returns The validated manifest, or `undefined` when malformed.
35
+ */
36
+ declare const parseStaticAssetManifest: (content: string) => StaticAssetManifest | undefined;
37
+
6
38
  interface NormalizedImageLocalPattern {
7
39
  pathname?: string;
8
40
  search?: string;
@@ -41,112 +73,255 @@ interface NormalizedImagePolicy {
41
73
  type JsonValue = null | boolean | number | string | JsonValue[] | {
42
74
  [key: string]: JsonValue;
43
75
  };
44
- interface GigadriveNextPrerenderOutput {
45
- id: string;
46
- type: 'PRERENDER';
47
- pathname: string;
48
- parentOutputId: string;
49
- groupId: number;
50
- pprChain?: {
51
- headers: Record<string, string>;
52
- };
53
- parentFallbackMode?: JsonValue;
54
- fallback?: {
55
- filePath?: string;
56
- initialStatus?: number;
57
- initialHeaders?: Record<string, string | string[]>;
58
- initialExpiration?: number;
59
- initialRevalidate?: number | false;
60
- postponedState?: string;
61
- };
62
- config: {
63
- allowQuery?: string[];
64
- allowHeader?: string[];
65
- bypassFor?: JsonValue[];
66
- renderingMode?: string;
67
- partialFallback?: boolean;
68
- bypassToken?: string;
69
- };
70
- }
71
- /**
72
- * A directory subtree published under a single URL prefix, registered as one
73
- * descriptor instead of enumerating every file. Used to collapse `.next/static`
74
- * (thousands of content-hashed chunks) into a single edge-served prefix.
75
- */
76
- interface GigadriveNextStaticAssetPrefix {
77
- /** Project-relative source directory (e.g. `.next/static`). */
78
- sourceDir: string;
79
- /** Public URL prefix the subtree is served under (e.g. `_next/static`). */
80
- urlPrefix: string;
81
- /** Entries are content-hashed and safe to serve with immutable cache-control. */
82
- immutable: boolean;
83
- }
84
- interface GigadriveNextBuildManifestV1 {
85
- version: 1;
86
- output: 'standalone' | 'export';
87
- distDir: string;
88
- repoRootToProject: string;
89
- nextVersion: string;
90
- buildId: string;
91
- }
92
- /** Aggregated runtime configuration collapsed onto the single standalone server. */
93
- interface GigadriveNextServerDescriptor {
94
- maxDuration?: number;
95
- preferredRegion?: string | string[];
96
- env?: Record<string, string>;
97
- }
98
- /**
99
- * Portable runtime plan for the single standalone Next.js server (Next >= 16.2).
100
- *
101
- * The whole deployment runs as one `next start` standalone server, so the plan
102
- * carries only what the platform needs to route around it: prerender/ISR/PPR
103
- * seeds, the `.next/static` prefix, and the routing/image configuration. It
104
- * deliberately omits per-route outputs and entrypoints — the server owns
105
- * routing, middleware, edge routes, and PPR resume in-process.
106
- */
107
- interface GigadriveNextBuildManifestV2Standalone {
108
- version: 2;
109
- mode: 'standalone-v2';
110
- distDir: string;
111
- repoRootToProject: string;
112
- nextVersion: string;
113
- buildId: string;
114
- server: GigadriveNextServerDescriptor;
115
- config: {
116
- basePath: string;
117
- trailingSlash: boolean;
118
- cacheComponents: boolean;
119
- i18n?: JsonValue;
120
- images?: NormalizedImagePolicy;
121
- };
122
- routing: {
123
- beforeMiddleware: JsonValue[];
124
- beforeFiles: JsonValue[];
125
- afterFiles: JsonValue[];
126
- dynamicRoutes: JsonValue[];
127
- onMatch: JsonValue[];
128
- fallback: JsonValue[];
129
- shouldNormalizeNextData: boolean;
130
- rsc: JsonValue;
131
- };
132
- outputs: {
133
- prerenders: GigadriveNextPrerenderOutput[];
134
- staticAssets: GigadriveNextStaticAssetPrefix[];
135
- };
136
- }
137
- /** Minimal plan for static-export builds (Next >= 16.2). */
138
- interface GigadriveNextBuildManifestV2Export {
139
- version: 2;
140
- mode: 'export';
141
- distDir: string;
142
- repoRootToProject: string;
143
- nextVersion: string;
144
- buildId: string;
145
- }
76
+ declare const GigadriveNextPrerenderOutputSchema: Schema.mutable<Schema.Struct<{
77
+ id: typeof Schema.String;
78
+ type: Schema.Literal<["PRERENDER"]>;
79
+ pathname: Schema.filter<typeof Schema.String>;
80
+ parentOutputId: typeof Schema.String;
81
+ groupId: typeof Schema.Number;
82
+ pprChain: Schema.optional<Schema.mutable<Schema.Struct<{
83
+ headers: Schema.filter<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.filter<typeof Schema.String>>>>;
84
+ }>>>;
85
+ parentFallbackMode: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
86
+ fallback: Schema.optional<Schema.mutable<Schema.Struct<{
87
+ filePath: Schema.optional<Schema.filter<typeof Schema.String>>;
88
+ initialStatus: Schema.optional<Schema.filter<typeof Schema.Int>>;
89
+ initialHeaders: Schema.optional<Schema.filter<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.filter<typeof Schema.String>, Schema.mutable<Schema.Array$<Schema.filter<typeof Schema.String>>>]>>>>>;
90
+ initialExpiration: Schema.optional<typeof Schema.Number>;
91
+ initialRevalidate: Schema.optional<Schema.Union<[typeof Schema.Number, Schema.Literal<[false]>]>>;
92
+ postponedState: Schema.optional<typeof Schema.String>;
93
+ }>>>;
94
+ config: Schema.mutable<Schema.Struct<{
95
+ allowQuery: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
96
+ allowHeader: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
97
+ bypassFor: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>>;
98
+ renderingMode: Schema.optional<typeof Schema.String>;
99
+ partialFallback: Schema.optional<typeof Schema.Boolean>;
100
+ bypassToken: Schema.optional<typeof Schema.String>;
101
+ }>>;
102
+ }>>;
103
+ type GigadriveNextPrerenderOutput = Schema.Schema.Type<typeof GigadriveNextPrerenderOutputSchema>;
104
+ /** A directory subtree published under one URL prefix. */
105
+ declare const GigadriveNextStaticAssetPrefixSchema: Schema.mutable<Schema.Struct<{
106
+ sourceDir: Schema.filter<typeof Schema.String>;
107
+ urlPrefix: Schema.filter<typeof Schema.String>;
108
+ immutable: typeof Schema.Boolean;
109
+ }>>;
110
+ type GigadriveNextStaticAssetPrefix = Schema.Schema.Type<typeof GigadriveNextStaticAssetPrefixSchema>;
111
+ /** Aggregated runtime configuration for the standalone server. */
112
+ declare const GigadriveNextServerDescriptorSchema: Schema.mutable<Schema.Struct<{
113
+ maxDuration: Schema.optional<typeof Schema.Number>;
114
+ preferredRegion: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Array$<typeof Schema.String>>]>>;
115
+ env: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.String>>>;
116
+ }>>;
117
+ type GigadriveNextServerDescriptor = Schema.Schema.Type<typeof GigadriveNextServerDescriptorSchema>;
118
+ declare const GigadriveNextBuildManifestV1Schema: Schema.mutable<Schema.Struct<{
119
+ version: Schema.Literal<[1]>;
120
+ output: Schema.Literal<["standalone", "export"]>;
121
+ distDir: Schema.filter<typeof Schema.String>;
122
+ repoRootToProject: Schema.filter<typeof Schema.String>;
123
+ nextVersion: typeof Schema.String;
124
+ buildId: typeof Schema.String;
125
+ }>>;
126
+ type GigadriveNextBuildManifestV1 = Schema.Schema.Type<typeof GigadriveNextBuildManifestV1Schema>;
127
+ /** Minimal plan for static-export builds. */
128
+ declare const GigadriveNextBuildManifestV2ExportSchema: Schema.mutable<Schema.Struct<{
129
+ version: Schema.Literal<[2]>;
130
+ mode: Schema.Literal<["export"]>;
131
+ distDir: Schema.filter<typeof Schema.String>;
132
+ repoRootToProject: Schema.filter<typeof Schema.String>;
133
+ nextVersion: typeof Schema.String;
134
+ buildId: typeof Schema.String;
135
+ }>>;
136
+ type GigadriveNextBuildManifestV2Export = Schema.Schema.Type<typeof GigadriveNextBuildManifestV2ExportSchema>;
137
+ /** Portable runtime plan for a standalone Next.js server. */
138
+ declare const GigadriveNextBuildManifestV2StandaloneSchema: Schema.mutable<Schema.Struct<{
139
+ version: Schema.Literal<[2]>;
140
+ mode: Schema.Literal<["standalone-v2"]>;
141
+ distDir: Schema.filter<typeof Schema.String>;
142
+ repoRootToProject: Schema.filter<typeof Schema.String>;
143
+ nextVersion: typeof Schema.String;
144
+ buildId: typeof Schema.String;
145
+ server: Schema.mutable<Schema.Struct<{
146
+ maxDuration: Schema.optional<typeof Schema.Number>;
147
+ preferredRegion: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Array$<typeof Schema.String>>]>>;
148
+ env: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.String>>>;
149
+ }>>;
150
+ config: Schema.mutable<Schema.Struct<{
151
+ basePath: typeof Schema.String;
152
+ trailingSlash: typeof Schema.Boolean;
153
+ cacheComponents: typeof Schema.Boolean;
154
+ i18n: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
155
+ images: Schema.optional<Schema.Schema<NormalizedImagePolicy, NormalizedImagePolicy, never>>;
156
+ }>>;
157
+ routing: Schema.mutable<Schema.Struct<{
158
+ beforeMiddleware: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
159
+ beforeFiles: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
160
+ afterFiles: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
161
+ dynamicRoutes: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
162
+ onMatch: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
163
+ fallback: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
164
+ shouldNormalizeNextData: typeof Schema.Boolean;
165
+ rsc: Schema.Schema<JsonValue, JsonValue, never>;
166
+ }>>;
167
+ outputs: Schema.mutable<Schema.Struct<{
168
+ prerenders: Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
169
+ id: typeof Schema.String;
170
+ type: Schema.Literal<["PRERENDER"]>;
171
+ pathname: Schema.filter<typeof Schema.String>;
172
+ parentOutputId: typeof Schema.String;
173
+ groupId: typeof Schema.Number;
174
+ pprChain: Schema.optional<Schema.mutable<Schema.Struct<{
175
+ headers: Schema.filter<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.filter<typeof Schema.String>>>>;
176
+ }>>>;
177
+ parentFallbackMode: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
178
+ fallback: Schema.optional<Schema.mutable<Schema.Struct<{
179
+ filePath: Schema.optional<Schema.filter<typeof Schema.String>>;
180
+ initialStatus: Schema.optional<Schema.filter<typeof Schema.Int>>;
181
+ initialHeaders: Schema.optional<Schema.filter<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.filter<typeof Schema.String>, Schema.mutable<Schema.Array$<Schema.filter<typeof Schema.String>>>]>>>>>;
182
+ initialExpiration: Schema.optional<typeof Schema.Number>;
183
+ initialRevalidate: Schema.optional<Schema.Union<[typeof Schema.Number, Schema.Literal<[false]>]>>;
184
+ postponedState: Schema.optional<typeof Schema.String>;
185
+ }>>>;
186
+ config: Schema.mutable<Schema.Struct<{
187
+ allowQuery: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
188
+ allowHeader: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
189
+ bypassFor: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>>;
190
+ renderingMode: Schema.optional<typeof Schema.String>;
191
+ partialFallback: Schema.optional<typeof Schema.Boolean>;
192
+ bypassToken: Schema.optional<typeof Schema.String>;
193
+ }>>;
194
+ }>>>>;
195
+ prerenderManifest: Schema.optional<Schema.filter<typeof Schema.String>>;
196
+ assetManifest: Schema.optional<Schema.filter<typeof Schema.String>>;
197
+ entryPagePaths: Schema.optional<Schema.mutable<Schema.Array$<Schema.filter<typeof Schema.String>>>>;
198
+ staticAssets: Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
199
+ sourceDir: Schema.filter<typeof Schema.String>;
200
+ urlPrefix: Schema.filter<typeof Schema.String>;
201
+ immutable: typeof Schema.Boolean;
202
+ }>>>>;
203
+ }>>;
204
+ }>>;
205
+ type GigadriveNextBuildManifestV2Standalone = Schema.Schema.Type<typeof GigadriveNextBuildManifestV2StandaloneSchema>;
206
+ declare const GigadriveNextBuildManifestSchema: Schema.Union<[Schema.mutable<Schema.Struct<{
207
+ version: Schema.Literal<[1]>;
208
+ output: Schema.Literal<["standalone", "export"]>;
209
+ distDir: Schema.filter<typeof Schema.String>;
210
+ repoRootToProject: Schema.filter<typeof Schema.String>;
211
+ nextVersion: typeof Schema.String;
212
+ buildId: typeof Schema.String;
213
+ }>>, Schema.mutable<Schema.Struct<{
214
+ version: Schema.Literal<[2]>;
215
+ mode: Schema.Literal<["export"]>;
216
+ distDir: Schema.filter<typeof Schema.String>;
217
+ repoRootToProject: Schema.filter<typeof Schema.String>;
218
+ nextVersion: typeof Schema.String;
219
+ buildId: typeof Schema.String;
220
+ }>>, Schema.mutable<Schema.Struct<{
221
+ version: Schema.Literal<[2]>;
222
+ mode: Schema.Literal<["standalone-v2"]>;
223
+ distDir: Schema.filter<typeof Schema.String>;
224
+ repoRootToProject: Schema.filter<typeof Schema.String>;
225
+ nextVersion: typeof Schema.String;
226
+ buildId: typeof Schema.String;
227
+ server: Schema.mutable<Schema.Struct<{
228
+ maxDuration: Schema.optional<typeof Schema.Number>;
229
+ preferredRegion: Schema.optional<Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Array$<typeof Schema.String>>]>>;
230
+ env: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.String>>>;
231
+ }>>;
232
+ config: Schema.mutable<Schema.Struct<{
233
+ basePath: typeof Schema.String;
234
+ trailingSlash: typeof Schema.Boolean;
235
+ cacheComponents: typeof Schema.Boolean;
236
+ i18n: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
237
+ images: Schema.optional<Schema.Schema<NormalizedImagePolicy, NormalizedImagePolicy, never>>;
238
+ }>>;
239
+ routing: Schema.mutable<Schema.Struct<{
240
+ beforeMiddleware: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
241
+ beforeFiles: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
242
+ afterFiles: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
243
+ dynamicRoutes: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
244
+ onMatch: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
245
+ fallback: Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>;
246
+ shouldNormalizeNextData: typeof Schema.Boolean;
247
+ rsc: Schema.Schema<JsonValue, JsonValue, never>;
248
+ }>>;
249
+ outputs: Schema.mutable<Schema.Struct<{
250
+ prerenders: Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
251
+ id: typeof Schema.String;
252
+ type: Schema.Literal<["PRERENDER"]>;
253
+ pathname: Schema.filter<typeof Schema.String>;
254
+ parentOutputId: typeof Schema.String;
255
+ groupId: typeof Schema.Number;
256
+ pprChain: Schema.optional<Schema.mutable<Schema.Struct<{
257
+ headers: Schema.filter<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.filter<typeof Schema.String>>>>;
258
+ }>>>;
259
+ parentFallbackMode: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
260
+ fallback: Schema.optional<Schema.mutable<Schema.Struct<{
261
+ filePath: Schema.optional<Schema.filter<typeof Schema.String>>;
262
+ initialStatus: Schema.optional<Schema.filter<typeof Schema.Int>>;
263
+ initialHeaders: Schema.optional<Schema.filter<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.filter<typeof Schema.String>, Schema.mutable<Schema.Array$<Schema.filter<typeof Schema.String>>>]>>>>>;
264
+ initialExpiration: Schema.optional<typeof Schema.Number>;
265
+ initialRevalidate: Schema.optional<Schema.Union<[typeof Schema.Number, Schema.Literal<[false]>]>>;
266
+ postponedState: Schema.optional<typeof Schema.String>;
267
+ }>>>;
268
+ config: Schema.mutable<Schema.Struct<{
269
+ allowQuery: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
270
+ allowHeader: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
271
+ bypassFor: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>>;
272
+ renderingMode: Schema.optional<typeof Schema.String>;
273
+ partialFallback: Schema.optional<typeof Schema.Boolean>;
274
+ bypassToken: Schema.optional<typeof Schema.String>;
275
+ }>>;
276
+ }>>>>;
277
+ prerenderManifest: Schema.optional<Schema.filter<typeof Schema.String>>;
278
+ assetManifest: Schema.optional<Schema.filter<typeof Schema.String>>;
279
+ entryPagePaths: Schema.optional<Schema.mutable<Schema.Array$<Schema.filter<typeof Schema.String>>>>;
280
+ staticAssets: Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
281
+ sourceDir: Schema.filter<typeof Schema.String>;
282
+ urlPrefix: Schema.filter<typeof Schema.String>;
283
+ immutable: typeof Schema.Boolean;
284
+ }>>>>;
285
+ }>>;
286
+ }>>]>;
146
287
  type GigadriveNextBuildManifestV2 = GigadriveNextBuildManifestV2Standalone | GigadriveNextBuildManifestV2Export;
147
- type GigadriveNextBuildManifest = GigadriveNextBuildManifestV1 | GigadriveNextBuildManifestV2;
288
+ type GigadriveNextBuildManifest = Schema.Schema.Type<typeof GigadriveNextBuildManifestSchema>;
289
+ /** Portable sidecar containing high-cardinality Next.js prerender metadata. */
290
+ declare const GigadriveNextPrerenderManifestV1Schema: Schema.mutable<Schema.Struct<{
291
+ version: Schema.Literal<[1]>;
292
+ prerenders: Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
293
+ id: typeof Schema.String;
294
+ type: Schema.Literal<["PRERENDER"]>;
295
+ pathname: Schema.filter<typeof Schema.String>;
296
+ parentOutputId: typeof Schema.String;
297
+ groupId: typeof Schema.Number;
298
+ pprChain: Schema.optional<Schema.mutable<Schema.Struct<{
299
+ headers: Schema.filter<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.filter<typeof Schema.String>>>>;
300
+ }>>>;
301
+ parentFallbackMode: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
302
+ fallback: Schema.optional<Schema.mutable<Schema.Struct<{
303
+ filePath: Schema.optional<Schema.filter<typeof Schema.String>>;
304
+ initialStatus: Schema.optional<Schema.filter<typeof Schema.Int>>;
305
+ initialHeaders: Schema.optional<Schema.filter<Schema.mutable<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.filter<typeof Schema.String>, Schema.mutable<Schema.Array$<Schema.filter<typeof Schema.String>>>]>>>>>;
306
+ initialExpiration: Schema.optional<typeof Schema.Number>;
307
+ initialRevalidate: Schema.optional<Schema.Union<[typeof Schema.Number, Schema.Literal<[false]>]>>;
308
+ postponedState: Schema.optional<typeof Schema.String>;
309
+ }>>>;
310
+ config: Schema.mutable<Schema.Struct<{
311
+ allowQuery: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
312
+ allowHeader: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
313
+ bypassFor: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>>;
314
+ renderingMode: Schema.optional<typeof Schema.String>;
315
+ partialFallback: Schema.optional<typeof Schema.Boolean>;
316
+ bypassToken: Schema.optional<typeof Schema.String>;
317
+ }>>;
318
+ }>>>>;
319
+ }>>;
320
+ type GigadriveNextPrerenderManifestV1 = Schema.Schema.Type<typeof GigadriveNextPrerenderManifestV1Schema>;
148
321
  /** Parses and structurally validates adapter metadata before deployment code consumes it. */
149
322
  declare const parseGigadriveNextBuildManifest: (content: string) => GigadriveNextBuildManifest | undefined;
323
+ /** Parses and validates a portable Next.js prerender sidecar. */
324
+ declare const parseGigadriveNextPrerenderManifest: (content: string) => GigadriveNextPrerenderManifestV1 | undefined;
150
325
 
151
326
  declare const REGION_DEFINITIONS: readonly ["us-east-1", "us-east-2", "us-west-1", "us-west-2", "ap-south-1", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", "sa-east-1"];
152
327
  type Region = (typeof REGION_DEFINITIONS)[number];
@@ -206,6 +381,14 @@ interface NormalizedConfig {
206
381
  /** Optional Content-Type override applied to the whole subtree. */
207
382
  contentType?: string;
208
383
  }>;
384
+ /**
385
+ * Project-relative manifests containing logical static asset entries. A
386
+ * manifest keeps high-cardinality path mappings out of this configuration.
387
+ */
388
+ manifests?: Array<{
389
+ /** Project-relative path to a {@link StaticAssetManifest}. */
390
+ source: string;
391
+ }>;
209
392
  /**
210
393
  * Whether routes for the assets should be generated during deployment.
211
394
  */
@@ -231,7 +414,8 @@ interface NormalizedConfig {
231
414
  commands: string[];
232
415
  entrypoints: Array<NormalizedConfigEntrypoint>;
233
416
  routes: Array<NormalizedConfigRoute>;
234
- services?: Array<NormalizedConfigService>;
417
+ /** Managed infrastructure declarations supplied through `gigadrive.yaml`. */
418
+ services?: NormalizedConfigService[];
235
419
  /**
236
420
  * Settings related to the archive the user uploads to the build workers.
237
421
  */
@@ -265,9 +449,13 @@ interface NormalizedConfig {
265
449
  interface NormalizedConfigService {
266
450
  type: NormalizedConfigServiceType;
267
451
  }
268
- type NormalizedConfigServiceType = 'redis' | 'postgres';
452
+ /** Service kinds supported by the normalized deployment configuration. */
453
+ type NormalizedConfigServiceType = 'redis' | 'postgres' | 'storage';
454
+ /** Fully normalized managed-service declaration consumed by provisioning. */
455
+ type NormalizedConfigServiceDefinition = NormalizedConfigServiceRedis | NormalizedConfigServicePostgres | NormalizedConfigServiceStorage;
269
456
  type UpstashAWSRegion = 'us-east-1' | 'us-east-2' | 'us-west-1' | 'us-west-2' | 'eu-central-1' | 'eu-west-1' | 'eu-west-2' | 'sa-east-1' | 'ap-south-1' | 'ap-northeast-1' | 'ap-southeast-1' | 'ap-southeast-2';
270
457
  interface NormalizedConfigServiceRedis extends NormalizedConfigService {
458
+ type: 'redis';
271
459
  envBindings?: Record<'url' | 'host' | 'port' | 'password' | 'db' | 'ssl', string>;
272
460
  primaryRegion?: UpstashAWSRegion | 'us-central1';
273
461
  readRegions?: UpstashAWSRegion[];
@@ -275,10 +463,30 @@ interface NormalizedConfigServiceRedis extends NormalizedConfigService {
275
463
  }
276
464
  type NeonAWSRegion = 'us-east-1' | 'us-east-2' | 'us-west-2' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'eu-west-2' | 'sa-east-1';
277
465
  interface NormalizedConfigServicePostgres extends NormalizedConfigService {
466
+ type: 'postgres';
278
467
  envBindings?: Record<'url' | 'host' | 'port' | 'user' | 'password' | 'database', string>;
279
468
  postgresVersion?: '17' | '16' | '15' | '14';
280
469
  region?: NeonAWSRegion;
281
470
  }
471
+ /** Declarative File Storage service provisioned in the deployment environment. */
472
+ interface NormalizedConfigServiceStorage extends NormalizedConfigService {
473
+ type: 'storage';
474
+ /**
475
+ * Buckets sorted by name for deterministic deployment plans.
476
+ *
477
+ * Names are preserved exactly after schema validation. The deployment
478
+ * environment is authoritative, and global CDN/S3 slugs are generated by
479
+ * the File Storage API rather than stored in configuration.
480
+ */
481
+ buckets: NormalizedConfigStorageBucket[];
482
+ }
483
+ /** Desired state for one environment-scoped File Storage bucket. */
484
+ interface NormalizedConfigStorageBucket {
485
+ /** Immutable environment-scoped API and IaC identifier. */
486
+ name: string;
487
+ /** Access policy to apply when the bucket is first provisioned. */
488
+ visibility: 'public' | 'private';
489
+ }
282
490
  /** Default maximum lifetime of one function invocation, in seconds. */
283
491
  declare const DEFAULT_FUNCTION_DURATION_SECONDS = 30;
284
492
  /** Maximum configurable lifetime of one function invocation, in seconds (eight hours). */
@@ -321,7 +529,8 @@ type NormalizedFramework = NormalizedNextjsFramework;
321
529
  * discriminators. The whole deployment runs as one standalone server, so this
322
530
  * carries prerender/routing/image metadata but no per-route entrypoints.
323
531
  */
324
- type NormalizedNextjsFramework = Omit<GigadriveNextBuildManifestV2Standalone, 'version'> & {
532
+ type NormalizedNextjsFramework = Omit<GigadriveNextBuildManifestV2Standalone, 'version' | 'outputs'> & {
533
+ outputs: Omit<GigadriveNextBuildManifestV2Standalone['outputs'], 'entryPagePaths'>;
325
534
  type: 'nextjs';
326
535
  schemaVersion: 2;
327
536
  /**
@@ -455,6 +664,10 @@ interface FrameworkDefaultConfig {
455
664
  populateCache?: boolean;
456
665
  contentType?: string;
457
666
  }>;
667
+ /** Project-relative manifests containing logical static asset entries. */
668
+ assetManifests?: Array<{
669
+ source: string;
670
+ }>;
458
671
  populateAssetCache?: boolean;
459
672
  routes: Array<{
460
673
  source: string;
@@ -529,7 +742,7 @@ declare const generateConfig: (framework: FrameworkDefinition, packageManager: P
529
742
  * - commands: use user's if non-empty, otherwise framework's
530
743
  * - entrypoints: use user's if non-empty, otherwise framework's
531
744
  * - routes: use user's if non-empty, otherwise framework's
532
- * - assets: use user's if defined with paths, otherwise framework's
745
+ * - assets: use user's if it declares any sources, otherwise framework's
533
746
  * - excludeFiles: use user's if non-empty, otherwise framework's
534
747
  * - regions: always use user's (always populated from parsing)
535
748
  * - environmentVariables: deep merge (framework base, user overrides)
@@ -720,14 +933,81 @@ interface ConfigV4 extends Config {
720
933
  * Additional environment variables to set during runtime and build.
721
934
  */
722
935
  env?: Record<string, string>;
936
+ /** Declares managed services to provision for the deployment environment. */
937
+ services?: ConfigV4Services;
938
+ }
939
+ interface ConfigV4Service {
940
+ }
941
+ interface ConfigV4ServiceRedis extends ConfigV4Service {
723
942
  /**
724
- * Optionally, specify additional services like databases to deploy.
943
+ * Optionally, specify what environment variables the credentials will be bound to.
944
+ * For example: `{ url: 'REDIS_URL' }` will bind the `url` environment variable to the Redis URL.
945
+ * If you don't specify any bindings, they will be bound to the REDIS_URL, REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_DB, and REDIS_SSL environment variables.
725
946
  */
726
- services?: {
727
- [type in NormalizedConfigServiceType]?: ConfigV4Service | null;
728
- };
947
+ envBindings?: Record<'url' | 'host' | 'port' | 'password' | 'db' | 'ssl', string>;
948
+ /**
949
+ * The primary region to deploy the Redis instance to.
950
+ */
951
+ primaryRegion?: UpstashAWSRegion | 'us-central1';
952
+ /**
953
+ * Optionally, add additional regions to read from. More regions will incur higher costs.
954
+ */
955
+ readRegions?: UpstashAWSRegion[];
956
+ /**
957
+ * Optionally, enable Redis eviction. This will evict the least recently used keys in order to make space for new ones.
958
+ */
959
+ eviction?: boolean;
729
960
  }
730
- interface ConfigV4Service {
961
+ interface ConfigV4ServicePostgres extends ConfigV4Service {
962
+ /**
963
+ * Optionally, specify what environment variables the credentials will be bound to.
964
+ * For example: `{ url: 'POSTGRES_URL' }` will bind the `url` environment variable to the Postgres URL.
965
+ * If you don't specify any bindings, they will be bound to the POSTGRES_URL, POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DATABASE environment variables.
966
+ */
967
+ envBindings?: Record<'url' | 'host' | 'port' | 'user' | 'password' | 'database', string>;
968
+ /**
969
+ * The version of Postgres to deploy.
970
+ */
971
+ postgresVersion?: '17' | '16' | '15' | '14';
972
+ /**
973
+ * The region to deploy the Postgres instance to.
974
+ */
975
+ region?: NeonAWSRegion;
976
+ }
977
+ /** Managed services accepted under the v4 `services` key. */
978
+ interface ConfigV4Services {
979
+ /** Managed Redis configuration. `null` selects provider defaults. */
980
+ redis?: ConfigV4ServiceRedis | null;
981
+ /** Managed Postgres configuration. `null` selects provider defaults. */
982
+ postgres?: ConfigV4ServicePostgres | null;
983
+ /** Declarative File Storage buckets for the deployment environment. */
984
+ storage?: ConfigV4ServiceStorage;
985
+ }
986
+ /** Declarative File Storage configuration for one deployment environment. */
987
+ interface ConfigV4ServiceStorage extends ConfigV4Service {
988
+ /**
989
+ * Buckets keyed by their immutable environment-scoped name.
990
+ *
991
+ * Use `null` or an empty object to accept the default private visibility.
992
+ * Names are validated exactly and are never normalized. The environment and
993
+ * global CDN/S3 slug are intentionally not configurable here.
994
+ *
995
+ * @example
996
+ * ```yaml
997
+ * services:
998
+ * storage:
999
+ * buckets:
1000
+ * assets:
1001
+ * visibility: public
1002
+ * uploads: null
1003
+ * ```
1004
+ */
1005
+ buckets: Record<string, ConfigV4StorageBucket | null>;
1006
+ }
1007
+ /** Optional settings for a declaratively provisioned File Storage bucket. */
1008
+ interface ConfigV4StorageBucket {
1009
+ /** Access policy applied when the bucket is first provisioned. Defaults to `private`. */
1010
+ visibility?: 'public' | 'private';
731
1011
  }
732
1012
  interface ConfigV4FunctionSettings {
733
1013
  /**
@@ -800,6 +1080,7 @@ declare const V4ConfigParser_base: Effect.Service.Class<V4ConfigParser, "V4Confi
800
1080
  environmentVariables: Record<string, string>;
801
1081
  commands: string[];
802
1082
  images: NormalizedImagePolicy | undefined;
1083
+ services: NormalizedConfigServiceDefinition[] | undefined;
803
1084
  entrypoints: NormalizedConfigEntrypoint[];
804
1085
  errors: never[];
805
1086
  warnings: never[];
@@ -843,6 +1124,7 @@ declare const parseConfigRaw: (filePath: string, projectFolder: string) => Effec
843
1124
  environmentVariables: Record<string, string>;
844
1125
  commands: string[];
845
1126
  images: NormalizedImagePolicy | undefined;
1127
+ services: NormalizedConfigServiceDefinition[] | undefined;
846
1128
  entrypoints: NormalizedConfigEntrypoint[];
847
1129
  errors: never[];
848
1130
  warnings: never[];
@@ -870,4 +1152,4 @@ declare const postProcessConfig: (config: NormalizedConfig, projectFolder: strin
870
1152
 
871
1153
  declare const NetworkConfigLive: Layer.Layer<RawConfigReader | SchemaValidator | V4ConfigParser | VercelBuildOutputParser, never, _effect_platform_FileSystem.FileSystem | _effect_platform_Path.Path>;
872
1154
 
873
- export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, type Config, ConfigFileEmptyError, ConfigFileNotFoundError, ConfigFileParseError, ConfigSchemaValidationError, ConfigVersionError, DEFAULT_FUNCTION_DURATION_SECONDS, type DetectionResult, FRAMEWORK_DEFINITIONS, type FilePathMap, type FrameworkDefaultConfig, type FrameworkDefinition, type FrameworkDetectionItem, type FrameworkLanguage, FrameworkNotDetectedError, FunctionConfigError, type GigadriveNextBuildManifest, type GigadriveNextBuildManifestV1, type GigadriveNextBuildManifestV2, type GigadriveNextBuildManifestV2Export, type GigadriveNextBuildManifestV2Standalone, type GigadriveNextPrerenderOutput, type GigadriveNextServerDescriptor, type GigadriveNextStaticAssetPrefix, type JsonValue, MAX_FUNCTION_DURATION_SECONDS, ManifestNotFoundError, ManifestParseError, ManifestReadError, type NeonAWSRegion, NetworkConfigLive, type NormalizedConfig, type NormalizedConfigEntrypoint, type NormalizedConfigRoute, type NormalizedConfigRouteHandler, type NormalizedConfigRouteMatchRequirements, type NormalizedConfigRouteMethod, type NormalizedConfigService, type NormalizedConfigServicePostgres, type NormalizedConfigServiceRedis, type NormalizedConfigServiceType, type NormalizedFramework, type NormalizedImageFit, type NormalizedImageFormat, type NormalizedImageLocalPattern, type NormalizedImagePolicy, type NormalizedImageRemotePattern, type NormalizedImageVariant, type NormalizedNextjsFramework, type NormalizedSharedArtifact, type PackageManager, RawConfigReader, type Region, type Runtime, SchemaValidator, type UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, detectFramework, detectPackageManager, filterFunctionsFromAssets, generateConfig, getFunctionSettings, mergeWithFrameworkDefaults, parseConfig, parseConfigRaw, parseGigadriveNextBuildManifest, postProcessConfig, readDependencies };
1155
+ export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, type Config, ConfigFileEmptyError, ConfigFileNotFoundError, ConfigFileParseError, ConfigSchemaValidationError, type ConfigV4, type ConfigV4FunctionSettings, type ConfigV4Service, type ConfigV4ServicePostgres, type ConfigV4ServiceRedis, type ConfigV4ServiceStorage, type ConfigV4Services, type ConfigV4StorageBucket, ConfigVersionError, DEFAULT_FUNCTION_DURATION_SECONDS, type DetectionResult, FRAMEWORK_DEFINITIONS, type FilePathMap, type FrameworkDefaultConfig, type FrameworkDefinition, type FrameworkDetectionItem, type FrameworkLanguage, FrameworkNotDetectedError, FunctionConfigError, type GigadriveNextBuildManifest, GigadriveNextBuildManifestSchema, type GigadriveNextBuildManifestV1, GigadriveNextBuildManifestV1Schema, type GigadriveNextBuildManifestV2, type GigadriveNextBuildManifestV2Export, GigadriveNextBuildManifestV2ExportSchema, type GigadriveNextBuildManifestV2Standalone, GigadriveNextBuildManifestV2StandaloneSchema, type GigadriveNextPrerenderManifestV1, GigadriveNextPrerenderManifestV1Schema, type GigadriveNextPrerenderOutput, GigadriveNextPrerenderOutputSchema, type GigadriveNextServerDescriptor, GigadriveNextServerDescriptorSchema, type GigadriveNextStaticAssetPrefix, GigadriveNextStaticAssetPrefixSchema, type JsonValue, MAX_FUNCTION_DURATION_SECONDS, ManifestNotFoundError, ManifestParseError, ManifestReadError, type NeonAWSRegion, NetworkConfigLive, type NormalizedConfig, type NormalizedConfigEntrypoint, type NormalizedConfigRoute, type NormalizedConfigRouteHandler, type NormalizedConfigRouteMatchRequirements, type NormalizedConfigRouteMethod, type NormalizedConfigService, type NormalizedConfigServiceDefinition, type NormalizedConfigServicePostgres, type NormalizedConfigServiceRedis, type NormalizedConfigServiceStorage, type NormalizedConfigServiceType, type NormalizedConfigStorageBucket, type NormalizedFramework, type NormalizedImageFit, type NormalizedImageFormat, type NormalizedImageLocalPattern, type NormalizedImagePolicy, type NormalizedImageRemotePattern, type NormalizedImageVariant, type NormalizedNextjsFramework, type NormalizedSharedArtifact, type PackageManager, RawConfigReader, type Region, type Runtime, SchemaValidator, type StaticAssetHeaders, StaticAssetHeadersSchema, type StaticAssetManifest, type StaticAssetManifestEntry, StaticAssetManifestEntrySchema, type StaticAssetManifestV1, StaticAssetManifestV1Schema, type UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, detectFramework, detectPackageManager, filterFunctionsFromAssets, generateConfig, getFunctionSettings, mergeWithFrameworkDefaults, parseConfig, parseConfigRaw, parseGigadriveNextBuildManifest, parseGigadriveNextPrerenderManifest, parseStaticAssetManifest, postProcessConfig, readDependencies };