@ts-cloud/core 0.2.3 → 0.2.4
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/advanced-features.test.d.ts +1 -0
- package/dist/aws/cloudformation.d.ts +136 -0
- package/dist/aws/cloudfront.d.ts +45 -0
- package/dist/aws/credentials.d.ts +77 -0
- package/dist/aws/credentials.test.d.ts +4 -0
- package/dist/aws/index.d.ts +10 -0
- package/dist/aws/s3.d.ts +256 -0
- package/dist/aws/s3.test.d.ts +4 -0
- package/dist/aws/signature.d.ts +142 -0
- package/dist/aws/signature.test.d.ts +4 -0
- package/dist/backup/disaster-recovery.d.ts +140 -0
- package/dist/backup/disaster-recovery.test.d.ts +1 -0
- package/dist/backup/index.d.ts +8 -0
- package/dist/backup/manager.d.ts +172 -0
- package/dist/backup/manager.test.d.ts +1 -0
- package/dist/cicd/circleci.d.ts +50 -0
- package/dist/cicd/github-actions.d.ts +62 -0
- package/dist/cicd/gitlab-ci.d.ts +50 -0
- package/dist/cicd/index.d.ts +7 -0
- package/dist/cli/history.d.ts +137 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/progress.d.ts +193 -0
- package/dist/cli/repl.d.ts +148 -0
- package/dist/cli/suggestions.d.ts +74 -0
- package/dist/cli/table.d.ts +73 -0
- package/dist/cli/table.test.d.ts +1 -0
- package/dist/cloudformation/builder.d.ts +93 -0
- package/dist/cloudformation/builder.test.d.ts +4 -0
- package/dist/cloudformation/builders/api-gateway.d.ts +30 -0
- package/dist/cloudformation/builders/cache.d.ts +35 -0
- package/dist/cloudformation/builders/cdn.d.ts +34 -0
- package/dist/cloudformation/builders/compute.d.ts +68 -0
- package/dist/cloudformation/builders/database.d.ts +61 -0
- package/dist/cloudformation/builders/functions.d.ts +32 -0
- package/dist/cloudformation/builders/messaging.d.ts +17 -0
- package/dist/cloudformation/builders/monitoring.d.ts +39 -0
- package/dist/cloudformation/builders/network.d.ts +14 -0
- package/dist/cloudformation/builders/queue.d.ts +16 -0
- package/dist/cloudformation/builders/security.d.ts +31 -0
- package/dist/cloudformation/builders/storage.d.ts +36 -0
- package/dist/cloudformation/index.d.ts +10 -0
- package/dist/cloudformation/types.d.ts +200 -0
- package/dist/compliance/aws-config.d.ts +175 -0
- package/dist/compliance/cloudtrail.d.ts +132 -0
- package/dist/compliance/compliance.test.d.ts +1 -0
- package/dist/compliance/guardduty.d.ts +176 -0
- package/dist/compliance/index.d.ts +12 -0
- package/dist/compliance/security-hub.d.ts +178 -0
- package/dist/containers/build-optimization.d.ts +155 -0
- package/dist/containers/containers.test.d.ts +1 -0
- package/dist/containers/image-scanning.d.ts +144 -0
- package/dist/containers/index.d.ts +8 -0
- package/dist/containers/registry.d.ts +129 -0
- package/dist/containers/service-mesh.d.ts +254 -0
- package/dist/database/database.test.d.ts +1 -0
- package/dist/database/index.d.ts +8 -0
- package/dist/database/migrations.d.ts +153 -0
- package/dist/database/performance.d.ts +219 -0
- package/dist/database/replicas.d.ts +218 -0
- package/dist/database/users.d.ts +165 -0
- package/dist/dependency-graph.d.ts +37 -0
- package/dist/deployment/ab-testing.d.ts +165 -0
- package/dist/deployment/blue-green.d.ts +140 -0
- package/dist/deployment/canary.d.ts +165 -0
- package/dist/deployment/deployment.test.d.ts +1 -0
- package/dist/deployment/index.d.ts +12 -0
- package/dist/deployment/progressive.d.ts +50 -0
- package/dist/dns/dns.test.d.ts +1 -0
- package/dist/dns/dnssec.d.ts +120 -0
- package/dist/dns/index.d.ts +7 -0
- package/dist/dns/resolver.d.ts +216 -0
- package/dist/dns/routing.d.ts +277 -0
- package/dist/email/advanced/analytics.d.ts +107 -0
- package/dist/email/advanced/index.d.ts +10 -0
- package/dist/email/advanced/rules.d.ts +131 -0
- package/dist/email/advanced/scheduling.d.ts +81 -0
- package/dist/email/advanced/search.d.ts +91 -0
- package/dist/email/advanced/shared-mailboxes.d.ts +109 -0
- package/dist/email/advanced/templates.d.ts +95 -0
- package/dist/email/advanced/threading.d.ts +65 -0
- package/dist/email/analytics.d.ts +189 -0
- package/dist/email/bounce-handling.d.ts +171 -0
- package/dist/email/email.test.d.ts +1 -0
- package/dist/email/handlers/__tests__/inbound.test.d.ts +1 -0
- package/dist/email/handlers/__tests__/outbound.test.d.ts +1 -0
- package/dist/email/handlers/converter.d.ts +11 -0
- package/dist/email/handlers/feedback.d.ts +11 -0
- package/dist/email/handlers/inbound.d.ts +13 -0
- package/dist/email/handlers/outbound.d.ts +13 -0
- package/dist/email/index.d.ts +10 -0
- package/dist/email/reputation.d.ts +133 -0
- package/dist/email/templates.d.ts +124 -0
- package/dist/errors/index.d.ts +177 -0
- package/dist/errors/index.test.d.ts +4 -0
- package/dist/health-checks/index.d.ts +35 -0
- package/dist/index.d.ts +15 -256
- package/dist/index.js +228 -80
- package/dist/intrinsic-functions.d.ts +77 -0
- package/dist/lambda/concurrency.d.ts +146 -0
- package/dist/lambda/destinations.d.ts +141 -0
- package/dist/lambda/dlq.d.ts +160 -0
- package/dist/lambda/index.d.ts +10 -0
- package/dist/lambda/lambda.test.d.ts +1 -0
- package/dist/lambda/layers.d.ts +117 -0
- package/dist/lambda/versions.d.ts +145 -0
- package/dist/lambda/vpc.d.ts +164 -0
- package/dist/local/config.d.ts +44 -0
- package/dist/local/index.d.ts +5 -0
- package/dist/local/mock-aws.d.ts +69 -0
- package/dist/modules/ai.d.ts +108 -0
- package/dist/modules/api.d.ts +157 -0
- package/dist/modules/auth.d.ts +262 -0
- package/dist/modules/cache.d.ts +108 -0
- package/dist/modules/cdn.d.ts +305 -0
- package/dist/modules/communication.d.ts +117 -0
- package/dist/modules/compute.d.ts +1376 -0
- package/dist/modules/database.d.ts +144 -0
- package/dist/modules/deployment.d.ts +372 -0
- package/dist/modules/dns.d.ts +143 -0
- package/dist/modules/email.d.ts +314 -0
- package/dist/modules/filesystem.d.ts +132 -0
- package/dist/modules/index.d.ts +31 -0
- package/dist/modules/messaging.d.ts +210 -0
- package/dist/modules/monitoring.d.ts +574 -0
- package/dist/modules/network.d.ts +148 -0
- package/dist/modules/parameter-store.d.ts +143 -0
- package/dist/modules/permissions.d.ts +245 -0
- package/dist/modules/phone.d.ts +125 -0
- package/dist/modules/queue.d.ts +411 -0
- package/dist/modules/redirects.d.ts +140 -0
- package/dist/modules/registry.d.ts +189 -0
- package/dist/modules/search.d.ts +135 -0
- package/dist/modules/secrets.d.ts +149 -0
- package/dist/modules/security.d.ts +219 -0
- package/dist/modules/sms.d.ts +130 -0
- package/dist/modules/storage.d.ts +344 -0
- package/dist/modules/workflow.d.ts +288 -0
- package/dist/multi-account/config.d.ts +166 -0
- package/dist/multi-account/index.d.ts +6 -0
- package/dist/multi-account/manager.d.ts +181 -0
- package/dist/multi-region/cross-region.d.ts +204 -0
- package/dist/multi-region/index.d.ts +7 -0
- package/dist/multi-region/manager.d.ts +136 -0
- package/dist/multi-region/regions.d.ts +98 -0
- package/dist/network-security/index.d.ts +55 -0
- package/dist/observability/index.d.ts +8 -0
- package/dist/observability/logs.d.ts +213 -0
- package/dist/observability/metrics.d.ts +187 -0
- package/dist/observability/observability.test.d.ts +1 -0
- package/dist/observability/synthetics.d.ts +189 -0
- package/dist/observability/xray.d.ts +193 -0
- package/dist/phone/advanced/analytics.d.ts +83 -0
- package/dist/phone/advanced/callbacks.d.ts +67 -0
- package/dist/phone/advanced/index.d.ts +7 -0
- package/dist/phone/advanced/ivr-builder.d.ts +130 -0
- package/dist/phone/advanced/recording.d.ts +62 -0
- package/dist/phone/handlers/__tests__/incoming-call.test.d.ts +1 -0
- package/dist/phone/handlers/incoming-call.d.ts +10 -0
- package/dist/phone/handlers/missed-call.d.ts +9 -0
- package/dist/phone/handlers/voicemail.d.ts +10 -0
- package/dist/phone/index.d.ts +5 -0
- package/dist/presets/api-backend.d.ts +11 -0
- package/dist/presets/data-pipeline.d.ts +11 -0
- package/dist/presets/extend.d.ts +194 -0
- package/dist/presets/extend.test.d.ts +4 -0
- package/dist/presets/fullstack-app.d.ts +12 -0
- package/dist/presets/index.d.ts +13 -0
- package/dist/presets/jamstack.d.ts +12 -0
- package/dist/presets/microservices.d.ts +18 -0
- package/dist/presets/ml-api.d.ts +13 -0
- package/dist/presets/nodejs-server.d.ts +14 -0
- package/dist/presets/nodejs-serverless.d.ts +14 -0
- package/dist/presets/realtime-app.d.ts +11 -0
- package/dist/presets/static-site.d.ts +12 -0
- package/dist/presets/traditional-web-app.d.ts +16 -0
- package/dist/presets/wordpress.d.ts +12 -0
- package/dist/preview/github.d.ts +32 -0
- package/dist/preview/github.test.d.ts +1 -0
- package/dist/preview/index.d.ts +10 -0
- package/dist/preview/manager.d.ts +101 -0
- package/dist/preview/manager.test.d.ts +1 -0
- package/dist/preview/notifications.d.ts +89 -0
- package/dist/preview/notifications.test.d.ts +1 -0
- package/dist/queue/batch-processing.d.ts +138 -0
- package/dist/queue/dlq-monitoring.d.ts +143 -0
- package/dist/queue/fifo.d.ts +131 -0
- package/dist/queue/index.d.ts +8 -0
- package/dist/queue/management.d.ts +162 -0
- package/dist/queue/queue.test.d.ts +1 -0
- package/dist/resource-mgmt/index.d.ts +44 -0
- package/dist/resource-naming.d.ts +26 -0
- package/dist/s3/index.d.ts +227 -0
- package/dist/schema/index.d.ts +12 -0
- package/dist/security/certificate-manager.d.ts +184 -0
- package/dist/security/index.d.ts +8 -0
- package/dist/security/scanning.d.ts +196 -0
- package/dist/security/secrets-manager.d.ts +204 -0
- package/dist/security/secrets-rotation.d.ts +167 -0
- package/dist/security/security.test.d.ts +1 -0
- package/dist/sms/advanced/ab-testing.d.ts +74 -0
- package/dist/sms/advanced/analytics.d.ts +75 -0
- package/dist/sms/advanced/campaigns.d.ts +96 -0
- package/dist/sms/advanced/chatbot.d.ts +67 -0
- package/dist/sms/advanced/index.d.ts +9 -0
- package/dist/sms/advanced/link-tracking.d.ts +60 -0
- package/dist/sms/advanced/mms.d.ts +60 -0
- package/dist/sms/handlers/__tests__/send.test.d.ts +1 -0
- package/dist/sms/handlers/delivery-status.d.ts +10 -0
- package/dist/sms/handlers/receive.d.ts +10 -0
- package/dist/sms/handlers/send.d.ts +10 -0
- package/dist/sms/index.d.ts +5 -0
- package/dist/stack-diff.d.ts +38 -0
- package/dist/static-site/index.d.ts +49 -0
- package/dist/template-builder.d.ts +42 -0
- package/dist/template-validator.d.ts +28 -0
- package/dist/types.d.ts +2514 -0
- package/dist/utils/cache.d.ts +117 -0
- package/dist/utils/diff.d.ts +52 -0
- package/dist/utils/hash.d.ts +73 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/parallel.d.ts +78 -0
- package/dist/validators/credentials.d.ts +30 -0
- package/dist/validators/credentials.test.d.ts +4 -0
- package/dist/validators/quotas.d.ts +64 -0
- package/dist/validators/quotas.test.d.ts +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import type { CloudConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Extend a base preset with custom configuration
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const myPreset = extendPreset(
|
|
8
|
+
* createNodeJsServerPreset({ name: 'My App', slug: 'my-app' }),
|
|
9
|
+
* {
|
|
10
|
+
* infrastructure: {
|
|
11
|
+
* compute: {
|
|
12
|
+
* server: {
|
|
13
|
+
* instanceType: 't3.large', // Override instance type
|
|
14
|
+
* autoScaling: {
|
|
15
|
+
* max: 20, // Increase max instances
|
|
16
|
+
* },
|
|
17
|
+
* },
|
|
18
|
+
* },
|
|
19
|
+
* database: {
|
|
20
|
+
* postgres: {
|
|
21
|
+
* instanceClass: 'db.r6g.xlarge', // Upgrade database
|
|
22
|
+
* },
|
|
23
|
+
* },
|
|
24
|
+
* },
|
|
25
|
+
* }
|
|
26
|
+
* )
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function extendPreset(basePreset: Partial<CloudConfig>, extensions: Partial<CloudConfig>): Partial<CloudConfig>;
|
|
30
|
+
/**
|
|
31
|
+
* Compose multiple presets together
|
|
32
|
+
* Later presets override earlier ones
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const composedPreset = composePresets(
|
|
37
|
+
* createStaticSitePreset({ name: 'Site', slug: 'site', domain: 'example.com' }),
|
|
38
|
+
* createApiBackendPreset({ name: 'API', slug: 'api' }),
|
|
39
|
+
* {
|
|
40
|
+
* // Custom overrides
|
|
41
|
+
* infrastructure: {
|
|
42
|
+
* monitoring: {
|
|
43
|
+
* alarms: [{ metric: 'CustomMetric', threshold: 100 }],
|
|
44
|
+
* },
|
|
45
|
+
* },
|
|
46
|
+
* }
|
|
47
|
+
* )
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function composePresets(...presets: Partial<CloudConfig>[]): Partial<CloudConfig>;
|
|
51
|
+
/**
|
|
52
|
+
* Create a custom preset by extending an existing one
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const createMyCustomPreset = createPreset(
|
|
57
|
+
* (options) => createNodeJsServerPreset(options),
|
|
58
|
+
* {
|
|
59
|
+
* infrastructure: {
|
|
60
|
+
* monitoring: {
|
|
61
|
+
* dashboard: {
|
|
62
|
+
* name: 'custom-dashboard',
|
|
63
|
+
* widgets: [{ type: 'metric', metrics: ['CustomMetric'] }],
|
|
64
|
+
* },
|
|
65
|
+
* },
|
|
66
|
+
* },
|
|
67
|
+
* }
|
|
68
|
+
* )
|
|
69
|
+
*
|
|
70
|
+
* // Use it
|
|
71
|
+
* const myPreset = createMyCustomPreset({ name: 'App', slug: 'app' })
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function createPreset<TOptions extends Record<string, any>>(basePresetFn: (options: TOptions) => Partial<CloudConfig>, extensions: Partial<CloudConfig> | ((_config: Partial<CloudConfig>, _options: TOptions) => Partial<CloudConfig>)): (options: TOptions) => Partial<CloudConfig>;
|
|
75
|
+
/**
|
|
76
|
+
* Merge infrastructure configurations selectively
|
|
77
|
+
* Useful for adding specific infrastructure to existing presets
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const withRedis = mergeInfrastructure({
|
|
82
|
+
* cache: {
|
|
83
|
+
* redis: {
|
|
84
|
+
* nodeType: 'cache.t3.small',
|
|
85
|
+
* numCacheNodes: 2,
|
|
86
|
+
* },
|
|
87
|
+
* },
|
|
88
|
+
* })
|
|
89
|
+
*
|
|
90
|
+
* const myPreset = extendPreset(
|
|
91
|
+
* createApiBackendPreset({ name: 'API', slug: 'api' }),
|
|
92
|
+
* withRedis
|
|
93
|
+
* )
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare function mergeInfrastructure(infrastructure: Partial<CloudConfig['infrastructure']>): Partial<CloudConfig>;
|
|
97
|
+
/**
|
|
98
|
+
* Add monitoring configuration to any preset
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* const myPreset = extendPreset(
|
|
103
|
+
* createStaticSitePreset({ name: 'Site', slug: 'site' }),
|
|
104
|
+
* withMonitoring({
|
|
105
|
+
* dashboard: { name: 'my-dashboard' },
|
|
106
|
+
* alarms: [{ metric: 'Errors', threshold: 10 }],
|
|
107
|
+
* })
|
|
108
|
+
* )
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare function withMonitoring(monitoring: NonNullable<CloudConfig['infrastructure']>['monitoring']): Partial<CloudConfig>;
|
|
112
|
+
/**
|
|
113
|
+
* Add security configuration to any preset
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* const myPreset = extendPreset(
|
|
118
|
+
* createApiBackendPreset({ name: 'API', slug: 'api' }),
|
|
119
|
+
* withSecurity({
|
|
120
|
+
* waf: { enabled: true, rules: ['rateLimit', 'sqlInjection'] },
|
|
121
|
+
* })
|
|
122
|
+
* )
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export declare function withSecurity(security: NonNullable<CloudConfig['infrastructure']>['security']): Partial<CloudConfig>;
|
|
126
|
+
/**
|
|
127
|
+
* Add database configuration to any preset
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* const myPreset = extendPreset(
|
|
132
|
+
* createNodeJsServerlessPreset({ name: 'App', slug: 'app' }),
|
|
133
|
+
* withDatabase({
|
|
134
|
+
* postgres: {
|
|
135
|
+
* engine: 'postgres',
|
|
136
|
+
* version: '15',
|
|
137
|
+
* instanceClass: 'db.t3.medium',
|
|
138
|
+
* multiAZ: true,
|
|
139
|
+
* },
|
|
140
|
+
* })
|
|
141
|
+
* )
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export declare function withDatabase(databases: NonNullable<CloudConfig['infrastructure']>['databases']): Partial<CloudConfig>;
|
|
145
|
+
/**
|
|
146
|
+
* Add cache configuration to any preset
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* const myPreset = extendPreset(
|
|
151
|
+
* createApiBackendPreset({ name: 'API', slug: 'api' }),
|
|
152
|
+
* withCache({
|
|
153
|
+
* redis: {
|
|
154
|
+
* nodeType: 'cache.t3.small',
|
|
155
|
+
* numCacheNodes: 2,
|
|
156
|
+
* },
|
|
157
|
+
* })
|
|
158
|
+
* )
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
export declare function withCache(cache: NonNullable<CloudConfig['infrastructure']>['cache']): Partial<CloudConfig>;
|
|
162
|
+
/**
|
|
163
|
+
* Add CDN configuration to any preset
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```typescript
|
|
167
|
+
* const myPreset = extendPreset(
|
|
168
|
+
* createNodeJsServerPreset({ name: 'App', slug: 'app' }),
|
|
169
|
+
* withCDN({
|
|
170
|
+
* enabled: true,
|
|
171
|
+
* compress: true,
|
|
172
|
+
* http3: true,
|
|
173
|
+
* })
|
|
174
|
+
* )
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
export declare function withCDN(cdn: NonNullable<CloudConfig['infrastructure']>['cdn']): Partial<CloudConfig>;
|
|
178
|
+
/**
|
|
179
|
+
* Add queue configuration to any preset
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* const myPreset = extendPreset(
|
|
184
|
+
* createNodeJsServerlessPreset({ name: 'App', slug: 'app' }),
|
|
185
|
+
* withQueue({
|
|
186
|
+
* jobs: {
|
|
187
|
+
* fifo: false,
|
|
188
|
+
* deadLetterQueue: true,
|
|
189
|
+
* },
|
|
190
|
+
* })
|
|
191
|
+
* )
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
export declare function withQueue(queues: NonNullable<CloudConfig['infrastructure']>['queues']): Partial<CloudConfig>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CloudConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Full Stack App Preset
|
|
4
|
+
* Perfect for: Complete web applications with frontend and API
|
|
5
|
+
* Includes: S3 + CloudFront (frontend) + ECS Fargate (API) + RDS + Redis
|
|
6
|
+
*/
|
|
7
|
+
export declare function createFullStackAppPreset(options: {
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
domain: string;
|
|
11
|
+
apiSubdomain?: string;
|
|
12
|
+
}): Partial<CloudConfig>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { createStaticSitePreset } from './static-site';
|
|
2
|
+
export { createNodeJsServerPreset } from './nodejs-server';
|
|
3
|
+
export { createNodeJsServerlessPreset } from './nodejs-serverless';
|
|
4
|
+
export { createFullStackAppPreset } from './fullstack-app';
|
|
5
|
+
export { createApiBackendPreset } from './api-backend';
|
|
6
|
+
export { createWordPressPreset } from './wordpress';
|
|
7
|
+
export { createJamstackPreset } from './jamstack';
|
|
8
|
+
export { createMicroservicesPreset } from './microservices';
|
|
9
|
+
export { createRealtimeAppPreset } from './realtime-app';
|
|
10
|
+
export { createDataPipelinePreset } from './data-pipeline';
|
|
11
|
+
export { createMLApiPreset } from './ml-api';
|
|
12
|
+
export { createTraditionalWebAppPreset } from './traditional-web-app';
|
|
13
|
+
export { extendPreset, composePresets, createPreset, mergeInfrastructure, withMonitoring, withSecurity, withDatabase, withCache, withCDN, withQueue, } from './extend';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CloudConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Jamstack Site Preset
|
|
4
|
+
* Perfect for: Modern static sites with API routes, Next.js, Astro, SvelteKit
|
|
5
|
+
* Includes: S3 + CloudFront + Lambda@Edge for SSR/ISR
|
|
6
|
+
*/
|
|
7
|
+
export declare function createJamstackPreset(options: {
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
domain: string;
|
|
11
|
+
apiDomain?: string;
|
|
12
|
+
}): Partial<CloudConfig>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CloudConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Microservices Preset
|
|
4
|
+
* Perfect for: Service-oriented architectures, distributed systems
|
|
5
|
+
* Includes: Multiple ECS services + API Gateway + Service Discovery + DynamoDB
|
|
6
|
+
*/
|
|
7
|
+
export declare function createMicroservicesPreset(options: {
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
domain: string;
|
|
11
|
+
services: Array<{
|
|
12
|
+
name: string;
|
|
13
|
+
port: number;
|
|
14
|
+
cpu?: string;
|
|
15
|
+
memory?: string;
|
|
16
|
+
desiredCount?: number;
|
|
17
|
+
}>;
|
|
18
|
+
}): Partial<CloudConfig>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CloudConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Machine Learning API Preset
|
|
4
|
+
* Perfect for: ML inference APIs, AI-powered applications
|
|
5
|
+
* Includes: SageMaker + API Gateway + Lambda + S3
|
|
6
|
+
*/
|
|
7
|
+
export declare function createMLApiPreset(options: {
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
domain?: string;
|
|
11
|
+
modelS3Path?: string;
|
|
12
|
+
instanceType?: string;
|
|
13
|
+
}): Partial<CloudConfig>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CloudConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Node.js Server Preset
|
|
4
|
+
* Perfect for: Traditional Node.js applications, API servers
|
|
5
|
+
* Includes: EC2 instances + ALB + Auto Scaling + RDS + Redis
|
|
6
|
+
*/
|
|
7
|
+
export declare function createNodeJsServerPreset(options: {
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
domain?: string;
|
|
11
|
+
instanceType?: string;
|
|
12
|
+
minInstances?: number;
|
|
13
|
+
maxInstances?: number;
|
|
14
|
+
}): Partial<CloudConfig>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CloudConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Node.js Serverless Preset
|
|
4
|
+
* Perfect for: Serverless APIs, microservices
|
|
5
|
+
* Includes: ECS Fargate + ALB + DynamoDB + Lambda functions
|
|
6
|
+
*/
|
|
7
|
+
export declare function createNodeJsServerlessPreset(options: {
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
domain?: string;
|
|
11
|
+
taskCpu?: string;
|
|
12
|
+
taskMemory?: string;
|
|
13
|
+
desiredCount?: number;
|
|
14
|
+
}): Partial<CloudConfig>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CloudConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Real-time App Preset
|
|
4
|
+
* Perfect for: Chat apps, collaborative tools, live dashboards, gaming backends
|
|
5
|
+
* Includes: API Gateway WebSocket + Lambda + DynamoDB Streams
|
|
6
|
+
*/
|
|
7
|
+
export declare function createRealtimeAppPreset(options: {
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
domain?: string;
|
|
11
|
+
}): Partial<CloudConfig>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CloudConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Static Site Preset
|
|
4
|
+
* Perfect for: Static websites, SPAs, documentation sites
|
|
5
|
+
* Includes: S3 bucket + CloudFront CDN
|
|
6
|
+
*/
|
|
7
|
+
export declare function createStaticSitePreset(options: {
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
domain?: string;
|
|
11
|
+
subdomain?: string;
|
|
12
|
+
}): Partial<CloudConfig>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CloudConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Traditional Web App Preset
|
|
4
|
+
* Perfect for: Server-rendered web apps, CMS platforms, admin panels
|
|
5
|
+
* Includes: EC2 + ALB + RDS + Redis + EFS (for session storage and uploads)
|
|
6
|
+
*/
|
|
7
|
+
export declare function createTraditionalWebAppPreset(options: {
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
domain?: string;
|
|
11
|
+
instanceType?: string;
|
|
12
|
+
minInstances?: number;
|
|
13
|
+
maxInstances?: number;
|
|
14
|
+
databaseEngine?: 'mysql' | 'postgres';
|
|
15
|
+
sessionStore?: 'redis' | 'database';
|
|
16
|
+
}): Partial<CloudConfig>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CloudConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* WordPress Preset
|
|
4
|
+
* Perfect for: WordPress sites, blogs, CMS-based sites
|
|
5
|
+
* Includes: EC2 + RDS MySQL + EFS + CloudFront
|
|
6
|
+
*/
|
|
7
|
+
export declare function createWordPressPreset(options: {
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
domain: string;
|
|
11
|
+
instanceType?: string;
|
|
12
|
+
}): Partial<CloudConfig>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub integration for preview environments
|
|
3
|
+
* Generates GitHub Actions workflows for automated preview deployments
|
|
4
|
+
*/
|
|
5
|
+
export interface GitHubWorkflowOptions {
|
|
6
|
+
workflowName?: string;
|
|
7
|
+
trigger?: 'pull_request' | 'push' | 'workflow_dispatch';
|
|
8
|
+
branches?: string[];
|
|
9
|
+
awsRegion?: string;
|
|
10
|
+
awsRole?: string;
|
|
11
|
+
configFile?: string;
|
|
12
|
+
ttl?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Generate GitHub Actions workflow for preview environments
|
|
16
|
+
*/
|
|
17
|
+
export declare function generatePreviewWorkflow(options?: GitHubWorkflowOptions): string;
|
|
18
|
+
/**
|
|
19
|
+
* Generate scheduled cleanup workflow
|
|
20
|
+
*/
|
|
21
|
+
export declare function generateCleanupWorkflow(options?: {
|
|
22
|
+
schedule?: string;
|
|
23
|
+
maxAge?: number;
|
|
24
|
+
keepCount?: number;
|
|
25
|
+
}): string;
|
|
26
|
+
/**
|
|
27
|
+
* Generate cost report workflow
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateCostReportWorkflow(options?: {
|
|
30
|
+
schedule?: string;
|
|
31
|
+
webhookUrl?: string;
|
|
32
|
+
}): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preview Environments
|
|
3
|
+
* Ephemeral environments for PR/branch previews
|
|
4
|
+
*/
|
|
5
|
+
export { PreviewEnvironmentManager, previewManager, } from './manager';
|
|
6
|
+
export type { PreviewEnvironment, PreviewEnvironmentOptions, PreviewCleanupOptions, } from './manager';
|
|
7
|
+
export { generatePreviewWorkflow, generateCleanupWorkflow, generateCostReportWorkflow, } from './github';
|
|
8
|
+
export type { GitHubWorkflowOptions } from './github';
|
|
9
|
+
export { PreviewNotificationService, previewNotifications, } from './notifications';
|
|
10
|
+
export type { NotificationChannel, SlackConfig, DiscordConfig, EmailConfig, WebhookConfig, NotificationEvent, } from './notifications';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preview Environment Manager
|
|
3
|
+
* Manages ephemeral environments for PR previews
|
|
4
|
+
*/
|
|
5
|
+
import type { CloudConfig } from '../types';
|
|
6
|
+
export interface PreviewEnvironment {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
branch: string;
|
|
10
|
+
pr?: number;
|
|
11
|
+
commitSha: string;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
expiresAt: Date;
|
|
14
|
+
url?: string;
|
|
15
|
+
status: 'creating' | 'active' | 'failed' | 'destroying' | 'destroyed';
|
|
16
|
+
stackName: string;
|
|
17
|
+
region: string;
|
|
18
|
+
resources: string[];
|
|
19
|
+
cost?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface PreviewEnvironmentOptions {
|
|
22
|
+
branch: string;
|
|
23
|
+
pr?: number;
|
|
24
|
+
commitSha: string;
|
|
25
|
+
ttl?: number;
|
|
26
|
+
baseConfig: CloudConfig;
|
|
27
|
+
region?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface PreviewCleanupOptions {
|
|
30
|
+
maxAge?: number;
|
|
31
|
+
keepCount?: number;
|
|
32
|
+
dryRun?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Preview Environment Manager
|
|
36
|
+
*/
|
|
37
|
+
export declare class PreviewEnvironmentManager {
|
|
38
|
+
private environments;
|
|
39
|
+
/**
|
|
40
|
+
* Create a new preview environment
|
|
41
|
+
*/
|
|
42
|
+
createPreviewEnvironment(options: PreviewEnvironmentOptions): Promise<PreviewEnvironment>;
|
|
43
|
+
/**
|
|
44
|
+
* Destroy a preview environment
|
|
45
|
+
*/
|
|
46
|
+
destroyPreviewEnvironment(id: string): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Get preview environment by ID
|
|
49
|
+
*/
|
|
50
|
+
getPreviewEnvironment(id: string): PreviewEnvironment | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Get preview environment by branch
|
|
53
|
+
*/
|
|
54
|
+
getPreviewEnvironmentByBranch(branch: string): PreviewEnvironment | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Get preview environment by PR number
|
|
57
|
+
*/
|
|
58
|
+
getPreviewEnvironmentByPR(pr: number): PreviewEnvironment | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* List all preview environments
|
|
61
|
+
*/
|
|
62
|
+
listPreviewEnvironments(): PreviewEnvironment[];
|
|
63
|
+
/**
|
|
64
|
+
* List active preview environments
|
|
65
|
+
*/
|
|
66
|
+
listActivePreviewEnvironments(): PreviewEnvironment[];
|
|
67
|
+
/**
|
|
68
|
+
* Clean up expired preview environments
|
|
69
|
+
*/
|
|
70
|
+
cleanupExpiredEnvironments(options?: PreviewCleanupOptions): Promise<{
|
|
71
|
+
destroyed: string[];
|
|
72
|
+
failed: string[];
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Update preview environment from new commit
|
|
76
|
+
*/
|
|
77
|
+
updatePreviewEnvironment(id: string, commitSha: string): Promise<PreviewEnvironment>;
|
|
78
|
+
/**
|
|
79
|
+
* Get cost estimate for preview environments
|
|
80
|
+
*/
|
|
81
|
+
getPreviewEnvironmentsCost(): Promise<{
|
|
82
|
+
total: number;
|
|
83
|
+
byEnvironment: Record<string, number>;
|
|
84
|
+
}>;
|
|
85
|
+
/**
|
|
86
|
+
* Generate preview environment ID
|
|
87
|
+
*/
|
|
88
|
+
private generatePreviewId;
|
|
89
|
+
/**
|
|
90
|
+
* Generate preview environment name
|
|
91
|
+
*/
|
|
92
|
+
private generatePreviewName;
|
|
93
|
+
/**
|
|
94
|
+
* Create modified config for preview environment
|
|
95
|
+
*/
|
|
96
|
+
private createPreviewConfig;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Global preview environment manager instance
|
|
100
|
+
*/
|
|
101
|
+
export declare const previewManager: PreviewEnvironmentManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preview environment notifications
|
|
3
|
+
* Send notifications to Slack, Discord, email, etc. when preview environments are created/destroyed
|
|
4
|
+
*/
|
|
5
|
+
import type { PreviewEnvironment } from './manager';
|
|
6
|
+
export interface NotificationChannel {
|
|
7
|
+
type: 'slack' | 'discord' | 'email' | 'webhook';
|
|
8
|
+
config: SlackConfig | DiscordConfig | EmailConfig | WebhookConfig;
|
|
9
|
+
}
|
|
10
|
+
export interface SlackConfig {
|
|
11
|
+
webhookUrl: string;
|
|
12
|
+
channel?: string;
|
|
13
|
+
username?: string;
|
|
14
|
+
iconEmoji?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DiscordConfig {
|
|
17
|
+
webhookUrl: string;
|
|
18
|
+
username?: string;
|
|
19
|
+
avatarUrl?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface EmailConfig {
|
|
22
|
+
from: string;
|
|
23
|
+
to: string[];
|
|
24
|
+
smtpHost: string;
|
|
25
|
+
smtpPort: number;
|
|
26
|
+
smtpUser?: string;
|
|
27
|
+
smtpPassword?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface WebhookConfig {
|
|
30
|
+
url: string;
|
|
31
|
+
method?: 'POST' | 'GET';
|
|
32
|
+
headers?: Record<string, string>;
|
|
33
|
+
}
|
|
34
|
+
export interface NotificationEvent {
|
|
35
|
+
type: 'created' | 'updated' | 'destroyed' | 'failed' | 'expired';
|
|
36
|
+
environment: PreviewEnvironment;
|
|
37
|
+
timestamp: Date;
|
|
38
|
+
metadata?: Record<string, any>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Preview environment notification service
|
|
42
|
+
*/
|
|
43
|
+
export declare class PreviewNotificationService {
|
|
44
|
+
private channels;
|
|
45
|
+
/**
|
|
46
|
+
* Add notification channel
|
|
47
|
+
*/
|
|
48
|
+
addChannel(channel: NotificationChannel): void;
|
|
49
|
+
/**
|
|
50
|
+
* Remove notification channel
|
|
51
|
+
*/
|
|
52
|
+
removeChannel(type: NotificationChannel['type']): void;
|
|
53
|
+
/**
|
|
54
|
+
* Send notification to all channels
|
|
55
|
+
*/
|
|
56
|
+
notify(event: NotificationEvent): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Send notification to specific channel
|
|
59
|
+
*/
|
|
60
|
+
private sendToChannel;
|
|
61
|
+
/**
|
|
62
|
+
* Send notification to Slack
|
|
63
|
+
*/
|
|
64
|
+
private sendToSlack;
|
|
65
|
+
/**
|
|
66
|
+
* Format Slack message
|
|
67
|
+
*/
|
|
68
|
+
private formatSlackMessage;
|
|
69
|
+
/**
|
|
70
|
+
* Send notification to Discord
|
|
71
|
+
*/
|
|
72
|
+
private sendToDiscord;
|
|
73
|
+
/**
|
|
74
|
+
* Format Discord message
|
|
75
|
+
*/
|
|
76
|
+
private formatDiscordMessage;
|
|
77
|
+
/**
|
|
78
|
+
* Send notification via email
|
|
79
|
+
*/
|
|
80
|
+
private sendToEmail;
|
|
81
|
+
/**
|
|
82
|
+
* Send notification to custom webhook
|
|
83
|
+
*/
|
|
84
|
+
private sendToWebhook;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Global notification service instance
|
|
88
|
+
*/
|
|
89
|
+
export declare const previewNotifications: PreviewNotificationService;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|