@gigadrive/network-config 3.1.1 → 3.2.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 CHANGED
@@ -110,11 +110,21 @@ interface NormalizedConfigServicePostgres extends NormalizedConfigService {
110
110
  postgresVersion?: '17' | '16' | '15' | '14';
111
111
  region?: NeonAWSRegion;
112
112
  }
113
+ /** Default maximum lifetime of one function invocation, in seconds. */
114
+ declare const DEFAULT_FUNCTION_DURATION_SECONDS = 30;
115
+ /** Maximum configurable lifetime of one function invocation, in seconds (eight hours). */
116
+ declare const MAX_FUNCTION_DURATION_SECONDS = 28800;
113
117
  interface NormalizedConfigEntrypoint {
114
118
  displayName?: string;
115
119
  path: string;
116
120
  runtime: Runtime;
117
121
  memory: number;
122
+ /**
123
+ * Maximum lifetime of one HTTP request, response stream, or WebSocket connection, in seconds.
124
+ *
125
+ * The limit applies to an invocation, not to the reusable compute environment that happens to
126
+ * serve it. The platform may suspend or reuse that environment after all invocations finish.
127
+ */
118
128
  maxDuration: number;
119
129
  schedule?: string;
120
130
  symlinks?: Record<string, string>;
@@ -262,7 +272,11 @@ interface DetectionResult {
262
272
  * @param projectFolder - Absolute path to the project root
263
273
  * @returns DetectionResult with framework, package manager, and generated config
264
274
  */
265
- declare const detectFramework: (projectFolder: string) => Effect.Effect<DetectionResult, ManifestReadError | ManifestParseError | FrameworkNotDetectedError, FileSystem.FileSystem | Path.Path>;
275
+ declare const detectFramework: (projectFolder: string) => Effect.Effect<{
276
+ framework: FrameworkDefinition;
277
+ packageManager: PackageManager;
278
+ config: NormalizedConfig;
279
+ }, ManifestReadError | ManifestParseError | FrameworkNotDetectedError, FileSystem.FileSystem | Path.Path>;
266
280
 
267
281
  /**
268
282
  * Detects the package manager by checking for lockfiles in the project folder.
@@ -500,7 +514,11 @@ interface ConfigV4FunctionSettings {
500
514
  */
501
515
  memory?: number;
502
516
  /**
503
- * The maximum duration of the function in seconds. May not be higher than 15 minutes.
517
+ * Maximum lifetime of one HTTP request, response stream, or WebSocket connection, in seconds.
518
+ * Defaults to 30 seconds and may not be higher than eight hours (28,800 seconds).
519
+ *
520
+ * This is an invocation limit. It does not control how long the platform retains or reuses the
521
+ * underlying execution environment after the invocation finishes.
504
522
  */
505
523
  max_duration?: number;
506
524
  /**
@@ -550,7 +568,21 @@ declare const V4ConfigParser_base: Effect.Service.Class<V4ConfigParser, "V4Confi
550
568
  * @param config - The raw V4 config object
551
569
  * @param projectFolder - Absolute path to the project root
552
570
  */
553
- parse: (config: ConfigV4, projectFolder: string) => Effect.Effect<NormalizedConfig, FunctionConfigError, FileSystem.FileSystem | Path.Path>;
571
+ parse: (config: ConfigV4, projectFolder: string) => Effect.Effect<{
572
+ regions: ("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")[];
573
+ assets: {
574
+ paths: string[];
575
+ prefixToStrip: string;
576
+ dynamicRoutes: boolean;
577
+ populateCache: boolean;
578
+ };
579
+ environmentVariables: Record<string, string>;
580
+ commands: string[];
581
+ entrypoints: NormalizedConfigEntrypoint[];
582
+ errors: never[];
583
+ warnings: never[];
584
+ routes: NormalizedConfigRoute[];
585
+ }, FunctionConfigError, FileSystem.FileSystem | Path.Path>;
554
586
  }, never, never>;
555
587
  }>;
