@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
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare interface APNsConfig {
|
|
2
|
+
keyId: string
|
|
3
|
+
teamId: string
|
|
4
|
+
privateKey: string
|
|
5
|
+
bundleId: string
|
|
6
|
+
production?: boolean
|
|
7
|
+
}
|
|
8
|
+
export declare interface APNsNotification {
|
|
9
|
+
deviceToken: string
|
|
10
|
+
title?: string
|
|
11
|
+
subtitle?: string
|
|
12
|
+
body?: string
|
|
13
|
+
badge?: number
|
|
14
|
+
sound?: string | { name: string; critical?: number; volume?: number }
|
|
15
|
+
category?: string
|
|
16
|
+
threadId?: string
|
|
17
|
+
data?: Record<string, any>
|
|
18
|
+
contentAvailable?: boolean
|
|
19
|
+
mutableContent?: boolean
|
|
20
|
+
pushType?: 'alert' | 'background' | 'voip' | 'complication' | 'fileprovider' | 'mdm' | 'liveactivity'
|
|
21
|
+
priority?: 5 | 10
|
|
22
|
+
expiration?: number
|
|
23
|
+
collapseId?: string
|
|
24
|
+
targetContentId?: string
|
|
25
|
+
}
|
|
26
|
+
export declare interface APNsSendResult {
|
|
27
|
+
success: boolean
|
|
28
|
+
deviceToken: string
|
|
29
|
+
apnsId?: string
|
|
30
|
+
statusCode?: number
|
|
31
|
+
error?: string
|
|
32
|
+
reason?: string
|
|
33
|
+
timestamp?: number
|
|
34
|
+
}
|
|
35
|
+
export declare interface APNsBatchResult {
|
|
36
|
+
sent: number
|
|
37
|
+
failed: number
|
|
38
|
+
results: APNsSendResult[]
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Apple Push Notification Service client
|
|
42
|
+
*/
|
|
43
|
+
export declare class APNsClient {
|
|
44
|
+
private config: APNsConfig;
|
|
45
|
+
private token: string | null;
|
|
46
|
+
private tokenGeneratedAt: number;
|
|
47
|
+
private client: http2.ClientHttp2Session | null;
|
|
48
|
+
private host: string;
|
|
49
|
+
constructor(config: APNsConfig);
|
|
50
|
+
private generateToken(): string;
|
|
51
|
+
private derToRaw(derSignature: Buffer): Buffer;
|
|
52
|
+
private getClient(): Promise<http2.ClientHttp2Session>;
|
|
53
|
+
private buildPayload(notification: APNsNotification): object;
|
|
54
|
+
send(notification: APNsNotification): Promise<APNsSendResult>;
|
|
55
|
+
sendBatch(notifications: APNsNotification[], options?: { concurrency?: number }): Promise<APNsBatchResult>;
|
|
56
|
+
sendSimple(deviceToken: string, title: string, body: string, data?: Record<string, any>): Promise<APNsSendResult>;
|
|
57
|
+
sendSilent(deviceToken: string, data?: Record<string, any>): Promise<APNsSendResult>;
|
|
58
|
+
close(): void;
|
|
59
|
+
}
|
|
60
|
+
export default APNsClient;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export declare interface FCMConfig {
|
|
2
|
+
projectId: string
|
|
3
|
+
clientEmail: string
|
|
4
|
+
privateKey: string
|
|
5
|
+
}
|
|
6
|
+
export declare interface FCMNotification {
|
|
7
|
+
token?: string
|
|
8
|
+
topic?: string
|
|
9
|
+
condition?: string
|
|
10
|
+
title?: string
|
|
11
|
+
body?: string
|
|
12
|
+
imageUrl?: string
|
|
13
|
+
data?: Record<string, string>
|
|
14
|
+
android?: {
|
|
15
|
+
/** Channel ID for Android O+ */
|
|
16
|
+
channelId?: string
|
|
17
|
+
/** Notification priority */
|
|
18
|
+
priority?: 'normal' | 'high'
|
|
19
|
+
/** Time to live in seconds */
|
|
20
|
+
ttl?: number
|
|
21
|
+
/** Collapse key for message deduplication */
|
|
22
|
+
collapseKey?: string
|
|
23
|
+
/** Notification icon */
|
|
24
|
+
icon?: string
|
|
25
|
+
/** Notification icon color (hex) */
|
|
26
|
+
color?: string
|
|
27
|
+
/** Sound to play */
|
|
28
|
+
sound?: string
|
|
29
|
+
/** Click action */
|
|
30
|
+
clickAction?: string
|
|
31
|
+
/** Tag for notification replacement */
|
|
32
|
+
tag?: string
|
|
33
|
+
/** Direct boot aware */
|
|
34
|
+
directBootOk?: boolean
|
|
35
|
+
/** Visibility: private, public, secret */
|
|
36
|
+
visibility?: 'private' | 'public' | 'secret'
|
|
37
|
+
/** Notification count */
|
|
38
|
+
notificationCount?: number
|
|
39
|
+
}
|
|
40
|
+
webpush?: {
|
|
41
|
+
/** Web notification options */
|
|
42
|
+
notification?: {
|
|
43
|
+
title?: string
|
|
44
|
+
body?: string
|
|
45
|
+
icon?: string
|
|
46
|
+
badge?: string
|
|
47
|
+
image?: string
|
|
48
|
+
requireInteraction?: boolean
|
|
49
|
+
silent?: boolean
|
|
50
|
+
tag?: string
|
|
51
|
+
actions?: Array<{ action: string; title: string; icon?: string }>
|
|
52
|
+
}
|
|
53
|
+
/** FCM options for web */
|
|
54
|
+
fcmOptions?: {
|
|
55
|
+
link?: string
|
|
56
|
+
analyticsLabel?: string
|
|
57
|
+
}
|
|
58
|
+
/** Custom headers */
|
|
59
|
+
headers?: Record<string, string>
|
|
60
|
+
/** Custom data */
|
|
61
|
+
data?: Record<string, string>
|
|
62
|
+
}
|
|
63
|
+
apns?: {
|
|
64
|
+
/** APNs headers */
|
|
65
|
+
headers?: Record<string, string>
|
|
66
|
+
/** APNs payload */
|
|
67
|
+
payload?: {
|
|
68
|
+
aps?: Record<string, any>
|
|
69
|
+
[key: string]: any
|
|
70
|
+
}
|
|
71
|
+
/** FCM options */
|
|
72
|
+
fcmOptions?: {
|
|
73
|
+
analyticsLabel?: string
|
|
74
|
+
image?: string
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
fcmOptions?: {
|
|
78
|
+
analyticsLabel?: string
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export declare interface FCMSendResult {
|
|
82
|
+
success: boolean
|
|
83
|
+
messageId?: string
|
|
84
|
+
error?: string
|
|
85
|
+
errorCode?: string
|
|
86
|
+
}
|
|
87
|
+
export declare interface FCMBatchResult {
|
|
88
|
+
sent: number
|
|
89
|
+
failed: number
|
|
90
|
+
results: Array<FCMSendResult & { token?: string }>
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Firebase Cloud Messaging client
|
|
94
|
+
*/
|
|
95
|
+
export declare class FCMClient {
|
|
96
|
+
private config: FCMConfig;
|
|
97
|
+
private accessToken: string | null;
|
|
98
|
+
private tokenExpiresAt: number;
|
|
99
|
+
constructor(config: FCMConfig);
|
|
100
|
+
static fromServiceAccount(serviceAccount: {
|
|
101
|
+
project_id: string
|
|
102
|
+
client_email: string
|
|
103
|
+
private_key: string
|
|
104
|
+
}): FCMClient;
|
|
105
|
+
private generateJWT(): string;
|
|
106
|
+
private getAccessToken(): Promise<string>;
|
|
107
|
+
private buildMessage(notification: FCMNotification): object;
|
|
108
|
+
send(notification: FCMNotification): Promise<FCMSendResult>;
|
|
109
|
+
sendBatch(tokens: string[], notification: Omit<FCMNotification, 'token' | 'topic' | 'condition'>, options?: { concurrency?: number }): Promise<FCMBatchResult>;
|
|
110
|
+
sendToTopic(topic: string, notification: Omit<FCMNotification, 'token' | 'topic' | 'condition'>): Promise<FCMSendResult>;
|
|
111
|
+
sendToCondition(condition: string, notification: Omit<FCMNotification, 'token' | 'topic' | 'condition'>): Promise<FCMSendResult>;
|
|
112
|
+
sendSimple(token: string, title: string, body: string, data?: Record<string, string>): Promise<FCMSendResult>;
|
|
113
|
+
sendSilent(token: string, data: Record<string, string>): Promise<FCMSendResult>;
|
|
114
|
+
subscribeToTopic(tokens: string[], topic: string): Promise<{ success: boolean; error?: string }>;
|
|
115
|
+
unsubscribeFromTopic(tokens: string[], topic: string): Promise<{ success: boolean; error?: string }>;
|
|
116
|
+
}
|
|
117
|
+
export default FCMClient;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
APNsConfig,
|
|
3
|
+
APNsNotification,
|
|
4
|
+
APNsSendResult,
|
|
5
|
+
APNsBatchResult,
|
|
6
|
+
} from './apns';
|
|
7
|
+
export type {
|
|
8
|
+
FCMConfig,
|
|
9
|
+
FCMNotification,
|
|
10
|
+
FCMSendResult,
|
|
11
|
+
FCMBatchResult,
|
|
12
|
+
} from './fcm';
|
|
13
|
+
export * from './apns';
|
|
14
|
+
export * from './fcm';
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@stacksjs/ts-cloud-types';
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './template';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CloudFormationTemplate } from '@stacksjs/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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/ts-cloud",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.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",
|
|
8
|
-
"homepage": "https://github.com/stacksjs/cloud#readme",
|
|
8
|
+
"homepage": "https://github.com/stacksjs/ts-cloud#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/stacksjs/cloud.git"
|
|
11
|
+
"url": "git+https://github.com/stacksjs/ts-cloud.git"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/stacksjs/cloud/issues"
|
|
14
|
+
"url": "https://github.com/stacksjs/ts-cloud/issues"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"typescript",
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"test": "bun test"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@stacksjs/ts-cloud-aws-types": "
|
|
88
|
-
"@stacksjs/ts-cloud-core": "
|
|
89
|
-
"@stacksjs/ts-cloud-types": "
|
|
90
|
-
"fast-xml-parser": "^5.3.
|
|
87
|
+
"@stacksjs/ts-cloud-aws-types": "0.1.5",
|
|
88
|
+
"@stacksjs/ts-cloud-core": "0.1.5",
|
|
89
|
+
"@stacksjs/ts-cloud-types": "0.1.5",
|
|
90
|
+
"fast-xml-parser": "^5.3.5"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"bunfig": "^0.15.6",
|