@stacksjs/ts-cloud 0.2.3 → 0.2.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/dist/aws/acm.d.ts +215 -0
- package/dist/aws/application-autoscaling.d.ts +345 -0
- package/dist/aws/bedrock.d.ts +2672 -0
- package/dist/aws/client.d.ts +181 -0
- package/dist/aws/cloudformation.d.ts +187 -0
- package/dist/aws/cloudfront.d.ts +416 -0
- package/dist/aws/cloudwatch-logs.d.ts +70 -0
- package/dist/aws/comprehend.d.ts +616 -0
- package/dist/aws/connect.d.ts +533 -0
- package/dist/aws/deploy-imap.d.ts +26 -0
- package/dist/aws/dynamodb.d.ts +270 -0
- package/dist/aws/ec2.d.ts +545 -0
- package/dist/aws/ecr.d.ts +240 -0
- package/dist/aws/ecs.d.ts +267 -0
- package/dist/aws/efs.d.ts +36 -0
- package/dist/aws/elasticache.d.ts +112 -0
- package/dist/aws/elbv2.d.ts +389 -0
- package/dist/aws/email.d.ts +260 -0
- package/dist/aws/eventbridge.d.ts +197 -0
- package/dist/aws/iam.d.ts +1013 -0
- package/dist/aws/imap-server.d.ts +298 -0
- package/dist/aws/index.d.ts +53 -0
- package/dist/aws/kendra.d.ts +831 -0
- package/dist/aws/lambda.d.ts +319 -0
- package/dist/aws/opensearch.d.ts +121 -0
- package/dist/aws/personalize.d.ts +586 -0
- package/dist/aws/polly.d.ts +243 -0
- package/dist/aws/rds.d.ts +346 -0
- package/dist/aws/rekognition.d.ts +691 -0
- package/dist/aws/route53-domains.d.ts +161 -0
- package/dist/aws/route53.d.ts +330 -0
- package/dist/aws/s3.d.ts +535 -0
- package/dist/aws/scheduler.d.ts +224 -0
- package/dist/aws/secrets-manager.d.ts +267 -0
- package/dist/aws/ses.d.ts +441 -0
- package/dist/aws/setup-phone.d.ts +1 -0
- package/dist/aws/setup-sms.d.ts +116 -0
- package/dist/aws/sms.d.ts +477 -0
- package/dist/aws/smtp-server.d.ts +108 -0
- package/dist/aws/sns.d.ts +224 -0
- package/dist/aws/sqs.d.ts +107 -0
- package/dist/aws/ssm.d.ts +311 -0
- package/dist/aws/sts.d.ts +21 -0
- package/dist/aws/support.d.ts +139 -0
- package/dist/aws/test-imap.d.ts +15 -0
- package/dist/aws/textract.d.ts +477 -0
- package/dist/aws/transcribe.d.ts +79 -0
- package/dist/aws/translate.d.ts +424 -0
- package/dist/aws/voice.d.ts +361 -0
- package/dist/bin/cli.js +4500 -809
- package/dist/config.d.ts +5 -0
- package/dist/deploy/index.d.ts +6 -0
- package/dist/deploy/static-site-external-dns.d.ts +70 -0
- package/dist/deploy/static-site.d.ts +110 -0
- package/dist/dns/cloudflare.d.ts +74 -0
- package/dist/dns/godaddy.d.ts +63 -0
- package/dist/dns/index.d.ts +67 -0
- package/dist/dns/porkbun.d.ts +43 -0
- package/dist/dns/route53-adapter.d.ts +67 -0
- package/dist/dns/types.d.ts +100 -0
- package/dist/dns/validator.d.ts +105 -0
- package/dist/generators/index.d.ts +4 -0
- package/dist/generators/infrastructure.d.ts +115 -0
- package/dist/index.d.ts +9 -165
- package/dist/index.js +24067 -6430
- package/dist/push/apns.d.ts +140 -0
- package/dist/push/fcm.d.ts +205 -0
- package/dist/push/index.d.ts +44 -0
- package/dist/security/pre-deploy-scanner.d.ts +97 -0
- package/dist/ssl/acme-client.d.ts +133 -0
- package/dist/ssl/index.d.ts +6 -0
- package/dist/ssl/letsencrypt.d.ts +96 -0
- package/dist/utils/cli.d.ts +121 -0
- package/dist/validation/index.d.ts +4 -0
- package/dist/validation/template.d.ts +27 -0
- package/package.json +6 -6
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Let's Encrypt Integration for Stacks
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities for obtaining and managing Let's Encrypt certificates.
|
|
5
|
+
* Supports both HTTP-01 and DNS-01 challenges with multiple DNS providers.
|
|
6
|
+
*/
|
|
7
|
+
import type { DnsProviderConfig } from '../dns/types';
|
|
8
|
+
export interface LetsEncryptConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Domain names to obtain certificate for
|
|
11
|
+
*/
|
|
12
|
+
domains: string[];
|
|
13
|
+
/**
|
|
14
|
+
* Email for Let's Encrypt notifications
|
|
15
|
+
*/
|
|
16
|
+
email: string;
|
|
17
|
+
/**
|
|
18
|
+
* Use staging server for testing
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
staging?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Challenge type
|
|
24
|
+
* - 'http-01': Serve challenge file via HTTP (requires port 80)
|
|
25
|
+
* - 'dns-01': Add TXT record to DNS (works behind load balancers)
|
|
26
|
+
* @default 'http-01'
|
|
27
|
+
*/
|
|
28
|
+
challengeType?: 'http-01' | 'dns-01';
|
|
29
|
+
/**
|
|
30
|
+
* Route53 hosted zone ID (required for dns-01 challenge with Route53)
|
|
31
|
+
* @deprecated Use dnsProvider config instead
|
|
32
|
+
*/
|
|
33
|
+
hostedZoneId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* DNS provider configuration for dns-01 challenge
|
|
36
|
+
* Supports: route53, porkbun, godaddy
|
|
37
|
+
*/
|
|
38
|
+
dnsProvider?: DnsProviderConfig;
|
|
39
|
+
/**
|
|
40
|
+
* Certificate storage path
|
|
41
|
+
* @default '/etc/letsencrypt/live'
|
|
42
|
+
*/
|
|
43
|
+
certPath?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Auto-renew certificates
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
autoRenew?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* DNS-01 challenge configuration for programmatic use
|
|
52
|
+
*/
|
|
53
|
+
export interface Dns01ChallengeConfig {
|
|
54
|
+
domain: string;
|
|
55
|
+
challengeValue: string;
|
|
56
|
+
/**
|
|
57
|
+
* Route53 hosted zone ID (legacy, use dnsProvider instead)
|
|
58
|
+
* @deprecated Use dnsProvider config instead
|
|
59
|
+
*/
|
|
60
|
+
hostedZoneId?: string;
|
|
61
|
+
/**
|
|
62
|
+
* DNS provider configuration
|
|
63
|
+
*/
|
|
64
|
+
dnsProvider?: DnsProviderConfig;
|
|
65
|
+
/**
|
|
66
|
+
* AWS region (only for Route53)
|
|
67
|
+
*/
|
|
68
|
+
region?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Generate UserData script for Let's Encrypt certificate setup on EC2
|
|
72
|
+
* This creates a complete setup that handles certificate acquisition and renewal
|
|
73
|
+
*/
|
|
74
|
+
export declare function generateLetsEncryptUserData(config: LetsEncryptConfig): string;
|
|
75
|
+
/**
|
|
76
|
+
* Generate server configuration for HTTPS with Let's Encrypt
|
|
77
|
+
*/
|
|
78
|
+
export declare function generateHttpsServerCode(options: {
|
|
79
|
+
httpPort?: number;
|
|
80
|
+
httpsPort?: number;
|
|
81
|
+
certPath?: string;
|
|
82
|
+
redirectHttp?: boolean;
|
|
83
|
+
}): string;
|
|
84
|
+
/**
|
|
85
|
+
* Setup DNS-01 challenge programmatically using any DNS provider
|
|
86
|
+
* This is the unified API that works with Route53, Porkbun, GoDaddy, etc.
|
|
87
|
+
*/
|
|
88
|
+
export declare function setupDns01Challenge(options: Dns01ChallengeConfig): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Clean up DNS-01 challenge record using any DNS provider
|
|
91
|
+
*/
|
|
92
|
+
export declare function cleanupDns01Challenge(options: Dns01ChallengeConfig): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Check if certificates need renewal (< 30 days until expiry)
|
|
95
|
+
*/
|
|
96
|
+
export declare function needsRenewal(certPath: string): boolean;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Utility Functions
|
|
3
|
+
* Helpers for colored output, spinners, prompts, and formatting
|
|
4
|
+
*/
|
|
5
|
+
export declare const colors: {
|
|
6
|
+
reset: string;
|
|
7
|
+
bright: string;
|
|
8
|
+
dim: string;
|
|
9
|
+
red: string;
|
|
10
|
+
green: string;
|
|
11
|
+
yellow: string;
|
|
12
|
+
blue: string;
|
|
13
|
+
magenta: string;
|
|
14
|
+
cyan: string;
|
|
15
|
+
white: string;
|
|
16
|
+
gray: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Colorize text
|
|
20
|
+
*/
|
|
21
|
+
export declare function colorize(text: string, color: keyof typeof colors): string;
|
|
22
|
+
/**
|
|
23
|
+
* Success message
|
|
24
|
+
*/
|
|
25
|
+
export declare function success(message: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* Error message
|
|
28
|
+
*/
|
|
29
|
+
export declare function error(message: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Warning message
|
|
32
|
+
*/
|
|
33
|
+
export declare function warn(message: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Warning message (alias)
|
|
36
|
+
*/
|
|
37
|
+
export declare const warning: typeof warn;
|
|
38
|
+
/**
|
|
39
|
+
* Info message
|
|
40
|
+
*/
|
|
41
|
+
export declare function info(message: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Step message
|
|
44
|
+
*/
|
|
45
|
+
export declare function step(message: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Header message
|
|
48
|
+
*/
|
|
49
|
+
export declare function header(message: string): void;
|
|
50
|
+
export declare class Spinner {
|
|
51
|
+
private frames;
|
|
52
|
+
private interval;
|
|
53
|
+
private currentFrame;
|
|
54
|
+
private message;
|
|
55
|
+
constructor(message: string);
|
|
56
|
+
get text(): string;
|
|
57
|
+
set text(value: string);
|
|
58
|
+
start(): void;
|
|
59
|
+
succeed(message?: string): void;
|
|
60
|
+
fail(message?: string): void;
|
|
61
|
+
warn(message?: string): void;
|
|
62
|
+
stop(): void;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Progress bar
|
|
66
|
+
*/
|
|
67
|
+
export declare class ProgressBar {
|
|
68
|
+
private total;
|
|
69
|
+
private current;
|
|
70
|
+
private width;
|
|
71
|
+
constructor(total: number);
|
|
72
|
+
update(current: number): void;
|
|
73
|
+
increment(): void;
|
|
74
|
+
private render;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Prompt for user input
|
|
78
|
+
*/
|
|
79
|
+
export declare function prompt(message: string, defaultValue?: string): Promise<string>;
|
|
80
|
+
/**
|
|
81
|
+
* Prompt for confirmation (yes/no)
|
|
82
|
+
*/
|
|
83
|
+
export declare function confirm(message: string, defaultValue?: boolean): Promise<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* Select from a list of options
|
|
86
|
+
*/
|
|
87
|
+
export declare function select(message: string, options: string[]): Promise<string>;
|
|
88
|
+
/**
|
|
89
|
+
* Format a table
|
|
90
|
+
*/
|
|
91
|
+
export declare function table(headers: string[], rows: string[][]): void;
|
|
92
|
+
/**
|
|
93
|
+
* Format bytes to human readable
|
|
94
|
+
*/
|
|
95
|
+
export declare function formatBytes(bytes: number): string;
|
|
96
|
+
/**
|
|
97
|
+
* Format duration to human readable
|
|
98
|
+
*/
|
|
99
|
+
export declare function formatDuration(ms: number): string;
|
|
100
|
+
/**
|
|
101
|
+
* Box a message
|
|
102
|
+
*/
|
|
103
|
+
export declare function box(message: string, color?: keyof typeof colors): void;
|
|
104
|
+
/**
|
|
105
|
+
* Check if AWS CLI is installed (deprecated - no longer required)
|
|
106
|
+
* @deprecated AWS CLI is no longer required. Use checkAwsCredentials() instead.
|
|
107
|
+
*/
|
|
108
|
+
export declare function checkAwsCli(): Promise<boolean>;
|
|
109
|
+
/**
|
|
110
|
+
* Check if AWS credentials are configured
|
|
111
|
+
* Uses direct API call to STS GetCallerIdentity
|
|
112
|
+
*/
|
|
113
|
+
export declare function checkAwsCredentials(): Promise<boolean>;
|
|
114
|
+
/**
|
|
115
|
+
* Get AWS account ID using direct STS API call
|
|
116
|
+
*/
|
|
117
|
+
export declare function getAwsAccountId(): Promise<string | null>;
|
|
118
|
+
/**
|
|
119
|
+
* Get AWS regions using direct EC2 API call
|
|
120
|
+
*/
|
|
121
|
+
export declare function getAwsRegions(): Promise<string[]>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CloudFormation Template Validation
|
|
3
|
+
* Validates templates before deployment
|
|
4
|
+
*/
|
|
5
|
+
import type { CloudFormationTemplate } from '@ts-cloud/aws-types';
|
|
6
|
+
export interface ValidationError {
|
|
7
|
+
path: string;
|
|
8
|
+
message: string;
|
|
9
|
+
severity: 'error' | 'warning';
|
|
10
|
+
}
|
|
11
|
+
export interface ValidationResult {
|
|
12
|
+
valid: boolean;
|
|
13
|
+
errors: ValidationError[];
|
|
14
|
+
warnings: ValidationError[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Validate a CloudFormation template
|
|
18
|
+
*/
|
|
19
|
+
export declare function validateTemplate(template: CloudFormationTemplate): ValidationResult;
|
|
20
|
+
/**
|
|
21
|
+
* Validate template size
|
|
22
|
+
*/
|
|
23
|
+
export declare function validateTemplateSize(templateBody: string): ValidationResult;
|
|
24
|
+
/**
|
|
25
|
+
* Validate template resource limits
|
|
26
|
+
*/
|
|
27
|
+
export declare function validateResourceLimits(template: CloudFormationTemplate): ValidationResult;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/ts-cloud",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.5",
|
|
5
5
|
"description": "A lightweight, performant infrastructure-as-code library and CLI for deploying both server-based (EC2) and serverless applications.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"dist"
|
|
62
62
|
],
|
|
63
63
|
"scripts": {
|
|
64
|
-
"build": "bun --bun build.ts
|
|
64
|
+
"build": "bun --bun build.ts",
|
|
65
65
|
"compile": "bun build ./bin/cli.ts --compile --minify --outfile bin/cloud",
|
|
66
66
|
"compile:all": "bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:windows-x64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64",
|
|
67
67
|
"compile:linux-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/cloud-linux-x64",
|
|
@@ -81,17 +81,17 @@
|
|
|
81
81
|
"format": "bunx --bun pickier format .",
|
|
82
82
|
"format:fix": "bunx --bun pickier format . --write",
|
|
83
83
|
"fresh": "bunx rimraf node_modules/ bun.lock && bun i",
|
|
84
|
-
"prepublishOnly": "bun --bun run build
|
|
84
|
+
"prepublishOnly": "bun --bun run build",
|
|
85
85
|
"test": "bun test"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@ts-cloud/aws-types": "0.2.
|
|
89
|
-
"@ts-cloud/core": "0.2.
|
|
88
|
+
"@ts-cloud/aws-types": "0.2.5",
|
|
89
|
+
"@ts-cloud/core": "0.2.5",
|
|
90
90
|
"@stacksjs/ts-xml": "^0.1.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"bunfig": "^0.15.6",
|
|
94
|
-
"better-dx": "^0.2.
|
|
94
|
+
"better-dx": "^0.2.12"
|
|
95
95
|
},
|
|
96
96
|
"lint-staged": {
|
|
97
97
|
"*.{js,ts,json,yaml,yml,md}": "bunx --bun pickier lint --fix"
|