@gigadrive/network-config 4.3.7 → 4.4.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.mts +102 -8
- package/dist/index.d.ts +102 -8
- package/dist/index.js +53 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +53 -1
- package/dist/index.mjs.map +1 -1
- package/dist/v4/schema.json +35 -1
- package/package.json +1 -1
- package/src/v4/schema.json +35 -1
package/dist/index.d.mts
CHANGED
|
@@ -231,7 +231,8 @@ interface NormalizedConfig {
|
|
|
231
231
|
commands: string[];
|
|
232
232
|
entrypoints: Array<NormalizedConfigEntrypoint>;
|
|
233
233
|
routes: Array<NormalizedConfigRoute>;
|
|
234
|
-
|
|
234
|
+
/** Managed infrastructure declarations supplied through `gigadrive.yaml`. */
|
|
235
|
+
services?: NormalizedConfigService[];
|
|
235
236
|
/**
|
|
236
237
|
* Settings related to the archive the user uploads to the build workers.
|
|
237
238
|
*/
|
|
@@ -265,9 +266,13 @@ interface NormalizedConfig {
|
|
|
265
266
|
interface NormalizedConfigService {
|
|
266
267
|
type: NormalizedConfigServiceType;
|
|
267
268
|
}
|
|
268
|
-
|
|
269
|
+
/** Service kinds supported by the normalized deployment configuration. */
|
|
270
|
+
type NormalizedConfigServiceType = 'redis' | 'postgres' | 'storage';
|
|
271
|
+
/** Fully normalized managed-service declaration consumed by provisioning. */
|
|
272
|
+
type NormalizedConfigServiceDefinition = NormalizedConfigServiceRedis | NormalizedConfigServicePostgres | NormalizedConfigServiceStorage;
|
|
269
273
|
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
274
|
interface NormalizedConfigServiceRedis extends NormalizedConfigService {
|
|
275
|
+
type: 'redis';
|
|
271
276
|
envBindings?: Record<'url' | 'host' | 'port' | 'password' | 'db' | 'ssl', string>;
|
|
272
277
|
primaryRegion?: UpstashAWSRegion | 'us-central1';
|
|
273
278
|
readRegions?: UpstashAWSRegion[];
|
|
@@ -275,10 +280,30 @@ interface NormalizedConfigServiceRedis extends NormalizedConfigService {
|
|
|
275
280
|
}
|
|
276
281
|
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
282
|
interface NormalizedConfigServicePostgres extends NormalizedConfigService {
|
|
283
|
+
type: 'postgres';
|
|
278
284
|
envBindings?: Record<'url' | 'host' | 'port' | 'user' | 'password' | 'database', string>;
|
|
279
285
|
postgresVersion?: '17' | '16' | '15' | '14';
|
|
280
286
|
region?: NeonAWSRegion;
|
|
281
287
|
}
|
|
288
|
+
/** Declarative File Storage service provisioned in the deployment environment. */
|
|
289
|
+
interface NormalizedConfigServiceStorage extends NormalizedConfigService {
|
|
290
|
+
type: 'storage';
|
|
291
|
+
/**
|
|
292
|
+
* Buckets sorted by name for deterministic deployment plans.
|
|
293
|
+
*
|
|
294
|
+
* Names are preserved exactly after schema validation. The deployment
|
|
295
|
+
* environment is authoritative, and global CDN/S3 slugs are generated by
|
|
296
|
+
* the File Storage API rather than stored in configuration.
|
|
297
|
+
*/
|
|
298
|
+
buckets: NormalizedConfigStorageBucket[];
|
|
299
|
+
}
|
|
300
|
+
/** Desired state for one environment-scoped File Storage bucket. */
|
|
301
|
+
interface NormalizedConfigStorageBucket {
|
|
302
|
+
/** Immutable environment-scoped API and IaC identifier. */
|
|
303
|
+
name: string;
|
|
304
|
+
/** Access policy to apply when the bucket is first provisioned. */
|
|
305
|
+
visibility: 'public' | 'private';
|
|
306
|
+
}
|
|
282
307
|
/** Default maximum lifetime of one function invocation, in seconds. */
|
|
283
308
|
declare const DEFAULT_FUNCTION_DURATION_SECONDS = 30;
|
|
284
309
|
/** Maximum configurable lifetime of one function invocation, in seconds (eight hours). */
|
|
@@ -720,14 +745,81 @@ interface ConfigV4 extends Config {
|
|
|
720
745
|
* Additional environment variables to set during runtime and build.
|
|
721
746
|
*/
|
|
722
747
|
env?: Record<string, string>;
|
|
748
|
+
/** Declares managed services to provision for the deployment environment. */
|
|
749
|
+
services?: ConfigV4Services;
|
|
750
|
+
}
|
|
751
|
+
interface ConfigV4Service {
|
|
752
|
+
}
|
|
753
|
+
interface ConfigV4ServiceRedis extends ConfigV4Service {
|
|
723
754
|
/**
|
|
724
|
-
* Optionally, specify
|
|
755
|
+
* Optionally, specify what environment variables the credentials will be bound to.
|
|
756
|
+
* For example: `{ url: 'REDIS_URL' }` will bind the `url` environment variable to the Redis URL.
|
|
757
|
+
* 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
758
|
*/
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
759
|
+
envBindings?: Record<'url' | 'host' | 'port' | 'password' | 'db' | 'ssl', string>;
|
|
760
|
+
/**
|
|
761
|
+
* The primary region to deploy the Redis instance to.
|
|
762
|
+
*/
|
|
763
|
+
primaryRegion?: UpstashAWSRegion | 'us-central1';
|
|
764
|
+
/**
|
|
765
|
+
* Optionally, add additional regions to read from. More regions will incur higher costs.
|
|
766
|
+
*/
|
|
767
|
+
readRegions?: UpstashAWSRegion[];
|
|
768
|
+
/**
|
|
769
|
+
* Optionally, enable Redis eviction. This will evict the least recently used keys in order to make space for new ones.
|
|
770
|
+
*/
|
|
771
|
+
eviction?: boolean;
|
|
729
772
|
}
|
|
730
|
-
interface ConfigV4Service {
|
|
773
|
+
interface ConfigV4ServicePostgres extends ConfigV4Service {
|
|
774
|
+
/**
|
|
775
|
+
* Optionally, specify what environment variables the credentials will be bound to.
|
|
776
|
+
* For example: `{ url: 'POSTGRES_URL' }` will bind the `url` environment variable to the Postgres URL.
|
|
777
|
+
* 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.
|
|
778
|
+
*/
|
|
779
|
+
envBindings?: Record<'url' | 'host' | 'port' | 'user' | 'password' | 'database', string>;
|
|
780
|
+
/**
|
|
781
|
+
* The version of Postgres to deploy.
|
|
782
|
+
*/
|
|
783
|
+
postgresVersion?: '17' | '16' | '15' | '14';
|
|
784
|
+
/**
|
|
785
|
+
* The region to deploy the Postgres instance to.
|
|
786
|
+
*/
|
|
787
|
+
region?: NeonAWSRegion;
|
|
788
|
+
}
|
|
789
|
+
/** Managed services accepted under the v4 `services` key. */
|
|
790
|
+
interface ConfigV4Services {
|
|
791
|
+
/** Managed Redis configuration. `null` selects provider defaults. */
|
|
792
|
+
redis?: ConfigV4ServiceRedis | null;
|
|
793
|
+
/** Managed Postgres configuration. `null` selects provider defaults. */
|
|
794
|
+
postgres?: ConfigV4ServicePostgres | null;
|
|
795
|
+
/** Declarative File Storage buckets for the deployment environment. */
|
|
796
|
+
storage?: ConfigV4ServiceStorage;
|
|
797
|
+
}
|
|
798
|
+
/** Declarative File Storage configuration for one deployment environment. */
|
|
799
|
+
interface ConfigV4ServiceStorage extends ConfigV4Service {
|
|
800
|
+
/**
|
|
801
|
+
* Buckets keyed by their immutable environment-scoped name.
|
|
802
|
+
*
|
|
803
|
+
* Use `null` or an empty object to accept the default private visibility.
|
|
804
|
+
* Names are validated exactly and are never normalized. The environment and
|
|
805
|
+
* global CDN/S3 slug are intentionally not configurable here.
|
|
806
|
+
*
|
|
807
|
+
* @example
|
|
808
|
+
* ```yaml
|
|
809
|
+
* services:
|
|
810
|
+
* storage:
|
|
811
|
+
* buckets:
|
|
812
|
+
* assets:
|
|
813
|
+
* visibility: public
|
|
814
|
+
* uploads: null
|
|
815
|
+
* ```
|
|
816
|
+
*/
|
|
817
|
+
buckets: Record<string, ConfigV4StorageBucket | null>;
|
|
818
|
+
}
|
|
819
|
+
/** Optional settings for a declaratively provisioned File Storage bucket. */
|
|
820
|
+
interface ConfigV4StorageBucket {
|
|
821
|
+
/** Access policy applied when the bucket is first provisioned. Defaults to `private`. */
|
|
822
|
+
visibility?: 'public' | 'private';
|
|
731
823
|
}
|
|
732
824
|
interface ConfigV4FunctionSettings {
|
|
733
825
|
/**
|
|
@@ -800,6 +892,7 @@ declare const V4ConfigParser_base: Effect.Service.Class<V4ConfigParser, "V4Confi
|
|
|
800
892
|
environmentVariables: Record<string, string>;
|
|
801
893
|
commands: string[];
|
|
802
894
|
images: NormalizedImagePolicy | undefined;
|
|
895
|
+
services: NormalizedConfigServiceDefinition[] | undefined;
|
|
803
896
|
entrypoints: NormalizedConfigEntrypoint[];
|
|
804
897
|
errors: never[];
|
|
805
898
|
warnings: never[];
|
|
@@ -843,6 +936,7 @@ declare const parseConfigRaw: (filePath: string, projectFolder: string) => Effec
|
|
|
843
936
|
environmentVariables: Record<string, string>;
|
|
844
937
|
commands: string[];
|
|
845
938
|
images: NormalizedImagePolicy | undefined;
|
|
939
|
+
services: NormalizedConfigServiceDefinition[] | undefined;
|
|
846
940
|
entrypoints: NormalizedConfigEntrypoint[];
|
|
847
941
|
errors: never[];
|
|
848
942
|
warnings: never[];
|
|
@@ -870,4 +964,4 @@ declare const postProcessConfig: (config: NormalizedConfig, projectFolder: strin
|
|
|
870
964
|
|
|
871
965
|
declare const NetworkConfigLive: Layer.Layer<RawConfigReader | SchemaValidator | V4ConfigParser | VercelBuildOutputParser, never, _effect_platform_FileSystem.FileSystem | _effect_platform_Path.Path>;
|
|
872
966
|
|
|
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 };
|
|
967
|
+
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, 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 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 UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, detectFramework, detectPackageManager, filterFunctionsFromAssets, generateConfig, getFunctionSettings, mergeWithFrameworkDefaults, parseConfig, parseConfigRaw, parseGigadriveNextBuildManifest, postProcessConfig, readDependencies };
|
package/dist/index.d.ts
CHANGED
|
@@ -231,7 +231,8 @@ interface NormalizedConfig {
|
|
|
231
231
|
commands: string[];
|
|
232
232
|
entrypoints: Array<NormalizedConfigEntrypoint>;
|
|
233
233
|
routes: Array<NormalizedConfigRoute>;
|
|
234
|
-
|
|
234
|
+
/** Managed infrastructure declarations supplied through `gigadrive.yaml`. */
|
|
235
|
+
services?: NormalizedConfigService[];
|
|
235
236
|
/**
|
|
236
237
|
* Settings related to the archive the user uploads to the build workers.
|
|
237
238
|
*/
|
|
@@ -265,9 +266,13 @@ interface NormalizedConfig {
|
|
|
265
266
|
interface NormalizedConfigService {
|
|
266
267
|
type: NormalizedConfigServiceType;
|
|
267
268
|
}
|
|
268
|
-
|
|
269
|
+
/** Service kinds supported by the normalized deployment configuration. */
|
|
270
|
+
type NormalizedConfigServiceType = 'redis' | 'postgres' | 'storage';
|
|
271
|
+
/** Fully normalized managed-service declaration consumed by provisioning. */
|
|
272
|
+
type NormalizedConfigServiceDefinition = NormalizedConfigServiceRedis | NormalizedConfigServicePostgres | NormalizedConfigServiceStorage;
|
|
269
273
|
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
274
|
interface NormalizedConfigServiceRedis extends NormalizedConfigService {
|
|
275
|
+
type: 'redis';
|
|
271
276
|
envBindings?: Record<'url' | 'host' | 'port' | 'password' | 'db' | 'ssl', string>;
|
|
272
277
|
primaryRegion?: UpstashAWSRegion | 'us-central1';
|
|
273
278
|
readRegions?: UpstashAWSRegion[];
|
|
@@ -275,10 +280,30 @@ interface NormalizedConfigServiceRedis extends NormalizedConfigService {
|
|
|
275
280
|
}
|
|
276
281
|
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
282
|
interface NormalizedConfigServicePostgres extends NormalizedConfigService {
|
|
283
|
+
type: 'postgres';
|
|
278
284
|
envBindings?: Record<'url' | 'host' | 'port' | 'user' | 'password' | 'database', string>;
|
|
279
285
|
postgresVersion?: '17' | '16' | '15' | '14';
|
|
280
286
|
region?: NeonAWSRegion;
|
|
281
287
|
}
|
|
288
|
+
/** Declarative File Storage service provisioned in the deployment environment. */
|
|
289
|
+
interface NormalizedConfigServiceStorage extends NormalizedConfigService {
|
|
290
|
+
type: 'storage';
|
|
291
|
+
/**
|
|
292
|
+
* Buckets sorted by name for deterministic deployment plans.
|
|
293
|
+
*
|
|
294
|
+
* Names are preserved exactly after schema validation. The deployment
|
|
295
|
+
* environment is authoritative, and global CDN/S3 slugs are generated by
|
|
296
|
+
* the File Storage API rather than stored in configuration.
|
|
297
|
+
*/
|
|
298
|
+
buckets: NormalizedConfigStorageBucket[];
|
|
299
|
+
}
|
|
300
|
+
/** Desired state for one environment-scoped File Storage bucket. */
|
|
301
|
+
interface NormalizedConfigStorageBucket {
|
|
302
|
+
/** Immutable environment-scoped API and IaC identifier. */
|
|
303
|
+
name: string;
|
|
304
|
+
/** Access policy to apply when the bucket is first provisioned. */
|
|
305
|
+
visibility: 'public' | 'private';
|
|
306
|
+
}
|
|
282
307
|
/** Default maximum lifetime of one function invocation, in seconds. */
|
|
283
308
|
declare const DEFAULT_FUNCTION_DURATION_SECONDS = 30;
|
|
284
309
|
/** Maximum configurable lifetime of one function invocation, in seconds (eight hours). */
|
|
@@ -720,14 +745,81 @@ interface ConfigV4 extends Config {
|
|
|
720
745
|
* Additional environment variables to set during runtime and build.
|
|
721
746
|
*/
|
|
722
747
|
env?: Record<string, string>;
|
|
748
|
+
/** Declares managed services to provision for the deployment environment. */
|
|
749
|
+
services?: ConfigV4Services;
|
|
750
|
+
}
|
|
751
|
+
interface ConfigV4Service {
|
|
752
|
+
}
|
|
753
|
+
interface ConfigV4ServiceRedis extends ConfigV4Service {
|
|
723
754
|
/**
|
|
724
|
-
* Optionally, specify
|
|
755
|
+
* Optionally, specify what environment variables the credentials will be bound to.
|
|
756
|
+
* For example: `{ url: 'REDIS_URL' }` will bind the `url` environment variable to the Redis URL.
|
|
757
|
+
* 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
758
|
*/
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
759
|
+
envBindings?: Record<'url' | 'host' | 'port' | 'password' | 'db' | 'ssl', string>;
|
|
760
|
+
/**
|
|
761
|
+
* The primary region to deploy the Redis instance to.
|
|
762
|
+
*/
|
|
763
|
+
primaryRegion?: UpstashAWSRegion | 'us-central1';
|
|
764
|
+
/**
|
|
765
|
+
* Optionally, add additional regions to read from. More regions will incur higher costs.
|
|
766
|
+
*/
|
|
767
|
+
readRegions?: UpstashAWSRegion[];
|
|
768
|
+
/**
|
|
769
|
+
* Optionally, enable Redis eviction. This will evict the least recently used keys in order to make space for new ones.
|
|
770
|
+
*/
|
|
771
|
+
eviction?: boolean;
|
|
729
772
|
}
|
|
730
|
-
interface ConfigV4Service {
|
|
773
|
+
interface ConfigV4ServicePostgres extends ConfigV4Service {
|
|
774
|
+
/**
|
|
775
|
+
* Optionally, specify what environment variables the credentials will be bound to.
|
|
776
|
+
* For example: `{ url: 'POSTGRES_URL' }` will bind the `url` environment variable to the Postgres URL.
|
|
777
|
+
* 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.
|
|
778
|
+
*/
|
|
779
|
+
envBindings?: Record<'url' | 'host' | 'port' | 'user' | 'password' | 'database', string>;
|
|
780
|
+
/**
|
|
781
|
+
* The version of Postgres to deploy.
|
|
782
|
+
*/
|
|
783
|
+
postgresVersion?: '17' | '16' | '15' | '14';
|
|
784
|
+
/**
|
|
785
|
+
* The region to deploy the Postgres instance to.
|
|
786
|
+
*/
|
|
787
|
+
region?: NeonAWSRegion;
|
|
788
|
+
}
|
|
789
|
+
/** Managed services accepted under the v4 `services` key. */
|
|
790
|
+
interface ConfigV4Services {
|
|
791
|
+
/** Managed Redis configuration. `null` selects provider defaults. */
|
|
792
|
+
redis?: ConfigV4ServiceRedis | null;
|
|
793
|
+
/** Managed Postgres configuration. `null` selects provider defaults. */
|
|
794
|
+
postgres?: ConfigV4ServicePostgres | null;
|
|
795
|
+
/** Declarative File Storage buckets for the deployment environment. */
|
|
796
|
+
storage?: ConfigV4ServiceStorage;
|
|
797
|
+
}
|
|
798
|
+
/** Declarative File Storage configuration for one deployment environment. */
|
|
799
|
+
interface ConfigV4ServiceStorage extends ConfigV4Service {
|
|
800
|
+
/**
|
|
801
|
+
* Buckets keyed by their immutable environment-scoped name.
|
|
802
|
+
*
|
|
803
|
+
* Use `null` or an empty object to accept the default private visibility.
|
|
804
|
+
* Names are validated exactly and are never normalized. The environment and
|
|
805
|
+
* global CDN/S3 slug are intentionally not configurable here.
|
|
806
|
+
*
|
|
807
|
+
* @example
|
|
808
|
+
* ```yaml
|
|
809
|
+
* services:
|
|
810
|
+
* storage:
|
|
811
|
+
* buckets:
|
|
812
|
+
* assets:
|
|
813
|
+
* visibility: public
|
|
814
|
+
* uploads: null
|
|
815
|
+
* ```
|
|
816
|
+
*/
|
|
817
|
+
buckets: Record<string, ConfigV4StorageBucket | null>;
|
|
818
|
+
}
|
|
819
|
+
/** Optional settings for a declaratively provisioned File Storage bucket. */
|
|
820
|
+
interface ConfigV4StorageBucket {
|
|
821
|
+
/** Access policy applied when the bucket is first provisioned. Defaults to `private`. */
|
|
822
|
+
visibility?: 'public' | 'private';
|
|
731
823
|
}
|
|
732
824
|
interface ConfigV4FunctionSettings {
|
|
733
825
|
/**
|
|
@@ -800,6 +892,7 @@ declare const V4ConfigParser_base: Effect.Service.Class<V4ConfigParser, "V4Confi
|
|
|
800
892
|
environmentVariables: Record<string, string>;
|
|
801
893
|
commands: string[];
|
|
802
894
|
images: NormalizedImagePolicy | undefined;
|
|
895
|
+
services: NormalizedConfigServiceDefinition[] | undefined;
|
|
803
896
|
entrypoints: NormalizedConfigEntrypoint[];
|
|
804
897
|
errors: never[];
|
|
805
898
|
warnings: never[];
|
|
@@ -843,6 +936,7 @@ declare const parseConfigRaw: (filePath: string, projectFolder: string) => Effec
|
|
|
843
936
|
environmentVariables: Record<string, string>;
|
|
844
937
|
commands: string[];
|
|
845
938
|
images: NormalizedImagePolicy | undefined;
|
|
939
|
+
services: NormalizedConfigServiceDefinition[] | undefined;
|
|
846
940
|
entrypoints: NormalizedConfigEntrypoint[];
|
|
847
941
|
errors: never[];
|
|
848
942
|
warnings: never[];
|
|
@@ -870,4 +964,4 @@ declare const postProcessConfig: (config: NormalizedConfig, projectFolder: strin
|
|
|
870
964
|
|
|
871
965
|
declare const NetworkConfigLive: Layer.Layer<RawConfigReader | SchemaValidator | V4ConfigParser | VercelBuildOutputParser, never, _effect_platform_FileSystem.FileSystem | _effect_platform_Path.Path>;
|
|
872
966
|
|
|
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 };
|
|
967
|
+
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, 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 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 UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, detectFramework, detectPackageManager, filterFunctionsFromAssets, generateConfig, getFunctionSettings, mergeWithFrameworkDefaults, parseConfig, parseConfigRaw, parseGigadriveNextBuildManifest, postProcessConfig, readDependencies };
|
package/dist/index.js
CHANGED
|
@@ -1266,6 +1266,23 @@ var normalizeImagePolicy = (images) => {
|
|
|
1266
1266
|
variants: images.variants ?? {}
|
|
1267
1267
|
};
|
|
1268
1268
|
};
|
|
1269
|
+
var normalizeServices = (services) => {
|
|
1270
|
+
if (services == null) return void 0;
|
|
1271
|
+
const normalized = [];
|
|
1272
|
+
if (services.redis !== void 0) {
|
|
1273
|
+
normalized.push({ type: "redis", ...services.redis ?? {} });
|
|
1274
|
+
}
|
|
1275
|
+
if (services.postgres !== void 0) {
|
|
1276
|
+
normalized.push({ type: "postgres", ...services.postgres ?? {} });
|
|
1277
|
+
}
|
|
1278
|
+
if (services.storage !== void 0) {
|
|
1279
|
+
normalized.push({
|
|
1280
|
+
type: "storage",
|
|
1281
|
+
buckets: Object.entries(services.storage.buckets).map(([name, bucket]) => ({ name, visibility: bucket?.visibility ?? "private" })).sort((left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0)
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
1285
|
+
};
|
|
1269
1286
|
var normalizeRouteDestination = (destination) => {
|
|
1270
1287
|
const [withoutHash] = destination.split("#", 1);
|
|
1271
1288
|
const [withoutQuery] = withoutHash.split("?", 1);
|
|
@@ -1429,6 +1446,7 @@ var V4ConfigParser = class extends import_effect15.Effect.Service()("V4ConfigPar
|
|
|
1429
1446
|
environmentVariables: config.env ?? {},
|
|
1430
1447
|
commands: config.build_commands ?? [],
|
|
1431
1448
|
images: normalizeImagePolicy(config.images),
|
|
1449
|
+
services: normalizeServices(config.services),
|
|
1432
1450
|
entrypoints,
|
|
1433
1451
|
errors: [],
|
|
1434
1452
|
warnings: [],
|
|
@@ -1946,7 +1964,8 @@ var schema_default = {
|
|
|
1946
1964
|
},
|
|
1947
1965
|
services: {
|
|
1948
1966
|
type: "object",
|
|
1949
|
-
description: "
|
|
1967
|
+
description: "Managed services to provision for the deployment environment.",
|
|
1968
|
+
additionalProperties: false,
|
|
1950
1969
|
properties: {
|
|
1951
1970
|
redis: {
|
|
1952
1971
|
oneOf: [
|
|
@@ -2060,6 +2079,39 @@ var schema_default = {
|
|
|
2060
2079
|
}
|
|
2061
2080
|
}
|
|
2062
2081
|
]
|
|
2082
|
+
},
|
|
2083
|
+
storage: {
|
|
2084
|
+
type: "object",
|
|
2085
|
+
required: ["buckets"],
|
|
2086
|
+
additionalProperties: false,
|
|
2087
|
+
description: "File Storage buckets to provision in the deployment environment. The environment and global delivery/S3 slug are assigned by the platform.",
|
|
2088
|
+
properties: {
|
|
2089
|
+
buckets: {
|
|
2090
|
+
type: "object",
|
|
2091
|
+
description: "Buckets keyed by immutable environment-scoped name. Use null or an empty object for the default private visibility.",
|
|
2092
|
+
propertyNames: {
|
|
2093
|
+
minLength: 3,
|
|
2094
|
+
maxLength: 63,
|
|
2095
|
+
pattern: "^(?![0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"
|
|
2096
|
+
},
|
|
2097
|
+
additionalProperties: {
|
|
2098
|
+
oneOf: [
|
|
2099
|
+
{ type: "null" },
|
|
2100
|
+
{
|
|
2101
|
+
type: "object",
|
|
2102
|
+
additionalProperties: false,
|
|
2103
|
+
properties: {
|
|
2104
|
+
visibility: {
|
|
2105
|
+
type: "string",
|
|
2106
|
+
enum: ["public", "private"],
|
|
2107
|
+
description: "Bucket access policy. Defaults to private when omitted. Public buckets can serve objects through their CDN hostname."
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
]
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2063
2115
|
}
|
|
2064
2116
|
}
|
|
2065
2117
|
}
|