@stacksjs/ts-cloud 0.1.3 → 0.1.5
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/README.md +98 -13
- package/dist/aws/acm.d.ts +129 -0
- package/dist/aws/application-autoscaling.d.ts +282 -0
- package/dist/aws/bedrock.d.ts +2292 -0
- package/dist/aws/client.d.ts +79 -0
- package/dist/aws/cloudformation.d.ts +105 -0
- package/dist/aws/cloudfront.d.ts +265 -0
- package/dist/aws/cloudwatch-logs.d.ts +48 -0
- package/dist/aws/comprehend.d.ts +505 -0
- package/dist/aws/connect.d.ts +377 -0
- package/dist/aws/deploy-imap.d.ts +14 -0
- package/dist/aws/dynamodb.d.ts +176 -0
- package/dist/aws/ec2.d.ts +272 -0
- package/dist/aws/ecr.d.ts +149 -0
- package/dist/aws/ecs.d.ts +162 -0
- package/dist/aws/elasticache.d.ts +71 -0
- package/dist/aws/elbv2.d.ts +248 -0
- package/dist/aws/email.d.ts +175 -0
- package/dist/aws/eventbridge.d.ts +142 -0
- package/dist/aws/iam.d.ts +638 -0
- package/dist/aws/imap-server.d.ts +119 -0
- package/{src/aws/index.ts → dist/aws/index.d.ts} +62 -83
- package/{src/aws/kendra.ts → dist/aws/kendra.d.ts} +71 -386
- package/dist/aws/lambda.d.ts +232 -0
- package/dist/aws/opensearch.d.ts +87 -0
- package/dist/aws/personalize.d.ts +516 -0
- package/dist/aws/polly.d.ts +214 -0
- package/dist/aws/rds.d.ts +240 -0
- package/dist/aws/rekognition.d.ts +543 -0
- package/dist/aws/route53-domains.d.ts +113 -0
- package/dist/aws/route53.d.ts +215 -0
- package/dist/aws/s3.d.ts +212 -0
- package/dist/aws/scheduler.d.ts +140 -0
- package/dist/aws/secrets-manager.d.ts +170 -0
- package/dist/aws/ses.d.ts +288 -0
- package/dist/aws/setup-phone.d.ts +0 -0
- package/dist/aws/setup-sms.d.ts +115 -0
- package/dist/aws/sms.d.ts +304 -0
- package/dist/aws/smtp-server.d.ts +61 -0
- package/dist/aws/sns.d.ts +117 -0
- package/dist/aws/sqs.d.ts +65 -0
- package/dist/aws/ssm.d.ts +179 -0
- package/dist/aws/sts.d.ts +15 -0
- package/dist/aws/support.d.ts +104 -0
- package/dist/aws/test-imap.d.ts +0 -0
- package/dist/aws/textract.d.ts +403 -0
- package/dist/aws/transcribe.d.ts +60 -0
- package/dist/aws/translate.d.ts +358 -0
- package/dist/aws/voice.d.ts +219 -0
- package/dist/bin/cli.js +1724 -0
- package/dist/config.d.ts +7 -0
- package/dist/deploy/index.d.ts +2 -0
- package/dist/deploy/static-site-external-dns.d.ts +51 -0
- package/dist/deploy/static-site.d.ts +71 -0
- package/dist/dns/cloudflare.d.ts +52 -0
- package/dist/dns/godaddy.d.ts +38 -0
- package/dist/dns/index.d.ts +45 -0
- package/dist/dns/porkbun.d.ts +18 -0
- package/dist/dns/route53-adapter.d.ts +38 -0
- package/{src/dns/types.ts → dist/dns/types.d.ts} +26 -63
- package/dist/dns/validator.d.ts +78 -0
- package/dist/generators/index.d.ts +1 -0
- package/dist/generators/infrastructure.d.ts +30 -0
- package/{src/index.ts → dist/index.d.ts} +70 -93
- package/dist/index.js +7881 -0
- package/dist/push/apns.d.ts +60 -0
- package/dist/push/fcm.d.ts +117 -0
- package/dist/push/index.d.ts +14 -0
- package/dist/security/pre-deploy-scanner.d.ts +69 -0
- package/dist/ssl/acme-client.d.ts +67 -0
- package/dist/ssl/index.d.ts +2 -0
- package/dist/ssl/letsencrypt.d.ts +48 -0
- package/dist/types.d.ts +1 -0
- package/dist/utils/cli.d.ts +123 -0
- package/dist/validation/index.d.ts +1 -0
- package/dist/validation/template.d.ts +23 -0
- package/package.json +8 -8
- package/bin/cli.ts +0 -133
- package/bin/commands/analytics.ts +0 -328
- package/bin/commands/api.ts +0 -379
- package/bin/commands/assets.ts +0 -221
- package/bin/commands/audit.ts +0 -501
- package/bin/commands/backup.ts +0 -682
- package/bin/commands/cache.ts +0 -294
- package/bin/commands/cdn.ts +0 -281
- package/bin/commands/config.ts +0 -202
- package/bin/commands/container.ts +0 -105
- package/bin/commands/cost.ts +0 -208
- package/bin/commands/database.ts +0 -401
- package/bin/commands/deploy.ts +0 -674
- package/bin/commands/domain.ts +0 -397
- package/bin/commands/email.ts +0 -423
- package/bin/commands/environment.ts +0 -285
- package/bin/commands/events.ts +0 -424
- package/bin/commands/firewall.ts +0 -145
- package/bin/commands/function.ts +0 -116
- package/bin/commands/generate.ts +0 -280
- package/bin/commands/git.ts +0 -139
- package/bin/commands/iam.ts +0 -464
- package/bin/commands/index.ts +0 -48
- package/bin/commands/init.ts +0 -120
- package/bin/commands/logs.ts +0 -148
- package/bin/commands/network.ts +0 -579
- package/bin/commands/notify.ts +0 -489
- package/bin/commands/queue.ts +0 -407
- package/bin/commands/scheduler.ts +0 -370
- package/bin/commands/secrets.ts +0 -54
- package/bin/commands/server.ts +0 -629
- package/bin/commands/shared.ts +0 -97
- package/bin/commands/ssl.ts +0 -138
- package/bin/commands/stack.ts +0 -325
- package/bin/commands/status.ts +0 -385
- package/bin/commands/storage.ts +0 -450
- package/bin/commands/team.ts +0 -96
- package/bin/commands/tunnel.ts +0 -489
- package/bin/commands/utils.ts +0 -202
- package/build.ts +0 -15
- package/cloud +0 -2
- package/src/aws/acm.ts +0 -768
- package/src/aws/application-autoscaling.ts +0 -845
- package/src/aws/bedrock.ts +0 -4074
- package/src/aws/client.ts +0 -878
- package/src/aws/cloudformation.ts +0 -896
- package/src/aws/cloudfront.ts +0 -1531
- package/src/aws/cloudwatch-logs.ts +0 -154
- package/src/aws/comprehend.ts +0 -839
- package/src/aws/connect.ts +0 -1056
- package/src/aws/deploy-imap.ts +0 -384
- package/src/aws/dynamodb.ts +0 -340
- package/src/aws/ec2.ts +0 -1385
- package/src/aws/ecr.ts +0 -621
- package/src/aws/ecs.ts +0 -615
- package/src/aws/elasticache.ts +0 -301
- package/src/aws/elbv2.ts +0 -942
- package/src/aws/email.ts +0 -928
- package/src/aws/eventbridge.ts +0 -248
- package/src/aws/iam.ts +0 -1689
- package/src/aws/imap-server.ts +0 -2100
- package/src/aws/lambda.ts +0 -786
- package/src/aws/opensearch.ts +0 -158
- package/src/aws/personalize.ts +0 -977
- package/src/aws/polly.ts +0 -559
- package/src/aws/rds.ts +0 -888
- package/src/aws/rekognition.ts +0 -846
- package/src/aws/route53-domains.ts +0 -359
- package/src/aws/route53.ts +0 -1046
- package/src/aws/s3.ts +0 -2318
- package/src/aws/scheduler.ts +0 -571
- package/src/aws/secrets-manager.ts +0 -769
- package/src/aws/ses.ts +0 -1081
- package/src/aws/setup-phone.ts +0 -104
- package/src/aws/setup-sms.ts +0 -580
- package/src/aws/sms.ts +0 -1735
- package/src/aws/smtp-server.ts +0 -531
- package/src/aws/sns.ts +0 -758
- package/src/aws/sqs.ts +0 -382
- package/src/aws/ssm.ts +0 -807
- package/src/aws/sts.ts +0 -92
- package/src/aws/support.ts +0 -391
- package/src/aws/test-imap.ts +0 -86
- package/src/aws/textract.ts +0 -780
- package/src/aws/transcribe.ts +0 -108
- package/src/aws/translate.ts +0 -641
- package/src/aws/voice.ts +0 -1379
- package/src/config.ts +0 -35
- package/src/deploy/index.ts +0 -7
- package/src/deploy/static-site-external-dns.ts +0 -906
- package/src/deploy/static-site.ts +0 -1125
- package/src/dns/godaddy.ts +0 -412
- package/src/dns/index.ts +0 -183
- package/src/dns/porkbun.ts +0 -362
- package/src/dns/route53-adapter.ts +0 -414
- package/src/dns/validator.ts +0 -369
- package/src/generators/index.ts +0 -5
- package/src/generators/infrastructure.ts +0 -1660
- package/src/push/apns.ts +0 -452
- package/src/push/fcm.ts +0 -506
- package/src/push/index.ts +0 -58
- package/src/ssl/acme-client.ts +0 -478
- package/src/ssl/index.ts +0 -7
- package/src/ssl/letsencrypt.ts +0 -747
- package/src/types.ts +0 -2
- package/src/utils/cli.ts +0 -398
- package/src/validation/index.ts +0 -5
- package/src/validation/template.ts +0 -405
- package/test/index.test.ts +0 -128
- package/tsconfig.json +0 -18
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CloudOptions } from '@stacksjs/ts-cloud-types';
|
|
2
|
+
export declare function getConfig(): Promise<CloudOptions>;
|
|
3
|
+
export declare const defaultConfig: CloudOptions;
|
|
4
|
+
// Alias for CLI usage
|
|
5
|
+
export declare const loadCloudConfig: () => Promise<CloudOptions>;
|
|
6
|
+
// For backwards compatibility - synchronous access with default fallback
|
|
7
|
+
export declare const config: CloudOptions;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { DnsProviderConfig } from '../dns/types';
|
|
2
|
+
/**
|
|
3
|
+
* Generate CloudFormation template for static site infrastructure (without Route53)
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateExternalDnsStaticSiteTemplate(config: {
|
|
6
|
+
bucketName: string
|
|
7
|
+
domain?: string
|
|
8
|
+
aliases?: string[]
|
|
9
|
+
certificateArn?: string
|
|
10
|
+
defaultRootObject?: string
|
|
11
|
+
errorDocument?: string
|
|
12
|
+
}): object;
|
|
13
|
+
/**
|
|
14
|
+
* Deploy a static site to AWS with external DNS provider
|
|
15
|
+
*/
|
|
16
|
+
export declare function deployStaticSiteWithExternalDns(config: ExternalDnsStaticSiteConfig): Promise<ExternalDnsDeployResult>;
|
|
17
|
+
/**
|
|
18
|
+
* Full deployment with external DNS: infrastructure + files + cache invalidation
|
|
19
|
+
*/
|
|
20
|
+
export declare function deployStaticSiteWithExternalDnsFull(config: ExternalDnsStaticSiteConfig & {
|
|
21
|
+
sourceDir: string
|
|
22
|
+
cleanBucket?: boolean
|
|
23
|
+
onProgress?: (stage: string, detail?: string) => void
|
|
24
|
+
}): Promise<ExternalDnsDeployResult>;
|
|
25
|
+
export declare interface ExternalDnsStaticSiteConfig {
|
|
26
|
+
siteName: string
|
|
27
|
+
region?: string
|
|
28
|
+
domain: string
|
|
29
|
+
bucket?: string
|
|
30
|
+
certificateArn?: string
|
|
31
|
+
stackName?: string
|
|
32
|
+
defaultRootObject?: string
|
|
33
|
+
errorDocument?: string
|
|
34
|
+
cacheControl?: string
|
|
35
|
+
tags?: Record<string, string>
|
|
36
|
+
dnsProvider: DnsProviderConfig
|
|
37
|
+
skipDnsVerification?: boolean
|
|
38
|
+
}
|
|
39
|
+
export declare interface ExternalDnsDeployResult {
|
|
40
|
+
success: boolean
|
|
41
|
+
stackId?: string
|
|
42
|
+
stackName: string
|
|
43
|
+
bucket: string
|
|
44
|
+
distributionId?: string
|
|
45
|
+
distributionDomain?: string
|
|
46
|
+
domain?: string
|
|
47
|
+
certificateArn?: string
|
|
48
|
+
message: string
|
|
49
|
+
filesUploaded?: number
|
|
50
|
+
filesSkipped?: number
|
|
51
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { DnsProviderConfig } from '../dns/types';
|
|
2
|
+
/**
|
|
3
|
+
* Generate CloudFormation template for static site infrastructure
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateStaticSiteTemplate(config: {
|
|
6
|
+
bucketName: string
|
|
7
|
+
domain?: string
|
|
8
|
+
certificateArn?: string
|
|
9
|
+
hostedZoneId?: string
|
|
10
|
+
defaultRootObject?: string
|
|
11
|
+
errorDocument?: string
|
|
12
|
+
}): object;
|
|
13
|
+
/**
|
|
14
|
+
* Deploy a static site to AWS
|
|
15
|
+
* Automatically routes to external DNS deployment when a non-Route53 dnsProvider is configured
|
|
16
|
+
*/
|
|
17
|
+
export declare function deployStaticSite(config: StaticSiteConfig): Promise<DeployResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Upload files to S3 bucket (only uploads changed files)
|
|
20
|
+
*/
|
|
21
|
+
export declare function uploadStaticFiles(options: UploadOptions): Promise<{ uploaded: number; skipped: number; errors: string[] }>;
|
|
22
|
+
/**
|
|
23
|
+
* Invalidate CloudFront cache
|
|
24
|
+
*/
|
|
25
|
+
export declare function invalidateCache(distributionId: string): Promise<{ invalidationId: string }>;
|
|
26
|
+
/**
|
|
27
|
+
* Delete static site infrastructure
|
|
28
|
+
*/
|
|
29
|
+
export declare function deleteStaticSite(stackName: string, region?: string): Promise<{ success: boolean; message: string }>;
|
|
30
|
+
/**
|
|
31
|
+
* Full deployment: infrastructure + files + cache invalidation
|
|
32
|
+
*/
|
|
33
|
+
export declare function deployStaticSiteFull(config: StaticSiteConfig & {
|
|
34
|
+
sourceDir: string
|
|
35
|
+
cleanBucket?: boolean
|
|
36
|
+
onProgress?: (stage: string, detail?: string) => void
|
|
37
|
+
}): Promise<DeployResult & { filesUploaded?: number; filesSkipped?: number }>;
|
|
38
|
+
export declare interface StaticSiteConfig {
|
|
39
|
+
siteName: string
|
|
40
|
+
region?: string
|
|
41
|
+
domain?: string
|
|
42
|
+
subdomain?: string
|
|
43
|
+
baseDomain?: string
|
|
44
|
+
bucket?: string
|
|
45
|
+
hostedZoneId?: string
|
|
46
|
+
certificateArn?: string
|
|
47
|
+
stackName?: string
|
|
48
|
+
defaultRootObject?: string
|
|
49
|
+
errorDocument?: string
|
|
50
|
+
cacheControl?: string
|
|
51
|
+
tags?: Record<string, string>
|
|
52
|
+
dnsProvider?: DnsProviderConfig
|
|
53
|
+
}
|
|
54
|
+
export declare interface DeployResult {
|
|
55
|
+
success: boolean
|
|
56
|
+
stackId?: string
|
|
57
|
+
stackName: string
|
|
58
|
+
bucket: string
|
|
59
|
+
distributionId?: string
|
|
60
|
+
distributionDomain?: string
|
|
61
|
+
domain?: string
|
|
62
|
+
certificateArn?: string
|
|
63
|
+
message: string
|
|
64
|
+
}
|
|
65
|
+
export declare interface UploadOptions {
|
|
66
|
+
sourceDir: string
|
|
67
|
+
bucket: string
|
|
68
|
+
region: string
|
|
69
|
+
cacheControl?: string
|
|
70
|
+
onProgress?: (uploaded: number, total: number, file: string) => void
|
|
71
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { CreateRecordResult, DeleteRecordResult, DnsProvider, DnsRecord, DnsRecordResult, DnsRecordType, ListRecordsResult, } from './types';
|
|
2
|
+
declare interface CloudflareRecord {
|
|
3
|
+
id: string
|
|
4
|
+
zone_id: string
|
|
5
|
+
zone_name: string
|
|
6
|
+
name: string
|
|
7
|
+
type: string
|
|
8
|
+
content: string
|
|
9
|
+
proxiable: boolean
|
|
10
|
+
proxied: boolean
|
|
11
|
+
ttl: number
|
|
12
|
+
locked: boolean
|
|
13
|
+
meta: Record<string, any>
|
|
14
|
+
comment?: string
|
|
15
|
+
tags?: string[]
|
|
16
|
+
created_on: string
|
|
17
|
+
modified_on: string
|
|
18
|
+
priority?: number
|
|
19
|
+
}
|
|
20
|
+
export declare class CloudflareProvider implements DnsProvider {
|
|
21
|
+
readonly name: any;
|
|
22
|
+
private apiToken: string;
|
|
23
|
+
private zoneCache: Map<string, string>;
|
|
24
|
+
constructor(apiToken: string);
|
|
25
|
+
private request<T>(method: string, endpoint: string, body?: any): Promise<CloudflareApiResponse<T>>;
|
|
26
|
+
private getRootDomain(domain: string): string;
|
|
27
|
+
private getZoneId(domain: string): Promise<string>;
|
|
28
|
+
private getFullRecordName(name: string, domain: string): string;
|
|
29
|
+
private toCloudflareRecord(record: DnsRecord, domain: string): Partial<CloudflareRecord>;
|
|
30
|
+
private fromCloudflareRecord(record: CloudflareRecord): DnsRecordResult;
|
|
31
|
+
createRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>;
|
|
32
|
+
upsertRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>;
|
|
33
|
+
deleteRecord(domain: string, record: DnsRecord): Promise<DeleteRecordResult>;
|
|
34
|
+
listRecords(domain: string, type?: DnsRecordType): Promise<ListRecordsResult>;
|
|
35
|
+
canManageDomain(domain: string): Promise<boolean>;
|
|
36
|
+
listDomains(): Promise<string[]>;
|
|
37
|
+
getZoneDetails(domain: string): Promise<{
|
|
38
|
+
id: string
|
|
39
|
+
name: string
|
|
40
|
+
status: string
|
|
41
|
+
nameServers: string[]
|
|
42
|
+
paused: boolean
|
|
43
|
+
} | null>;
|
|
44
|
+
purgeCache(domain: string, options?: {
|
|
45
|
+
purgeEverything?: boolean
|
|
46
|
+
files?: string[]
|
|
47
|
+
tags?: string[]
|
|
48
|
+
hosts?: string[]
|
|
49
|
+
}): Promise<boolean>;
|
|
50
|
+
getRecordProxyStatus(domain: string, record: DnsRecord): Promise<boolean | null>;
|
|
51
|
+
setRecordProxyStatus(domain: string, record: DnsRecord, proxied: boolean): Promise<boolean>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CreateRecordResult, DeleteRecordResult, DnsProvider, DnsRecord, DnsRecordResult, DnsRecordType, ListRecordsResult, } from './types';
|
|
2
|
+
declare interface GoDaddyRecord {
|
|
3
|
+
type: string
|
|
4
|
+
name: string
|
|
5
|
+
data: string
|
|
6
|
+
ttl: number
|
|
7
|
+
priority?: number
|
|
8
|
+
}
|
|
9
|
+
export declare class GoDaddyProvider implements DnsProvider {
|
|
10
|
+
readonly name: any;
|
|
11
|
+
private apiKey: string;
|
|
12
|
+
private apiSecret: string;
|
|
13
|
+
private baseUrl: string;
|
|
14
|
+
constructor(apiKey: string, apiSecret: string, environment?: 'production' | 'ote');
|
|
15
|
+
private request<T>(method: string, endpoint: string, body?: any): Promise<T>;
|
|
16
|
+
private getSubdomain(recordName: string, domain: string): string;
|
|
17
|
+
private getRootDomain(domain: string): string;
|
|
18
|
+
private toGoDaddyRecord(record: DnsRecord, domain: string): GoDaddyRecord;
|
|
19
|
+
private fromGoDaddyRecord(record: GoDaddyRecord, domain: string): DnsRecordResult;
|
|
20
|
+
createRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>;
|
|
21
|
+
upsertRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>;
|
|
22
|
+
deleteRecord(domain: string, record: DnsRecord): Promise<DeleteRecordResult>;
|
|
23
|
+
listRecords(domain: string, type?: DnsRecordType): Promise<ListRecordsResult>;
|
|
24
|
+
canManageDomain(domain: string): Promise<boolean>;
|
|
25
|
+
listDomains(): Promise<string[]>;
|
|
26
|
+
getDomainDetails(domain: string): Promise<{
|
|
27
|
+
domain: string
|
|
28
|
+
status: string
|
|
29
|
+
nameServers?: string[]
|
|
30
|
+
expires?: string
|
|
31
|
+
} | null>;
|
|
32
|
+
updateNameServers(domain: string, nameservers: string[]): Promise<boolean>;
|
|
33
|
+
checkDomainAvailability(domain: string): Promise<{
|
|
34
|
+
available: boolean
|
|
35
|
+
price?: number
|
|
36
|
+
currency?: string
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CloudflareProvider } from './cloudflare';
|
|
2
|
+
import { GoDaddyProvider } from './godaddy';
|
|
3
|
+
import { PorkbunProvider } from './porkbun';
|
|
4
|
+
import { Route53Provider } from './route53-adapter';
|
|
5
|
+
import type { DnsProvider, DnsProviderConfig } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Create a DNS provider from configuration
|
|
8
|
+
*/
|
|
9
|
+
export declare function createDnsProvider(config: DnsProviderConfig): DnsProvider;
|
|
10
|
+
/**
|
|
11
|
+
* Auto-detect DNS provider for a domain
|
|
12
|
+
* Tries each provider to see which one can manage the domain
|
|
13
|
+
*/
|
|
14
|
+
export declare function detectDnsProvider(domain: string, configs: DnsProviderConfig[]): Promise<DnsProvider | null>;
|
|
15
|
+
/**
|
|
16
|
+
* Default factory instance (can be configured globally)
|
|
17
|
+
*/
|
|
18
|
+
export declare const dnsProviders: DnsProviderFactory;
|
|
19
|
+
/**
|
|
20
|
+
* DNS Provider factory with environment variable support
|
|
21
|
+
*/
|
|
22
|
+
export declare class DnsProviderFactory {
|
|
23
|
+
private providers: Map<string, DnsProvider>;
|
|
24
|
+
private configs: DnsProviderConfig[];
|
|
25
|
+
addConfig(config: DnsProviderConfig): this;
|
|
26
|
+
addRoute53(region?: string, hostedZoneId?: string): this;
|
|
27
|
+
addPorkbun(apiKey: string, secretKey: string): this;
|
|
28
|
+
addGoDaddy(apiKey: string, apiSecret: string, environment?: 'production' | 'ote'): this;
|
|
29
|
+
addCloudflare(apiToken: string): this;
|
|
30
|
+
loadFromEnv(): this;
|
|
31
|
+
getProvider(name: 'route53' | 'porkbun' | 'godaddy' | 'cloudflare'): DnsProvider | null;
|
|
32
|
+
getProviderForDomain(domain: string): Promise<DnsProvider | null>;
|
|
33
|
+
getAllProviders(): DnsProvider[];
|
|
34
|
+
}
|
|
35
|
+
export * from './types';
|
|
36
|
+
export { PorkbunProvider } from './porkbun';
|
|
37
|
+
export { GoDaddyProvider } from './godaddy';
|
|
38
|
+
export { CloudflareProvider } from './cloudflare';
|
|
39
|
+
export { Route53Provider } from './route53-adapter';
|
|
40
|
+
export {
|
|
41
|
+
UnifiedDnsValidator,
|
|
42
|
+
createPorkbunValidator,
|
|
43
|
+
createGoDaddyValidator,
|
|
44
|
+
createRoute53Validator,
|
|
45
|
+
} from './validator';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CreateRecordResult, DeleteRecordResult, DnsProvider, DnsRecord, DnsRecordType, ListRecordsResult, } from './types';
|
|
2
|
+
export declare class PorkbunProvider implements DnsProvider {
|
|
3
|
+
readonly name: any;
|
|
4
|
+
private apiKey: string;
|
|
5
|
+
private secretKey: string;
|
|
6
|
+
constructor(apiKey: string, secretKey: string);
|
|
7
|
+
private request<T extends PorkbunApiResponse>(endpoint: string, additionalBody?: Record<string, any>): Promise<T>;
|
|
8
|
+
private getSubdomain(recordName: string, domain: string): string;
|
|
9
|
+
private getRootDomain(domain: string): string;
|
|
10
|
+
createRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>;
|
|
11
|
+
upsertRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>;
|
|
12
|
+
deleteRecord(domain: string, record: DnsRecord): Promise<DeleteRecordResult>;
|
|
13
|
+
listRecords(domain: string, type?: DnsRecordType): Promise<ListRecordsResult>;
|
|
14
|
+
canManageDomain(domain: string): Promise<boolean>;
|
|
15
|
+
listDomains(): Promise<string[]>;
|
|
16
|
+
getNameServers(domain: string): Promise<string[]>;
|
|
17
|
+
updateNameServers(domain: string, nameservers: string[]): Promise<boolean>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Route53Client } from '../aws/route53';
|
|
2
|
+
import type { CreateRecordResult, DeleteRecordResult, DnsProvider, DnsRecord, DnsRecordType, ListRecordsResult, } from './types';
|
|
3
|
+
export declare class Route53Provider implements DnsProvider {
|
|
4
|
+
readonly name: any;
|
|
5
|
+
private client: Route53Client;
|
|
6
|
+
private hostedZoneCache: Map<string, string>;
|
|
7
|
+
private providedHostedZoneId?: string;
|
|
8
|
+
constructor(region?: string, hostedZoneId?: string);
|
|
9
|
+
private getRootDomain(domain: string): string;
|
|
10
|
+
private getHostedZoneId(domain: string): Promise<string | null>;
|
|
11
|
+
private normalizeName(name: string): string;
|
|
12
|
+
createRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>;
|
|
13
|
+
upsertRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>;
|
|
14
|
+
deleteRecord(domain: string, record: DnsRecord): Promise<DeleteRecordResult>;
|
|
15
|
+
listRecords(domain: string, type?: DnsRecordType): Promise<ListRecordsResult>;
|
|
16
|
+
canManageDomain(domain: string): Promise<boolean>;
|
|
17
|
+
listDomains(): Promise<string[]>;
|
|
18
|
+
getRoute53Client(): Route53Client;
|
|
19
|
+
createAliasRecord(params: {
|
|
20
|
+
domain: string
|
|
21
|
+
name: string
|
|
22
|
+
targetHostedZoneId: string
|
|
23
|
+
targetDnsName: string
|
|
24
|
+
evaluateTargetHealth?: boolean
|
|
25
|
+
type?: 'A' | 'AAAA'
|
|
26
|
+
}): Promise<CreateRecordResult>;
|
|
27
|
+
createCloudFrontAlias(params: {
|
|
28
|
+
domain: string
|
|
29
|
+
name: string
|
|
30
|
+
cloudFrontDomainName: string
|
|
31
|
+
}): Promise<CreateRecordResult>;
|
|
32
|
+
createAlbAlias(params: {
|
|
33
|
+
domain: string
|
|
34
|
+
name: string
|
|
35
|
+
albDnsName: string
|
|
36
|
+
region: string
|
|
37
|
+
}): Promise<CreateRecordResult>;
|
|
38
|
+
}
|
|
@@ -1,114 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
* DNS Provider Types
|
|
3
|
-
* Common interfaces for DNS provider abstraction
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export type DnsRecordType = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'MX' | 'NS' | 'SRV' | 'CAA'
|
|
7
|
-
|
|
8
|
-
export interface DnsRecord {
|
|
1
|
+
export declare interface DnsRecord {
|
|
9
2
|
name: string
|
|
10
3
|
type: DnsRecordType
|
|
11
4
|
content: string
|
|
12
|
-
/** Alias for content - some providers use 'value' instead */
|
|
13
5
|
value?: string
|
|
14
6
|
ttl?: number
|
|
15
|
-
priority?: number
|
|
16
|
-
weight?: number
|
|
17
|
-
port?: number
|
|
7
|
+
priority?: number
|
|
8
|
+
weight?: number
|
|
9
|
+
port?: number
|
|
18
10
|
}
|
|
19
|
-
|
|
20
|
-
export interface DnsRecordResult extends DnsRecord {
|
|
11
|
+
export declare interface DnsRecordResult extends DnsRecord {
|
|
21
12
|
id?: string
|
|
22
13
|
}
|
|
23
|
-
|
|
24
|
-
export interface CreateRecordResult {
|
|
14
|
+
export declare interface CreateRecordResult {
|
|
25
15
|
success: boolean
|
|
26
16
|
id?: string
|
|
27
17
|
message?: string
|
|
28
18
|
}
|
|
29
|
-
|
|
30
|
-
export interface DeleteRecordResult {
|
|
19
|
+
export declare interface DeleteRecordResult {
|
|
31
20
|
success: boolean
|
|
32
21
|
message?: string
|
|
33
22
|
}
|
|
34
|
-
|
|
35
|
-
export interface ListRecordsResult {
|
|
23
|
+
export declare interface ListRecordsResult {
|
|
36
24
|
success: boolean
|
|
37
25
|
records: DnsRecordResult[]
|
|
38
26
|
message?: string
|
|
39
27
|
}
|
|
40
|
-
|
|
41
28
|
/**
|
|
42
29
|
* Common DNS Provider interface
|
|
43
30
|
* All DNS providers (Route53, Porkbun, GoDaddy, etc.) implement this
|
|
44
31
|
*/
|
|
45
|
-
export interface DnsProvider {
|
|
46
|
-
|
|
47
|
-
* Provider name for logging/identification
|
|
48
|
-
*/
|
|
49
|
-
readonly name: string
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Create a DNS record
|
|
53
|
-
*/
|
|
32
|
+
export declare interface DnsProvider {
|
|
33
|
+
name: string
|
|
54
34
|
createRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Update an existing DNS record (upsert behavior)
|
|
58
|
-
*/
|
|
59
35
|
upsertRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Delete a DNS record
|
|
63
|
-
*/
|
|
64
36
|
deleteRecord(domain: string, record: DnsRecord): Promise<DeleteRecordResult>
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* List all DNS records for a domain
|
|
68
|
-
*/
|
|
69
37
|
listRecords(domain: string, type?: DnsRecordType): Promise<ListRecordsResult>
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Check if the provider can manage this domain
|
|
73
|
-
*/
|
|
74
38
|
canManageDomain(domain: string): Promise<boolean>
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* List all domains managed by this provider
|
|
78
|
-
* Returns an array of domain names (e.g., ['example.com', 'mysite.org'])
|
|
79
|
-
*/
|
|
80
39
|
listDomains(): Promise<string[]>
|
|
81
40
|
}
|
|
82
|
-
|
|
83
41
|
/**
|
|
84
42
|
* DNS Provider configuration types
|
|
85
43
|
*/
|
|
86
|
-
export interface Route53ProviderConfig {
|
|
44
|
+
export declare interface Route53ProviderConfig {
|
|
87
45
|
provider: 'route53'
|
|
88
46
|
region?: string
|
|
89
|
-
hostedZoneId?: string
|
|
47
|
+
hostedZoneId?: string
|
|
90
48
|
}
|
|
91
|
-
|
|
92
|
-
export interface PorkbunProviderConfig {
|
|
49
|
+
export declare interface PorkbunProviderConfig {
|
|
93
50
|
provider: 'porkbun'
|
|
94
51
|
apiKey: string
|
|
95
52
|
secretKey: string
|
|
96
53
|
}
|
|
97
|
-
|
|
98
|
-
export interface GoDaddyProviderConfig {
|
|
54
|
+
export declare interface GoDaddyProviderConfig {
|
|
99
55
|
provider: 'godaddy'
|
|
100
56
|
apiKey: string
|
|
101
57
|
apiSecret: string
|
|
102
|
-
environment?: 'production' | 'ote'
|
|
58
|
+
environment?: 'production' | 'ote'
|
|
59
|
+
}
|
|
60
|
+
export declare interface CloudflareProviderConfig {
|
|
61
|
+
provider: 'cloudflare'
|
|
62
|
+
apiToken: string
|
|
103
63
|
}
|
|
104
|
-
|
|
105
|
-
export type DnsProviderConfig = Route53ProviderConfig | PorkbunProviderConfig | GoDaddyProviderConfig
|
|
106
|
-
|
|
107
64
|
/**
|
|
108
65
|
* Extended configuration for certificate validation
|
|
109
66
|
*/
|
|
110
|
-
export interface CertificateValidationConfig {
|
|
67
|
+
export declare interface CertificateValidationConfig {
|
|
111
68
|
provider: DnsProviderConfig
|
|
112
69
|
waitForValidation?: boolean
|
|
113
70
|
maxWaitMinutes?: number
|
|
114
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* DNS Provider Types
|
|
74
|
+
* Common interfaces for DNS provider abstraction
|
|
75
|
+
*/
|
|
76
|
+
export type DnsRecordType = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'MX' | 'NS' | 'SRV' | 'CAA'
|
|
77
|
+
export type DnsProviderConfig = Route53ProviderConfig | PorkbunProviderConfig | GoDaddyProviderConfig | CloudflareProviderConfig
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ACMClient } from '../aws/acm';
|
|
2
|
+
import type { DnsProvider, DnsProviderConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Helper function to create a validator with Porkbun
|
|
5
|
+
*/
|
|
6
|
+
export declare function createPorkbunValidator(apiKey: string, secretKey: string, acmRegion?: string): UnifiedDnsValidator;
|
|
7
|
+
/**
|
|
8
|
+
* Helper function to create a validator with GoDaddy
|
|
9
|
+
*/
|
|
10
|
+
export declare function createGoDaddyValidator(apiKey: string, apiSecret: string, acmRegion?: string, environment?: 'production' | 'ote'): UnifiedDnsValidator;
|
|
11
|
+
/**
|
|
12
|
+
* Helper function to create a validator with Route53
|
|
13
|
+
*/
|
|
14
|
+
export declare function createRoute53Validator(region?: string, hostedZoneId?: string, acmRegion?: string): UnifiedDnsValidator;
|
|
15
|
+
export declare interface ValidationRecord {
|
|
16
|
+
domainName: string
|
|
17
|
+
recordName: string
|
|
18
|
+
recordType: string
|
|
19
|
+
recordValue: string
|
|
20
|
+
}
|
|
21
|
+
export declare interface CertificateValidationResult {
|
|
22
|
+
certificateArn: string
|
|
23
|
+
validationRecords: ValidationRecord[]
|
|
24
|
+
isNew: boolean
|
|
25
|
+
status: 'pending' | 'issued' | 'failed'
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Unified DNS Validator
|
|
29
|
+
* Handles ACM certificate validation with any DNS provider
|
|
30
|
+
*/
|
|
31
|
+
export declare class UnifiedDnsValidator {
|
|
32
|
+
private acm: ACMClient;
|
|
33
|
+
private dnsProvider: DnsProvider;
|
|
34
|
+
constructor(dnsProvider: DnsProvider | DnsProviderConfig, acmRegion?: string);
|
|
35
|
+
getProvider(): DnsProvider;
|
|
36
|
+
requestAndValidate(params: {
|
|
37
|
+
domainName: string
|
|
38
|
+
subjectAlternativeNames?: string[]
|
|
39
|
+
waitForValidation?: boolean
|
|
40
|
+
maxWaitMinutes?: number
|
|
41
|
+
}): Promise<CertificateValidationResult>;
|
|
42
|
+
createValidationRecords(params: {
|
|
43
|
+
certificateArn: string
|
|
44
|
+
domain: string
|
|
45
|
+
}): Promise<{
|
|
46
|
+
success: boolean
|
|
47
|
+
records: ValidationRecord[]
|
|
48
|
+
errors: string[]
|
|
49
|
+
}>;
|
|
50
|
+
deleteValidationRecords(params: {
|
|
51
|
+
certificateArn: string
|
|
52
|
+
domain: string
|
|
53
|
+
}): Promise<{
|
|
54
|
+
success: boolean
|
|
55
|
+
errors: string[]
|
|
56
|
+
}>;
|
|
57
|
+
findOrCreateCertificate(params: {
|
|
58
|
+
domainName: string
|
|
59
|
+
subjectAlternativeNames?: string[]
|
|
60
|
+
waitForValidation?: boolean
|
|
61
|
+
maxWaitMinutes?: number
|
|
62
|
+
}): Promise<CertificateValidationResult>;
|
|
63
|
+
requestCertificateWithCommonSans(params: {
|
|
64
|
+
domainName: string
|
|
65
|
+
includeWww?: boolean
|
|
66
|
+
includeWildcard?: boolean
|
|
67
|
+
additionalSans?: string[]
|
|
68
|
+
waitForValidation?: boolean
|
|
69
|
+
}): Promise<CertificateValidationResult>;
|
|
70
|
+
private waitForValidationOptions(certificateArn: string, maxAttempts?: any): Promise<void>;
|
|
71
|
+
getCertificateStatus(certificateArn: string): Promise<{
|
|
72
|
+
status: string
|
|
73
|
+
domainValidations: Array<{
|
|
74
|
+
domain: string
|
|
75
|
+
status: string
|
|
76
|
+
}>
|
|
77
|
+
}>;
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './infrastructure';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TemplateBuilder, } from '@stacksjs/ts-cloud-core';
|
|
2
|
+
import type { CloudConfig } from '@stacksjs/ts-cloud-types';
|
|
3
|
+
export declare interface GenerationOptions {
|
|
4
|
+
config: CloudConfig
|
|
5
|
+
environment: 'production' | 'staging' | 'development'
|
|
6
|
+
modules?: string[]
|
|
7
|
+
}
|
|
8
|
+
export declare class InfrastructureGenerator {
|
|
9
|
+
private builder: TemplateBuilder;
|
|
10
|
+
private config: CloudConfig;
|
|
11
|
+
private environment: 'production' | 'staging' | 'development';
|
|
12
|
+
private mergedConfig: CloudConfig;
|
|
13
|
+
constructor(options: GenerationOptions);
|
|
14
|
+
private mergeEnvironmentConfig(): CloudConfig;
|
|
15
|
+
private shouldDeploy(resource: any): boolean;
|
|
16
|
+
generate(): this;
|
|
17
|
+
private applyGlobalTags(tags: Record<string, string>): void;
|
|
18
|
+
private generateServerless(slug: string, env: typeof this.environment): void;
|
|
19
|
+
private generateServer(slug: string, env: typeof this.environment): void;
|
|
20
|
+
private generateSharedInfrastructure(slug: string, env: typeof this.environment): void;
|
|
21
|
+
private generateRealtimeResources(slug: string, env: typeof this.environment): void;
|
|
22
|
+
private generateConnectHandlerCode(): string;
|
|
23
|
+
private generateDisconnectHandlerCode(): string;
|
|
24
|
+
private generateMessageHandlerCode(): string;
|
|
25
|
+
private generateRealtimeServerResources(slug: string, env: typeof this.environment): void;
|
|
26
|
+
generateBroadcastConfig(): string;
|
|
27
|
+
toYAML(): string;
|
|
28
|
+
toJSON(): string;
|
|
29
|
+
getBuilder(): TemplateBuilder;
|
|
30
|
+
}
|