@gigadrive/network-config 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,8 +1,18 @@
1
+ declare const ALLOWED_CONFIG_NAMES: string[];
2
+ /**
3
+ * Finds a config file in the project folder.
4
+ * @param projectFolder The folder to search for a config file in.
5
+ * @returns The path to the config file, or null if no config file is found.
6
+ */
7
+ declare const findConfig: (projectFolder: string) => string | null;
8
+
1
9
  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"];
2
10
  type Region = (typeof REGION_DEFINITIONS)[number];
11
+ declare const AVAILABLE_REGIONS: Region[];
3
12
 
4
13
  declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "node-22", "node-20", "node-18", "node-16", "bun-1"];
5
14
  type Runtime = (typeof RUNTIME_DEFINITIONS)[number];
15
+ declare const AVAILABLE_RUNTIMES: Runtime[];
6
16
 
7
17
  /**
8
18
  * The object structure that all config versions will be parsed into.
@@ -62,6 +72,19 @@ interface NormalizedConfigService {
62
72
  type: NormalizedConfigServiceType;
63
73
  }
64
74
  type NormalizedConfigServiceType = 'redis' | 'postgres';
75
+ 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';
76
+ interface NormalizedConfigServiceRedis extends NormalizedConfigService {
77
+ envBindings?: Record<'url' | 'host' | 'port' | 'password' | 'db' | 'ssl', string>;
78
+ primaryRegion?: UpstashAWSRegion | 'us-central1';
79
+ readRegions?: UpstashAWSRegion[];
80
+ eviction?: boolean;
81
+ }
82
+ 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';
83
+ interface NormalizedConfigServicePostgres extends NormalizedConfigService {
84
+ envBindings?: Record<'url' | 'host' | 'port' | 'user' | 'password' | 'database', string>;
85
+ postgresVersion?: '17' | '16' | '15' | '14';
86
+ region?: NeonAWSRegion;
87
+ }
65
88
  interface NormalizedConfigEntrypoint {
66
89
  displayName?: string;
67
90
  path: string;
@@ -115,13 +138,8 @@ type NormalizedConfigRouteMatchRequirements = [] | [
115
138
  }
116
139
  ];
117
140
 
118
- declare const ALLOWED_CONFIG_NAMES: string[];
119
- /**
120
- * Finds a config file in the project folder.
121
- * @param projectFolder The folder to search for a config file in.
122
- * @returns The path to the config file, or null if no config file is found.
123
- */
124
- declare const findConfig: (projectFolder: string) => string | null;
125
141
  declare const parseConfig: (filePath: string, projectFolder: string) => Promise<NormalizedConfig>;
126
142
 
127
- export { ALLOWED_CONFIG_NAMES, findConfig, parseConfig };
143
+ declare const parseRawConfig: (filePath: string) => Promise<any>;
144
+
145
+ export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, type NeonAWSRegion, type NormalizedConfig, type NormalizedConfigEntrypoint, type NormalizedConfigRoute, type NormalizedConfigRouteHandler, type NormalizedConfigRouteMatchRequirements, type NormalizedConfigRouteMethod, type NormalizedConfigService, type NormalizedConfigServicePostgres, type NormalizedConfigServiceRedis, type NormalizedConfigServiceType, type Region, type Runtime, type UpstashAWSRegion, findConfig, parseConfig, parseRawConfig };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,18 @@
1
+ declare const ALLOWED_CONFIG_NAMES: string[];
2
+ /**
3
+ * Finds a config file in the project folder.
4
+ * @param projectFolder The folder to search for a config file in.
5
+ * @returns The path to the config file, or null if no config file is found.
6
+ */
7
+ declare const findConfig: (projectFolder: string) => string | null;
8
+
1
9
  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"];
2
10
  type Region = (typeof REGION_DEFINITIONS)[number];
11
+ declare const AVAILABLE_REGIONS: Region[];
3
12
 
4
13
  declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "node-22", "node-20", "node-18", "node-16", "bun-1"];
5
14
  type Runtime = (typeof RUNTIME_DEFINITIONS)[number];
15
+ declare const AVAILABLE_RUNTIMES: Runtime[];
6
16
 
7
17
  /**
8
18
  * The object structure that all config versions will be parsed into.
@@ -62,6 +72,19 @@ interface NormalizedConfigService {
62
72
  type: NormalizedConfigServiceType;
63
73
  }
64
74
  type NormalizedConfigServiceType = 'redis' | 'postgres';
75
+ 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';
76
+ interface NormalizedConfigServiceRedis extends NormalizedConfigService {
77
+ envBindings?: Record<'url' | 'host' | 'port' | 'password' | 'db' | 'ssl', string>;
78
+ primaryRegion?: UpstashAWSRegion | 'us-central1';
79
+ readRegions?: UpstashAWSRegion[];
80
+ eviction?: boolean;
81
+ }
82
+ 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';
83
+ interface NormalizedConfigServicePostgres extends NormalizedConfigService {
84
+ envBindings?: Record<'url' | 'host' | 'port' | 'user' | 'password' | 'database', string>;
85
+ postgresVersion?: '17' | '16' | '15' | '14';
86
+ region?: NeonAWSRegion;
87
+ }
65
88
  interface NormalizedConfigEntrypoint {
66
89
  displayName?: string;
67
90
  path: string;
@@ -115,13 +138,8 @@ type NormalizedConfigRouteMatchRequirements = [] | [
115
138
  }
116
139
  ];
117
140
 
118
- declare const ALLOWED_CONFIG_NAMES: string[];
119
- /**
120
- * Finds a config file in the project folder.
121
- * @param projectFolder The folder to search for a config file in.
122
- * @returns The path to the config file, or null if no config file is found.
123
- */
124
- declare const findConfig: (projectFolder: string) => string | null;
125
141
  declare const parseConfig: (filePath: string, projectFolder: string) => Promise<NormalizedConfig>;
126
142
 
127
- export { ALLOWED_CONFIG_NAMES, findConfig, parseConfig };
143
+ declare const parseRawConfig: (filePath: string) => Promise<any>;
144
+
145
+ export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, type NeonAWSRegion, type NormalizedConfig, type NormalizedConfigEntrypoint, type NormalizedConfigRoute, type NormalizedConfigRouteHandler, type NormalizedConfigRouteMatchRequirements, type NormalizedConfigRouteMethod, type NormalizedConfigService, type NormalizedConfigServicePostgres, type NormalizedConfigServiceRedis, type NormalizedConfigServiceType, type Region, type Runtime, type UpstashAWSRegion, findConfig, parseConfig, parseRawConfig };