@stacksjs/ts-cloud 0.1.11 → 0.1.14

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 (77) hide show
  1. package/README.md +41 -379
  2. package/dist/bin/cli.js +1039 -416
  3. package/dist/index.d.ts +34 -1
  4. package/dist/index.js +76467 -7133
  5. package/package.json +6 -6
  6. package/dist/aws/acm.d.ts +0 -129
  7. package/dist/aws/application-autoscaling.d.ts +0 -282
  8. package/dist/aws/bedrock.d.ts +0 -2292
  9. package/dist/aws/client.d.ts +0 -79
  10. package/dist/aws/cloudformation.d.ts +0 -105
  11. package/dist/aws/cloudfront.d.ts +0 -265
  12. package/dist/aws/cloudwatch-logs.d.ts +0 -48
  13. package/dist/aws/comprehend.d.ts +0 -505
  14. package/dist/aws/connect.d.ts +0 -377
  15. package/dist/aws/deploy-imap.d.ts +0 -14
  16. package/dist/aws/dynamodb.d.ts +0 -176
  17. package/dist/aws/ec2.d.ts +0 -272
  18. package/dist/aws/ecr.d.ts +0 -149
  19. package/dist/aws/ecs.d.ts +0 -162
  20. package/dist/aws/elasticache.d.ts +0 -71
  21. package/dist/aws/elbv2.d.ts +0 -248
  22. package/dist/aws/email.d.ts +0 -175
  23. package/dist/aws/eventbridge.d.ts +0 -142
  24. package/dist/aws/iam.d.ts +0 -638
  25. package/dist/aws/imap-server.d.ts +0 -119
  26. package/dist/aws/index.d.ts +0 -192
  27. package/dist/aws/kendra.d.ts +0 -782
  28. package/dist/aws/lambda.d.ts +0 -232
  29. package/dist/aws/opensearch.d.ts +0 -87
  30. package/dist/aws/personalize.d.ts +0 -516
  31. package/dist/aws/polly.d.ts +0 -214
  32. package/dist/aws/rds.d.ts +0 -240
  33. package/dist/aws/rekognition.d.ts +0 -543
  34. package/dist/aws/route53-domains.d.ts +0 -113
  35. package/dist/aws/route53.d.ts +0 -215
  36. package/dist/aws/s3.d.ts +0 -212
  37. package/dist/aws/scheduler.d.ts +0 -140
  38. package/dist/aws/secrets-manager.d.ts +0 -170
  39. package/dist/aws/ses.d.ts +0 -288
  40. package/dist/aws/setup-phone.d.ts +0 -0
  41. package/dist/aws/setup-sms.d.ts +0 -116
  42. package/dist/aws/sms.d.ts +0 -304
  43. package/dist/aws/smtp-server.d.ts +0 -61
  44. package/dist/aws/sns.d.ts +0 -117
  45. package/dist/aws/sqs.d.ts +0 -65
  46. package/dist/aws/ssm.d.ts +0 -179
  47. package/dist/aws/sts.d.ts +0 -15
  48. package/dist/aws/support.d.ts +0 -104
  49. package/dist/aws/test-imap.d.ts +0 -0
  50. package/dist/aws/textract.d.ts +0 -403
  51. package/dist/aws/transcribe.d.ts +0 -60
  52. package/dist/aws/translate.d.ts +0 -358
  53. package/dist/aws/voice.d.ts +0 -219
  54. package/dist/config.d.ts +0 -7
  55. package/dist/deploy/index.d.ts +0 -2
  56. package/dist/deploy/static-site-external-dns.d.ts +0 -51
  57. package/dist/deploy/static-site.d.ts +0 -71
  58. package/dist/dns/cloudflare.d.ts +0 -52
  59. package/dist/dns/godaddy.d.ts +0 -38
  60. package/dist/dns/index.d.ts +0 -45
  61. package/dist/dns/porkbun.d.ts +0 -18
  62. package/dist/dns/route53-adapter.d.ts +0 -38
  63. package/dist/dns/types.d.ts +0 -77
  64. package/dist/dns/validator.d.ts +0 -78
  65. package/dist/generators/index.d.ts +0 -1
  66. package/dist/generators/infrastructure.d.ts +0 -30
  67. package/dist/push/apns.d.ts +0 -60
  68. package/dist/push/fcm.d.ts +0 -117
  69. package/dist/push/index.d.ts +0 -14
  70. package/dist/security/pre-deploy-scanner.d.ts +0 -69
  71. package/dist/ssl/acme-client.d.ts +0 -67
  72. package/dist/ssl/index.d.ts +0 -2
  73. package/dist/ssl/letsencrypt.d.ts +0 -48
  74. package/dist/types.d.ts +0 -1
  75. package/dist/utils/cli.d.ts +0 -123
  76. package/dist/validation/index.d.ts +0 -1
  77. package/dist/validation/template.d.ts +0 -23
