@stacksjs/cloud 0.68.1 → 0.69.2

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/helpers.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import type { CountryCode, RegisterDomainCommandOutput } from '@aws-sdk/client-route-53-domains';
2
2
  import type { Result } from '@stacksjs/error-handling';
3
3
 
4
- export { InstanceType }
5
4
  declare const appEnv: unknown;
6
5
  export declare function getSecurityGroupId(securityGroupName: string): Promise<Result<string | undefined, string>>;
7
6
  export declare interface PurchaseOptions {
@@ -48,7 +47,7 @@ export declare interface PurchaseOptions {
48
47
  contactType: ContactType
49
48
  verbose: boolean
50
49
  }
51
- export declare function purchaseDomain(domain: string, options: PurchaseOptions,): Result<Promise<RegisterDomainCommandOutput>, Error>;
50
+ export declare function purchaseDomain(domain: string, options: PurchaseOptions): Result<Promise<RegisterDomainCommandOutput>, Error>;
52
51
  export declare function getJumpBoxInstanceId(name?: string): Promise<string | undefined>;
53
52
  export declare function deleteEc2Instance(id: string, stackName?: string): Promise<Result<string, string>>;
54
53
  export declare function deleteJumpBox(stackName?: string): Promise<Result<string, string>>;
@@ -68,4 +67,6 @@ export declare function getSecurityGroupFromInstanceId(instanceId: string): Prom
68
67
  export declare function isFirstDeployment(): Promise<boolean>;
69
68
  export declare function isFailedState(): Promise<boolean>;
70
69
  export declare function getOrCreateTimestamp(): Promise<string>;
71
- export declare function getCloudFrontDistributionId(): Promise<string>;
70
+ export declare function getCloudFrontDistributionId(): Promise<string>;
71
+
72
+ export { InstanceType }
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
+ }