@gigadrive/network-config 2.0.3 → 2.1.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
@@ -14,6 +14,13 @@ declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "node
14
14
  type Runtime = (typeof RUNTIME_DEFINITIONS)[number];
15
15
  declare const AVAILABLE_RUNTIMES: Runtime[];
16
16
 
17
+ /**
18
+ * A map of file paths to their corresponding paths in the deployment.
19
+ *
20
+ * Left side should be an absolute path on the file system.
21
+ * Right side should be a relative path in the deployment package.
22
+ */
23
+ type FilePathMap = Record<string, string>;
17
24
  /**
18
25
  * The object structure that all config versions will be parsed into.
19
26
  * This is done to provide a consistent interface for the rest of the codebase and easily provision the necessary resources, regardless of the config version.
@@ -59,6 +66,20 @@ interface NormalizedConfig {
59
66
  entrypoints: Array<NormalizedConfigEntrypoint>;
60
67
  routes: Array<NormalizedConfigRoute>;
61
68
  services?: Array<NormalizedConfigService>;
69
+ /**
70
+ * Settings related to the archive the user uploads to the build workers.
71
+ */
72
+ userArchive?: {
73
+ /**
74
+ * Overwrite the root of the user-uploaded package. This is mostly used for monorepos to make sure all relevant files are included.
75
+ */
76
+ rootOverwrite?: string;
77
+ /**
78
+ * Use a whitelist to only include relevant files in monorepos. May be a glob pattern.
79
+ * @see getFilesForPattern
80
+ */
81
+ fileWhitelist?: string[];
82
+ };
62
83
  /**
63
84
  * Warning codes to be printed to the output during deployment.
64
85
  */
@@ -97,7 +118,7 @@ interface NormalizedConfigEntrypoint {
97
118
  streaming?: boolean;
98
119
  package?: {
99
120
  rootOverwrite?: string;
100
- filePathMap?: Record<string, string>;
121
+ filePathMap?: FilePathMap;
101
122
  };
102
123
  }
103
124
  interface NormalizedConfigRoute {
@@ -140,6 +161,8 @@ type NormalizedConfigRouteMatchRequirements = [] | [
140
161
 
141
162
  declare const parseConfig: (filePath: string, projectFolder: string) => Promise<NormalizedConfig>;
142
163
 
143
- declare const parseRawConfig: (filePath: string) => Promise<any>;
164
+ declare const parseRawConfig: (filePath: string, { disableVersionCheck }?: {
165
+ disableVersionCheck?: boolean;
166
+ }) => Promise<any>;
144
167
 
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 };
168
+ export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, type FilePathMap, 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
@@ -14,6 +14,13 @@ declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "node
14
14
  type Runtime = (typeof RUNTIME_DEFINITIONS)[number];
15
15
  declare const AVAILABLE_RUNTIMES: Runtime[];
16
16
 
17
+ /**
18
+ * A map of file paths to their corresponding paths in the deployment.
19
+ *
20
+ * Left side should be an absolute path on the file system.
21
+ * Right side should be a relative path in the deployment package.
22
+ */
23
+ type FilePathMap = Record<string, string>;
17
24
  /**
18
25
  * The object structure that all config versions will be parsed into.
19
26
  * This is done to provide a consistent interface for the rest of the codebase and easily provision the necessary resources, regardless of the config version.
@@ -59,6 +66,20 @@ interface NormalizedConfig {
59
66
  entrypoints: Array<NormalizedConfigEntrypoint>;
60
67
  routes: Array<NormalizedConfigRoute>;
61
68
  services?: Array<NormalizedConfigService>;
69
+ /**
70
+ * Settings related to the archive the user uploads to the build workers.
71
+ */
72
+ userArchive?: {
73
+ /**
74
+ * Overwrite the root of the user-uploaded package. This is mostly used for monorepos to make sure all relevant files are included.
75
+ */
76
+ rootOverwrite?: string;
77
+ /**
78
+ * Use a whitelist to only include relevant files in monorepos. May be a glob pattern.
79
+ * @see getFilesForPattern
80
+ */
81
+ fileWhitelist?: string[];
82
+ };
62
83
  /**
63
84
  * Warning codes to be printed to the output during deployment.
64
85
  */
@@ -97,7 +118,7 @@ interface NormalizedConfigEntrypoint {
97
118
  streaming?: boolean;
98
119
  package?: {
99
120
  rootOverwrite?: string;
100
- filePathMap?: Record<string, string>;
121
+ filePathMap?: FilePathMap;
101
122
  };
102
123
  }
103
124
  interface NormalizedConfigRoute {
@@ -140,6 +161,8 @@ type NormalizedConfigRouteMatchRequirements = [] | [
140
161
 
141
162
  declare const parseConfig: (filePath: string, projectFolder: string) => Promise<NormalizedConfig>;
142
163
 
143
- declare const parseRawConfig: (filePath: string) => Promise<any>;
164
+ declare const parseRawConfig: (filePath: string, { disableVersionCheck }?: {
165
+ disableVersionCheck?: boolean;
166
+ }) => Promise<any>;
144
167
 
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 };
168
+ export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, type FilePathMap, 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 };