@@ -1,69 +0,0 @@
1
- /**
2
- * Convenience function to scan a directory
3
- */
4
- export declare function scanForSecrets(options: ScanOptions): Promise<ScanResult>;
5
- /**
6
- * Format scan results for CLI output
7
- */
8
- export declare function formatScanResults(result: ScanResult): string;
9
- /**
10
- * Common secret patterns to detect
11
- */
12
- export declare const SECRET_PATTERNS: SecretPattern[];
13
- export declare interface SecretPattern {
14
- name: string
15
- pattern: RegExp
16
- severity: 'critical' | 'high' | 'medium' | 'low'
17
- description: string
18
- }
19
- export declare interface SecurityFinding {
20
- file: string
21
- line: number
22
- column: number
23
- match: string
24
- pattern: SecretPattern
25
- context: string
26
- }
27
- export declare interface ScanResult {
28
- passed: boolean
29
- findings: SecurityFinding[]
30
- scannedFiles: number
31
- duration: number
32
- summary: {
33
- critical: number
34
- high: number
35
- medium: number
36
- low: number
37
- }
38
- }
39
- export declare interface ScanOptions {
40
- directory: string
41
- exclude?: string[]
42
- include?: string[]
43
- skipPatterns?: string[]
44
- maxFileSize?: number
45
- failOnSeverity?: 'critical' | 'high' | 'medium' | 'low'
46
- }
47
- /**
48
- * Pre-deployment security scanner
49
- */
50
- export declare class PreDeployScanner {
51
- private patterns: SecretPattern[];
52
- private excludeDirs: string[];
53
- private excludeFiles: string[];
54
- private maxFileSize: number;
55
- constructor(options?: {
56
- customPatterns?: SecretPattern[]
57
- excludeDirs?: string[]
58
- excludeFiles?: string[]
59
- maxFileSize?: number
60
- });
61
- scan(options: ScanOptions): Promise<ScanResult>;
62
- private scanContent(content: string, filePath: string, skipPatterns: string[]): SecurityFinding[];
63
- private isLikelyPlaceholder(match: string, context: string): boolean;
64
- private maskSecret(value: string): string;
65
- private getFilesToScan(dir: string, excludeDirs: string[], includeExtensions?: string[]): string[];
66
- private shouldExcludeFile(filePath: string): boolean;
67
- addPattern(pattern: SecretPattern): void;
68
- getPatterns(): SecretPattern[];
69
- }
@@ -1,67 +0,0 @@
1
- // ACME Directory URLs
2
- export declare const ACME_DIRECTORIES: {
3
- production: 'https://acme-v02.api.letsencrypt.org/directory';
4
- staging: 'https://acme-staging-v02.api.letsencrypt.org/directory'
5
- };
6
- export declare interface AcmeClientOptions {
7
- staging?: boolean
8
- email: string
9
- accountKey?: string
10
- }
11
- export declare interface AcmeChallenge {
12
- type: 'http-01' | 'dns-01'
13
- token: string
14
- keyAuthorization: string
15
- identifier: string
16
- dnsValue?: string
17
- }
18
- export declare interface AcmeCertificate {
19
- certificate: string
20
- privateKey: string
21
- chain: string
22
- fullchain: string
23
- expiresAt: Date
24
- }
25
- declare interface AcmeDirectory {
26
- newNonce: string
27
- newAccount: string
28
- newOrder: string
29
- revokeCert: string
30
- keyChange: string
31
- }
32
- /**
33
- * ACME Client for Let's Encrypt certificate management
34
- */
35
- export declare class AcmeClient {
36
- private directoryUrl: string;
37
- private email: string;
38
- private accountKey: string;
39
- private accountUrl: string | null;
40
- private directory: AcmeDirectory | null;
41
- private nonce: string | null;
42
- constructor(options: AcmeClientOptions);
43
- private generateAccountKey(): string;
44
- private getDirectory(): Promise<AcmeDirectory>;
45
- private getNonce(): Promise<string>;
46
- private getJwk(): Record<string, string>;
47
- private getJwkThumbprint(): string;
48
- private base64UrlEncode(data: Buffer | string): string;
49
- private signPayload(url: string, payload: any): Promise<string>;
50
- private acmeRequest(url: string, payload: any): Promise<{ body: any; headers: Headers }>;
51
- registerAccount(): Promise<string>;
52
- createOrder(domains: string[]): Promise<{
53
- orderUrl: string
54
- authorizations: string[]
55
- finalize: string
56
- }>;
57
- getAuthorization(authUrl: string): Promise<{
58
- domain: string
59
- challenges: AcmeChallenge[]
60
- }>;
61
- respondToChallenge(challengeUrl: string): Promise<void>;
62
- waitForAuthorization(authUrl: string, maxAttempts?: any): Promise<void>;
63
- private generateCsr(domains: string[]): { csr: string; privateKey: string };
64
- private createSimpleCsr(domains: string[], privateKey: any): string;
65
- finalizeOrder(finalizeUrl: string, domains: string[]): Promise<AcmeCertificate>;
66
- getAccountKey(): string;
67
- }
@@ -1,2 +0,0 @@
1
- export * from './letsencrypt';
2
- export * from './acme-client';
@@ -1,48 +0,0 @@
1
- import type { DnsProviderConfig } from '../dns/types';
2
- /**
3
- * Generate UserData script for Let's Encrypt certificate setup on EC2
4
- * This creates a complete setup that handles certificate acquisition and renewal
5
- */
6
- export declare function generateLetsEncryptUserData(config: LetsEncryptConfig): string;
7
- /**
8
- * Generate server configuration for HTTPS with Let's Encrypt
9
- */
10
- export declare function generateHttpsServerCode(options: {
11
- httpPort?: number
12
- httpsPort?: number
13
- certPath?: string
14
- redirectHttp?: boolean
15
- }): string;
16
- /**
17
- * Setup DNS-01 challenge programmatically using any DNS provider
18
- * This is the unified API that works with Route53, Porkbun, GoDaddy, etc.
19
- */
20
- export declare function setupDns01Challenge(options: Dns01ChallengeConfig): Promise<void>;
21
- /**
22
- * Clean up DNS-01 challenge record using any DNS provider
23
- */
24
- export declare function cleanupDns01Challenge(options: Dns01ChallengeConfig): Promise<void>;
25
- /**
26
- * Check if certificates need renewal (< 30 days until expiry)
27
- */
28
- export declare function needsRenewal(certPath: string): boolean;
29
- export declare interface LetsEncryptConfig {
30
- domains: string[]
31
- email: string
32
- staging?: boolean
33
- challengeType?: 'http-01' | 'dns-01'
34
- hostedZoneId?: string
35
- dnsProvider?: DnsProviderConfig
36
- certPath?: string
37
- autoRenew?: boolean
38
- }
39
- /**
40
- * DNS-01 challenge configuration for programmatic use
41
- */
42
- export declare interface Dns01ChallengeConfig {
43
- domain: string
44
- challengeValue: string
45
- hostedZoneId?: string
46
- dnsProvider?: DnsProviderConfig
47
- region?: string
48
- }
package/dist/types.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from 'ts-cloud-types';
@@ -1,123 +0,0 @@
1
- /**
2
- * Colorize text
3
- */
4
- export declare function colorize(text: string, color: keyof typeof colors): string;
5
- /**
6
- * Success message
7
- */
8
- export declare function success(message: string): void;
9
- /**
10
- * Error message
11
- */
12
- export declare function error(message: string): void;
13
- /**
14
- * Warning message
15
- */
16
- export declare function warn(message: string): void;
17
- /**
18
- * Info message
19
- */
20
- export declare function info(message: string): void;
21
- /**
22
- * Step message
23
- */
24
- export declare function step(message: string): void;
25
- /**
26
- * Header message
27
- */
28
- export declare function header(message: string): void;
29
- /**
30
- * Prompt for user input
31
- */
32
- export declare function prompt(message: string, defaultValue?: string): Promise<string>;
33
- /**
34
- * Prompt for confirmation (yes/no)
35
- */
36
- export declare function confirm(message: string, defaultValue?: any): Promise<boolean>;
37
- /**
38
- * Select from a list of options
39
- */
40
- export declare function select(message: string, options: string[]): Promise<string>;
41
- /**
42
- * Format a table
43
- */
44
- export declare function table(headers: string[], rows: string[][]): void;
45
- /**
46
- * Format bytes to human readable
47
- */
48
- export declare function formatBytes(bytes: number): string;
49
- /**
50
- * Format duration to human readable
51
- */
52
- export declare function formatDuration(ms: number): string;
53
- /**
54
- * Box a message
55
- */
56
- export declare function box(message: string, color?: keyof typeof colors): void;
57
- /**
58
- * Check if AWS CLI is installed (deprecated - no longer required)
59
- * @deprecated AWS CLI is no longer required. Use checkAwsCredentials() instead.
60
- */
61
- export declare function checkAwsCli(): Promise<boolean>;
62
- /**
63
- * Check if AWS credentials are configured
64
- * Uses direct API call to STS GetCallerIdentity
65
- */
66
- export declare function checkAwsCredentials(): Promise<boolean>;
67
- /**
68
- * Get AWS account ID using direct STS API call
69
- */
70
- export declare function getAwsAccountId(): Promise<string | null>;
71
- /**
72
- * Get AWS regions using direct EC2 API call
73
- */
74
- export declare function getAwsRegions(): Promise<string[]>;
75
- /**
76
- * CLI Utility Functions
77
- * Helpers for colored output, spinners, prompts, and formatting
78
- */
79
- // ANSI color codes
80
- export declare const colors: {
81
- reset: '\x1B[0m';
82
- bright: '\x1B[1m';
83
- dim: '\x1B[2m';
84
- red: '\x1B[31m';
85
- green: '\x1B[32m';
86
- yellow: '\x1B[33m';
87
- blue: '\x1B[34m';
88
- magenta: '\x1B[35m';
89
- cyan: '\x1B[36m';
90
- white: '\x1B[37m';
91
- gray: '\x1B[90m'
92
- };
93
- /**
94
- * Warning message (alias)
95
- */
96
- export declare const warning: typeof warn;
97
- /**
98
- * Simple spinner
99
- */
100
- export declare class Spinner {
101
- private frames: any;
102
- private interval: Timer | null;
103
- private currentFrame: any;
104
- private message: string;
105
- constructor(message: string);
106
- start(): void;
107
- succeed(message?: string): void;
108
- fail(message?: string): void;
109
- warn(message?: string): void;
110
- stop(): void;
111
- }
112
- /**
113
- * Progress bar
114
- */
115
- export declare class ProgressBar {
116
- private total: number;
117
- private current: any;
118
- private width: any;
119
- constructor(total: number);
120
- update(current: number): void;
121
- increment(): void;
122
- private render(): void;
123
- }
@@ -1 +0,0 @@
1
- export * from './template';
@@ -1,23 +0,0 @@
1
- import type { CloudFormationTemplate } from 'ts-cloud-aws-types';
2
- /**
3
- * Validate a CloudFormation template
4
- */
5
- export declare function validateTemplate(template: CloudFormationTemplate): ValidationResult;
6
- /**
7
- * Validate template size
8
- */
9
- export declare function validateTemplateSize(templateBody: string): ValidationResult;
10
- /**
11
- * Validate template resource limits
12
- */
13
- export declare function validateResourceLimits(template: CloudFormationTemplate): ValidationResult;
14
- export declare interface ValidationError {
15
- path: string
16
- message: string
17
- severity: 'error' | 'warning'
18
- }
19
- export declare interface ValidationResult {
20
- valid: boolean
21
- errors: ValidationError[]
22
- warnings: ValidationError[]
23
- }