@stacksjs/ts-cloud-core 0.1.6 → 0.1.7
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 +0 -0
- package/dist/aws/cloudformation.d.ts +69 -0
- package/dist/aws/cloudfront.d.ts +21 -0
- package/dist/aws/credentials.d.ts +66 -0
- package/dist/aws/credentials.test.d.ts +0 -0
- package/dist/aws/index.d.ts +73 -0
- package/dist/aws/s3.d.ts +130 -0
- package/dist/aws/s3.test.d.ts +0 -0
- package/dist/aws/signature.d.ts +101 -0
- package/dist/aws/signature.test.d.ts +0 -0
- package/dist/backup/disaster-recovery.d.ts +98 -0
- package/dist/backup/disaster-recovery.test.d.ts +0 -0
- package/dist/backup/index.d.ts +24 -0
- package/dist/backup/manager.d.ts +112 -0
- package/dist/backup/manager.test.d.ts +0 -0
- package/dist/cicd/circleci.d.ts +47 -0
- package/dist/cicd/github-actions.d.ts +55 -0
- package/dist/cicd/gitlab-ci.d.ts +46 -0
- package/dist/cicd/index.d.ts +3 -0
- package/dist/cli/history.d.ts +66 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/progress.d.ts +97 -0
- package/dist/cli/repl.d.ts +76 -0
- package/dist/cli/suggestions.d.ts +67 -0
- package/dist/cli/table.d.ts +70 -0
- package/dist/cli/table.test.d.ts +0 -0
- package/dist/cloudformation/builder.d.ts +59 -0
- package/dist/cloudformation/builder.test.d.ts +0 -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 +66 -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 +36 -0
- package/dist/cloudformation/builders/network.d.ts +14 -0
- package/dist/cloudformation/builders/queue.d.ts +8 -0
- package/dist/cloudformation/builders/security.d.ts +31 -0
- package/dist/cloudformation/builders/storage.d.ts +8 -0
- package/dist/cloudformation/index.d.ts +24 -0
- package/dist/cloudformation/types.d.ts +132 -0
- package/dist/compliance/aws-config.d.ts +88 -0
- package/dist/compliance/cloudtrail.d.ts +96 -0
- package/dist/compliance/compliance.test.d.ts +0 -0
- package/dist/compliance/guardduty.d.ts +110 -0
- package/dist/compliance/index.d.ts +50 -0
- package/dist/compliance/security-hub.d.ts +110 -0
- package/dist/containers/build-optimization.d.ts +110 -0
- package/dist/containers/containers.test.d.ts +0 -0
- package/dist/containers/image-scanning.d.ts +96 -0
- package/dist/containers/index.d.ts +4 -0
- package/dist/containers/registry.d.ts +99 -0
- package/dist/containers/service-mesh.d.ts +206 -0
- package/dist/database/database.test.d.ts +0 -0
- package/dist/database/index.d.ts +4 -0
- package/dist/database/migrations.d.ts +102 -0
- package/dist/database/performance.d.ts +168 -0
- package/dist/database/replicas.d.ts +146 -0
- package/dist/database/users.d.ts +102 -0
- package/dist/dependency-graph.d.ts +19 -0
- package/dist/deployment/ab-testing.d.ts +114 -0
- package/dist/deployment/blue-green.d.ts +98 -0
- package/dist/deployment/canary.d.ts +103 -0
- package/dist/deployment/deployment.test.d.ts +0 -0
- package/dist/deployment/index.d.ts +45 -0
- package/dist/deployment/progressive.d.ts +34 -0
- package/dist/dns/dns.test.d.ts +0 -0
- package/dist/dns/dnssec.d.ts +75 -0
- package/dist/dns/index.d.ts +3 -0
- package/dist/dns/resolver.d.ts +150 -0
- package/dist/dns/routing.d.ts +217 -0
- package/dist/email/advanced/analytics.d.ts +78 -0
- package/dist/email/advanced/index.d.ts +7 -0
- package/dist/email/advanced/rules.d.ts +60 -0
- package/dist/email/advanced/scheduling.d.ts +63 -0
- package/dist/email/advanced/search.d.ts +76 -0
- package/dist/email/advanced/shared-mailboxes.d.ts +66 -0
- package/dist/email/advanced/templates.d.ts +39 -0
- package/dist/email/advanced/threading.d.ts +53 -0
- package/dist/email/analytics.d.ts +144 -0
- package/dist/email/bounce-handling.d.ts +120 -0
- package/dist/email/email.test.d.ts +0 -0
- package/dist/email/handlers/__tests__/inbound.test.d.ts +0 -0
- package/dist/email/handlers/__tests__/outbound.test.d.ts +0 -0
- package/dist/email/handlers/converter.d.ts +225 -0
- package/dist/email/handlers/feedback.d.ts +226 -0
- package/dist/email/handlers/inbound.d.ts +167 -0
- package/dist/email/handlers/outbound.d.ts +176 -0
- package/dist/email/index.d.ts +6 -0
- package/dist/email/reputation.d.ts +97 -0
- package/dist/email/templates.d.ts +82 -0
- package/dist/errors/index.d.ts +186 -0
- package/dist/errors/index.test.d.ts +0 -0
- package/dist/health-checks/index.d.ts +35 -0
- package/dist/index.d.ts +256 -0
- package/dist/index.js +63499 -0
- package/dist/intrinsic-functions.d.ts +37 -0
- package/dist/lambda/concurrency.d.ts +98 -0
- package/dist/lambda/destinations.d.ts +99 -0
- package/dist/lambda/dlq.d.ts +109 -0
- package/dist/lambda/index.d.ts +6 -0
- package/dist/lambda/lambda.test.d.ts +0 -0
- package/dist/lambda/layers.d.ts +81 -0
- package/dist/lambda/versions.d.ts +91 -0
- package/dist/lambda/vpc.d.ts +116 -0
- package/dist/local/config.d.ts +44 -0
- package/dist/local/index.d.ts +2 -0
- package/dist/local/mock-aws.d.ts +60 -0
- package/dist/modules/ai.d.ts +47 -0
- package/dist/modules/api.d.ts +98 -0
- package/dist/modules/auth.d.ts +165 -0
- package/dist/modules/cache.d.ts +73 -0
- package/dist/modules/cdn.d.ts +125 -0
- package/dist/modules/communication.d.ts +98 -0
- package/dist/modules/compute.d.ts +309 -0
- package/dist/modules/database.d.ts +105 -0
- package/dist/modules/deployment.d.ts +181 -0
- package/dist/modules/dns.d.ts +45 -0
- package/dist/modules/email.d.ts +217 -0
- package/dist/modules/filesystem.d.ts +94 -0
- package/dist/modules/index.d.ts +27 -0
- package/dist/modules/messaging.d.ts +108 -0
- package/dist/modules/monitoring.d.ts +127 -0
- package/dist/modules/network.d.ts +102 -0
- package/dist/modules/parameter-store.d.ts +33 -0
- package/dist/modules/permissions.d.ts +132 -0
- package/dist/modules/phone.d.ts +80 -0
- package/dist/modules/queue.d.ts +210 -0
- package/dist/modules/redirects.d.ts +59 -0
- package/dist/modules/registry.d.ts +73 -0
- package/dist/modules/search.d.ts +56 -0
- package/dist/modules/secrets.d.ts +80 -0
- package/dist/modules/security.d.ts +100 -0
- package/dist/modules/sms.d.ts +52 -0
- package/dist/modules/storage.d.ts +160 -0
- package/dist/modules/workflow.d.ts +205 -0
- package/dist/multi-account/config.d.ts +315 -0
- package/dist/multi-account/index.d.ts +2 -0
- package/dist/multi-account/manager.d.ts +100 -0
- package/dist/multi-region/cross-region.d.ts +114 -0
- package/dist/multi-region/index.d.ts +3 -0
- package/dist/multi-region/manager.d.ts +72 -0
- package/dist/multi-region/regions.d.ts +98 -0
- package/dist/network-security/index.d.ts +39 -0
- package/dist/observability/index.d.ts +4 -0
- package/dist/observability/logs.d.ts +129 -0
- package/dist/observability/metrics.d.ts +153 -0
- package/dist/observability/observability.test.d.ts +0 -0
- package/dist/observability/synthetics.d.ts +146 -0
- package/dist/observability/xray.d.ts +129 -0
- package/dist/phone/advanced/analytics.d.ts +66 -0
- package/dist/phone/advanced/callbacks.d.ts +50 -0
- package/dist/phone/advanced/index.d.ts +4 -0
- package/dist/phone/advanced/ivr-builder.d.ts +83 -0
- package/dist/phone/advanced/recording.d.ts +48 -0
- package/dist/phone/handlers/__tests__/incoming-call.test.d.ts +0 -0
- package/dist/phone/handlers/incoming-call.d.ts +115 -0
- package/dist/phone/handlers/missed-call.d.ts +114 -0
- package/dist/phone/handlers/voicemail.d.ts +177 -0
- package/dist/phone/index.d.ts +2 -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 +0 -0
- package/dist/presets/fullstack-app.d.ts +12 -0
- package/dist/presets/index.d.ts +24 -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 +0 -0
- package/dist/preview/index.d.ts +27 -0
- package/dist/preview/manager.d.ts +58 -0
- package/dist/preview/manager.test.d.ts +0 -0
- package/dist/preview/notifications.d.ts +55 -0
- package/dist/preview/notifications.test.d.ts +0 -0
- package/dist/queue/batch-processing.d.ts +87 -0
- package/dist/queue/dlq-monitoring.d.ts +95 -0
- package/dist/queue/fifo.d.ts +90 -0
- package/dist/queue/index.d.ts +4 -0
- package/dist/queue/management.d.ts +105 -0
- package/dist/queue/queue.test.d.ts +0 -0
- package/dist/resource-mgmt/index.d.ts +29 -0
- package/dist/resource-naming.d.ts +26 -0
- package/dist/s3/index.d.ts +173 -0
- package/dist/schema/index.d.ts +9 -0
- package/dist/security/certificate-manager.d.ts +121 -0
- package/dist/security/index.d.ts +4 -0
- package/dist/security/scanning.d.ts +147 -0
- package/dist/security/secrets-manager.d.ts +144 -0
- package/dist/security/secrets-rotation.d.ts +115 -0
- package/dist/security/security.test.d.ts +0 -0
- package/dist/sms/advanced/ab-testing.d.ts +54 -0
- package/dist/sms/advanced/analytics.d.ts +56 -0
- package/dist/sms/advanced/campaigns.d.ts +82 -0
- package/dist/sms/advanced/chatbot.d.ts +48 -0
- package/dist/sms/advanced/index.d.ts +6 -0
- package/dist/sms/advanced/link-tracking.d.ts +42 -0
- package/dist/sms/advanced/mms.d.ts +35 -0
- package/dist/sms/handlers/__tests__/send.test.d.ts +0 -0
- package/dist/sms/handlers/delivery-status.d.ts +131 -0
- package/dist/sms/handlers/receive.d.ts +160 -0
- package/dist/sms/handlers/send.d.ts +172 -0
- package/dist/sms/index.d.ts +2 -0
- package/dist/stack-diff.d.ts +34 -0
- package/dist/static-site/index.d.ts +49 -0
- package/dist/template-builder.d.ts +14 -0
- package/dist/template-validator.d.ts +24 -0
- package/dist/utils/cache.d.ts +55 -0
- package/dist/utils/diff.d.ts +48 -0
- package/dist/utils/hash.d.ts +58 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/parallel.d.ts +60 -0
- package/dist/validators/credentials.d.ts +23 -0
- package/dist/validators/credentials.test.d.ts +0 -0
- package/dist/validators/quotas.d.ts +60 -0
- package/dist/validators/quotas.test.d.ts +0 -0
- package/package.json +4 -4
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import type { CloudConfig } from '@stacksjs/ts-cloud-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>;
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CloudConfig } from '@stacksjs/ts-cloud-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,24 @@
|
|
|
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 {
|
|
14
|
+
extendPreset,
|
|
15
|
+
composePresets,
|
|
16
|
+
createPreset,
|
|
17
|
+
mergeInfrastructure,
|
|
18
|
+
withMonitoring,
|
|
19
|
+
withSecurity,
|
|
20
|
+
withDatabase,
|
|
21
|
+
withCache,
|
|
22
|
+
withCDN,
|
|
23
|
+
withQueue,
|
|
24
|
+
} from './extend';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CloudConfig } from '@stacksjs/ts-cloud-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 '@stacksjs/ts-cloud-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 '@stacksjs/ts-cloud-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 '@stacksjs/ts-cloud-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 '@stacksjs/ts-cloud-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 '@stacksjs/ts-cloud-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 '@stacksjs/ts-cloud-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 '@stacksjs/ts-cloud-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 '@stacksjs/ts-cloud-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
|
+
* Generate GitHub Actions workflow for preview environments
|
|
3
|
+
*/
|
|
4
|
+
export declare function generatePreviewWorkflow(options?: GitHubWorkflowOptions): string;
|
|
5
|
+
/**
|
|
6
|
+
* Generate scheduled cleanup workflow
|
|
7
|
+
*/
|
|
8
|
+
export declare function generateCleanupWorkflow(options?: {
|
|
9
|
+
schedule?: string
|
|
10
|
+
maxAge?: number
|
|
11
|
+
keepCount?: number
|
|
12
|
+
}): string;
|
|
13
|
+
/**
|
|
14
|
+
* Generate cost report workflow
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateCostReportWorkflow(options?: {
|
|
17
|
+
schedule?: string
|
|
18
|
+
webhookUrl?: string
|
|
19
|
+
}): string;
|
|
20
|
+
/**
|
|
21
|
+
* GitHub integration for preview environments
|
|
22
|
+
* Generates GitHub Actions workflows for automated preview deployments
|
|
23
|
+
*/
|
|
24
|
+
export declare interface GitHubWorkflowOptions {
|
|
25
|
+
workflowName?: string
|
|
26
|
+
trigger?: 'pull_request' | 'push' | 'workflow_dispatch'
|
|
27
|
+
branches?: string[]
|
|
28
|
+
awsRegion?: string
|
|
29
|
+
awsRole?: string
|
|
30
|
+
configFile?: string
|
|
31
|
+
ttl?: number
|
|
32
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
PreviewEnvironment,
|
|
3
|
+
PreviewEnvironmentOptions,
|
|
4
|
+
PreviewCleanupOptions,
|
|
5
|
+
} from './manager';
|
|
6
|
+
export type { GitHubWorkflowOptions } from './github';
|
|
7
|
+
export type {
|
|
8
|
+
NotificationChannel,
|
|
9
|
+
SlackConfig,
|
|
10
|
+
DiscordConfig,
|
|
11
|
+
EmailConfig,
|
|
12
|
+
WebhookConfig,
|
|
13
|
+
NotificationEvent,
|
|
14
|
+
} from './notifications';
|
|
15
|
+
export {
|
|
16
|
+
PreviewEnvironmentManager,
|
|
17
|
+
previewManager,
|
|
18
|
+
} from './manager';
|
|
19
|
+
export {
|
|
20
|
+
generatePreviewWorkflow,
|
|
21
|
+
generateCleanupWorkflow,
|
|
22
|
+
generateCostReportWorkflow,
|
|
23
|
+
} from './github';
|
|
24
|
+
export {
|
|
25
|
+
PreviewNotificationService,
|
|
26
|
+
previewNotifications,
|
|
27
|
+
} from './notifications';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { CloudConfig } from '@stacksjs/ts-cloud-types';
|
|
2
|
+
/**
|
|
3
|
+
* Global preview environment manager instance
|
|
4
|
+
*/
|
|
5
|
+
export declare const previewManager: PreviewEnvironmentManager;
|
|
6
|
+
export declare 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 declare interface PreviewEnvironmentOptions {
|
|
22
|
+
branch: string
|
|
23
|
+
pr?: number
|
|
24
|
+
commitSha: string
|
|
25
|
+
ttl?: number
|
|
26
|
+
baseConfig: CloudConfig
|
|
27
|
+
region?: string
|
|
28
|
+
}
|
|
29
|
+
export declare 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: Map<string, PreviewEnvironment>;
|
|
39
|
+
createPreviewEnvironment(options: PreviewEnvironmentOptions): Promise<PreviewEnvironment>;
|
|
40
|
+
destroyPreviewEnvironment(id: string): Promise<void>;
|
|
41
|
+
getPreviewEnvironment(id: string): PreviewEnvironment | undefined;
|
|
42
|
+
getPreviewEnvironmentByBranch(branch: string): PreviewEnvironment | undefined;
|
|
43
|
+
getPreviewEnvironmentByPR(pr: number): PreviewEnvironment | undefined;
|
|
44
|
+
listPreviewEnvironments(): PreviewEnvironment[];
|
|
45
|
+
listActivePreviewEnvironments(): PreviewEnvironment[];
|
|
46
|
+
cleanupExpiredEnvironments(options?: PreviewCleanupOptions): Promise<{
|
|
47
|
+
destroyed: string[]
|
|
48
|
+
failed: string[]
|
|
49
|
+
}>;
|
|
50
|
+
updatePreviewEnvironment(id: string, commitSha: string): Promise<PreviewEnvironment>;
|
|
51
|
+
getPreviewEnvironmentsCost(): Promise<{
|
|
52
|
+
total: number
|
|
53
|
+
byEnvironment: Record<string, number>
|
|
54
|
+
}>;
|
|
55
|
+
private generatePreviewId(branch: string, pr?: number, commitSha?: string): string;
|
|
56
|
+
private generatePreviewName(branch: string, pr?: number): string;
|
|
57
|
+
private createPreviewConfig(baseConfig: CloudConfig, name: string): CloudConfig;
|
|
58
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { PreviewEnvironment } from './manager';
|
|
2
|
+
/**
|
|
3
|
+
* Global notification service instance
|
|
4
|
+
*/
|
|
5
|
+
export declare const previewNotifications: PreviewNotificationService;
|
|
6
|
+
export declare interface NotificationChannel {
|
|
7
|
+
type: 'slack' | 'discord' | 'email' | 'webhook'
|
|
8
|
+
config: SlackConfig | DiscordConfig | EmailConfig | WebhookConfig
|
|
9
|
+
}
|
|
10
|
+
export declare interface SlackConfig {
|
|
11
|
+
webhookUrl: string
|
|
12
|
+
channel?: string
|
|
13
|
+
username?: string
|
|
14
|
+
iconEmoji?: string
|
|
15
|
+
}
|
|
16
|
+
export declare interface DiscordConfig {
|
|
17
|
+
webhookUrl: string
|
|
18
|
+
username?: string
|
|
19
|
+
avatarUrl?: string
|
|
20
|
+
}
|
|
21
|
+
export declare interface EmailConfig {
|
|
22
|
+
from: string
|
|
23
|
+
to: string[]
|
|
24
|
+
smtpHost: string
|
|
25
|
+
smtpPort: number
|
|
26
|
+
smtpUser?: string
|
|
27
|
+
smtpPassword?: string
|
|
28
|
+
}
|
|
29
|
+
export declare interface WebhookConfig {
|
|
30
|
+
url: string
|
|
31
|
+
method?: 'POST' | 'GET'
|
|
32
|
+
headers?: Record<string, string>
|
|
33
|
+
}
|
|
34
|
+
export declare 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: NotificationChannel[];
|
|
45
|
+
addChannel(channel: NotificationChannel): void;
|
|
46
|
+
removeChannel(type: NotificationChannel['type']): void;
|
|
47
|
+
notify(event: NotificationEvent): Promise<void>;
|
|
48
|
+
private sendToChannel(channel: NotificationChannel, event: NotificationEvent): Promise<void>;
|
|
49
|
+
private sendToSlack(config: SlackConfig, event: NotificationEvent): Promise<void>;
|
|
50
|
+
private formatSlackMessage(event: NotificationEvent, config: SlackConfig): any;
|
|
51
|
+
private sendToDiscord(config: DiscordConfig, event: NotificationEvent): Promise<void>;
|
|
52
|
+
private formatDiscordMessage(event: NotificationEvent, config: DiscordConfig): any;
|
|
53
|
+
private sendToEmail(config: EmailConfig, event: NotificationEvent): Promise<void>;
|
|
54
|
+
private sendToWebhook(config: WebhookConfig, event: NotificationEvent): Promise<void>;
|
|
55
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global batch processing manager instance
|
|
3
|
+
*/
|
|
4
|
+
export declare const batchProcessingManager: BatchProcessingManager;
|
|
5
|
+
/**
|
|
6
|
+
* SQS Batch Processing
|
|
7
|
+
* Batch operations, parallel processing, and throughput optimization
|
|
8
|
+
*/
|
|
9
|
+
export declare interface BatchConfig {
|
|
10
|
+
id: string
|
|
11
|
+
queueUrl: string
|
|
12
|
+
batchSize: number
|
|
13
|
+
maxWaitTime: number
|
|
14
|
+
parallelProcessors: number
|
|
15
|
+
retryAttempts: number
|
|
16
|
+
visibilityTimeout: number
|
|
17
|
+
}
|
|
18
|
+
export declare interface BatchJob {
|
|
19
|
+
id: string
|
|
20
|
+
configId: string
|
|
21
|
+
messages: BatchMessage[]
|
|
22
|
+
status: 'pending' | 'processing' | 'completed' | 'failed'
|
|
23
|
+
startedAt?: Date
|
|
24
|
+
completedAt?: Date
|
|
25
|
+
processedCount: number
|
|
26
|
+
failedCount: number
|
|
27
|
+
}
|
|
28
|
+
export declare interface BatchMessage {
|
|
29
|
+
id: string
|
|
30
|
+
messageId: string
|
|
31
|
+
body: string
|
|
32
|
+
receiptHandle: string
|
|
33
|
+
attributes: Record<string, any>
|
|
34
|
+
status: 'pending' | 'processing' | 'success' | 'failed'
|
|
35
|
+
processingTime?: number
|
|
36
|
+
error?: string
|
|
37
|
+
}
|
|
38
|
+
export declare interface ProcessorMetrics {
|
|
39
|
+
id: string
|
|
40
|
+
configId: string
|
|
41
|
+
timestamp: Date
|
|
42
|
+
messagesProcessed: number
|
|
43
|
+
averageProcessingTime: number
|
|
44
|
+
throughput: number
|
|
45
|
+
errorRate: number
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Batch processing manager
|
|
49
|
+
*/
|
|
50
|
+
export declare class BatchProcessingManager {
|
|
51
|
+
private configs: Map<string, BatchConfig>;
|
|
52
|
+
private jobs: Map<string, BatchJob>;
|
|
53
|
+
private metrics: Map<string, ProcessorMetrics[]>;
|
|
54
|
+
private configCounter: any;
|
|
55
|
+
private jobCounter: any;
|
|
56
|
+
private metricsCounter: any;
|
|
57
|
+
createBatchConfig(config: Omit<BatchConfig, 'id'>): BatchConfig;
|
|
58
|
+
createHighThroughputConfig(options: {
|
|
59
|
+
queueUrl: string
|
|
60
|
+
}): BatchConfig;
|
|
61
|
+
createLowLatencyConfig(options: {
|
|
62
|
+
queueUrl: string
|
|
63
|
+
}): BatchConfig;
|
|
64
|
+
createBatchJob(options: {
|
|
65
|
+
configId: string
|
|
66
|
+
messageCount: number
|
|
67
|
+
}): BatchJob;
|
|
68
|
+
processBatchJob(jobId: string): Promise<BatchJob>;
|
|
69
|
+
private processBatch(messages: BatchMessage[], config: BatchConfig): Promise<void>;
|
|
70
|
+
private processMessage(message: BatchMessage, config: BatchConfig): Promise<void>;
|
|
71
|
+
private chunkArray<T>(array: T[], chunkSize: number): T[][];
|
|
72
|
+
private collectProcessorMetrics(configId: string, job: BatchJob): void;
|
|
73
|
+
getBatchStatistics(configId: string): {
|
|
74
|
+
totalJobsProcessed: number
|
|
75
|
+
totalMessagesProcessed: number
|
|
76
|
+
averageThroughput: number
|
|
77
|
+
averageErrorRate: number
|
|
78
|
+
averageProcessingTime: number
|
|
79
|
+
};
|
|
80
|
+
optimizeBatchConfig(configId: string): BatchConfig;
|
|
81
|
+
getConfig(id: string): BatchConfig | undefined;
|
|
82
|
+
listConfigs(): BatchConfig[];
|
|
83
|
+
getJob(id: string): BatchJob | undefined;
|
|
84
|
+
listJobs(configId?: string): BatchJob[];
|
|
85
|
+
generateBatchProcessorCF(config: BatchConfig): any;
|
|
86
|
+
clear(): void;
|
|
87
|
+
}
|