@stacksjs/ts-cloud 0.2.2 → 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,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS API Client - Direct API calls without AWS CLI
|
|
3
|
+
* Implements AWS Signature Version 4 for authentication
|
|
4
|
+
*/
|
|
5
|
+
export interface AWSCredentials {
|
|
6
|
+
accessKeyId: string;
|
|
7
|
+
secretAccessKey: string;
|
|
8
|
+
sessionToken?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AWSRequestOptions {
|
|
11
|
+
service: string;
|
|
12
|
+
region: string;
|
|
13
|
+
method: string;
|
|
14
|
+
path: string;
|
|
15
|
+
queryParams?: Record<string, string>;
|
|
16
|
+
headers?: Record<string, string>;
|
|
17
|
+
body?: string;
|
|
18
|
+
credentials?: AWSCredentials;
|
|
19
|
+
retries?: number;
|
|
20
|
+
cacheKey?: string;
|
|
21
|
+
cacheTTL?: number;
|
|
22
|
+
returnHeaders?: boolean;
|
|
23
|
+
rawResponse?: boolean;
|
|
24
|
+
/** S3 bucket name for virtual-hosted style URLs */
|
|
25
|
+
bucket?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AWSClientConfig {
|
|
28
|
+
maxRetries?: number;
|
|
29
|
+
retryDelay?: number;
|
|
30
|
+
cacheEnabled?: boolean;
|
|
31
|
+
defaultCacheTTL?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface AWSError extends Error {
|
|
34
|
+
code?: string;
|
|
35
|
+
statusCode?: number;
|
|
36
|
+
requestId?: string;
|
|
37
|
+
type?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* AWS API Client - Makes authenticated requests to AWS services
|
|
41
|
+
*/
|
|
42
|
+
export declare class AWSClient {
|
|
43
|
+
private credentials?;
|
|
44
|
+
private config;
|
|
45
|
+
private cache;
|
|
46
|
+
private xmlParser;
|
|
47
|
+
constructor(credentials?: AWSCredentials, config?: AWSClientConfig);
|
|
48
|
+
/**
|
|
49
|
+
* Load AWS credentials from environment variables, credentials file, or EC2 instance metadata
|
|
50
|
+
*/
|
|
51
|
+
private loadCredentials;
|
|
52
|
+
/**
|
|
53
|
+
* Load credentials from ~/.aws/credentials file
|
|
54
|
+
*/
|
|
55
|
+
private loadCredentialsFromFile;
|
|
56
|
+
/**
|
|
57
|
+
* Parse AWS credentials file (INI format)
|
|
58
|
+
*/
|
|
59
|
+
private parseCredentialsFile;
|
|
60
|
+
/**
|
|
61
|
+
* Cache for EC2 instance metadata credentials
|
|
62
|
+
*/
|
|
63
|
+
private ec2CredentialsCache?;
|
|
64
|
+
/**
|
|
65
|
+
* Get credentials, fetching from credentials file or EC2 metadata if needed
|
|
66
|
+
*/
|
|
67
|
+
private getCredentials;
|
|
68
|
+
/**
|
|
69
|
+
* Make a signed AWS API request with retry logic and caching
|
|
70
|
+
*/
|
|
71
|
+
request(options: AWSRequestOptions): Promise<any>;
|
|
72
|
+
/**
|
|
73
|
+
* Make the actual HTTP request
|
|
74
|
+
*/
|
|
75
|
+
private makeRequest;
|
|
76
|
+
/**
|
|
77
|
+
* Convert Headers object to plain object
|
|
78
|
+
*/
|
|
79
|
+
private headersToObject;
|
|
80
|
+
/**
|
|
81
|
+
* Build the full URL for the request
|
|
82
|
+
*/
|
|
83
|
+
private buildUrl;
|
|
84
|
+
/**
|
|
85
|
+
* Sign the request using AWS Signature Version 4
|
|
86
|
+
*/
|
|
87
|
+
private signRequest;
|
|
88
|
+
/**
|
|
89
|
+
* Get AMZ date format (YYYYMMDDTHHMMSSZ)
|
|
90
|
+
*/
|
|
91
|
+
private getAmzDate;
|
|
92
|
+
/**
|
|
93
|
+
* Get date stamp (YYYYMMDD)
|
|
94
|
+
*/
|
|
95
|
+
private getDateStamp;
|
|
96
|
+
/**
|
|
97
|
+
* URI-encode a string per RFC 3986
|
|
98
|
+
*/
|
|
99
|
+
private uriEncode;
|
|
100
|
+
/**
|
|
101
|
+
* SHA256 hash
|
|
102
|
+
*/
|
|
103
|
+
private sha256;
|
|
104
|
+
/**
|
|
105
|
+
* HMAC SHA256
|
|
106
|
+
*/
|
|
107
|
+
private hmac;
|
|
108
|
+
/**
|
|
109
|
+
* Get signature key
|
|
110
|
+
*/
|
|
111
|
+
private getSignatureKey;
|
|
112
|
+
/**
|
|
113
|
+
* Parse XML response using ts-xml
|
|
114
|
+
*/
|
|
115
|
+
private parseXmlResponse;
|
|
116
|
+
/**
|
|
117
|
+
* Parse error response and create detailed error object
|
|
118
|
+
*/
|
|
119
|
+
private parseError;
|
|
120
|
+
/**
|
|
121
|
+
* Create error from XML error object
|
|
122
|
+
*/
|
|
123
|
+
private createErrorFromXml;
|
|
124
|
+
/**
|
|
125
|
+
* Check if error code is retryable
|
|
126
|
+
*/
|
|
127
|
+
private isRetryableError;
|
|
128
|
+
/**
|
|
129
|
+
* Check if HTTP status code is retryable
|
|
130
|
+
*/
|
|
131
|
+
private isRetryableStatusCode;
|
|
132
|
+
/**
|
|
133
|
+
* Determine if an error should be retried
|
|
134
|
+
*/
|
|
135
|
+
private shouldRetry;
|
|
136
|
+
/**
|
|
137
|
+
* Calculate retry delay with exponential backoff
|
|
138
|
+
*/
|
|
139
|
+
private calculateRetryDelay;
|
|
140
|
+
/**
|
|
141
|
+
* Sleep for specified milliseconds
|
|
142
|
+
*/
|
|
143
|
+
private sleep;
|
|
144
|
+
/**
|
|
145
|
+
* Get value from cache
|
|
146
|
+
*/
|
|
147
|
+
private getFromCache;
|
|
148
|
+
/**
|
|
149
|
+
* Set value in cache
|
|
150
|
+
*/
|
|
151
|
+
private setInCache;
|
|
152
|
+
/**
|
|
153
|
+
* Clear cache
|
|
154
|
+
*/
|
|
155
|
+
clearCache(): void;
|
|
156
|
+
/**
|
|
157
|
+
* Clear expired cache entries
|
|
158
|
+
*/
|
|
159
|
+
clearExpiredCache(): void;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Build query string for AWS API calls
|
|
163
|
+
*/
|
|
164
|
+
export declare function buildQueryParams(params: Record<string, any>): Record<string, string>;
|
|
165
|
+
/**
|
|
166
|
+
* Describes where AWS credentials will be loaded from based on current env state.
|
|
167
|
+
* Useful for diagnostics — surfaces which source the deploy will actually use
|
|
168
|
+
* before any AWS calls happen.
|
|
169
|
+
*/
|
|
170
|
+
export interface CredentialSourceInfo {
|
|
171
|
+
source: 'env' | 'file' | 'ec2' | 'none';
|
|
172
|
+
/** Profile name when source is 'file' */
|
|
173
|
+
profile?: string;
|
|
174
|
+
/** Empty AWS_ACCESS_KEY_ID env var was found — likely a misconfigured .env */
|
|
175
|
+
emptyEnvKey?: boolean;
|
|
176
|
+
/** Empty AWS_SECRET_ACCESS_KEY env var was found */
|
|
177
|
+
emptyEnvSecret?: boolean;
|
|
178
|
+
/** Human-readable description */
|
|
179
|
+
description: string;
|
|
180
|
+
}
|
|
181
|
+
export declare function detectCredentialSource(): CredentialSourceInfo;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS CloudFormation Operations
|
|
3
|
+
* Direct API calls without AWS CLI dependency
|
|
4
|
+
*/
|
|
5
|
+
export interface StackParameter {
|
|
6
|
+
ParameterKey: string;
|
|
7
|
+
ParameterValue: string;
|
|
8
|
+
UsePreviousValue?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface StackTag {
|
|
11
|
+
Key: string;
|
|
12
|
+
Value: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateStackOptions {
|
|
15
|
+
stackName: string;
|
|
16
|
+
templateBody?: string;
|
|
17
|
+
templateUrl?: string;
|
|
18
|
+
parameters?: StackParameter[];
|
|
19
|
+
capabilities?: string[];
|
|
20
|
+
roleArn?: string;
|
|
21
|
+
tags?: StackTag[];
|
|
22
|
+
timeoutInMinutes?: number;
|
|
23
|
+
onFailure?: 'DO_NOTHING' | 'ROLLBACK' | 'DELETE';
|
|
24
|
+
}
|
|
25
|
+
export interface UpdateStackOptions {
|
|
26
|
+
stackName: string;
|
|
27
|
+
templateBody?: string;
|
|
28
|
+
templateUrl?: string;
|
|
29
|
+
parameters?: StackParameter[];
|
|
30
|
+
capabilities?: string[];
|
|
31
|
+
roleArn?: string;
|
|
32
|
+
tags?: StackTag[];
|
|
33
|
+
}
|
|
34
|
+
export interface DescribeStacksOptions {
|
|
35
|
+
stackName?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface StackEvent {
|
|
38
|
+
Timestamp: string;
|
|
39
|
+
ResourceType: string;
|
|
40
|
+
LogicalResourceId: string;
|
|
41
|
+
ResourceStatus: string;
|
|
42
|
+
ResourceStatusReason?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface Stack {
|
|
45
|
+
StackId: string;
|
|
46
|
+
StackName: string;
|
|
47
|
+
StackStatus: string;
|
|
48
|
+
StackStatusReason?: string;
|
|
49
|
+
CreationTime: string;
|
|
50
|
+
LastUpdatedTime?: string;
|
|
51
|
+
Parameters?: StackParameter[];
|
|
52
|
+
Outputs?: Array<{
|
|
53
|
+
OutputKey: string;
|
|
54
|
+
OutputValue: string;
|
|
55
|
+
Description?: string;
|
|
56
|
+
ExportName?: string;
|
|
57
|
+
}>;
|
|
58
|
+
Tags?: StackTag[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* CloudFormation stack management using direct API calls
|
|
62
|
+
*/
|
|
63
|
+
export declare class CloudFormationClient {
|
|
64
|
+
private client;
|
|
65
|
+
private region;
|
|
66
|
+
constructor(region?: string, profile?: string);
|
|
67
|
+
/**
|
|
68
|
+
* Create a new CloudFormation stack
|
|
69
|
+
*/
|
|
70
|
+
createStack(options: CreateStackOptions): Promise<{
|
|
71
|
+
StackId: string;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Update an existing CloudFormation stack
|
|
75
|
+
*/
|
|
76
|
+
updateStack(options: UpdateStackOptions): Promise<{
|
|
77
|
+
StackId: string;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Delete a CloudFormation stack
|
|
81
|
+
*/
|
|
82
|
+
deleteStack(stackName: string, roleArn?: string, retainResources?: string[]): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Describe CloudFormation stacks
|
|
85
|
+
*/
|
|
86
|
+
describeStacks(options?: DescribeStacksOptions): Promise<{
|
|
87
|
+
Stacks: Stack[];
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* Get stack events
|
|
91
|
+
*/
|
|
92
|
+
describeStackEvents(stackName: string): Promise<{
|
|
93
|
+
StackEvents: StackEvent[];
|
|
94
|
+
}>;
|
|
95
|
+
/**
|
|
96
|
+
* List stack resources
|
|
97
|
+
*/
|
|
98
|
+
listStackResources(stackName: string): Promise<{
|
|
99
|
+
StackResourceSummaries: any[];
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Wait for stack to reach a specific status
|
|
103
|
+
*/
|
|
104
|
+
waitForStack(stackName: string, waitType: 'stack-create-complete' | 'stack-update-complete' | 'stack-delete-complete'): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Validate CloudFormation template
|
|
107
|
+
*/
|
|
108
|
+
validateTemplate(templateBody: string): Promise<any>;
|
|
109
|
+
/**
|
|
110
|
+
* List all stacks
|
|
111
|
+
*/
|
|
112
|
+
listStacks(statusFilter?: string[]): Promise<{
|
|
113
|
+
StackSummaries: Array<{
|
|
114
|
+
StackId: string;
|
|
115
|
+
StackName: string;
|
|
116
|
+
TemplateDescription?: string;
|
|
117
|
+
CreationTime: string;
|
|
118
|
+
LastUpdatedTime?: string;
|
|
119
|
+
DeletionTime?: string;
|
|
120
|
+
StackStatus: string;
|
|
121
|
+
}>;
|
|
122
|
+
}>;
|
|
123
|
+
/**
|
|
124
|
+
* Create change set (for preview before updating)
|
|
125
|
+
*/
|
|
126
|
+
createChangeSet(options: {
|
|
127
|
+
stackName: string;
|
|
128
|
+
changeSetName: string;
|
|
129
|
+
templateBody?: string;
|
|
130
|
+
templateUrl?: string;
|
|
131
|
+
parameters?: StackParameter[];
|
|
132
|
+
capabilities?: string[];
|
|
133
|
+
changeSetType?: 'CREATE' | 'UPDATE';
|
|
134
|
+
}): Promise<{
|
|
135
|
+
Id: string;
|
|
136
|
+
StackId: string;
|
|
137
|
+
}>;
|
|
138
|
+
/**
|
|
139
|
+
* Describe change set
|
|
140
|
+
*/
|
|
141
|
+
describeChangeSet(stackName: string, changeSetName: string): Promise<any>;
|
|
142
|
+
/**
|
|
143
|
+
* Execute change set
|
|
144
|
+
*/
|
|
145
|
+
executeChangeSet(stackName: string, changeSetName: string): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Delete change set
|
|
148
|
+
*/
|
|
149
|
+
deleteChangeSet(stackName: string, changeSetName: string): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Get stack outputs as key-value pairs
|
|
152
|
+
*/
|
|
153
|
+
getStackOutputs(stackName: string): Promise<Record<string, string>>;
|
|
154
|
+
/**
|
|
155
|
+
* Get stack template
|
|
156
|
+
*/
|
|
157
|
+
getTemplate(stackName: string): Promise<{
|
|
158
|
+
TemplateBody: string;
|
|
159
|
+
}>;
|
|
160
|
+
/**
|
|
161
|
+
* Parse stacks response
|
|
162
|
+
*/
|
|
163
|
+
private parseStacksResponse;
|
|
164
|
+
/**
|
|
165
|
+
* Parse stack events response
|
|
166
|
+
*/
|
|
167
|
+
private parseStackEvents;
|
|
168
|
+
/**
|
|
169
|
+
* Wait for stack with real-time progress output (CDK-style)
|
|
170
|
+
*/
|
|
171
|
+
waitForStackWithProgress(stackName: string, waitType: 'stack-create-complete' | 'stack-update-complete' | 'stack-delete-complete', onProgress?: (event: {
|
|
172
|
+
resourceId: string;
|
|
173
|
+
resourceType: string;
|
|
174
|
+
status: string;
|
|
175
|
+
reason?: string;
|
|
176
|
+
timestamp: string;
|
|
177
|
+
}) => void): Promise<void>;
|
|
178
|
+
/**
|
|
179
|
+
* Wait for stack operation to complete (create, update, or delete)
|
|
180
|
+
* Returns a result object with success status
|
|
181
|
+
*/
|
|
182
|
+
waitForStackComplete(stackName: string, maxAttempts?: number, delayMs?: number): Promise<{
|
|
183
|
+
success: boolean;
|
|
184
|
+
status: string;
|
|
185
|
+
reason?: string;
|
|
186
|
+
}>;
|
|
187
|
+
}
|