@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,389 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS Elastic Load Balancing V2 (ELBv2) Operations
|
|
3
|
+
* Direct API calls without AWS CLI dependency
|
|
4
|
+
*
|
|
5
|
+
* Supports Application Load Balancers (ALB), Network Load Balancers (NLB),
|
|
6
|
+
* and Gateway Load Balancers (GWLB)
|
|
7
|
+
*/
|
|
8
|
+
export interface LoadBalancer {
|
|
9
|
+
LoadBalancerArn?: string;
|
|
10
|
+
DNSName?: string;
|
|
11
|
+
CanonicalHostedZoneId?: string;
|
|
12
|
+
CreatedTime?: string;
|
|
13
|
+
LoadBalancerName?: string;
|
|
14
|
+
Scheme?: 'internet-facing' | 'internal';
|
|
15
|
+
VpcId?: string;
|
|
16
|
+
State?: {
|
|
17
|
+
Code?: 'active' | 'provisioning' | 'active_impaired' | 'failed';
|
|
18
|
+
Reason?: string;
|
|
19
|
+
};
|
|
20
|
+
Type?: 'application' | 'network' | 'gateway';
|
|
21
|
+
AvailabilityZones?: AvailabilityZone[];
|
|
22
|
+
SecurityGroups?: string[];
|
|
23
|
+
IpAddressType?: 'ipv4' | 'dualstack';
|
|
24
|
+
}
|
|
25
|
+
export interface AvailabilityZone {
|
|
26
|
+
ZoneName?: string;
|
|
27
|
+
SubnetId?: string;
|
|
28
|
+
OutpostId?: string;
|
|
29
|
+
LoadBalancerAddresses?: LoadBalancerAddress[];
|
|
30
|
+
}
|
|
31
|
+
export interface LoadBalancerAddress {
|
|
32
|
+
IpAddress?: string;
|
|
33
|
+
AllocationId?: string;
|
|
34
|
+
PrivateIPv4Address?: string;
|
|
35
|
+
IPv6Address?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface TargetGroup {
|
|
38
|
+
TargetGroupArn?: string;
|
|
39
|
+
TargetGroupName?: string;
|
|
40
|
+
Protocol?: string;
|
|
41
|
+
Port?: number;
|
|
42
|
+
VpcId?: string;
|
|
43
|
+
HealthCheckProtocol?: string;
|
|
44
|
+
HealthCheckPort?: string;
|
|
45
|
+
HealthCheckEnabled?: boolean;
|
|
46
|
+
HealthCheckIntervalSeconds?: number;
|
|
47
|
+
HealthCheckTimeoutSeconds?: number;
|
|
48
|
+
HealthyThresholdCount?: number;
|
|
49
|
+
UnhealthyThresholdCount?: number;
|
|
50
|
+
HealthCheckPath?: string;
|
|
51
|
+
Matcher?: {
|
|
52
|
+
HttpCode?: string;
|
|
53
|
+
GrpcCode?: string;
|
|
54
|
+
};
|
|
55
|
+
LoadBalancerArns?: string[];
|
|
56
|
+
TargetType?: 'instance' | 'ip' | 'lambda' | 'alb';
|
|
57
|
+
ProtocolVersion?: string;
|
|
58
|
+
IpAddressType?: 'ipv4' | 'ipv6';
|
|
59
|
+
}
|
|
60
|
+
export interface Listener {
|
|
61
|
+
ListenerArn?: string;
|
|
62
|
+
LoadBalancerArn?: string;
|
|
63
|
+
Port?: number;
|
|
64
|
+
Protocol?: string;
|
|
65
|
+
Certificates?: Certificate[];
|
|
66
|
+
SslPolicy?: string;
|
|
67
|
+
DefaultActions?: Action[];
|
|
68
|
+
AlpnPolicy?: string[];
|
|
69
|
+
}
|
|
70
|
+
export interface Certificate {
|
|
71
|
+
CertificateArn?: string;
|
|
72
|
+
IsDefault?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface Action {
|
|
75
|
+
Type?: 'forward' | 'redirect' | 'fixed-response' | 'authenticate-oidc' | 'authenticate-cognito';
|
|
76
|
+
TargetGroupArn?: string;
|
|
77
|
+
Order?: number;
|
|
78
|
+
RedirectConfig?: {
|
|
79
|
+
Protocol?: string;
|
|
80
|
+
Port?: string;
|
|
81
|
+
Host?: string;
|
|
82
|
+
Path?: string;
|
|
83
|
+
Query?: string;
|
|
84
|
+
StatusCode?: 'HTTP_301' | 'HTTP_302';
|
|
85
|
+
};
|
|
86
|
+
FixedResponseConfig?: {
|
|
87
|
+
MessageBody?: string;
|
|
88
|
+
StatusCode?: string;
|
|
89
|
+
ContentType?: string;
|
|
90
|
+
};
|
|
91
|
+
ForwardConfig?: {
|
|
92
|
+
TargetGroups?: Array<{
|
|
93
|
+
TargetGroupArn?: string;
|
|
94
|
+
Weight?: number;
|
|
95
|
+
}>;
|
|
96
|
+
TargetGroupStickinessConfig?: {
|
|
97
|
+
Enabled?: boolean;
|
|
98
|
+
DurationSeconds?: number;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export interface Rule {
|
|
103
|
+
RuleArn?: string;
|
|
104
|
+
Priority?: string;
|
|
105
|
+
Conditions?: Condition[];
|
|
106
|
+
Actions?: Action[];
|
|
107
|
+
IsDefault?: boolean;
|
|
108
|
+
}
|
|
109
|
+
export interface Condition {
|
|
110
|
+
Field?: string;
|
|
111
|
+
Values?: string[];
|
|
112
|
+
HostHeaderConfig?: {
|
|
113
|
+
Values?: string[];
|
|
114
|
+
};
|
|
115
|
+
PathPatternConfig?: {
|
|
116
|
+
Values?: string[];
|
|
117
|
+
};
|
|
118
|
+
HttpHeaderConfig?: {
|
|
119
|
+
HttpHeaderName?: string;
|
|
120
|
+
Values?: string[];
|
|
121
|
+
};
|
|
122
|
+
QueryStringConfig?: {
|
|
123
|
+
Values?: Array<{
|
|
124
|
+
Key?: string;
|
|
125
|
+
Value?: string;
|
|
126
|
+
}>;
|
|
127
|
+
};
|
|
128
|
+
HttpRequestMethodConfig?: {
|
|
129
|
+
Values?: string[];
|
|
130
|
+
};
|
|
131
|
+
SourceIpConfig?: {
|
|
132
|
+
Values?: string[];
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
export interface TargetHealthDescription {
|
|
136
|
+
Target?: {
|
|
137
|
+
Id?: string;
|
|
138
|
+
Port?: number;
|
|
139
|
+
AvailabilityZone?: string;
|
|
140
|
+
};
|
|
141
|
+
HealthCheckPort?: string;
|
|
142
|
+
TargetHealth?: {
|
|
143
|
+
State?: 'initial' | 'healthy' | 'unhealthy' | 'unused' | 'draining' | 'unavailable';
|
|
144
|
+
Reason?: string;
|
|
145
|
+
Description?: string;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* ELBv2 client for managing Application, Network, and Gateway Load Balancers
|
|
150
|
+
*/
|
|
151
|
+
export declare class ELBv2Client {
|
|
152
|
+
private client;
|
|
153
|
+
private region;
|
|
154
|
+
constructor(region?: string);
|
|
155
|
+
/**
|
|
156
|
+
* Describe load balancers
|
|
157
|
+
*/
|
|
158
|
+
describeLoadBalancers(options?: {
|
|
159
|
+
LoadBalancerArns?: string[];
|
|
160
|
+
Names?: string[];
|
|
161
|
+
Marker?: string;
|
|
162
|
+
PageSize?: number;
|
|
163
|
+
}): Promise<{
|
|
164
|
+
LoadBalancers?: LoadBalancer[];
|
|
165
|
+
NextMarker?: string;
|
|
166
|
+
}>;
|
|
167
|
+
/**
|
|
168
|
+
* Describe target groups
|
|
169
|
+
*/
|
|
170
|
+
describeTargetGroups(options?: {
|
|
171
|
+
LoadBalancerArn?: string;
|
|
172
|
+
TargetGroupArns?: string[];
|
|
173
|
+
Names?: string[];
|
|
174
|
+
Marker?: string;
|
|
175
|
+
PageSize?: number;
|
|
176
|
+
}): Promise<{
|
|
177
|
+
TargetGroups?: TargetGroup[];
|
|
178
|
+
NextMarker?: string;
|
|
179
|
+
}>;
|
|
180
|
+
/**
|
|
181
|
+
* Describe target health
|
|
182
|
+
*/
|
|
183
|
+
describeTargetHealth(options: {
|
|
184
|
+
TargetGroupArn: string;
|
|
185
|
+
Targets?: Array<{
|
|
186
|
+
Id: string;
|
|
187
|
+
Port?: number;
|
|
188
|
+
AvailabilityZone?: string;
|
|
189
|
+
}>;
|
|
190
|
+
}): Promise<{
|
|
191
|
+
TargetHealthDescriptions?: TargetHealthDescription[];
|
|
192
|
+
}>;
|
|
193
|
+
/**
|
|
194
|
+
* Describe listeners
|
|
195
|
+
*/
|
|
196
|
+
describeListeners(options?: {
|
|
197
|
+
LoadBalancerArn?: string;
|
|
198
|
+
ListenerArns?: string[];
|
|
199
|
+
Marker?: string;
|
|
200
|
+
PageSize?: number;
|
|
201
|
+
}): Promise<{
|
|
202
|
+
Listeners?: Listener[];
|
|
203
|
+
NextMarker?: string;
|
|
204
|
+
}>;
|
|
205
|
+
/**
|
|
206
|
+
* Describe rules for a listener
|
|
207
|
+
*/
|
|
208
|
+
describeRules(options?: {
|
|
209
|
+
ListenerArn?: string;
|
|
210
|
+
RuleArns?: string[];
|
|
211
|
+
Marker?: string;
|
|
212
|
+
PageSize?: number;
|
|
213
|
+
}): Promise<{
|
|
214
|
+
Rules?: Rule[];
|
|
215
|
+
NextMarker?: string;
|
|
216
|
+
}>;
|
|
217
|
+
/**
|
|
218
|
+
* Describe load balancer attributes
|
|
219
|
+
*/
|
|
220
|
+
describeLoadBalancerAttributes(loadBalancerArn: string): Promise<{
|
|
221
|
+
Attributes?: Array<{
|
|
222
|
+
Key: string;
|
|
223
|
+
Value: string;
|
|
224
|
+
}>;
|
|
225
|
+
}>;
|
|
226
|
+
/**
|
|
227
|
+
* Describe target group attributes
|
|
228
|
+
*/
|
|
229
|
+
describeTargetGroupAttributes(targetGroupArn: string): Promise<{
|
|
230
|
+
Attributes?: Array<{
|
|
231
|
+
Key: string;
|
|
232
|
+
Value: string;
|
|
233
|
+
}>;
|
|
234
|
+
}>;
|
|
235
|
+
/**
|
|
236
|
+
* Create a load balancer
|
|
237
|
+
*/
|
|
238
|
+
createLoadBalancer(options: {
|
|
239
|
+
Name: string;
|
|
240
|
+
Subnets?: string[];
|
|
241
|
+
SubnetMappings?: Array<{
|
|
242
|
+
SubnetId: string;
|
|
243
|
+
AllocationId?: string;
|
|
244
|
+
PrivateIPv4Address?: string;
|
|
245
|
+
IPv6Address?: string;
|
|
246
|
+
}>;
|
|
247
|
+
SecurityGroups?: string[];
|
|
248
|
+
Scheme?: 'internet-facing' | 'internal';
|
|
249
|
+
Type?: 'application' | 'network' | 'gateway';
|
|
250
|
+
IpAddressType?: 'ipv4' | 'dualstack';
|
|
251
|
+
Tags?: Array<{
|
|
252
|
+
Key: string;
|
|
253
|
+
Value: string;
|
|
254
|
+
}>;
|
|
255
|
+
}): Promise<{
|
|
256
|
+
LoadBalancers?: LoadBalancer[];
|
|
257
|
+
}>;
|
|
258
|
+
/**
|
|
259
|
+
* Delete a load balancer
|
|
260
|
+
*/
|
|
261
|
+
deleteLoadBalancer(loadBalancerArn: string): Promise<void>;
|
|
262
|
+
/**
|
|
263
|
+
* Create a target group
|
|
264
|
+
*/
|
|
265
|
+
createTargetGroup(options: {
|
|
266
|
+
Name: string;
|
|
267
|
+
Protocol?: string;
|
|
268
|
+
ProtocolVersion?: string;
|
|
269
|
+
Port?: number;
|
|
270
|
+
VpcId?: string;
|
|
271
|
+
HealthCheckProtocol?: string;
|
|
272
|
+
HealthCheckPort?: string;
|
|
273
|
+
HealthCheckEnabled?: boolean;
|
|
274
|
+
HealthCheckPath?: string;
|
|
275
|
+
HealthCheckIntervalSeconds?: number;
|
|
276
|
+
HealthCheckTimeoutSeconds?: number;
|
|
277
|
+
HealthyThresholdCount?: number;
|
|
278
|
+
UnhealthyThresholdCount?: number;
|
|
279
|
+
Matcher?: {
|
|
280
|
+
HttpCode?: string;
|
|
281
|
+
GrpcCode?: string;
|
|
282
|
+
};
|
|
283
|
+
TargetType?: 'instance' | 'ip' | 'lambda' | 'alb';
|
|
284
|
+
Tags?: Array<{
|
|
285
|
+
Key: string;
|
|
286
|
+
Value: string;
|
|
287
|
+
}>;
|
|
288
|
+
IpAddressType?: 'ipv4' | 'ipv6';
|
|
289
|
+
}): Promise<{
|
|
290
|
+
TargetGroups?: TargetGroup[];
|
|
291
|
+
}>;
|
|
292
|
+
/**
|
|
293
|
+
* Delete a target group
|
|
294
|
+
*/
|
|
295
|
+
deleteTargetGroup(targetGroupArn: string): Promise<void>;
|
|
296
|
+
/**
|
|
297
|
+
* Register targets with a target group
|
|
298
|
+
*/
|
|
299
|
+
registerTargets(options: {
|
|
300
|
+
TargetGroupArn: string;
|
|
301
|
+
Targets: Array<{
|
|
302
|
+
Id: string;
|
|
303
|
+
Port?: number;
|
|
304
|
+
AvailabilityZone?: string;
|
|
305
|
+
}>;
|
|
306
|
+
}): Promise<void>;
|
|
307
|
+
/**
|
|
308
|
+
* Deregister targets from a target group
|
|
309
|
+
*/
|
|
310
|
+
deregisterTargets(options: {
|
|
311
|
+
TargetGroupArn: string;
|
|
312
|
+
Targets: Array<{
|
|
313
|
+
Id: string;
|
|
314
|
+
Port?: number;
|
|
315
|
+
AvailabilityZone?: string;
|
|
316
|
+
}>;
|
|
317
|
+
}): Promise<void>;
|
|
318
|
+
/**
|
|
319
|
+
* Create a listener
|
|
320
|
+
*/
|
|
321
|
+
createListener(options: {
|
|
322
|
+
LoadBalancerArn: string;
|
|
323
|
+
Protocol?: string;
|
|
324
|
+
Port: number;
|
|
325
|
+
SslPolicy?: string;
|
|
326
|
+
Certificates?: Array<{
|
|
327
|
+
CertificateArn: string;
|
|
328
|
+
}>;
|
|
329
|
+
DefaultActions: Array<{
|
|
330
|
+
Type: 'forward' | 'redirect' | 'fixed-response';
|
|
331
|
+
TargetGroupArn?: string;
|
|
332
|
+
Order?: number;
|
|
333
|
+
RedirectConfig?: {
|
|
334
|
+
Protocol?: string;
|
|
335
|
+
Port?: string;
|
|
336
|
+
Host?: string;
|
|
337
|
+
Path?: string;
|
|
338
|
+
Query?: string;
|
|
339
|
+
StatusCode: 'HTTP_301' | 'HTTP_302';
|
|
340
|
+
};
|
|
341
|
+
FixedResponseConfig?: {
|
|
342
|
+
MessageBody?: string;
|
|
343
|
+
StatusCode: string;
|
|
344
|
+
ContentType?: string;
|
|
345
|
+
};
|
|
346
|
+
}>;
|
|
347
|
+
AlpnPolicy?: string[];
|
|
348
|
+
Tags?: Array<{
|
|
349
|
+
Key: string;
|
|
350
|
+
Value: string;
|
|
351
|
+
}>;
|
|
352
|
+
}): Promise<{
|
|
353
|
+
Listeners?: Listener[];
|
|
354
|
+
}>;
|
|
355
|
+
/**
|
|
356
|
+
* Delete a listener
|
|
357
|
+
*/
|
|
358
|
+
deleteListener(listenerArn: string): Promise<void>;
|
|
359
|
+
/**
|
|
360
|
+
* Modify listener
|
|
361
|
+
*/
|
|
362
|
+
modifyListener(options: {
|
|
363
|
+
ListenerArn: string;
|
|
364
|
+
Port?: number;
|
|
365
|
+
Protocol?: string;
|
|
366
|
+
SslPolicy?: string;
|
|
367
|
+
Certificates?: Array<{
|
|
368
|
+
CertificateArn: string;
|
|
369
|
+
}>;
|
|
370
|
+
DefaultActions?: Action[];
|
|
371
|
+
AlpnPolicy?: string[];
|
|
372
|
+
}): Promise<{
|
|
373
|
+
Listeners?: Listener[];
|
|
374
|
+
}>;
|
|
375
|
+
/**
|
|
376
|
+
* Build form URL encoded body for ELBv2 API
|
|
377
|
+
*/
|
|
378
|
+
private buildFormBody;
|
|
379
|
+
/**
|
|
380
|
+
* Normalize the parsed XML result from AWS API
|
|
381
|
+
* The client parses XML to JSON, so we need to extract the result
|
|
382
|
+
*/
|
|
383
|
+
private normalizeResult;
|
|
384
|
+
/**
|
|
385
|
+
* Normalize arrays in the response
|
|
386
|
+
* AWS XML parsing sometimes returns single items as objects instead of arrays
|
|
387
|
+
*/
|
|
388
|
+
private normalizeArrays;
|
|
389
|
+
}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS Email Module
|
|
3
|
+
* High-level email operations for both serverless and server deployments
|
|
4
|
+
*
|
|
5
|
+
* This module provides:
|
|
6
|
+
* - Email sending via SES
|
|
7
|
+
* - Email receiving setup (receipt rules, S3 storage)
|
|
8
|
+
* - Domain verification and DKIM setup
|
|
9
|
+
* - SMTP credential management for client email apps
|
|
10
|
+
*/
|
|
11
|
+
export interface EmailConfig {
|
|
12
|
+
domain: string;
|
|
13
|
+
region?: string;
|
|
14
|
+
mailboxes?: string[];
|
|
15
|
+
storage?: {
|
|
16
|
+
bucket?: string;
|
|
17
|
+
prefix?: string;
|
|
18
|
+
retentionDays?: number;
|
|
19
|
+
};
|
|
20
|
+
smtp?: {
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
username?: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface EmailSetupResult {
|
|
26
|
+
domainVerified: boolean;
|
|
27
|
+
dkimStatus: string;
|
|
28
|
+
dkimTokens?: string[];
|
|
29
|
+
mailFromStatus?: string;
|
|
30
|
+
receiptRuleSet?: string;
|
|
31
|
+
storageBucket?: string;
|
|
32
|
+
smtpCredentials?: {
|
|
33
|
+
username: string;
|
|
34
|
+
server: string;
|
|
35
|
+
port: number;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface SendEmailOptions {
|
|
39
|
+
from?: string;
|
|
40
|
+
fromName?: string;
|
|
41
|
+
to: string | string[];
|
|
42
|
+
cc?: string | string[];
|
|
43
|
+
bcc?: string | string[];
|
|
44
|
+
subject: string;
|
|
45
|
+
text?: string;
|
|
46
|
+
html?: string;
|
|
47
|
+
replyTo?: string | string[];
|
|
48
|
+
attachments?: Array<{
|
|
49
|
+
filename: string;
|
|
50
|
+
content: string;
|
|
51
|
+
contentType?: string;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
export interface EmailDeploymentConfig {
|
|
55
|
+
domain: string;
|
|
56
|
+
accountId: string;
|
|
57
|
+
region?: string;
|
|
58
|
+
appName: string;
|
|
59
|
+
environment: string;
|
|
60
|
+
mailboxes?: string[];
|
|
61
|
+
catchAll?: boolean;
|
|
62
|
+
storage?: {
|
|
63
|
+
bucketName?: string;
|
|
64
|
+
prefix?: string;
|
|
65
|
+
};
|
|
66
|
+
notifications?: {
|
|
67
|
+
bounces?: boolean;
|
|
68
|
+
complaints?: boolean;
|
|
69
|
+
newEmail?: boolean;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* High-level Email client for serverless and server deployments
|
|
74
|
+
*/
|
|
75
|
+
export declare class EmailClient {
|
|
76
|
+
private ses;
|
|
77
|
+
private s3;
|
|
78
|
+
private iam;
|
|
79
|
+
private route53;
|
|
80
|
+
private region;
|
|
81
|
+
private domain?;
|
|
82
|
+
private defaultFrom?;
|
|
83
|
+
constructor(options?: {
|
|
84
|
+
region?: string;
|
|
85
|
+
domain?: string;
|
|
86
|
+
defaultFrom?: string;
|
|
87
|
+
});
|
|
88
|
+
/**
|
|
89
|
+
* Send an email
|
|
90
|
+
*/
|
|
91
|
+
send(options: SendEmailOptions): Promise<{
|
|
92
|
+
messageId: string;
|
|
93
|
+
}>;
|
|
94
|
+
/**
|
|
95
|
+
* Send a templated email
|
|
96
|
+
*/
|
|
97
|
+
sendTemplate(options: {
|
|
98
|
+
from?: string;
|
|
99
|
+
fromName?: string;
|
|
100
|
+
to: string | string[];
|
|
101
|
+
templateName: string;
|
|
102
|
+
templateData: Record<string, any>;
|
|
103
|
+
replyTo?: string | string[];
|
|
104
|
+
}): Promise<{
|
|
105
|
+
messageId: string;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* Send bulk emails using a template
|
|
109
|
+
*/
|
|
110
|
+
sendBulk(options: {
|
|
111
|
+
from?: string;
|
|
112
|
+
templateName: string;
|
|
113
|
+
defaultTemplateData: Record<string, any>;
|
|
114
|
+
recipients: Array<{
|
|
115
|
+
to: string | string[];
|
|
116
|
+
templateData?: Record<string, any>;
|
|
117
|
+
}>;
|
|
118
|
+
}): Promise<{
|
|
119
|
+
results: Array<{
|
|
120
|
+
status: string;
|
|
121
|
+
messageId?: string;
|
|
122
|
+
error?: string;
|
|
123
|
+
}>;
|
|
124
|
+
}>;
|
|
125
|
+
/**
|
|
126
|
+
* Set up email for a domain (creates identity, DKIM, etc.)
|
|
127
|
+
*/
|
|
128
|
+
setupDomain(domain: string): Promise<EmailSetupResult>;
|
|
129
|
+
/**
|
|
130
|
+
* Get DNS records needed for email verification
|
|
131
|
+
*/
|
|
132
|
+
getDnsRecords(domain: string): Promise<Array<{
|
|
133
|
+
type: string;
|
|
134
|
+
name: string;
|
|
135
|
+
value: string;
|
|
136
|
+
priority?: number;
|
|
137
|
+
ttl?: number;
|
|
138
|
+
}>>;
|
|
139
|
+
/**
|
|
140
|
+
* Check if domain is fully verified and ready to send
|
|
141
|
+
*/
|
|
142
|
+
isDomainReady(domain: string): Promise<boolean>;
|
|
143
|
+
/**
|
|
144
|
+
* Set up email receiving for a domain
|
|
145
|
+
*/
|
|
146
|
+
setupReceiving(config: {
|
|
147
|
+
domain: string;
|
|
148
|
+
ruleSetName: string;
|
|
149
|
+
ruleName: string;
|
|
150
|
+
bucketName: string;
|
|
151
|
+
prefix?: string;
|
|
152
|
+
accountId: string;
|
|
153
|
+
recipients?: string[];
|
|
154
|
+
scanEnabled?: boolean;
|
|
155
|
+
lambdaArn?: string;
|
|
156
|
+
}): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Get incoming emails from S3 bucket
|
|
159
|
+
*/
|
|
160
|
+
getIncomingEmails(options: {
|
|
161
|
+
bucket: string;
|
|
162
|
+
prefix?: string;
|
|
163
|
+
maxResults?: number;
|
|
164
|
+
}): Promise<Array<{
|
|
165
|
+
key: string;
|
|
166
|
+
lastModified: string;
|
|
167
|
+
size: number;
|
|
168
|
+
}>>;
|
|
169
|
+
/**
|
|
170
|
+
* Read an email from S3
|
|
171
|
+
*/
|
|
172
|
+
readEmail(options: {
|
|
173
|
+
bucket: string;
|
|
174
|
+
key: string;
|
|
175
|
+
}): Promise<string>;
|
|
176
|
+
/**
|
|
177
|
+
* Create SMTP credentials for sending via email clients
|
|
178
|
+
* Note: These use IAM users and SES SMTP interface
|
|
179
|
+
*/
|
|
180
|
+
createSmtpCredentials(options: {
|
|
181
|
+
username: string;
|
|
182
|
+
domain: string;
|
|
183
|
+
}): Promise<{
|
|
184
|
+
username: string;
|
|
185
|
+
password: string;
|
|
186
|
+
server: string;
|
|
187
|
+
port: number;
|
|
188
|
+
}>;
|
|
189
|
+
/**
|
|
190
|
+
* Derive SMTP password from AWS secret access key
|
|
191
|
+
* Based on AWS documentation for SES SMTP credentials
|
|
192
|
+
*/
|
|
193
|
+
private deriveSmtpPassword;
|
|
194
|
+
/**
|
|
195
|
+
* Create an email template
|
|
196
|
+
*/
|
|
197
|
+
createTemplate(options: {
|
|
198
|
+
name: string;
|
|
199
|
+
subject: string;
|
|
200
|
+
text?: string;
|
|
201
|
+
html?: string;
|
|
202
|
+
}): Promise<void>;
|
|
203
|
+
/**
|
|
204
|
+
* Get an email template
|
|
205
|
+
*/
|
|
206
|
+
getTemplate(name: string): Promise<{
|
|
207
|
+
name: string;
|
|
208
|
+
subject?: string;
|
|
209
|
+
text?: string;
|
|
210
|
+
html?: string;
|
|
211
|
+
} | null>;
|
|
212
|
+
/**
|
|
213
|
+
* Delete an email template
|
|
214
|
+
*/
|
|
215
|
+
deleteTemplate(name: string): Promise<void>;
|
|
216
|
+
/**
|
|
217
|
+
* List all email templates
|
|
218
|
+
*/
|
|
219
|
+
listTemplates(): Promise<Array<{
|
|
220
|
+
name: string;
|
|
221
|
+
createdAt?: string;
|
|
222
|
+
}>>;
|
|
223
|
+
/**
|
|
224
|
+
* Deploy full email infrastructure for an application
|
|
225
|
+
*/
|
|
226
|
+
deploy(config: EmailDeploymentConfig): Promise<{
|
|
227
|
+
success: boolean;
|
|
228
|
+
domainVerified: boolean;
|
|
229
|
+
dkimStatus: string;
|
|
230
|
+
receiptRuleSet: string;
|
|
231
|
+
storageBucket: string;
|
|
232
|
+
dnsRecords: Array<{
|
|
233
|
+
type: string;
|
|
234
|
+
name: string;
|
|
235
|
+
value: string;
|
|
236
|
+
}>;
|
|
237
|
+
}>;
|
|
238
|
+
/**
|
|
239
|
+
* Undeploy email infrastructure
|
|
240
|
+
*/
|
|
241
|
+
undeploy(config: {
|
|
242
|
+
appName: string;
|
|
243
|
+
environment: string;
|
|
244
|
+
domain: string;
|
|
245
|
+
deleteBucket?: boolean;
|
|
246
|
+
}): Promise<void>;
|
|
247
|
+
/**
|
|
248
|
+
* Get sending statistics
|
|
249
|
+
*/
|
|
250
|
+
getSendingStats(): Promise<{
|
|
251
|
+
sentLast24Hours: number;
|
|
252
|
+
maxSendRate: number;
|
|
253
|
+
max24HourSend: number;
|
|
254
|
+
}>;
|
|
255
|
+
/**
|
|
256
|
+
* Build a raw MIME email with attachments
|
|
257
|
+
*/
|
|
258
|
+
private buildRawEmail;
|
|
259
|
+
}
|
|
260
|
+
export declare const email: EmailClient;
|