556
588
  declare class V4ConfigParser extends V4ConfigParser_base {
@@ -578,7 +610,21 @@ interface Config {
578
610
  * @param filePath - Absolute path to the config file
579
611
  * @param projectFolder - Absolute path to the project root
580
612
  */
581
- declare const parseConfigRaw: (filePath: string, projectFolder: string) => Effect.Effect<NormalizedConfig, ConfigFileNotFoundError | ConfigFileEmptyError | ConfigFileParseError | ConfigVersionError | ConfigSchemaValidationError | FunctionConfigError, _effect_platform_FileSystem.FileSystem | _effect_platform_Path.Path | RawConfigReader | SchemaValidator | V4ConfigParser>;
613
+ declare const parseConfigRaw: (filePath: string, projectFolder: string) => Effect.Effect<{
614
+ regions: ("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")[];
615
+ assets: {
616
+ paths: string[];
617
+ prefixToStrip: string;
618
+ dynamicRoutes: boolean;
619
+ populateCache: boolean;
620
+ };
621
+ environmentVariables: Record<string, string>;
622
+ commands: string[];
623
+ entrypoints: NormalizedConfigEntrypoint[];
624
+ errors: never[];
625
+ warnings: never[];
626
+ routes: NormalizedConfigRoute[];
627
+ }, ConfigFileNotFoundError | ConfigFileEmptyError | ConfigFileParseError | ConfigVersionError | ConfigSchemaValidationError | FunctionConfigError, _effect_platform_FileSystem.FileSystem | _effect_platform_Path.Path | RawConfigReader | SchemaValidator | V4ConfigParser>;
582
628
  /**
583
629
  * Parses a config file at the given path, validates it against the appropriate
584
630
  * JSON Schema, converts it to a NormalizedConfig, and applies post-processing.
@@ -601,4 +647,4 @@ declare const postProcessConfig: (config: NormalizedConfig, projectFolder: strin
601
647
 
602
648
  declare const NetworkConfigLive: Layer.Layer<RawConfigReader | SchemaValidator | V4ConfigParser | VercelBuildOutputParser, never, _effect_platform_FileSystem.FileSystem | _effect_platform_Path.Path>;
603
649
 
604
- export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, type Config, ConfigFileEmptyError, ConfigFileNotFoundError, ConfigFileParseError, ConfigSchemaValidationError, ConfigVersionError, type DetectionResult, FRAMEWORK_DEFINITIONS, type FilePathMap, type FrameworkDefaultConfig, type FrameworkDefinition, type FrameworkDetectionItem, type FrameworkLanguage, FrameworkNotDetectedError, FunctionConfigError, 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 PackageManager, RawConfigReader, type Region, type Runtime, SchemaValidator, type UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, detectFramework, detectPackageManager, filterFunctionsFromAssets, generateConfig, getFunctionSettings, mergeWithFrameworkDefaults, parseConfig, parseConfigRaw, postProcessConfig, readDependencies };
650
+ 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, 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 PackageManager, RawConfigReader, type Region, type Runtime, SchemaValidator, type UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, detectFramework, detectPackageManager, filterFunctionsFromAssets, generateConfig, getFunctionSettings, mergeWithFrameworkDefaults, parseConfig, parseConfigRaw, postProcessConfig, readDependencies };
package/dist/index.d.ts CHANGED
@@ -110,11 +110,21 @@ interface NormalizedConfigServicePostgres extends NormalizedConfigService {
110
110
  postgresVersion?: '17' | '16' | '15' | '14';
111
111
  region?: NeonAWSRegion;
112
112
  }
113
+ /** Default maximum lifetime of one function invocation, in seconds. */
114
+ declare const DEFAULT_FUNCTION_DURATION_SECONDS = 30;
115
+ /** Maximum configurable lifetime of one function invocation, in seconds (eight hours). */
116
+ declare const MAX_FUNCTION_DURATION_SECONDS = 28800;
113
117
  interface NormalizedConfigEntrypoint {
114
118
  displayName?: string;
115
119
  path: string;
116
120
  runtime: Runtime;
117
121
  memory: number;
122
+ /**
123
+ * Maximum lifetime of one HTTP request, response stream, or WebSocket connection, in seconds.
124
+ *
125
+ * The limit applies to an invocation, not to the reusable compute environment that happens to
126
+ * serve it. The platform may suspend or reuse that environment after all invocations finish.
127
+ */
118
128
  maxDuration: number;
119
129
  schedule?: string;
120
130
  symlinks?: Record<string, string>;
@@ -262,7 +272,11 @@ interface DetectionResult {
262
272
  * @param projectFolder - Absolute path to the project root
263
273
  * @returns DetectionResult with framework, package manager, and generated config
264
274
  */
265
- declare const detectFramework: (projectFolder: string) => Effect.Effect<DetectionResult, ManifestReadError | ManifestParseError | FrameworkNotDetectedError, FileSystem.FileSystem | Path.Path>;
275
+ declare const detectFramework: (projectFolder: string) => Effect.Effect<{
276
+ framework: FrameworkDefinition;
277
+ packageManager: PackageManager;
278
+ config: NormalizedConfig;
279
+ }, ManifestReadError | ManifestParseError | FrameworkNotDetectedError, FileSystem.FileSystem | Path.Path>;
266
280
 
267
281
  /**
268
282
  * Detects the package manager by checking for lockfiles in the project folder.
@@ -500,7 +514,11 @@ interface ConfigV4FunctionSettings {
500
514
  */
501
515
  memory?: number;
502
516
  /**
503
- * The maximum duration of the function in seconds. May not be higher than 15 minutes.
517
+ * Maximum lifetime of one HTTP request, response stream, or WebSocket connection, in seconds.
518
+ * Defaults to 30 seconds and may not be higher than eight hours (28,800 seconds).
519
+ *
520
+ * This is an invocation limit. It does not control how long the platform retains or reuses the
521
+ * underlying execution environment after the invocation finishes.
504
522
  */
505
523
  max_duration?: number;
506
524
  /**
@@ -550,7 +568,21 @@ declare const V4ConfigParser_base: Effect.Service.Class<V4ConfigParser, "V4Confi
550
568
  * @param config - The raw V4 config object
551
569
  * @param projectFolder - Absolute path to the project root
552
570
  */
553
- parse: (config: ConfigV4, projectFolder: string) => Effect.Effect<NormalizedConfig, FunctionConfigError, FileSystem.FileSystem | Path.Path>;
571
+ parse: (config: ConfigV4, projectFolder: string) => Effect.Effect<{
572
+ regions: ("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")[];
573
+ assets: {
574
+ paths: string[];
575
+ prefixToStrip: string;
576
+ dynamicRoutes: boolean;
577
+ populateCache: boolean;
578
+ };
579
+ environmentVariables: Record<string, string>;
580
+ commands: string[];
581
+ entrypoints: NormalizedConfigEntrypoint[];
582
+ errors: never[];
583
+ warnings: never[];
584
+ routes: NormalizedConfigRoute[];
585
+ }, FunctionConfigError, FileSystem.FileSystem | Path.Path>;
554
586
  }, never, never>;
555
587
  }>;
556
588
  declare class V4ConfigParser extends V4ConfigParser_base {
@@ -578,7 +610,21 @@ interface Config {
578
610
  * @param filePath - Absolute path to the config file
579
611
  * @param projectFolder - Absolute path to the project root
580
612
  */
581
- declare const parseConfigRaw: (filePath: string, projectFolder: string) => Effect.Effect<NormalizedConfig, ConfigFileNotFoundError | ConfigFileEmptyError | ConfigFileParseError | ConfigVersionError | ConfigSchemaValidationError | FunctionConfigError, _effect_platform_FileSystem.FileSystem | _effect_platform_Path.Path | RawConfigReader | SchemaValidator | V4ConfigParser>;
613
+ declare const parseConfigRaw: (filePath: string, projectFolder: string) => Effect.Effect<{
614
+ regions: ("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")[];
615
+ assets: {
616
+ paths: string[];
617
+ prefixToStrip: string;
618
+ dynamicRoutes: boolean;
619
+ populateCache: boolean;
620
+ };
621
+ environmentVariables: Record<string, string>;
622
+ commands: string[];
623
+ entrypoints: NormalizedConfigEntrypoint[];
624
+ errors: never[];
625
+ warnings: never[];
626
+ routes: NormalizedConfigRoute[];
627
+ }, ConfigFileNotFoundError | ConfigFileEmptyError | ConfigFileParseError | ConfigVersionError | ConfigSchemaValidationError | FunctionConfigError, _effect_platform_FileSystem.FileSystem | _effect_platform_Path.Path | RawConfigReader | SchemaValidator | V4ConfigParser>;
582
628
  /**
583
629
  * Parses a config file at the given path, validates it against the appropriate
584
630
  * JSON Schema, converts it to a NormalizedConfig, and applies post-processing.
@@ -601,4 +647,4 @@ declare const postProcessConfig: (config: NormalizedConfig, projectFolder: strin
601
647
 
602
648
  declare const NetworkConfigLive: Layer.Layer<RawConfigReader | SchemaValidator | V4ConfigParser | VercelBuildOutputParser, never, _effect_platform_FileSystem.FileSystem | _effect_platform_Path.Path>;
603
649
 
604
- export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, type Config, ConfigFileEmptyError, ConfigFileNotFoundError, ConfigFileParseError, ConfigSchemaValidationError, ConfigVersionError, type DetectionResult, FRAMEWORK_DEFINITIONS, type FilePathMap, type FrameworkDefaultConfig, type FrameworkDefinition, type FrameworkDetectionItem, type FrameworkLanguage, FrameworkNotDetectedError, FunctionConfigError, 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 PackageManager, RawConfigReader, type Region, type Runtime, SchemaValidator, type UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, detectFramework, detectPackageManager, filterFunctionsFromAssets, generateConfig, getFunctionSettings, mergeWithFrameworkDefaults, parseConfig, parseConfigRaw, postProcessConfig, readDependencies };
650
+ 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, 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 PackageManager, RawConfigReader, type Region, type Runtime, SchemaValidator, type UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, detectFramework, detectPackageManager, filterFunctionsFromAssets, generateConfig, getFunctionSettings, mergeWithFrameworkDefaults, parseConfig, parseConfigRaw, postProcessConfig, readDependencies };