@venturekit/infra 0.0.0-dev.20260307234057

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/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2025 VentureKit Contributors
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
@@ -0,0 +1,76 @@
1
+ /**
2
+ * VentureKit API Gateway Construct
3
+ *
4
+ * Creates an API Gateway with configurable throttling, CORS, and custom domains.
5
+ */
6
+ import { ApiEnvConfig, CorsConfig } from '@venturekit/core';
7
+ /**
8
+ * Route definition for API Gateway
9
+ */
10
+ export interface RouteDefinition {
11
+ /** HTTP method */
12
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS';
13
+ /** Route path (e.g., '/users/{id}') */
14
+ path: string;
15
+ /** Handler file path */
16
+ handler: string;
17
+ /** Whether route requires authentication */
18
+ auth?: boolean;
19
+ /** Required OAuth scopes */
20
+ scopes?: string[];
21
+ }
22
+ /**
23
+ * API construct output
24
+ */
25
+ export interface ApiOutput {
26
+ /** API Gateway URL */
27
+ url: string;
28
+ /** API Gateway ID */
29
+ apiId: string;
30
+ /** Custom domain URL (if configured) */
31
+ customDomainUrl?: string;
32
+ }
33
+ /**
34
+ * Create CORS configuration for SST API
35
+ */
36
+ export declare function createCorsConfig(cors: CorsConfig | undefined): {
37
+ allowOrigins: string[];
38
+ allowMethods: string[];
39
+ allowHeaders: string[];
40
+ allowCredentials: boolean;
41
+ maxAge: string;
42
+ } | undefined;
43
+ /**
44
+ * Create throttling configuration
45
+ */
46
+ export declare function createThrottleConfig(config: ApiEnvConfig): {
47
+ rate: number;
48
+ burst: number;
49
+ };
50
+ /**
51
+ * Convert route definitions to SST route format
52
+ */
53
+ export declare function convertRoutesToSst(routes: RouteDefinition[], basePath?: string): Record<string, string>;
54
+ /**
55
+ * Discover routes from file system
56
+ *
57
+ * Scans a directory for route handlers following the convention:
58
+ * - src/routes/health/get.ts -> GET /health
59
+ * - src/routes/users/[id]/get.ts -> GET /users/{id}
60
+ * - src/routes/users/list.ts -> GET /users
61
+ * - src/routes/users/create.ts -> POST /users
62
+ */
63
+ export declare function discoverRoutes(routesDir: string): RouteDefinition[];
64
+ /**
65
+ * Map file name to HTTP method
66
+ */
67
+ export declare function fileNameToMethod(fileName: string): RouteDefinition['method'] | null;
68
+ /**
69
+ * Convert directory path to API route path
70
+ *
71
+ * Examples:
72
+ * - 'users' -> '/users'
73
+ * - 'users/[id]' -> '/users/{id}'
74
+ * - 'projects/[projectId]/tasks/[taskId]' -> '/projects/{projectId}/tasks/{taskId}'
75
+ */
76
+ export declare function dirPathToRoutePath(dirPath: string): string;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ /**
3
+ * VentureKit API Gateway Construct
4
+ *
5
+ * Creates an API Gateway with configurable throttling, CORS, and custom domains.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.createCorsConfig = createCorsConfig;
9
+ exports.createThrottleConfig = createThrottleConfig;
10
+ exports.convertRoutesToSst = convertRoutesToSst;
11
+ exports.discoverRoutes = discoverRoutes;
12
+ exports.fileNameToMethod = fileNameToMethod;
13
+ exports.dirPathToRoutePath = dirPathToRoutePath;
14
+ /**
15
+ * Create CORS configuration for SST API
16
+ */
17
+ function createCorsConfig(cors) {
18
+ if (!cors)
19
+ return undefined;
20
+ return {
21
+ allowOrigins: cors.allowOrigins,
22
+ allowMethods: cors.allowMethods,
23
+ allowHeaders: cors.allowHeaders,
24
+ allowCredentials: cors.allowCredentials,
25
+ maxAge: `${cors.maxAgeSec} seconds`,
26
+ };
27
+ }
28
+ /**
29
+ * Create throttling configuration
30
+ */
31
+ function createThrottleConfig(config) {
32
+ return {
33
+ rate: config.throttleRateLimit,
34
+ burst: config.throttleBurstLimit,
35
+ };
36
+ }
37
+ /**
38
+ * Convert route definitions to SST route format
39
+ */
40
+ function convertRoutesToSst(routes, basePath = '') {
41
+ const sstRoutes = {};
42
+ for (const route of routes) {
43
+ const key = `${route.method} ${basePath}${route.path}`;
44
+ sstRoutes[key] = route.handler;
45
+ }
46
+ return sstRoutes;
47
+ }
48
+ /**
49
+ * Discover routes from file system
50
+ *
51
+ * Scans a directory for route handlers following the convention:
52
+ * - src/routes/health/get.ts -> GET /health
53
+ * - src/routes/users/[id]/get.ts -> GET /users/{id}
54
+ * - src/routes/users/list.ts -> GET /users
55
+ * - src/routes/users/create.ts -> POST /users
56
+ */
57
+ function discoverRoutes(routesDir) {
58
+ // This is a placeholder - actual implementation would use fs
59
+ // In SST context, this runs at build time
60
+ return [];
61
+ }
62
+ /**
63
+ * Map file name to HTTP method
64
+ */
65
+ function fileNameToMethod(fileName) {
66
+ const methodMap = {
67
+ 'get': 'GET',
68
+ 'list': 'GET',
69
+ 'post': 'POST',
70
+ 'create': 'POST',
71
+ 'put': 'PUT',
72
+ 'update': 'PUT',
73
+ 'patch': 'PATCH',
74
+ 'delete': 'DELETE',
75
+ 'remove': 'DELETE',
76
+ };
77
+ const baseName = fileName.replace(/\.(ts|js)$/, '').toLowerCase();
78
+ return methodMap[baseName] || null;
79
+ }
80
+ /**
81
+ * Convert directory path to API route path
82
+ *
83
+ * Examples:
84
+ * - 'users' -> '/users'
85
+ * - 'users/[id]' -> '/users/{id}'
86
+ * - 'projects/[projectId]/tasks/[taskId]' -> '/projects/{projectId}/tasks/{taskId}'
87
+ */
88
+ function dirPathToRoutePath(dirPath) {
89
+ return '/' + dirPath
90
+ .split('/')
91
+ .filter(Boolean)
92
+ .map(segment => {
93
+ // Convert [param] to {param}
94
+ if (segment.startsWith('[') && segment.endsWith(']')) {
95
+ return `{${segment.slice(1, -1)}}`;
96
+ }
97
+ return segment;
98
+ })
99
+ .join('/');
100
+ }
101
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnN0cnVjdHMvYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7OztHQUlHOztBQW1DSCw0Q0FnQkM7QUFLRCxvREFRQztBQUtELGdEQVlDO0FBV0Qsd0NBSUM7QUFLRCw0Q0FlQztBQVVELGdEQVlDO0FBMUdEOztHQUVHO0FBQ0gsU0FBZ0IsZ0JBQWdCLENBQUMsS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nXG4gKiAtICdwcm9qZWN0cy9bcHJvamVjdElkXS90YXNrcy9bdGFza0lkXScgLT4gJy9wcm9qZWN0cy97cHJvamVjdElkfS90YXNrcy97dGFza0lkfSdcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGRpclBhdGhUb1JvdXRlUGF0aChkaXJQYXRoOiBzdHJpbmcpOiBzdHJpbmcge1xuICByZXR1cm4gJy8nICsgZGlyUGF0aFxuICAgIC5zcGxpdCgnLycpXG4gICAgLmZpbHRlcihCb29sZWFuKVxuICAgIC5tYXAoc2VnbWVudCA9PiB7XG4gICAgICAvLyBDb252ZXJ0IFtwYXJhbV0gdG8ge3BhcmFtfVxuICAgICAgaWYgKHNlZ21lbnQuc3RhcnRzV2l0aCgnWycpICYmIHNlZ21lbnQuZW5kc1dpdGgoJ10nKSkge1xuICAgICAgICByZXR1cm4gYHske3NlZ21lbnQuc2xpY2UoMSwgLTEpfX1gO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHNlZ21lbnQ7XG4gICAgfSlcbiAgICAuam9pbignLycpO1xufVxuIl19
@@ -0,0 +1,6 @@
1
+ /**
2
+ * VentureKit Infrastructure Constructs
3
+ */
4
+ export * from './vpc';
5
+ export * from './api';
6
+ export * from './lambda';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /**
3
+ * VentureKit Infrastructure Constructs
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ __exportStar(require("./vpc"), exports);
21
+ __exportStar(require("./api"), exports);
22
+ __exportStar(require("./lambda"), exports);
23
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29uc3RydWN0cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7O0dBRUc7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFSCx3Q0FBc0I7QUFDdEIsd0NBQXNCO0FBQ3RCLDJDQUF5QiIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogVmVudHVyZUtpdCBJbmZyYXN0cnVjdHVyZSBDb25zdHJ1Y3RzXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi92cGMnO1xuZXhwb3J0ICogZnJvbSAnLi9hcGknO1xuZXhwb3J0ICogZnJvbSAnLi9sYW1iZGEnO1xuIl19
@@ -0,0 +1,47 @@
1
+ /**
2
+ * VentureKit Lambda Construct
3
+ *
4
+ * Creates Lambda function configuration with VentureKit defaults.
5
+ */
6
+ import { LambdaEnvConfig } from '@venturekit/core';
7
+ /**
8
+ * Lambda function definition
9
+ */
10
+ export interface LambdaDefinition {
11
+ /** Function name */
12
+ name: string;
13
+ /** Handler file path */
14
+ handler: string;
15
+ /** Function description */
16
+ description?: string;
17
+ /** Override memory (uses default if not specified) */
18
+ memoryMb?: number;
19
+ /** Override timeout (uses default if not specified) */
20
+ timeoutSec?: number;
21
+ /** Environment variables */
22
+ environment?: Record<string, string>;
23
+ /** Whether to run in VPC */
24
+ vpc?: boolean;
25
+ }
26
+ /**
27
+ * Create Lambda configuration for SST
28
+ */
29
+ export declare function createLambdaConfig(config: LambdaEnvConfig, overrides?: Partial<LambdaDefinition>): {
30
+ memory: string;
31
+ timeout: string;
32
+ runtime: string;
33
+ architecture: string;
34
+ tracing: string | undefined;
35
+ };
36
+ /**
37
+ * Create Lambda environment variables
38
+ */
39
+ export declare function createLambdaEnvironment(baseEnv: Record<string, string>, customEnv?: Record<string, string>): Record<string, string>;
40
+ /**
41
+ * Get log retention configuration
42
+ */
43
+ export declare function getLogRetention(config: LambdaEnvConfig): string;
44
+ /**
45
+ * Create reserved concurrency configuration
46
+ */
47
+ export declare function getReservedConcurrency(config: LambdaEnvConfig): number | undefined;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /**
3
+ * VentureKit Lambda Construct
4
+ *
5
+ * Creates Lambda function configuration with VentureKit defaults.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.createLambdaConfig = createLambdaConfig;
9
+ exports.createLambdaEnvironment = createLambdaEnvironment;
10
+ exports.getLogRetention = getLogRetention;
11
+ exports.getReservedConcurrency = getReservedConcurrency;
12
+ /**
13
+ * Create Lambda configuration for SST
14
+ */
15
+ function createLambdaConfig(config, overrides) {
16
+ return {
17
+ memory: `${overrides?.memoryMb ?? config.memoryMb} MB`,
18
+ timeout: `${overrides?.timeoutSec ?? config.timeoutSec} seconds`,
19
+ runtime: config.runtime,
20
+ architecture: config.architecture,
21
+ tracing: config.tracingEnabled ? 'active' : undefined,
22
+ };
23
+ }
24
+ /**
25
+ * Create Lambda environment variables
26
+ */
27
+ function createLambdaEnvironment(baseEnv, customEnv) {
28
+ return {
29
+ NODE_OPTIONS: '--enable-source-maps',
30
+ ...baseEnv,
31
+ ...customEnv,
32
+ };
33
+ }
34
+ /**
35
+ * Get log retention configuration
36
+ */
37
+ function getLogRetention(config) {
38
+ const days = config.logRetentionDays;
39
+ // Map to valid CloudWatch log retention values
40
+ const validRetentions = [1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653];
41
+ const closest = validRetentions.reduce((prev, curr) => Math.abs(curr - days) < Math.abs(prev - days) ? curr : prev);
42
+ return `${closest} days`;
43
+ }
44
+ /**
45
+ * Create reserved concurrency configuration
46
+ */
47
+ function getReservedConcurrency(config) {
48
+ return config.reservedConcurrency;
49
+ }
50
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFtYmRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnN0cnVjdHMvbGFtYmRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7OztHQUlHOztBQTJCSCxnREFpQkM7QUFLRCwwREFTQztBQUtELDBDQVVDO0FBS0Qsd0RBRUM7QUF4REQ7O0dBRUc7QUFDSCxTQUFnQixrQkFBa0IsQ0FDaEMsTUFBdUIsRUFDdkIsU0FBcUM7SUFRckMsT0FBTztRQUNMLE1BQU0sRUFBRSxHQUFHLFNBQVMsRUFBRSxRQUFRLElBQUksTUFBTSxDQUFDLFFBQVEsS0FBSztRQUN0RCxPQUFPLEVBQUUsR0FBRyxTQUFTLEVBQUUsVUFBVSxJQUFJLE1BQU0sQ0FBQyxVQUFVLFVBQVU7UUFDaEUsT0FBTyxFQUFFLE1BQU0sQ0FBQyxPQUFPO1FBQ3ZCLFlBQVksRUFBRSxNQUFNLENBQUMsWUFBWTtRQUNqQyxPQUFPLEVBQUUsTUFBTSxDQUFDLGNBQWMsQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxTQUFTO0tBQ3RELENBQUM7QUFDSixDQUFDO0FBRUQ7O0dBRUc7QUFDSCxTQUFnQix1QkFBdUIsQ0FDckMsT0FBK0IsRUFDL0IsU0FBa0M7SUFFbEMsT0FBTztRQUNMLFlBQVksRUFBRSxzQkFBc0I7UUFDcEMsR0FBRyxPQUFPO1FBQ1YsR0FBRyxTQUFTO0tBQ2IsQ0FBQztBQUNKLENBQUM7QUFFRDs7R0FFRztBQUNILFNBQWdCLGVBQWUsQ0FBQyxNQUF1QjtJQ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sIDYwLCA5MCwgMTIwLCAxNTAsIDE4MCwgMzY1LCA0MDAsIDU0NSwgNzMxLCAxODI3LCAzNjUzXTtcbiAgY29uc3QgY2xvc2VzdCA9IHZhbGlkUmV0ZW50aW9ucy5yZWR1Y2UoKHByZXYsIGN1cnIpID0+IFxuICAgIE1hdGguYWJzKGN1cnIgLSBkYXlzKSA8IE1hdGguYWJzKHByZXYgLSBkYXlzKSA/IGN1cnIgOiBwcmV2XG4gICk7XG4gIFxuICByZXR1cm4gYCR7Y2xvc2VzdH0gZGF5c2A7XG59XG5cbi8qKlxuICogQ3JlYXRlIHJlc2VydmVkIGNvbmN1cnJlbmN5IGNvbmZpZ3VyYXRpb25cbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGdldFJlc2VydmVkQ29uY3VycmVuY3koY29uZmlnOiBMYW1iZGFFbnZDb25maWcpOiBudW1iZXIgfCB1bmRlZmluZWQge1xuICByZXR1cm4gY29uZmlnLnJlc2VydmVkQ29uY3VycmVuY3k7XG59XG4iXX0=
@@ -0,0 +1,37 @@
1
+ /**
2
+ * VentureKit VPC Construct
3
+ *
4
+ * Creates a VPC with configurable subnets, NAT gateways, and flow logs.
5
+ */
6
+ import { VpcEnvConfig } from '@venturekit/core';
7
+ /**
8
+ * VPC construct output
9
+ */
10
+ export interface VpcOutput {
11
+ /** VPC ID */
12
+ vpcId: string;
13
+ /** Public subnet IDs */
14
+ publicSubnetIds: string[];
15
+ /** Private subnet IDs */
16
+ privateSubnetIds: string[];
17
+ /** Security group ID for Lambda functions */
18
+ lambdaSecurityGroupId: string;
19
+ }
20
+ /**
21
+ * Create VPC configuration for SST
22
+ *
23
+ * This returns the configuration object that SST's Vpc component expects.
24
+ * The actual VPC creation is handled by SST.
25
+ */
26
+ export declare function createVpcConfig(name: string, config: VpcEnvConfig): {
27
+ nat: 'managed' | 'ec2' | undefined;
28
+ bastion: boolean;
29
+ };
30
+ /**
31
+ * Get VPC CIDR configuration
32
+ */
33
+ export declare function getVpcCidr(config: VpcEnvConfig): string;
34
+ /**
35
+ * Check if VPC is needed based on config
36
+ */
37
+ export declare function isVpcRequired(lambdaVpcEnabled: boolean): boolean;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /**
3
+ * VentureKit VPC Construct
4
+ *
5
+ * Creates a VPC with configurable subnets, NAT gateways, and flow logs.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.createVpcConfig = createVpcConfig;
9
+ exports.getVpcCidr = getVpcCidr;
10
+ exports.isVpcRequired = isVpcRequired;
11
+ /**
12
+ * Create VPC configuration for SST
13
+ *
14
+ * This returns the configuration object that SST's Vpc component expects.
15
+ * The actual VPC creation is handled by SST.
16
+ */
17
+ function createVpcConfig(name, config) {
18
+ return {
19
+ nat: config.natGateways > 0 ? 'managed' : undefined,
20
+ bastion: false,
21
+ };
22
+ }
23
+ /**
24
+ * Get VPC CIDR configuration
25
+ */
26
+ function getVpcCidr(config) {
27
+ return config.cidr;
28
+ }
29
+ /**
30
+ * Check if VPC is needed based on config
31
+ */
32
+ function isVpcRequired(lambdaVpcEnabled) {
33
+ return lambdaVpcEnabled;
34
+ }
35
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidnBjLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnN0cnVjdHMvdnBjLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7OztHQUlHOztBQXdCSCwwQ0FXQztBQUtELGdDQUVDO0FBS0Qsc0NBRUM7QUEvQkQ7Ozs7O0dBS0c7QUFDSCxTQUFnQixlQUFlLENBQzdCLElBQVksRUFDWixNQUFvQjtJQUtwQixPQUFPO1FBQ0wsR0FBRyxFQUFFLE1BQU0sQ0FBQyxXQUFXLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLFNBQVM7UUFDbkQsT0FBTy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4gKiBUaGUgYWN0dWFsIFZQQyBjcmVhdGlvbiBpcyBoYW5kbGVkIGJ5IFNTVC5cbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGNyZWF0ZVZwY0NvbmZpZyhcbiAgbmFtZTogc3RyaW5nLFxuICBjb25maWc6IFZwY0VudkNvbmZpZ1xuKToge1xuICBuYXQ6ICdtYW5hZ2VkJyB8ICdlYzInIHwgdW5kZWZpbmVkO1xuICBiYXN0aW9uOiBib29sZWFuO1xufSB7XG4gIHJldHVybiB7XG4gICAgbmF0OiBjb25maWcubmF0R2F0ZXdheXMgPiAwID8gJ21hbmFnZWQnIDogdW5kZWZpbmVkLFxuICAgIGJhc3Rpb246IGZhbHNlLFxuICB9O1xufVxuXG4vKipcbiAqIEdldCBWUEMgQ0lEUiBjb25maWd1cmF0aW9uXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXRWcGNDaWRyKGNvbmZpZzogVnBjRW52Q29uZmlnKTogc3RyaW5nIHtcbiAgcmV0dXJuIGNvbmZpZy5jaWRyO1xufVxuXG4vKipcbiAqIENoZWNrIGlmIFZQQyBpcyBuZWVkZWQgYmFzZWQgb24gY29uZmlnXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBpc1ZwY1JlcXVpcmVkKGxhbWJkYVZwY0VuYWJsZWQ6IGJvb2xlYW4pOiBib29sZWFuIHtcbiAgcmV0dXJuIGxhbWJkYVZwY0VuYWJsZWQ7XG59XG4iXX0=
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @venturekit/infra
3
+ *
4
+ * Infrastructure package for VentureKit.
5
+ */
6
+ export { defineVenture, getResolvedConfig } from './venture';
7
+ export type { VentureDefinition, VentureAppConfig } from './venture';
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * @venturekit/infra
4
+ *
5
+ * Infrastructure package for VentureKit.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.getResolvedConfig = exports.defineVenture = void 0;
9
+ // Main entry point
10
+ var venture_1 = require("./venture");
11
+ Object.defineProperty(exports, "defineVenture", { enumerable: true, get: function () { return venture_1.defineVenture; } });
12
+ Object.defineProperty(exports, "getResolvedConfig", { enumerable: true, get: function () { return venture_1.getResolvedConfig; } });
13
+ // Constructs (internal, not exported to consumers)
14
+ // export * from './constructs';
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7O0dBSUc7OztBQUVILG1CQUFtQjtBQUNuQixxQ0FBNkQ7QUFBcEQsd0dBQUEsYUFBYSxPQUFBO0FBQUUsNEdBQUEsaUJBQWlCLE9BQUE7QUFHekMsbURBQW1EO0FBQ25ELGdDQUFnQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQHZlbnR1cmVraXQvaW5mcmFcbiAqIFxuICogSW5mcmFzdHJ1Y3R1cmUgcGFja2FnZSBmb3IgVmVudHVyZUtpdC5cbiAqL1xuXG4vLyBNYWluIGVudHJ5IHBvaW50XG5leHBvcnQgeyBkZWZpbmVWZW50dXJlLCBnZXRSZXNvbHZlZENvbmZpZyB9IGZyb20gJy4vdmVudHVyZSc7XG5leHBvcnQgdHlwZSB7IFZlbnR1cmVEZWZpbml0aW9uLCBWZW50dXJlQXBwQ29uZmlnIH0gZnJvbSAnLi92ZW50dXJlJztcblxuLy8gQ29uc3RydWN0cyAoaW50ZXJuYWwsIG5vdCBleHBvcnRlZCB0byBjb25zdW1lcnMpXG4vLyBleHBvcnQgKiBmcm9tICcuL2NvbnN0cnVjdHMnO1xuIl19
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Auth Intent Translator
3
+ *
4
+ * Translates AuthIntent to SST Cognito resources.
5
+ * This file isolates all SST/Cognito-specific logic.
6
+ */
7
+ import type { AuthIntent } from '@venturekit/core';
8
+ /**
9
+ * Auth output after creation
10
+ */
11
+ export interface AuthOutput {
12
+ userPoolId: string;
13
+ userPoolArn: string;
14
+ clientId: string;
15
+ domain?: string;
16
+ }
17
+ /**
18
+ * Translate AuthIntent to SST Cognito UserPool
19
+ */
20
+ export declare function translateAuth(intent: AuthIntent, sst: any, projectName: string): Promise<AuthOutput>;