@stacksjs/cloud 0.69.1 → 0.69.3

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +118 -2
  2. package/dist/index.js +40 -51
  3. package/package.json +15 -15
package/dist/index.d.ts CHANGED
@@ -1,2 +1,118 @@
1
- export * from './cloud'
2
- export * from './helpers'
1
+ import type { CloudOptions } from '../types';
2
+ import type { Construct } from 'constructs';
3
+
4
+ export declare class Cloud extends Stack {
5
+ dns: DnsStack
6
+ security: SecurityStack
7
+ storage: StorageStack
8
+ network: NetworkStack
9
+ fileSystem: FileSystemStack
10
+ jumpBox: JumpBoxStack
11
+ docs: DocsStack
12
+ email: EmailStack
13
+ redirects: RedirectsStack
14
+ permissions: PermissionsStack
15
+ ai: AiStack
16
+ cli: CliStack
17
+ api?: ComputeStack
18
+ cdn!: CdnStack
19
+ queue?: QueueStack
20
+ deployment!: DeploymentStack
21
+ scope: Construct
22
+ props: CloudOptions
23
+
24
+ constructor(scope: Construct, id: string, props: CloudOptions) {
25
+ super(scope, id, props)
26
+ this.scope = scope
27
+ this.props = props
28
+
29
+ this.dns = new DnsStack(this, props)
30
+ this.security = new SecurityStack(this, {
31
+ ...props,
32
+ zone: this.dns.zone,
33
+ })
34
+
35
+ this.storage = new StorageStack(this, {
36
+ ...props,
37
+ kmsKey: this.security.kmsKey,
38
+ originAccessIdentity: this.security.originAccessIdentity,
39
+ })
40
+
41
+ this.network = new NetworkStack(this, props)
42
+
43
+ this.fileSystem = new FileSystemStack(this, {
44
+ ...props,
45
+ vpc: this.network.vpc,
46
+ })
47
+
48
+ this.jumpBox = new JumpBoxStack(this, {
49
+ ...props,
50
+ vpc: this.network.vpc,
51
+ fileSystem: this.fileSystem.fileSystem,
52
+ })
53
+
54
+ this.docs = new DocsStack(this, props)
55
+
56
+ this.email = new EmailStack(this, {
57
+ ...props,
58
+ zone: this.dns.zone,
59
+ })
60
+
61
+ this.redirects = new RedirectsStack(this, props)
62
+
63
+ this.permissions = new PermissionsStack(this)
64
+
65
+
66
+ this.ai = new AiStack(this, props)
67
+
68
+ this.cli = new CliStack(this, props)
69
+ }
70
+
71
+
72
+ async init(): Promise<void> {
73
+ const props = this.props
74
+
75
+ if (this.shouldDeployApi()) {
76
+ this.api = new ComputeStack(this, {
77
+ ...props,
78
+ vpc: this.network.vpc,
79
+ fileSystem: this.fileSystem.fileSystem,
80
+ zone: this.dns.zone,
81
+ certificate: this.security.certificate,
82
+ })
83
+
84
+ this.queue = new QueueStack(this, {
85
+ ...props,
86
+ cluster: this.api.cluster,
87
+ taskDefinition: this.api.taskDefinition,
88
+ })
89
+
90
+ await this.queue.init()
91
+ }
92
+
93
+ this.cdn = new CdnStack(this, {
94
+ ...props,
95
+ publicBucket: this.storage.publicBucket,
96
+ docsBucket: this.storage.docsBucket,
97
+ logBucket: this.storage.logBucket,
98
+ certificate: this.security.certificate,
99
+ firewall: this.security.firewall,
100
+ originRequestFunction: this.docs.originRequestFunction,
101
+ zone: this.dns.zone,
102
+ lb: this.api?.lb,
103
+ })
104
+
105
+ this.deployment = new DeploymentStack(this, {
106
+ ...props,
107
+ publicBucket: this.storage.publicBucket,
108
+ privateBucket: this.storage.privateBucket,
109
+ docsBucket: this.storage.docsBucket,
110
+ mainDistribution: this.cdn.mainDistribution,
111
+ docsDistribution: this.cdn.docsDistribution,
112
+ })
113
+ }
114
+
115
+ shouldDeployApi(): boolean {
116
+ return config.cloud.api?.deploy ?? false
117
+ }
118
+ }