@stacksjs/ts-cloud-core 0.1.6 → 0.1.8
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/advanced-features.test.d.ts +0 -0
- package/dist/aws/cloudformation.d.ts +69 -0
- package/dist/aws/cloudfront.d.ts +21 -0
- package/dist/aws/credentials.d.ts +66 -0
- package/dist/aws/credentials.test.d.ts +0 -0
- package/dist/aws/index.d.ts +73 -0
- package/dist/aws/s3.d.ts +130 -0
- package/dist/aws/s3.test.d.ts +0 -0
- package/dist/aws/signature.d.ts +101 -0
- package/dist/aws/signature.test.d.ts +0 -0
- package/dist/backup/disaster-recovery.d.ts +98 -0
- package/dist/backup/disaster-recovery.test.d.ts +0 -0
- package/dist/backup/index.d.ts +24 -0
- package/dist/backup/manager.d.ts +112 -0
- package/dist/backup/manager.test.d.ts +0 -0
- package/dist/cicd/circleci.d.ts +47 -0
- package/dist/cicd/github-actions.d.ts +55 -0
- package/dist/cicd/gitlab-ci.d.ts +46 -0
- package/dist/cicd/index.d.ts +3 -0
- package/dist/cli/history.d.ts +66 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/progress.d.ts +97 -0
- package/dist/cli/repl.d.ts +76 -0
- package/dist/cli/suggestions.d.ts +67 -0
- package/dist/cli/table.d.ts +70 -0
- package/dist/cli/table.test.d.ts +0 -0
- package/dist/cloudformation/builder.d.ts +59 -0
- package/dist/cloudformation/builder.test.d.ts +0 -0
- package/dist/cloudformation/builders/api-gateway.d.ts +30 -0
- package/dist/cloudformation/builders/cache.d.ts +35 -0
- package/dist/cloudformation/builders/cdn.d.ts +34 -0
- package/dist/cloudformation/builders/compute.d.ts +66 -0
- package/dist/cloudformation/builders/database.d.ts +61 -0
- package/dist/cloudformation/builders/functions.d.ts +32 -0
- package/dist/cloudformation/builders/messaging.d.ts +17 -0
- package/dist/cloudformation/builders/monitoring.d.ts +36 -0
- package/dist/cloudformation/builders/network.d.ts +14 -0
- package/dist/cloudformation/builders/queue.d.ts +8 -0
- package/dist/cloudformation/builders/security.d.ts +31 -0
- package/dist/cloudformation/builders/storage.d.ts +8 -0
- package/dist/cloudformation/index.d.ts +24 -0
- package/dist/cloudformation/types.d.ts +132 -0
- package/dist/compliance/aws-config.d.ts +88 -0
- package/dist/compliance/cloudtrail.d.ts +96 -0
- package/dist/compliance/compliance.test.d.ts +0 -0
- package/dist/compliance/guardduty.d.ts +110 -0
- package/dist/compliance/index.d.ts +50 -0
- package/dist/compliance/security-hub.d.ts +110 -0
- package/dist/containers/build-optimization.d.ts +110 -0
- package/dist/containers/containers.test.d.ts +0 -0
- package/dist/containers/image-scanning.d.ts +96 -0
- package/dist/containers/index.d.ts +4 -0
- package/dist/containers/registry.d.ts +99 -0
- package/dist/containers/service-mesh.d.ts +206 -0
- package/dist/database/database.test.d.ts +0 -0
- package/dist/database/index.d.ts +4 -0
- package/dist/database/migrations.d.ts +102 -0
- package/dist/database/performance.d.ts +168 -0
- package/dist/database/replicas.d.ts +146 -0
- package/dist/database/users.d.ts +102 -0
- package/dist/dependency-graph.d.ts +19 -0
- package/dist/deployment/ab-testing.d.ts +114 -0
- package/dist/deployment/blue-green.d.ts +98 -0
- package/dist/deployment/canary.d.ts +103 -0
- package/dist/deployment/deployment.test.d.ts +0 -0
- package/dist/deployment/index.d.ts +45 -0
- package/dist/deployment/progressive.d.ts +34 -0
- package/dist/dns/dns.test.d.ts +0 -0
- package/dist/dns/dnssec.d.ts +75 -0
- package/dist/dns/index.d.ts +3 -0
- package/dist/dns/resolver.d.ts +150 -0
- package/dist/dns/routing.d.ts +217 -0
- package/dist/email/advanced/analytics.d.ts +78 -0
- package/dist/email/advanced/index.d.ts +7 -0
- package/dist/email/advanced/rules.d.ts +60 -0
- package/dist/email/advanced/scheduling.d.ts +63 -0
- package/dist/email/advanced/search.d.ts +76 -0
- package/dist/email/advanced/shared-mailboxes.d.ts +66 -0
- package/dist/email/advanced/templates.d.ts +39 -0
- package/dist/email/advanced/threading.d.ts +53 -0
- package/dist/email/analytics.d.ts +144 -0
- package/dist/email/bounce-handling.d.ts +120 -0
- package/dist/email/email.test.d.ts +0 -0
- package/dist/email/handlers/__tests__/inbound.test.d.ts +0 -0
- package/dist/email/handlers/__tests__/outbound.test.d.ts +0 -0
- package/dist/email/handlers/converter.d.ts +225 -0
- package/dist/email/handlers/feedback.d.ts +226 -0
- package/dist/email/handlers/inbound.d.ts +167 -0
- package/dist/email/handlers/outbound.d.ts +176 -0
- package/dist/email/index.d.ts +6 -0
- package/dist/email/reputation.d.ts +97 -0
- package/dist/email/templates.d.ts +82 -0
- package/dist/errors/index.d.ts +186 -0
- package/dist/errors/index.test.d.ts +0 -0
- package/dist/health-checks/index.d.ts +35 -0
- package/dist/index.d.ts +256 -0
- package/dist/index.js +63499 -0
- package/dist/intrinsic-functions.d.ts +37 -0
- package/dist/lambda/concurrency.d.ts +98 -0
- package/dist/lambda/destinations.d.ts +99 -0
- package/dist/lambda/dlq.d.ts +109 -0
- package/dist/lambda/index.d.ts +6 -0
- package/dist/lambda/lambda.test.d.ts +0 -0
- package/dist/lambda/layers.d.ts +81 -0
- package/dist/lambda/versions.d.ts +91 -0
- package/dist/lambda/vpc.d.ts +116 -0
- package/dist/local/config.d.ts +44 -0
- package/dist/local/index.d.ts +2 -0
- package/dist/local/mock-aws.d.ts +60 -0
- package/dist/modules/ai.d.ts +47 -0
- package/dist/modules/api.d.ts +98 -0
- package/dist/modules/auth.d.ts +165 -0
- package/dist/modules/cache.d.ts +73 -0
- package/dist/modules/cdn.d.ts +125 -0
- package/dist/modules/communication.d.ts +98 -0
- package/dist/modules/compute.d.ts +309 -0
- package/dist/modules/database.d.ts +105 -0
- package/dist/modules/deployment.d.ts +181 -0
- package/dist/modules/dns.d.ts +45 -0
- package/dist/modules/email.d.ts +217 -0
- package/dist/modules/filesystem.d.ts +94 -0
- package/dist/modules/index.d.ts +27 -0
- package/dist/modules/messaging.d.ts +108 -0
- package/dist/modules/monitoring.d.ts +127 -0
- package/dist/modules/network.d.ts +102 -0
- package/dist/modules/parameter-store.d.ts +33 -0
- package/dist/modules/permissions.d.ts +132 -0
- package/dist/modules/phone.d.ts +80 -0
- package/dist/modules/queue.d.ts +210 -0
- package/dist/modules/redirects.d.ts +59 -0
- package/dist/modules/registry.d.ts +73 -0
- package/dist/modules/search.d.ts +56 -0
- package/dist/modules/secrets.d.ts +80 -0
- package/dist/modules/security.d.ts +100 -0
- package/dist/modules/sms.d.ts +52 -0
- package/dist/modules/storage.d.ts +160 -0
- package/dist/modules/workflow.d.ts +205 -0
- package/dist/multi-account/config.d.ts +315 -0
- package/dist/multi-account/index.d.ts +2 -0
- package/dist/multi-account/manager.d.ts +100 -0
- package/dist/multi-region/cross-region.d.ts +114 -0
- package/dist/multi-region/index.d.ts +3 -0
- package/dist/multi-region/manager.d.ts +72 -0
- package/dist/multi-region/regions.d.ts +98 -0
- package/dist/network-security/index.d.ts +39 -0
- package/dist/observability/index.d.ts +4 -0
- package/dist/observability/logs.d.ts +129 -0
- package/dist/observability/metrics.d.ts +153 -0
- package/dist/observability/observability.test.d.ts +0 -0
- package/dist/observability/synthetics.d.ts +146 -0
- package/dist/observability/xray.d.ts +129 -0
- package/dist/phone/advanced/analytics.d.ts +66 -0
- package/dist/phone/advanced/callbacks.d.ts +50 -0
- package/dist/phone/advanced/index.d.ts +4 -0
- package/dist/phone/advanced/ivr-builder.d.ts +83 -0
- package/dist/phone/advanced/recording.d.ts +48 -0
- package/dist/phone/handlers/__tests__/incoming-call.test.d.ts +0 -0
- package/dist/phone/handlers/incoming-call.d.ts +115 -0
- package/dist/phone/handlers/missed-call.d.ts +114 -0
- package/dist/phone/handlers/voicemail.d.ts +177 -0
- package/dist/phone/index.d.ts +2 -0
- package/dist/presets/api-backend.d.ts +11 -0
- package/dist/presets/data-pipeline.d.ts +11 -0
- package/dist/presets/extend.d.ts +194 -0
- package/dist/presets/extend.test.d.ts +0 -0
- package/dist/presets/fullstack-app.d.ts +12 -0
- package/dist/presets/index.d.ts +24 -0
- package/dist/presets/jamstack.d.ts +12 -0
- package/dist/presets/microservices.d.ts +18 -0
- package/dist/presets/ml-api.d.ts +13 -0
- package/dist/presets/nodejs-server.d.ts +14 -0
- package/dist/presets/nodejs-serverless.d.ts +14 -0
- package/dist/presets/realtime-app.d.ts +11 -0
- package/dist/presets/static-site.d.ts +12 -0
- package/dist/presets/traditional-web-app.d.ts +16 -0
- package/dist/presets/wordpress.d.ts +12 -0
- package/dist/preview/github.d.ts +32 -0
- package/dist/preview/github.test.d.ts +0 -0
- package/dist/preview/index.d.ts +27 -0
- package/dist/preview/manager.d.ts +58 -0
- package/dist/preview/manager.test.d.ts +0 -0
- package/dist/preview/notifications.d.ts +55 -0
- package/dist/preview/notifications.test.d.ts +0 -0
- package/dist/queue/batch-processing.d.ts +87 -0
- package/dist/queue/dlq-monitoring.d.ts +95 -0
- package/dist/queue/fifo.d.ts +90 -0
- package/dist/queue/index.d.ts +4 -0
- package/dist/queue/management.d.ts +105 -0
- package/dist/queue/queue.test.d.ts +0 -0
- package/dist/resource-mgmt/index.d.ts +29 -0
- package/dist/resource-naming.d.ts +26 -0
- package/dist/s3/index.d.ts +173 -0
- package/dist/schema/index.d.ts +9 -0
- package/dist/security/certificate-manager.d.ts +121 -0
- package/dist/security/index.d.ts +4 -0
- package/dist/security/scanning.d.ts +147 -0
- package/dist/security/secrets-manager.d.ts +144 -0
- package/dist/security/secrets-rotation.d.ts +115 -0
- package/dist/security/security.test.d.ts +0 -0
- package/dist/sms/advanced/ab-testing.d.ts +54 -0
- package/dist/sms/advanced/analytics.d.ts +56 -0
- package/dist/sms/advanced/campaigns.d.ts +82 -0
- package/dist/sms/advanced/chatbot.d.ts +48 -0
- package/dist/sms/advanced/index.d.ts +6 -0
- package/dist/sms/advanced/link-tracking.d.ts +42 -0
- package/dist/sms/advanced/mms.d.ts +35 -0
- package/dist/sms/handlers/__tests__/send.test.d.ts +0 -0
- package/dist/sms/handlers/delivery-status.d.ts +131 -0
- package/dist/sms/handlers/receive.d.ts +160 -0
- package/dist/sms/handlers/send.d.ts +172 -0
- package/dist/sms/index.d.ts +2 -0
- package/dist/stack-diff.d.ts +34 -0
- package/dist/static-site/index.d.ts +49 -0
- package/dist/template-builder.d.ts +14 -0
- package/dist/template-validator.d.ts +24 -0
- package/dist/utils/cache.d.ts +55 -0
- package/dist/utils/diff.d.ts +48 -0
- package/dist/utils/hash.d.ts +58 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/parallel.d.ts +60 -0
- package/dist/validators/credentials.d.ts +23 -0
- package/dist/validators/credentials.test.d.ts +0 -0
- package/dist/validators/quotas.d.ts +60 -0
- package/dist/validators/quotas.test.d.ts +0 -0
- package/package.json +4 -4
|
File without changes
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { AWSCredentials } from './credentials';
|
|
2
|
+
export declare interface CloudFormationStack {
|
|
3
|
+
StackName: string
|
|
4
|
+
StackId?: string
|
|
5
|
+
StackStatus?: string
|
|
6
|
+
CreationTime?: string
|
|
7
|
+
LastUpdatedTime?: string
|
|
8
|
+
StackStatusReason?: string
|
|
9
|
+
Description?: string
|
|
10
|
+
Parameters?: Array<{ ParameterKey: string, ParameterValue: string }>
|
|
11
|
+
Outputs?: Array<{ OutputKey: string, OutputValue: string, Description?: string }>
|
|
12
|
+
Tags?: Array<{ Key: string, Value: string }>
|
|
13
|
+
}
|
|
14
|
+
export declare interface CreateStackOptions {
|
|
15
|
+
stackName: string
|
|
16
|
+
templateBody?: string
|
|
17
|
+
templateURL?: string
|
|
18
|
+
parameters?: Record<string, string>
|
|
19
|
+
capabilities?: string[]
|
|
20
|
+
tags?: Record<string, string>
|
|
21
|
+
timeoutInMinutes?: number
|
|
22
|
+
onFailure?: 'DO_NOTHING' | 'ROLLBACK' | 'DELETE'
|
|
23
|
+
}
|
|
24
|
+
export declare interface UpdateStackOptions {
|
|
25
|
+
stackName: string
|
|
26
|
+
templateBody?: string
|
|
27
|
+
templateURL?: string
|
|
28
|
+
parameters?: Record<string, string>
|
|
29
|
+
capabilities?: string[]
|
|
30
|
+
tags?: Record<string, string>
|
|
31
|
+
}
|
|
32
|
+
export declare interface StackEvent {
|
|
33
|
+
EventId: string
|
|
34
|
+
StackName: string
|
|
35
|
+
LogicalResourceId: string
|
|
36
|
+
PhysicalResourceId?: string
|
|
37
|
+
ResourceType: string
|
|
38
|
+
Timestamp: string
|
|
39
|
+
ResourceStatus: string
|
|
40
|
+
ResourceStatusReason?: string
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* CloudFormation API Client
|
|
44
|
+
*/
|
|
45
|
+
export declare class CloudFormationClient {
|
|
46
|
+
private credentials: AWSCredentials | null;
|
|
47
|
+
private region: string;
|
|
48
|
+
private readonly profile?: string;
|
|
49
|
+
constructor(region?: string, profile?: string);
|
|
50
|
+
init(): Promise<void>;
|
|
51
|
+
private ensureCredentials(): Promise<AWSCredentials>;
|
|
52
|
+
private request(action: string, params: Record<string, any>): Promise<any>;
|
|
53
|
+
createStack(options: CreateStackOptions): Promise<string>;
|
|
54
|
+
updateStack(options: UpdateStackOptions): Promise<string>;
|
|
55
|
+
deleteStack(stackName: string): Promise<void>;
|
|
56
|
+
describeStack(stackName: string): Promise<CloudFormationStack>;
|
|
57
|
+
listStacks(statusFilter?: string[]): Promise<CloudFormationStack[]>;
|
|
58
|
+
describeStackEvents(stackName: string): Promise<StackEvent[]>;
|
|
59
|
+
waitForStack(stackName: string, desiredStates: string[], onProgress?: (event: StackEvent) => void): Promise<CloudFormationStack>;
|
|
60
|
+
createChangeSet(options: {
|
|
61
|
+
stackName: string
|
|
62
|
+
changeSetName: string
|
|
63
|
+
templateBody?: string
|
|
64
|
+
templateURL?: string
|
|
65
|
+
parameters?: Record<string, string>
|
|
66
|
+
capabilities?: string[]
|
|
67
|
+
}): Promise<string>;
|
|
68
|
+
executeChangeSet(changeSetName: string, stackName: string): Promise<void>;
|
|
69
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AWSCredentials } from './credentials';
|
|
2
|
+
export declare interface InvalidationOptions {
|
|
3
|
+
distributionId: string
|
|
4
|
+
paths: string[]
|
|
5
|
+
callerReference?: string
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* CloudFront API Client
|
|
9
|
+
*/
|
|
10
|
+
export declare class CloudFrontClient {
|
|
11
|
+
private credentials: AWSCredentials | null;
|
|
12
|
+
private readonly profile?: string;
|
|
13
|
+
constructor(profile?: string);
|
|
14
|
+
init(): Promise<void>;
|
|
15
|
+
private ensureCredentials(): Promise<AWSCredentials>;
|
|
16
|
+
createInvalidation(options: InvalidationOptions): Promise<string>;
|
|
17
|
+
getInvalidation(distributionId: string, invalidationId: string): Promise<any>;
|
|
18
|
+
listInvalidations(distributionId: string): Promise<any[]>;
|
|
19
|
+
waitForInvalidation(distributionId: string, invalidationId: string, maxAttempts?: number, pollInterval?: number): Promise<void>;
|
|
20
|
+
invalidateAll(distributionId: string): Promise<string>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get credentials from environment variables
|
|
3
|
+
* Checks: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN
|
|
4
|
+
*/
|
|
5
|
+
export declare function fromEnvironment(): AWSCredentials | null;
|
|
6
|
+
/**
|
|
7
|
+
* Get credentials from shared credentials file (~/.aws/credentials)
|
|
8
|
+
*/
|
|
9
|
+
export declare function fromSharedCredentials(options?: CredentialProviderOptions): AWSCredentials | null;
|
|
10
|
+
/**
|
|
11
|
+
* Get credentials from EC2 instance metadata service (IMDSv2)
|
|
12
|
+
*/
|
|
13
|
+
export declare function fromEC2Metadata(options?: CredentialProviderOptions): Promise<AWSCredentials | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Get credentials from ECS task metadata
|
|
16
|
+
*/
|
|
17
|
+
export declare function fromECSMetadata(options?: CredentialProviderOptions): Promise<AWSCredentials | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Get credentials from web identity token (for Kubernetes/IRSA)
|
|
20
|
+
*/
|
|
21
|
+
export declare function fromWebIdentity(options?: CredentialProviderOptions): Promise<AWSCredentials | null>;
|
|
22
|
+
/**
|
|
23
|
+
* Get credentials using the default credential chain
|
|
24
|
+
* Tries providers in order: Environment -> Shared Credentials -> Web Identity -> ECS -> EC2
|
|
25
|
+
*/
|
|
26
|
+
export declare function getCredentials(options?: CredentialProviderOptions): Promise<AWSCredentials>;
|
|
27
|
+
/**
|
|
28
|
+
* Create a credential provider that caches and auto-refreshes credentials
|
|
29
|
+
*/
|
|
30
|
+
export declare function createCredentialProvider(options?: CredentialProviderOptions): () => Promise<AWSCredentials>;
|
|
31
|
+
/**
|
|
32
|
+
* Resolve AWS credentials from various sources
|
|
33
|
+
* @deprecated Use getCredentials() instead
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveCredentials(profile?: string): Promise<AWSCredentials>;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve AWS region from environment or config
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveRegion(profile?: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Get AWS account ID using STS GetCallerIdentity
|
|
42
|
+
*/
|
|
43
|
+
export declare function getAccountId(credentials?: AWSCredentials): Promise<string>;
|
|
44
|
+
export declare interface AWSCredentials {
|
|
45
|
+
accessKeyId: string
|
|
46
|
+
secretAccessKey: string
|
|
47
|
+
sessionToken?: string
|
|
48
|
+
expiration?: Date
|
|
49
|
+
region?: string
|
|
50
|
+
}
|
|
51
|
+
export declare interface CredentialProviderOptions {
|
|
52
|
+
profile?: string
|
|
53
|
+
credentialsFile?: string
|
|
54
|
+
configFile?: string
|
|
55
|
+
timeout?: number
|
|
56
|
+
}
|
|
57
|
+
// ============================================================================
|
|
58
|
+
// Backwards Compatibility Exports
|
|
59
|
+
// ============================================================================
|
|
60
|
+
export declare interface AWSProfile {
|
|
61
|
+
name: string
|
|
62
|
+
accessKeyId: string
|
|
63
|
+
secretAccessKey: string
|
|
64
|
+
sessionToken?: string
|
|
65
|
+
region?: string
|
|
66
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
SignatureOptions,
|
|
3
|
+
SignedRequest,
|
|
4
|
+
PresignedUrlOptions,
|
|
5
|
+
RetryOptions,
|
|
6
|
+
} from './signature';
|
|
7
|
+
export type {
|
|
8
|
+
AWSCredentials,
|
|
9
|
+
AWSProfile,
|
|
10
|
+
CredentialProviderOptions,
|
|
11
|
+
} from './credentials';
|
|
12
|
+
export type {
|
|
13
|
+
CloudFormationStack,
|
|
14
|
+
CreateStackOptions,
|
|
15
|
+
UpdateStackOptions,
|
|
16
|
+
StackEvent,
|
|
17
|
+
} from './cloudformation';
|
|
18
|
+
export type {
|
|
19
|
+
S3ClientOptions,
|
|
20
|
+
GetObjectOptions,
|
|
21
|
+
PutObjectOptions,
|
|
22
|
+
ListObjectsOptions,
|
|
23
|
+
ListObjectsResult,
|
|
24
|
+
S3Object,
|
|
25
|
+
HeadObjectResult,
|
|
26
|
+
CopyObjectOptions,
|
|
27
|
+
MultipartUploadOptions,
|
|
28
|
+
MultipartProgress,
|
|
29
|
+
} from './s3';
|
|
30
|
+
export type {
|
|
31
|
+
InvalidationOptions,
|
|
32
|
+
} from './cloudfront';
|
|
33
|
+
export {
|
|
34
|
+
signRequest,
|
|
35
|
+
signRequestAsync,
|
|
36
|
+
makeAWSRequest,
|
|
37
|
+
makeAWSRequestAsync,
|
|
38
|
+
makeAWSRequestOnce,
|
|
39
|
+
createPresignedUrl,
|
|
40
|
+
createPresignedUrlAsync,
|
|
41
|
+
detectServiceRegion,
|
|
42
|
+
clearSigningKeyCache,
|
|
43
|
+
getSigningKeyCacheSize,
|
|
44
|
+
parseXMLResponse,
|
|
45
|
+
parseJSONResponse,
|
|
46
|
+
isNodeCryptoAvailable,
|
|
47
|
+
isWebCryptoAvailable,
|
|
48
|
+
} from './signature';
|
|
49
|
+
export {
|
|
50
|
+
// New credential providers
|
|
51
|
+
fromEnvironment,
|
|
52
|
+
fromSharedCredentials,
|
|
53
|
+
fromEC2Metadata,
|
|
54
|
+
fromECSMetadata,
|
|
55
|
+
fromWebIdentity,
|
|
56
|
+
getCredentials,
|
|
57
|
+
createCredentialProvider,
|
|
58
|
+
// Backwards compatibility
|
|
59
|
+
resolveCredentials,
|
|
60
|
+
resolveRegion,
|
|
61
|
+
getAccountId,
|
|
62
|
+
} from './credentials';
|
|
63
|
+
export {
|
|
64
|
+
CloudFormationClient,
|
|
65
|
+
} from './cloudformation';
|
|
66
|
+
export {
|
|
67
|
+
S3Client,
|
|
68
|
+
S3Error,
|
|
69
|
+
createS3Client,
|
|
70
|
+
} from './s3';
|
|
71
|
+
export {
|
|
72
|
+
CloudFrontClient,
|
|
73
|
+
} from './cloudfront';
|
package/dist/aws/s3.d.ts
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { getCredentials } from './credentials';
|
|
2
|
+
/**
|
|
3
|
+
* Convenience function to create an S3 client
|
|
4
|
+
*/
|
|
5
|
+
export declare function createS3Client(options?: S3ClientOptions): S3Client;
|
|
6
|
+
export declare interface S3ClientOptions {
|
|
7
|
+
region?: string
|
|
8
|
+
endpoint?: string
|
|
9
|
+
forcePathStyle?: boolean
|
|
10
|
+
credentials?: AWSCredentials
|
|
11
|
+
credentialOptions?: CredentialProviderOptions
|
|
12
|
+
retryOptions?: RetryOptions
|
|
13
|
+
}
|
|
14
|
+
export declare interface GetObjectOptions {
|
|
15
|
+
range?: string
|
|
16
|
+
ifModifiedSince?: Date
|
|
17
|
+
ifMatch?: string
|
|
18
|
+
ifNoneMatch?: string
|
|
19
|
+
responseContentType?: string
|
|
20
|
+
responseContentDisposition?: string
|
|
21
|
+
}
|
|
22
|
+
export declare interface PutObjectOptions {
|
|
23
|
+
contentType?: string
|
|
24
|
+
contentEncoding?: string
|
|
25
|
+
cacheControl?: string
|
|
26
|
+
contentDisposition?: string
|
|
27
|
+
metadata?: Record<string, string>
|
|
28
|
+
storageClass?: string
|
|
29
|
+
serverSideEncryption?: string
|
|
30
|
+
acl?: string
|
|
31
|
+
tagging?: string
|
|
32
|
+
}
|
|
33
|
+
export declare interface ListObjectsOptions {
|
|
34
|
+
prefix?: string
|
|
35
|
+
delimiter?: string
|
|
36
|
+
maxKeys?: number
|
|
37
|
+
continuationToken?: string
|
|
38
|
+
startAfter?: string
|
|
39
|
+
}
|
|
40
|
+
export declare interface ListObjectsResult {
|
|
41
|
+
contents: S3Object[]
|
|
42
|
+
commonPrefixes: string[]
|
|
43
|
+
isTruncated: boolean
|
|
44
|
+
continuationToken?: string
|
|
45
|
+
nextContinuationToken?: string
|
|
46
|
+
keyCount: number
|
|
47
|
+
maxKeys: number
|
|
48
|
+
prefix?: string
|
|
49
|
+
delimiter?: string
|
|
50
|
+
}
|
|
51
|
+
export declare interface S3Object {
|
|
52
|
+
key: string
|
|
53
|
+
lastModified: Date
|
|
54
|
+
etag: string
|
|
55
|
+
size: number
|
|
56
|
+
storageClass: string
|
|
57
|
+
}
|
|
58
|
+
export declare interface HeadObjectResult {
|
|
59
|
+
contentLength: number
|
|
60
|
+
contentType: string
|
|
61
|
+
etag: string
|
|
62
|
+
lastModified: Date
|
|
63
|
+
metadata: Record<string, string>
|
|
64
|
+
storageClass?: string
|
|
65
|
+
serverSideEncryption?: string
|
|
66
|
+
}
|
|
67
|
+
export declare interface CopyObjectOptions {
|
|
68
|
+
metadataDirective?: 'COPY' | 'REPLACE'
|
|
69
|
+
metadata?: Record<string, string>
|
|
70
|
+
contentType?: string
|
|
71
|
+
storageClass?: string
|
|
72
|
+
acl?: string
|
|
73
|
+
}
|
|
74
|
+
export declare interface MultipartUploadOptions extends PutObjectOptions {
|
|
75
|
+
partSize?: number
|
|
76
|
+
concurrency?: number
|
|
77
|
+
onProgress?: (progress: MultipartProgress) => void
|
|
78
|
+
}
|
|
79
|
+
export declare interface MultipartProgress {
|
|
80
|
+
loaded: number
|
|
81
|
+
total: number
|
|
82
|
+
part: number
|
|
83
|
+
totalParts: number
|
|
84
|
+
}
|
|
85
|
+
export declare interface PresignedUrlOptions {
|
|
86
|
+
expiresIn?: number
|
|
87
|
+
method?: string
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* S3 Client for high-level S3 operations
|
|
91
|
+
*/
|
|
92
|
+
export declare class S3Client {
|
|
93
|
+
private region: string;
|
|
94
|
+
private endpoint: string;
|
|
95
|
+
private forcePathStyle: boolean;
|
|
96
|
+
private credentials?: AWSCredentials;
|
|
97
|
+
private credentialOptions?: CredentialProviderOptions;
|
|
98
|
+
private retryOptions: RetryOptions;
|
|
99
|
+
constructor(options?: S3ClientOptions);
|
|
100
|
+
private getCredentials(): Promise<AWSCredentials>;
|
|
101
|
+
private buildUrl(bucket: string, key?: string): string;
|
|
102
|
+
get(bucket: string, key: string, options?: GetObjectOptions): Promise<Response>;
|
|
103
|
+
getText(bucket: string, key: string, options?: GetObjectOptions): Promise<string>;
|
|
104
|
+
getJSON<T = unknown>(bucket: string, key: string, options?: GetObjectOptions): Promise<T>;
|
|
105
|
+
getBuffer(bucket: string, key: string, options?: GetObjectOptions): Promise<ArrayBuffer>;
|
|
106
|
+
put(bucket: string, key: string, body: string | ArrayBuffer | Uint8Array | Blob | ReadableStream, options?: PutObjectOptions): Promise<{ etag: string }>;
|
|
107
|
+
private putSimple(bucket: string, key: string, body: string | ArrayBuffer | Uint8Array | Blob, size: number, options: PutObjectOptions): Promise<{ etag: string }>;
|
|
108
|
+
delete(bucket: string, key: string): Promise<void>;
|
|
109
|
+
deleteMany(bucket: string, keys: string[]): Promise<{ deleted: string[], errors: Array<{ key: string, error: string }> }>;
|
|
110
|
+
list(bucket: string, options?: ListObjectsOptions): Promise<ListObjectsResult>;
|
|
111
|
+
listAll(bucket: string, options?: Omit<ListObjectsOptions, 'continuationToken'>): AsyncGenerator<S3Object>;
|
|
112
|
+
head(bucket: string, key: string): Promise<HeadObjectResult | null>;
|
|
113
|
+
exists(bucket: string, key: string): Promise<boolean>;
|
|
114
|
+
copy(sourceBucket: string, sourceKey: string, destBucket: string, destKey: string, options?: CopyObjectOptions): Promise<{ etag: string }>;
|
|
115
|
+
getPresignedUrl(bucket: string, key: string, options?: PresignedUrlOptions): Promise<string>;
|
|
116
|
+
uploadMultipart(bucket: string, key: string, body: ReadableStream | Blob | ArrayBuffer | Uint8Array, options?: MultipartUploadOptions): Promise<{ etag: string }>;
|
|
117
|
+
private initiateMultipartUpload(bucket: string, key: string, options: PutObjectOptions): Promise<string>;
|
|
118
|
+
private uploadParts(bucket: string, key: string, uploadId: string, stream: ReadableStream<Uint8Array>, partSize: number, credentials: AWSCredentials, totalSize: number | undefined, concurrency: number, onProgress?: (progress: MultipartProgress) => void): Promise<Array<{ partNumber: number, etag: string }>>;
|
|
119
|
+
private completeMultipartUpload(bucket: string, key: string, uploadId: string, parts: Array<{ partNumber: number, etag: string }>): Promise<{ etag: string }>;
|
|
120
|
+
abortMultipartUpload(bucket: string, key: string, uploadId: string): Promise<void>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* S3 Error class
|
|
124
|
+
*/
|
|
125
|
+
export declare class S3Error extends Error {
|
|
126
|
+
public statusCode: number;
|
|
127
|
+
public bucket: string;
|
|
128
|
+
public key?: string;
|
|
129
|
+
constructor(message: string, statusCode: number, bucket: string, key?: string);
|
|
130
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect service and region from AWS URL
|
|
3
|
+
* Supports standard AWS endpoints, Lambda URLs, R2, and Backblaze B2
|
|
4
|
+
*/
|
|
5
|
+
export declare function detectServiceRegion(url: string | URL): { service: string, region: string };
|
|
6
|
+
/**
|
|
7
|
+
* Sign an AWS request using Signature Version 4
|
|
8
|
+
*/
|
|
9
|
+
export declare function signRequest(options: SignatureOptions): SignedRequest;
|
|
10
|
+
/**
|
|
11
|
+
* Sign an AWS request using Signature Version 4 (async - browser compatible)
|
|
12
|
+
* Use this in browser environments where crypto.subtle is available
|
|
13
|
+
*/
|
|
14
|
+
export declare function signRequestAsync(options: SignatureOptions): Promise<SignedRequest>;
|
|
15
|
+
/**
|
|
16
|
+
* Generate a presigned URL for AWS requests (e.g., S3 GetObject, PutObject)
|
|
17
|
+
*/
|
|
18
|
+
export declare function createPresignedUrl(options: PresignedUrlOptions): string;
|
|
19
|
+
/**
|
|
20
|
+
* Generate a presigned URL for AWS requests (async - browser compatible)
|
|
21
|
+
*/
|
|
22
|
+
export declare function createPresignedUrlAsync(options: PresignedUrlOptions): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Make a signed AWS API request with automatic retry
|
|
25
|
+
*/
|
|
26
|
+
export declare function makeAWSRequest(options: SignatureOptions, retryOptions?: RetryOptions): Promise<Response>;
|
|
27
|
+
/**
|
|
28
|
+
* Make a signed AWS API request without retry (for backwards compatibility)
|
|
29
|
+
*/
|
|
30
|
+
export declare function makeAWSRequestOnce(options: SignatureOptions): Promise<Response>;
|
|
31
|
+
/**
|
|
32
|
+
* Make a signed AWS API request with automatic retry (async - browser compatible)
|
|
33
|
+
* Use this in browser environments where crypto.subtle is available
|
|
34
|
+
*/
|
|
35
|
+
export declare function makeAWSRequestAsync(options: SignatureOptions, retryOptions?: RetryOptions): Promise<Response>;
|
|
36
|
+
/**
|
|
37
|
+
* Parse XML response from AWS
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseXMLResponse<T = any>(response: Response): Promise<T>;
|
|
40
|
+
/**
|
|
41
|
+
* Parse JSON response from AWS
|
|
42
|
+
*/
|
|
43
|
+
export declare function parseJSONResponse<T = any>(response: Response): Promise<T>;
|
|
44
|
+
/**
|
|
45
|
+
* Clear the internal signing key cache
|
|
46
|
+
* Call this when credentials change or for testing
|
|
47
|
+
*/
|
|
48
|
+
export declare function clearSigningKeyCache(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Get current cache size (for diagnostics)
|
|
51
|
+
*/
|
|
52
|
+
export declare function getSigningKeyCacheSize(): number;
|
|
53
|
+
/**
|
|
54
|
+
* Check if Node.js crypto is available (for sync operations)
|
|
55
|
+
* Returns true in Node.js/Bun, false in browser
|
|
56
|
+
*/
|
|
57
|
+
export declare function isNodeCryptoAvailable(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Check if Web Crypto API is available (for async operations)
|
|
60
|
+
* Returns true in modern browsers and Node.js 15+
|
|
61
|
+
*/
|
|
62
|
+
export declare function isWebCryptoAvailable(): boolean;
|
|
63
|
+
export declare interface SignatureOptions {
|
|
64
|
+
method: string
|
|
65
|
+
url: string
|
|
66
|
+
service?: string
|
|
67
|
+
region?: string
|
|
68
|
+
headers?: Record<string, string>
|
|
69
|
+
body?: string
|
|
70
|
+
accessKeyId: string
|
|
71
|
+
secretAccessKey: string
|
|
72
|
+
sessionToken?: string
|
|
73
|
+
cache?: Map<string, Buffer | Uint8Array>
|
|
74
|
+
signQuery?: boolean
|
|
75
|
+
expiresIn?: number
|
|
76
|
+
datetime?: string
|
|
77
|
+
}
|
|
78
|
+
export declare interface SignedRequest {
|
|
79
|
+
url: string
|
|
80
|
+
method: string
|
|
81
|
+
headers: Record<string, string>
|
|
82
|
+
body?: string
|
|
83
|
+
}
|
|
84
|
+
export declare interface PresignedUrlOptions {
|
|
85
|
+
url: string
|
|
86
|
+
method?: string
|
|
87
|
+
accessKeyId: string
|
|
88
|
+
secretAccessKey: string
|
|
89
|
+
sessionToken?: string
|
|
90
|
+
service?: string
|
|
91
|
+
region?: string
|
|
92
|
+
expiresIn?: number
|
|
93
|
+
cache?: Map<string, Buffer | Uint8Array>
|
|
94
|
+
}
|
|
95
|
+
export declare interface RetryOptions {
|
|
96
|
+
maxRetries?: number
|
|
97
|
+
initialDelayMs?: number
|
|
98
|
+
maxDelayMs?: number
|
|
99
|
+
retryableStatusCodes?: number[]
|
|
100
|
+
timeoutMs?: number
|
|
101
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global disaster recovery manager instance
|
|
3
|
+
*/
|
|
4
|
+
export declare const drManager: DisasterRecoveryManager;
|
|
5
|
+
/**
|
|
6
|
+
* Disaster Recovery Module
|
|
7
|
+
* Automated failover, recovery runbooks, and DR testing
|
|
8
|
+
*/
|
|
9
|
+
export declare interface DisasterRecoveryPlan {
|
|
10
|
+
id: string
|
|
11
|
+
name: string
|
|
12
|
+
primaryRegion: string
|
|
13
|
+
secondaryRegion: string
|
|
14
|
+
rto: number
|
|
15
|
+
rpo: number
|
|
16
|
+
resources: DRResource[]
|
|
17
|
+
runbook: RecoveryRunbook
|
|
18
|
+
testSchedule?: string
|
|
19
|
+
}
|
|
20
|
+
export declare interface DRResource {
|
|
21
|
+
resourceId: string
|
|
22
|
+
resourceType: 'rds' | 'dynamodb' | 'efs' | 's3' | 'ec2' | 'ecs'
|
|
23
|
+
primaryArn: string
|
|
24
|
+
secondaryArn?: string
|
|
25
|
+
replicationEnabled: boolean
|
|
26
|
+
}
|
|
27
|
+
export declare interface RecoveryRunbook {
|
|
28
|
+
steps: RecoveryStep[]
|
|
29
|
+
estimatedDuration: number
|
|
30
|
+
requiredApprovals?: string[]
|
|
31
|
+
}
|
|
32
|
+
export declare interface RecoveryStep {
|
|
33
|
+
order: number
|
|
34
|
+
name: string
|
|
35
|
+
description: string
|
|
36
|
+
action: string
|
|
37
|
+
automatable: boolean
|
|
38
|
+
estimatedDuration: number
|
|
39
|
+
rollbackable: boolean
|
|
40
|
+
}
|
|
41
|
+
export declare interface FailoverTest {
|
|
42
|
+
id: string
|
|
43
|
+
planId: string
|
|
44
|
+
status: 'scheduled' | 'running' | 'completed' | 'failed'
|
|
45
|
+
startTime: Date
|
|
46
|
+
endTime?: Date
|
|
47
|
+
results?: FailoverTestResult[]
|
|
48
|
+
}
|
|
49
|
+
export declare interface FailoverTestResult {
|
|
50
|
+
step: string
|
|
51
|
+
status: 'success' | 'failed' | 'skipped'
|
|
52
|
+
duration: number
|
|
53
|
+
message?: string
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Disaster recovery manager
|
|
57
|
+
*/
|
|
58
|
+
export declare class DisasterRecoveryManager {
|
|
59
|
+
private drPlans: Map<string, DisasterRecoveryPlan>;
|
|
60
|
+
private failoverTests: Map<string, FailoverTest>;
|
|
61
|
+
private planCounter: any;
|
|
62
|
+
private testCounter: any;
|
|
63
|
+
createDRPlan(plan: Omit<DisasterRecoveryPlan, 'id'>): DisasterRecoveryPlan;
|
|
64
|
+
createRDSDRPlan(options: {
|
|
65
|
+
primaryDbArn: string
|
|
66
|
+
secondaryDbArn: string
|
|
67
|
+
primaryRegion: string
|
|
68
|
+
secondaryRegion: string
|
|
69
|
+
rto?: number
|
|
70
|
+
rpo?: number
|
|
71
|
+
}): DisasterRecoveryPlan;
|
|
72
|
+
createDynamoDBDRPlan(options: {
|
|
73
|
+
tableArn: string
|
|
74
|
+
regions: string[]
|
|
75
|
+
rto?: number
|
|
76
|
+
rpo?: number
|
|
77
|
+
}): DisasterRecoveryPlan;
|
|
78
|
+
private generateRDSRunbook(primaryRegion: string, secondaryRegion: string): RecoveryRunbook;
|
|
79
|
+
private generateDynamoDBRunbook(regions: string[]): RecoveryRunbook;
|
|
80
|
+
executeFailover(planId: string, dryRun?: boolean): Promise<{
|
|
81
|
+
success: boolean
|
|
82
|
+
duration: number
|
|
83
|
+
completedSteps: number
|
|
84
|
+
failedStep?: string
|
|
85
|
+
}>;
|
|
86
|
+
scheduleFailoverTest(planId: string, testDate: Date): FailoverTest;
|
|
87
|
+
runFailoverTest(planId: string): Promise<FailoverTest>;
|
|
88
|
+
getDRPlan(id: string): DisasterRecoveryPlan | undefined;
|
|
89
|
+
listDRPlans(): DisasterRecoveryPlan[];
|
|
90
|
+
getFailoverTest(id: string): FailoverTest | undefined;
|
|
91
|
+
listFailoverTests(): FailoverTest[];
|
|
92
|
+
validateDRPlan(plan: DisasterRecoveryPlan): {
|
|
93
|
+
valid: boolean
|
|
94
|
+
warnings: string[]
|
|
95
|
+
errors: string[]
|
|
96
|
+
};
|
|
97
|
+
clear(): void;
|
|
98
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
BackupPlan,
|
|
3
|
+
BackupResource,
|
|
4
|
+
BackupLifecycle,
|
|
5
|
+
BackupVault,
|
|
6
|
+
RestoreJob,
|
|
7
|
+
ContinuousBackup,
|
|
8
|
+
} from './manager';
|
|
9
|
+
export type {
|
|
10
|
+
DisasterRecoveryPlan,
|
|
11
|
+
DRResource,
|
|
12
|
+
RecoveryRunbook,
|
|
13
|
+
RecoveryStep,
|
|
14
|
+
FailoverTest,
|
|
15
|
+
FailoverTestResult,
|
|
16
|
+
} from './disaster-recovery';
|
|
17
|
+
export {
|
|
18
|
+
BackupManager,
|
|
19
|
+
backupManager,
|
|
20
|
+
} from './manager';
|
|
21
|
+
export {
|
|
22
|
+
DisasterRecoveryManager,
|
|
23
|
+
drManager,
|
|
24
|
+
} from './disaster-recovery';
|