@venturekit/infra 0.0.0-dev.20260311071358 → 0.0.0-dev.20260312002737
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/cdk/index.d.ts +8 -0
- package/dist/cdk/index.d.ts.map +1 -0
- package/dist/cdk/index.js +11 -0
- package/dist/cdk/index.js.map +1 -0
- package/dist/cdk/stack.d.ts +29 -0
- package/dist/cdk/stack.d.ts.map +1 -0
- package/dist/cdk/stack.js +301 -0
- package/dist/cdk/stack.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/venture.d.ts +10 -2
- package/dist/venture.d.ts.map +1 -1
- package/dist/venture.js +10 -166
- package/dist/venture.js.map +1 -1
- package/package.json +19 -6
- package/dist/constructs/api.d.ts +0 -77
- package/dist/constructs/api.d.ts.map +0 -1
- package/dist/constructs/api.js +0 -101
- package/dist/constructs/api.js.map +0 -1
- package/dist/constructs/index.d.ts +0 -7
- package/dist/constructs/index.d.ts.map +0 -1
- package/dist/constructs/index.js +0 -23
- package/dist/constructs/index.js.map +0 -1
- package/dist/constructs/lambda.d.ts +0 -48
- package/dist/constructs/lambda.d.ts.map +0 -1
- package/dist/constructs/lambda.js +0 -50
- package/dist/constructs/lambda.js.map +0 -1
- package/dist/constructs/vpc.d.ts +0 -38
- package/dist/constructs/vpc.d.ts.map +0 -1
- package/dist/constructs/vpc.js +0 -35
- package/dist/constructs/vpc.js.map +0 -1
- package/dist/translators/auth.d.ts +0 -21
- package/dist/translators/auth.d.ts.map +0 -1
- package/dist/translators/auth.js +0 -69
- package/dist/translators/auth.js.map +0 -1
- package/dist/translators/cache.d.ts +0 -22
- package/dist/translators/cache.d.ts.map +0 -1
- package/dist/translators/cache.js +0 -38
- package/dist/translators/cache.js.map +0 -1
- package/dist/translators/database.d.ts +0 -33
- package/dist/translators/database.d.ts.map +0 -1
- package/dist/translators/database.js +0 -89
- package/dist/translators/database.js.map +0 -1
- package/dist/translators/index.d.ts +0 -16
- package/dist/translators/index.d.ts.map +0 -1
- package/dist/translators/index.js +0 -26
- package/dist/translators/index.js.map +0 -1
- package/dist/translators/orchestrator.d.ts +0 -19
- package/dist/translators/orchestrator.d.ts.map +0 -1
- package/dist/translators/orchestrator.js +0 -95
- package/dist/translators/orchestrator.js.map +0 -1
- package/dist/translators/queue.d.ts +0 -20
- package/dist/translators/queue.d.ts.map +0 -1
- package/dist/translators/queue.js +0 -39
- package/dist/translators/queue.js.map +0 -1
- package/dist/translators/schedule.d.ts +0 -19
- package/dist/translators/schedule.d.ts.map +0 -1
- package/dist/translators/schedule.js +0 -45
- package/dist/translators/schedule.js.map +0 -1
- package/dist/translators/storage.d.ts +0 -20
- package/dist/translators/storage.d.ts.map +0 -1
- package/dist/translators/storage.js +0 -49
- package/dist/translators/storage.js.map +0 -1
package/dist/venture.js
CHANGED
|
@@ -4,91 +4,21 @@
|
|
|
4
4
|
*
|
|
5
5
|
* defineVenture() is the primary API for creating VentureKit applications.
|
|
6
6
|
* Consumers never see the underlying infrastructure tooling.
|
|
7
|
+
*
|
|
8
|
+
* Architecture:
|
|
9
|
+
* - `vk dev` → CLI reads _routesDir + _infrastructure, starts local HTTP server + Docker
|
|
10
|
+
* - `vk deploy` → CLI reads metadata, generates CDK app, runs `cdk deploy`
|
|
11
|
+
* - No SST dependency — infrastructure lives in CDK VentureStack
|
|
7
12
|
*/
|
|
8
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
-
var ownKeys = function(o) {
|
|
26
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
-
var ar = [];
|
|
28
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
-
return ar;
|
|
30
|
-
};
|
|
31
|
-
return ownKeys(o);
|
|
32
|
-
};
|
|
33
|
-
return function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
14
|
exports.defineVenture = defineVenture;
|
|
43
15
|
exports.getResolvedConfig = getResolvedConfig;
|
|
44
16
|
const core_1 = require("@venturekit/core");
|
|
45
|
-
const index_js_1 = require("./translators/index.js");
|
|
46
|
-
const lambda_js_1 = require("./constructs/lambda.js");
|
|
47
|
-
const api_js_1 = require("./constructs/api.js");
|
|
48
|
-
const vpc_js_1 = require("./constructs/vpc.js");
|
|
49
|
-
const fs = __importStar(require("fs"));
|
|
50
|
-
const path = __importStar(require("path"));
|
|
51
|
-
/**
|
|
52
|
-
* Discover routes from file system
|
|
53
|
-
*
|
|
54
|
-
* Convention:
|
|
55
|
-
* - src/routes/health/get.ts -> GET /health
|
|
56
|
-
* - src/routes/projects/post.ts -> POST /projects
|
|
57
|
-
* - src/routes/projects/[id]/get.ts -> GET /projects/{id}
|
|
58
|
-
* - src/routes/projects/[id]/delete.ts -> DELETE /projects/{id}
|
|
59
|
-
*/
|
|
60
|
-
function discoverRoutes(routesDir) {
|
|
61
|
-
const routes = [];
|
|
62
|
-
function scanDir(dir, routePath = '') {
|
|
63
|
-
if (!fs.existsSync(dir))
|
|
64
|
-
return;
|
|
65
|
-
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
66
|
-
for (const entry of entries) {
|
|
67
|
-
const fullPath = path.join(dir, entry.name);
|
|
68
|
-
if (entry.isDirectory()) {
|
|
69
|
-
// Convert [param] to {param} for API Gateway
|
|
70
|
-
const segment = entry.name.startsWith('[') && entry.name.endsWith(']')
|
|
71
|
-
? `{${entry.name.slice(1, -1)}}`
|
|
72
|
-
: entry.name;
|
|
73
|
-
scanDir(fullPath, `${routePath}/${segment}`);
|
|
74
|
-
}
|
|
75
|
-
else if (entry.isFile() && (entry.name.endsWith('.ts') || entry.name.endsWith('.js'))) {
|
|
76
|
-
const method = (0, api_js_1.fileNameToMethod)(entry.name);
|
|
77
|
-
if (method) {
|
|
78
|
-
const apiPath = routePath || '/';
|
|
79
|
-
const handlerPath = fullPath.replace(/\\/g, '/').replace(/\.(ts|js)$/, '.handler');
|
|
80
|
-
routes.push({ method, path: apiPath, handler: handlerPath });
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
scanDir(routesDir);
|
|
86
|
-
return routes;
|
|
87
|
-
}
|
|
88
17
|
/**
|
|
89
18
|
* Define a VentureKit application
|
|
90
19
|
*
|
|
91
20
|
* This is the main entry point for VentureKit projects.
|
|
21
|
+
* Returns an object with metadata that CLI tools (vk dev, vk deploy) read.
|
|
92
22
|
*
|
|
93
23
|
* @example
|
|
94
24
|
* ```typescript
|
|
@@ -114,6 +44,10 @@ function defineVenture(definition) {
|
|
|
114
44
|
const securityValidation = (0, core_1.validateSecurityConfig)(definition.security);
|
|
115
45
|
(0, core_1.assertValid)(securityValidation);
|
|
116
46
|
return {
|
|
47
|
+
// Metadata exposed for CLI tools (vk dev, vk deploy) to read
|
|
48
|
+
_routesDir: definition.routesDir,
|
|
49
|
+
_infrastructure: definition.infrastructure,
|
|
50
|
+
_definition: definition,
|
|
117
51
|
app(input) {
|
|
118
52
|
return {
|
|
119
53
|
name: definition.base.name,
|
|
@@ -125,97 +59,7 @@ function defineVenture(definition) {
|
|
|
125
59
|
},
|
|
126
60
|
};
|
|
127
61
|
},
|
|
128
|
-
async run() {
|
|
129
|
-
// Determine current environment from $app.stage (set by SST CLI --stage flag)
|
|
130
|
-
const stage = globalThis.$app?.stage || process.env.VENTURE_STAGE || 'dev';
|
|
131
|
-
const env = (stage === 'prod' ? 'prod' : stage === 'stage' ? 'stage' : 'dev');
|
|
132
|
-
// Get env config (default to empty if not specified)
|
|
133
|
-
const envInput = definition.envs[env] || {};
|
|
134
|
-
// Validate env config
|
|
135
|
-
const envValidation = (0, core_1.validateEnvConfigInput)(env, envInput);
|
|
136
|
-
(0, core_1.assertValid)(envValidation);
|
|
137
|
-
// Resolve full configuration
|
|
138
|
-
const config = (0, core_1.resolveConfig)(definition.base, definition.security, env, envInput);
|
|
139
|
-
// Discover routes from file system
|
|
140
|
-
const routes = discoverRoutes(definition.routesDir);
|
|
141
|
-
// Translate infrastructure intents if provided
|
|
142
|
-
let intentOutputs;
|
|
143
|
-
if (definition.infrastructure) {
|
|
144
|
-
intentOutputs = await (0, index_js_1.translateAllIntents)(definition.infrastructure, config.name);
|
|
145
|
-
}
|
|
146
|
-
// Create infrastructure (passes intent outputs to Lambda env)
|
|
147
|
-
const resources = await createInfrastructure(config, routes, intentOutputs);
|
|
148
|
-
if (intentOutputs) {
|
|
149
|
-
resources.infrastructure = intentOutputs;
|
|
150
|
-
}
|
|
151
|
-
return resources;
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Create infrastructure resources
|
|
157
|
-
*/
|
|
158
|
-
async function createInfrastructure(config, routes, intentOutputs) {
|
|
159
|
-
// Dynamic import of SST v3 (hidden from consumers)
|
|
160
|
-
const sst = await import('sst');
|
|
161
|
-
const aws = sst.aws ?? sst;
|
|
162
|
-
const outputs = {};
|
|
163
|
-
// Create VPC if needed
|
|
164
|
-
let vpc = undefined;
|
|
165
|
-
if ((0, vpc_js_1.isVpcRequired)(config.lambda.vpcEnabled)) {
|
|
166
|
-
vpc = new aws.Vpc(`${config.name}-vpc`, (0, vpc_js_1.createVpcConfig)(config.name, config.vpc));
|
|
167
|
-
outputs.vpcId = vpc.id;
|
|
168
|
-
}
|
|
169
|
-
// Build shared Lambda config for route handlers
|
|
170
|
-
const lambdaConfig = (0, lambda_js_1.createLambdaConfig)(config.lambda);
|
|
171
|
-
const lambdaEnv = (0, lambda_js_1.createLambdaEnvironment)({
|
|
172
|
-
VENTURE_ENV: config.env,
|
|
173
|
-
VENTURE_NAME: config.name,
|
|
174
|
-
...(intentOutputs ? { VENTURE_INTENT_OUTPUTS: JSON.stringify(intentOutputs) } : {}),
|
|
175
|
-
});
|
|
176
|
-
// Create API Gateway (SST v3: construct first, then add routes)
|
|
177
|
-
const apiConfig = {};
|
|
178
|
-
const corsConfig = (0, api_js_1.createCorsConfig)(config.api.cors);
|
|
179
|
-
if (corsConfig) {
|
|
180
|
-
apiConfig.cors = corsConfig;
|
|
181
|
-
}
|
|
182
|
-
// Add custom domain if configured
|
|
183
|
-
if (config.api.customDomain) {
|
|
184
|
-
apiConfig.domain = {
|
|
185
|
-
name: config.api.customDomain.domainName,
|
|
186
|
-
cert: config.api.customDomain.certificateArn,
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
if (vpc && config.lambda.vpcEnabled) {
|
|
190
|
-
apiConfig.vpc = vpc;
|
|
191
|
-
}
|
|
192
|
-
const api = new aws.ApiGatewayV2(`${config.name}-api`, apiConfig);
|
|
193
|
-
// Add routes using SST v3 .route() method
|
|
194
|
-
for (const route of routes) {
|
|
195
|
-
const routeKey = `${route.method} ${route.path}`;
|
|
196
|
-
api.route(routeKey, {
|
|
197
|
-
handler: route.handler,
|
|
198
|
-
...lambdaConfig,
|
|
199
|
-
environment: lambdaEnv,
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
outputs.apiUrl = api.url;
|
|
203
|
-
// Create WebSocket API if enabled
|
|
204
|
-
if (config.websocket.enabled) {
|
|
205
|
-
const wsApi = new aws.ApiGatewayWebSocket(`${config.name}-ws`);
|
|
206
|
-
wsApi.route('$connect', `src/ws/connect.handler`);
|
|
207
|
-
wsApi.route('$disconnect', `src/ws/disconnect.handler`);
|
|
208
|
-
wsApi.route('$default', `src/ws/default.handler`);
|
|
209
|
-
outputs.wsUrl = wsApi.url;
|
|
210
|
-
}
|
|
211
|
-
// Output resolved config for debugging
|
|
212
|
-
outputs.config = {
|
|
213
|
-
name: config.name,
|
|
214
|
-
env: config.env,
|
|
215
|
-
dataSafety: config.dataSafety,
|
|
216
|
-
routeCount: routes.length,
|
|
217
62
|
};
|
|
218
|
-
return outputs;
|
|
219
63
|
}
|
|
220
64
|
/**
|
|
221
65
|
* Get resolved configuration for current environment
|
package/dist/venture.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"venture.js","sourceRoot":"","sources":["../src/venture.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"venture.js","sourceRoot":"","sources":["../src/venture.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAwFH,sCA0BC;AAOD,8CAQC;AA/HD,2CAW0B;AAoD1B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,aAAa,CAAC,UAA6B;IACzD,mBAAmB;IACnB,MAAM,cAAc,GAAG,IAAA,yBAAkB,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC3D,IAAA,kBAAW,EAAC,cAAc,CAAC,CAAC;IAE5B,MAAM,kBAAkB,GAAG,IAAA,6BAAsB,EAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACvE,IAAA,kBAAW,EAAC,kBAAkB,CAAC,CAAC;IAEhC,OAAO;QACL,6DAA6D;QAC7D,UAAU,EAAE,UAAU,CAAC,SAAS;QAChC,eAAe,EAAE,UAAU,CAAC,cAAc;QAC1C,WAAW,EAAE,UAAU;QAEvB,GAAG,CAAC,KAAwB;YAC1B,OAAO;gBACL,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI;gBAC1B,IAAI,EAAE,KAAc;gBACpB,SAAS,EAAE;oBACT,GAAG,EAAE;wBACH,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM;qBAC/B;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAC/B,IAAgB,EAChB,QAAwB,EACxB,QAAwB;IAExB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,KAAK,CAAC;IACjD,MAAM,GAAG,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAgB,CAAC;IAC7F,OAAO,IAAA,oBAAa,EAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AACtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venturekit/infra",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
4
|
-
"description": "VentureKit infrastructure -
|
|
3
|
+
"version": "0.0.0-dev.20260312002737",
|
|
4
|
+
"description": "VentureKit infrastructure - AWS CDK constructs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"./cdk": {
|
|
13
|
+
"import": "./dist/cdk/index.js",
|
|
14
|
+
"require": "./dist/cdk/index.js",
|
|
15
|
+
"types": "./dist/cdk/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
7
18
|
"files": [
|
|
8
19
|
"dist"
|
|
9
20
|
],
|
|
@@ -19,14 +30,16 @@
|
|
|
19
30
|
"keywords": [
|
|
20
31
|
"venturekit",
|
|
21
32
|
"saas",
|
|
22
|
-
"
|
|
33
|
+
"cdk",
|
|
23
34
|
"aws",
|
|
24
|
-
"infrastructure"
|
|
35
|
+
"infrastructure",
|
|
36
|
+
"cloudformation"
|
|
25
37
|
],
|
|
26
38
|
"license": "Apache-2.0",
|
|
27
39
|
"dependencies": {
|
|
28
|
-
"@venturekit/core": "0.0.0-dev.
|
|
29
|
-
"
|
|
40
|
+
"@venturekit/core": "0.0.0-dev.20260312002737",
|
|
41
|
+
"aws-cdk-lib": "^2.170.0",
|
|
42
|
+
"constructs": "^10.4.0"
|
|
30
43
|
},
|
|
31
44
|
"devDependencies": {
|
|
32
45
|
"@types/node": "^20.10.0",
|
package/dist/constructs/api.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
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;
|
|
77
|
-
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/constructs/api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kBAAkB;IAClB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAChE,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,GAAG;IAC9D,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,SAAS,CAUZ;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAKA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EAAE,EACzB,QAAQ,GAAE,MAAW,GACpB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,EAAE,CAInE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CAAC,QAAQ,CAAC,GAAG,IAAI,CAenF;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAY1D"}
|
package/dist/constructs/api.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
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=api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/constructs/api.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAmCH,4CAgBC;AAKD,oDAQC;AAKD,gDAYC;AAWD,wCAIC;AAKD,4CAeC;AAUD,gDAYC;AA1GD;;GAEG;AACH,SAAgB,gBAAgB,CAAC,IAA4B;IAO3D,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAE5B,OAAO;QACL,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,UAAU;KACpC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAAC,MAAoB;IAIvD,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,iBAAiB;QAC9B,KAAK,EAAE,MAAM,CAAC,kBAAkB;KACjC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAChC,MAAyB,EACzB,WAAmB,EAAE;IAErB,MAAM,SAAS,GAA2B,EAAE,CAAC;IAE7C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,MAAM,IAAI,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACvD,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;IACjC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAAC,SAAiB;IAC9C,6DAA6D;IAC7D,0CAA0C;IAC1C,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAAC,QAAgB;IAC/C,MAAM,SAAS,GAA8C;QAC3D,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,QAAQ;KACnB,CAAC;IAEF,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAClE,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC;AACrC,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,OAAe;IAChD,OAAO,GAAG,GAAG,OAAO;SACjB,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,OAAO,CAAC,EAAE;QACb,6BAA6B;QAC7B,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACrD,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QACrC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constructs/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
package/dist/constructs/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
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.js"), exports);
|
|
21
|
-
__exportStar(require("./api.js"), exports);
|
|
22
|
-
__exportStar(require("./lambda.js"), exports);
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constructs/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B"}
|
|
@@ -1,48 +0,0 @@
|
|
|
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;
|
|
48
|
-
//# sourceMappingURL=lambda.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lambda.d.ts","sourceRoot":"","sources":["../../src/constructs/lambda.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,4BAA4B;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EACvB,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GACpC;IACD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAQA;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACjC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAU/D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAElF"}
|
|
@@ -1,50 +0,0 @@
|
|
|
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=lambda.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lambda.js","sourceRoot":"","sources":["../../src/constructs/lambda.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA2BH,gDAiBC;AAKD,0DASC;AAKD,0CAUC;AAKD,wDAEC;AAxDD;;GAEG;AACH,SAAgB,kBAAkB,CAChC,MAAuB,EACvB,SAAqC;IAQrC,OAAO;QACL,MAAM,EAAE,GAAG,SAAS,EAAE,QAAQ,IAAI,MAAM,CAAC,QAAQ,KAAK;QACtD,OAAO,EAAE,GAAG,SAAS,EAAE,UAAU,IAAI,MAAM,CAAC,UAAU,UAAU;QAChE,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,OAAO,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;KACtD,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,uBAAuB,CACrC,OAA+B,EAC/B,SAAkC;IAElC,OAAO;QACL,YAAY,EAAE,sBAAsB;QACpC,GAAG,OAAO;QACV,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,MAAuB;IACrD,MAAM,IAAI,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAErC,+CAA+C;IAC/C,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACpG,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CACpD,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAC5D,CAAC;IAEF,OAAO,GAAG,OAAO,OAAO,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,SAAgB,sBAAsB,CAAC,MAAuB;IAC5D,OAAO,MAAM,CAAC,mBAAmB,CAAC;AACpC,CAAC"}
|
package/dist/constructs/vpc.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
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;
|
|
38
|
-
//# sourceMappingURL=vpc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vpc.d.ts","sourceRoot":"","sources":["../../src/constructs/vpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,aAAa;IACb,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,yBAAyB;IACzB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,6CAA6C;IAC7C,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,YAAY,GACnB;IACD,GAAG,EAAE,SAAS,GAAG,KAAK,GAAG,SAAS,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;CAClB,CAKA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAEvD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAEhE"}
|