@bitblit/ratchet-aws 4.0.1-alpha
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/lib/batch/aws-batch-background-processor.d.ts +8 -0
- package/lib/batch/aws-batch-background-processor.spec.d.ts +1 -0
- package/lib/batch/aws-batch-ratchet.d.ts +13 -0
- package/lib/batch/aws-batch-ratchet.spec.d.ts +1 -0
- package/lib/build/ratchet-aws-info.d.ts +5 -0
- package/lib/cache/dynamo-db-storage-provider.d.ts +25 -0
- package/lib/cache/s3-storage-provider.d.ts +14 -0
- package/lib/cache/simple-cache-object-wrapper.d.ts +7 -0
- package/lib/cache/simple-cache-read-options.d.ts +5 -0
- package/lib/cache/simple-cache-storage-provider.d.ts +8 -0
- package/lib/cache/simple-cache.d.ts +14 -0
- package/lib/cache/simple-cache.spec.d.ts +1 -0
- package/lib/cloudwatch/cloud-watch-log-group-ratchet.d.ts +10 -0
- package/lib/cloudwatch/cloud-watch-log-group-ratchet.spec.d.ts +1 -0
- package/lib/cloudwatch/cloud-watch-logs-ratchet.d.ts +15 -0
- package/lib/cloudwatch/cloud-watch-logs-ratchet.spec.d.ts +1 -0
- package/lib/cloudwatch/cloud-watch-metrics-ratchet.d.ts +11 -0
- package/lib/cloudwatch/cloud-watch-metrics-ratchet.spec.d.ts +1 -0
- package/lib/daemon/daemon-like.d.ts +17 -0
- package/lib/daemon/daemon-process-create-options.d.ts +7 -0
- package/lib/daemon/daemon-process-state-public-token.d.ts +4 -0
- package/lib/daemon/daemon-process-state.d.ts +13 -0
- package/lib/daemon/daemon-util.d.ts +18 -0
- package/lib/daemon/daemon-util.spec.d.ts +4 -0
- package/lib/daemon/daemon.d.ts +33 -0
- package/lib/dao/prototype-dao-config.d.ts +8 -0
- package/lib/dao/prototype-dao-db.d.ts +4 -0
- package/lib/dao/prototype-dao-provider.d.ts +5 -0
- package/lib/dao/prototype-dao.d.ts +15 -0
- package/lib/dao/prototype-dao.spec.d.ts +8 -0
- package/lib/dao/s3-prototype-dao-provider.d.ts +10 -0
- package/lib/dao/s3-simple-dao.d.ts +15 -0
- package/lib/dao/simple-dao-item.d.ts +5 -0
- package/lib/dynamodb/dynamo-ratchet-like.d.ts +27 -0
- package/lib/dynamodb/dynamo-ratchet.d.ts +37 -0
- package/lib/dynamodb/dynamo-ratchet.spec.d.ts +1 -0
- package/lib/dynamodb/dynamo-table-ratchet.d.ts +11 -0
- package/lib/dynamodb/hash-spreader.d.ts +15 -0
- package/lib/dynamodb/hash-spreader.spec.d.ts +1 -0
- package/lib/ec2/ec2-ratchet.d.ts +16 -0
- package/lib/ec2/ec2-ratchet.spec.d.ts +1 -0
- package/lib/environment/cascade-environment-service-provider.d.ts +6 -0
- package/lib/environment/env-var-environment-service-provider.d.ts +6 -0
- package/lib/environment/environment-service-config.d.ts +4 -0
- package/lib/environment/environment-service-provider.d.ts +3 -0
- package/lib/environment/environment-service.d.ts +11 -0
- package/lib/environment/environment-service.spec.d.ts +1 -0
- package/lib/environment/fixed-environment-service-provider.d.ts +7 -0
- package/lib/environment/s3-environment-service-provider.d.ts +15 -0
- package/lib/environment/ssm-environment-service-provider.d.ts +8 -0
- package/lib/expiring-code/dynamo-expiring-code-provider.d.ts +12 -0
- package/lib/expiring-code/expiring-code-params.d.ts +7 -0
- package/lib/expiring-code/expiring-code-provider.d.ts +5 -0
- package/lib/expiring-code/expiring-code-ratchet.d.ts +10 -0
- package/lib/expiring-code/expiring-code-ratchet.spec.d.ts +1 -0
- package/lib/expiring-code/expiring-code.d.ts +6 -0
- package/lib/expiring-code/s3-expiring-code-provider.d.ts +17 -0
- package/lib/expiring-code/s3-expiring-code-provider.spec.d.ts +1 -0
- package/lib/iam/aws-credentials-ratchet.d.ts +4 -0
- package/lib/index.d.ts +78 -0
- package/lib/index.mjs +11 -0
- package/lib/index.mjs.map +1 -0
- package/lib/lambda/lambda-event-detector.d.ts +14 -0
- package/lib/lambda/lambda-event-type-guards.d.ts +10 -0
- package/lib/model/cloud-watch-metrics-minute-level-dynamo-count-request.d.ts +12 -0
- package/lib/model/cloud-watch-metrics-unit.d.ts +29 -0
- package/lib/model/dynamo/doc-put-item-command-input.d.ts +4 -0
- package/lib/model/dynamo/doc-query-command-input.d.ts +5 -0
- package/lib/model/dynamo/doc-scan-command-input.d.ts +5 -0
- package/lib/model/dynamo/doc-update-item-command-input.d.ts +5 -0
- package/lib/model/dynamo-count-result.d.ts +5 -0
- package/lib/route53/route-53-ratchet.d.ts +8 -0
- package/lib/runtime-parameter/cached-stored-runtime-parameter.d.ts +4 -0
- package/lib/runtime-parameter/dynamo-runtime-parameter-provider.d.ts +11 -0
- package/lib/runtime-parameter/dynamo-runtime-parameter-provider.spec.d.ts +1 -0
- package/lib/runtime-parameter/global-variable-override-runtime-parameter-provider.d.ts +17 -0
- package/lib/runtime-parameter/global-variable-override-runtime-parameter-provider.spec.d.ts +1 -0
- package/lib/runtime-parameter/memory-runtime-parameter-provider.d.ts +9 -0
- package/lib/runtime-parameter/runtime-parameter-provider.d.ts +6 -0
- package/lib/runtime-parameter/runtime-parameter-ratchet.d.ts +15 -0
- package/lib/runtime-parameter/runtime-parameter-ratchet.spec.d.ts +1 -0
- package/lib/runtime-parameter/stored-runtime-parameter.d.ts +6 -0
- package/lib/s3/s3-cache-ratchet.d.ts +38 -0
- package/lib/s3/s3-cache-ratchet.spec.d.ts +1 -0
- package/lib/s3/s3-cache-to-local-disk-ratchet.d.ts +18 -0
- package/lib/s3/s3-cache-to-local-dist-ratchet.spec.d.ts +1 -0
- package/lib/s3/s3-location-sync-ratchet.d.ts +21 -0
- package/lib/s3/s3-ratchet.d.ts +5 -0
- package/lib/s3/s3-ratchet.spec.d.ts +1 -0
- package/lib/ses/email-attachment.d.ts +5 -0
- package/lib/ses/mailer-config.d.ts +12 -0
- package/lib/ses/mailer-like.d.ts +11 -0
- package/lib/ses/mailer.d.ts +20 -0
- package/lib/ses/mailer.spec.d.ts +1 -0
- package/lib/ses/ratchet-template-renderer.d.ts +4 -0
- package/lib/ses/ready-to-send-email.d.ts +13 -0
- package/lib/ses/remote-handlebars-template-renderer.d.ts +13 -0
- package/lib/ses/resolved-ready-to-send-email.d.ts +5 -0
- package/lib/sns/sns-ratchet.d.ts +9 -0
- package/lib/sns/sns-ratchet.spec.d.ts +1 -0
- package/lib/sync-lock/dynamo-db-sync-lock.d.ts +10 -0
- package/lib/sync-lock/dynamo-db-sync-lock.spec.d.ts +1 -0
- package/lib/sync-lock/memory-sync-lock.d.ts +8 -0
- package/lib/sync-lock/sync-lock-provider.d.ts +5 -0
- package/package.json +93 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class LambdaEventDetector {
|
|
2
|
+
static isValidCronEvent(event: any): boolean;
|
|
3
|
+
static isValidSnsEvent(event: any): boolean;
|
|
4
|
+
static isValidDynamoDBEvent(event: any): boolean;
|
|
5
|
+
static isValidS3Event(event: any): boolean;
|
|
6
|
+
static isValidApiGatewayV2WithRequestContextEvent(event: any): boolean;
|
|
7
|
+
static isValidApiGatewayEvent(event: any): boolean;
|
|
8
|
+
static isValidApiGatewayAuthorizerEvent(event: any): boolean;
|
|
9
|
+
static isSingleCronEvent(event: any): boolean;
|
|
10
|
+
static isSingleSnsEvent(event: any): boolean;
|
|
11
|
+
static isSingleDynamoDBEvent(event: any): boolean;
|
|
12
|
+
static isSingleS3Event(event: any): boolean;
|
|
13
|
+
static isSingleEntryEvent(event: any, entryName?: string): boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { APIGatewayEvent, APIGatewayProxyEventV2, DynamoDBStreamEvent, S3Event, ScheduledEvent, SNSEvent } from 'aws-lambda';
|
|
2
|
+
export declare class LambdaEventTypeGuards {
|
|
3
|
+
static isValidCronEvent(event: any): event is ScheduledEvent;
|
|
4
|
+
static isValidSnsEvent(event: any): event is SNSEvent;
|
|
5
|
+
static isValidDynamoDBEvent(event: any): event is DynamoDBStreamEvent;
|
|
6
|
+
static isValidS3Event(event: any): event is S3Event;
|
|
7
|
+
static isValidApiGatewayV2WithRequestContextEvent(event: any): event is APIGatewayProxyEventV2;
|
|
8
|
+
static isValidApiGatewayEvent(event: any): event is APIGatewayEvent;
|
|
9
|
+
static isValidApiGatewayAuthorizerEvent(event: any): boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { KeyValue } from '@bitblit/ratchet-common';
|
|
2
|
+
import { DynamoRatchet } from '../dynamodb/dynamo-ratchet.js';
|
|
3
|
+
import { QueryInput, ScanCommandInput } from '@aws-sdk/client-dynamodb';
|
|
4
|
+
export interface CloudWatchMetricsMinuteLevelDynamoCountRequest {
|
|
5
|
+
dynamoRatchet: DynamoRatchet;
|
|
6
|
+
query: QueryInput;
|
|
7
|
+
scan: ScanCommandInput;
|
|
8
|
+
minuteUTC: string;
|
|
9
|
+
namespace: string;
|
|
10
|
+
metric: string;
|
|
11
|
+
dims: KeyValue[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare enum CloudWatchMetricsUnit {
|
|
2
|
+
Seconds = "Seconds",
|
|
3
|
+
Microseconds = "Microseconds",
|
|
4
|
+
Milliseconds = "Milliseconds",
|
|
5
|
+
Bytes = "Bytes",
|
|
6
|
+
Kilobytes = "Kilobytes",
|
|
7
|
+
Megabytes = "Megabytes",
|
|
8
|
+
Gigabytes = "Gigabytes",
|
|
9
|
+
Terabytes = "Terabytes",
|
|
10
|
+
Bits = "Bits",
|
|
11
|
+
Kilobits = "Kilobits",
|
|
12
|
+
Megabits = "Megabits",
|
|
13
|
+
Gigabits = "Gigabits",
|
|
14
|
+
Terabits = "Terabits",
|
|
15
|
+
Percent = "Percent",
|
|
16
|
+
Count = "Count",
|
|
17
|
+
BytesPerSecond = "Bytes/Second",
|
|
18
|
+
KilobytesPerSecond = "Kilobytes/Second",
|
|
19
|
+
MegabytesPerSecond = "Megabytes/Second",
|
|
20
|
+
GigabytesPerSecond = "Gigabytes/Second",
|
|
21
|
+
TerabytesPerSecond = "Terabytes/Second",
|
|
22
|
+
BitsPerSecond = "Terabytes/Second",
|
|
23
|
+
KilobitsPerSecond = "Kilobits/Second",
|
|
24
|
+
MegabitsPerSecond = "Megabits/Second",
|
|
25
|
+
GigabitsPerSecond = "Gigabits/Second",
|
|
26
|
+
TerabitsPerSecond = "Terabits/Second",
|
|
27
|
+
CountPerSecond = "Count/Second",
|
|
28
|
+
None = "None"
|
|
29
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Route53Client } from '@aws-sdk/client-route-53';
|
|
2
|
+
export declare class Route53Ratchet {
|
|
3
|
+
private route53;
|
|
4
|
+
private hostedZoneId;
|
|
5
|
+
constructor(route53: Route53Client, hostedZoneId: string);
|
|
6
|
+
get route53Client(): Route53Client;
|
|
7
|
+
changeCnameRecordTarget(domainName: string, target: string, hostedZoneId?: string, ttlSeconds?: number): Promise<boolean>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RuntimeParameterProvider } from './runtime-parameter-provider.js';
|
|
2
|
+
import { StoredRuntimeParameter } from './stored-runtime-parameter.js';
|
|
3
|
+
import { DynamoRatchet } from '../dynamodb/dynamo-ratchet.js';
|
|
4
|
+
export declare class DynamoRuntimeParameterProvider implements RuntimeParameterProvider {
|
|
5
|
+
private dynamo;
|
|
6
|
+
private tableName;
|
|
7
|
+
constructor(dynamo: DynamoRatchet, tableName: string);
|
|
8
|
+
readParameter(groupId: string, paramKey: string): Promise<StoredRuntimeParameter>;
|
|
9
|
+
readAllParametersForGroup(groupId: string): Promise<StoredRuntimeParameter[]>;
|
|
10
|
+
writeParameter(toStore: StoredRuntimeParameter): Promise<boolean>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RuntimeParameterProvider } from './runtime-parameter-provider.js';
|
|
2
|
+
import { StoredRuntimeParameter } from './stored-runtime-parameter.js';
|
|
3
|
+
export declare class GlobalVariableOverrideRuntimeParameterProvider implements RuntimeParameterProvider {
|
|
4
|
+
private wrapped;
|
|
5
|
+
private options;
|
|
6
|
+
constructor(wrapped: RuntimeParameterProvider, opts?: GlobalVariableOverrideRuntimeParameterProviderOptions);
|
|
7
|
+
generateName(groupId: string, paramKey: string): string;
|
|
8
|
+
readParameter(groupId: string, paramKey: string): Promise<StoredRuntimeParameter>;
|
|
9
|
+
readAllParametersForGroup(groupId: string): Promise<StoredRuntimeParameter[]>;
|
|
10
|
+
writeParameter(toStore: StoredRuntimeParameter): Promise<boolean>;
|
|
11
|
+
}
|
|
12
|
+
export interface GlobalVariableOverrideRuntimeParameterProviderOptions {
|
|
13
|
+
globalTTL: number;
|
|
14
|
+
separator: string;
|
|
15
|
+
prefix?: string;
|
|
16
|
+
suffix?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RuntimeParameterProvider } from './runtime-parameter-provider.js';
|
|
2
|
+
import { StoredRuntimeParameter } from './stored-runtime-parameter.js';
|
|
3
|
+
export declare class MemoryRuntimeParameterProvider implements RuntimeParameterProvider {
|
|
4
|
+
private data;
|
|
5
|
+
constructor(data?: Promise<Record<string, StoredRuntimeParameter>>);
|
|
6
|
+
readParameter(groupId: string, paramKey: string): Promise<StoredRuntimeParameter>;
|
|
7
|
+
readAllParametersForGroup(groupId: string): Promise<StoredRuntimeParameter[]>;
|
|
8
|
+
writeParameter(toStore: StoredRuntimeParameter): Promise<boolean>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StoredRuntimeParameter } from './stored-runtime-parameter.js';
|
|
2
|
+
export interface RuntimeParameterProvider {
|
|
3
|
+
readParameter(groupId: string, paramKey: string): Promise<StoredRuntimeParameter>;
|
|
4
|
+
readAllParametersForGroup(groupId: string): Promise<StoredRuntimeParameter[]>;
|
|
5
|
+
writeParameter(param: StoredRuntimeParameter): Promise<boolean>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RuntimeParameterProvider } from './runtime-parameter-provider.js';
|
|
2
|
+
import { StoredRuntimeParameter } from './stored-runtime-parameter.js';
|
|
3
|
+
export declare class RuntimeParameterRatchet {
|
|
4
|
+
private provider;
|
|
5
|
+
private cache;
|
|
6
|
+
constructor(provider: RuntimeParameterProvider);
|
|
7
|
+
fetchParameter<T>(groupId: string, paramKey: string, defaultValue?: T, forceFreshRead?: boolean): Promise<T>;
|
|
8
|
+
fetchAllParametersForGroup(groupId: string): Promise<Map<string, any>>;
|
|
9
|
+
readUnderlyingEntry(groupId: string, paramKey: string): Promise<StoredRuntimeParameter>;
|
|
10
|
+
readUnderlyingEntries(groupId: string): Promise<StoredRuntimeParameter[]>;
|
|
11
|
+
storeParameter(groupId: string, paramKey: string, paramValue: any, ttlSeconds: number): Promise<StoredRuntimeParameter>;
|
|
12
|
+
private static toCacheStoreKey;
|
|
13
|
+
private addToCache;
|
|
14
|
+
clearCache(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { CompleteMultipartUploadCommandOutput, CopyObjectCommandOutput, DeleteObjectCommandOutput, GetObjectCommandOutput, HeadObjectCommandOutput, PutObjectCommandInput, S3Client } from '@aws-sdk/client-s3';
|
|
4
|
+
import { Readable } from 'stream';
|
|
5
|
+
export declare class S3CacheRatchet {
|
|
6
|
+
private s3;
|
|
7
|
+
private defaultBucket;
|
|
8
|
+
constructor(s3: S3Client, defaultBucket?: string);
|
|
9
|
+
get s3Client(): S3Client;
|
|
10
|
+
static applyCacheControlMaxAge(input: PutObjectCommandInput, seconds: number): PutObjectCommandInput;
|
|
11
|
+
static applyUserMetaData(input: PutObjectCommandInput, key: string, value: string): PutObjectCommandInput;
|
|
12
|
+
getDefaultBucket(): string;
|
|
13
|
+
getS3Client(): S3Client;
|
|
14
|
+
fileExists(key: string, bucket?: string): Promise<boolean>;
|
|
15
|
+
fetchCacheFileAsS3GetObjectCommandOutput(key: string, bucket?: string): Promise<GetObjectCommandOutput>;
|
|
16
|
+
fetchCacheFileAsReadableStream(key: string, bucket?: string): Promise<ReadableStream>;
|
|
17
|
+
fetchCacheFileAsBuffer(key: string, bucket?: string): Promise<Buffer>;
|
|
18
|
+
fetchCacheFileAsString(key: string, bucket?: string): Promise<string>;
|
|
19
|
+
fetchCacheFileAsObject<T>(key: string, bucket?: string): Promise<T>;
|
|
20
|
+
removeCacheFile(key: string, bucket?: string): Promise<DeleteObjectCommandOutput>;
|
|
21
|
+
writeObjectToCacheFile(key: string, dataObject: any, template?: PutObjectCommandInput, bucket?: string): Promise<CompleteMultipartUploadCommandOutput>;
|
|
22
|
+
writeStringToCacheFile(key: string, dataString: string, template?: PutObjectCommandInput, bucket?: string): Promise<CompleteMultipartUploadCommandOutput>;
|
|
23
|
+
writeStreamToCacheFile(key: string, data: ReadableStream | Readable, template?: PutObjectCommandInput, bucket?: string): Promise<CompleteMultipartUploadCommandOutput>;
|
|
24
|
+
synchronize(srcPrefix: string, targetPrefix: string, targetRatchet?: S3CacheRatchet, recurseSubFolders?: boolean): Promise<string[]>;
|
|
25
|
+
fetchMetaForCacheFile(key: string, bucket?: string): Promise<HeadObjectCommandOutput>;
|
|
26
|
+
cacheFileAgeInSeconds(key: string, bucket?: string): Promise<number>;
|
|
27
|
+
copyFile(srcKey: string, dstKey: string, srcBucket?: string, dstBucket?: string): Promise<CopyObjectCommandOutput>;
|
|
28
|
+
quietCopyFile(srcKey: string, dstKey: string, srcBucket?: string, dstBucket?: string): Promise<boolean>;
|
|
29
|
+
preSignedDownloadUrlForCacheFile(key: string, expirationSeconds?: number, bucket?: string): Promise<string>;
|
|
30
|
+
directChildrenOfPrefix(prefix: string, expandFiles?: boolean, bucket?: string, maxToReturn?: number): Promise<string[]>;
|
|
31
|
+
allSubFoldersOfPrefix(prefix: string, bucket?: string): Promise<string[]>;
|
|
32
|
+
private bucketVal;
|
|
33
|
+
}
|
|
34
|
+
export interface ExpandedFileChildren {
|
|
35
|
+
link: string;
|
|
36
|
+
name: string;
|
|
37
|
+
size: number;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { S3CacheRatchet } from './s3-cache-ratchet.js';
|
|
3
|
+
export declare class S3CacheToLocalDiskRatchet {
|
|
4
|
+
private s3;
|
|
5
|
+
private tmpFolder;
|
|
6
|
+
private cacheTimeoutSeconds;
|
|
7
|
+
private static readonly DEFAULT_CACHE_TIMEOUT_SEC;
|
|
8
|
+
private currentlyLoading;
|
|
9
|
+
constructor(s3: S3CacheRatchet, tmpFolder: string, cacheTimeoutSeconds?: number);
|
|
10
|
+
getFileString(key: string): Promise<string>;
|
|
11
|
+
private keyToLocalCachePath;
|
|
12
|
+
removeCacheFileForKey(key: string): void;
|
|
13
|
+
getFileBuffer(key: string): Promise<Buffer>;
|
|
14
|
+
private updateLocalCacheFile;
|
|
15
|
+
getCacheFileAsString(filePath: string): string;
|
|
16
|
+
getCacheFileAsBuffer(filePath: string): Buffer;
|
|
17
|
+
private generateCacheHash;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { S3Client } from '@aws-sdk/client-s3';
|
|
2
|
+
export interface S3LocationSyncRatchetConfig {
|
|
3
|
+
srcS3: S3Client;
|
|
4
|
+
srcBucket: string;
|
|
5
|
+
srcPrefix: string;
|
|
6
|
+
dstS3: S3Client;
|
|
7
|
+
dstBucket: string;
|
|
8
|
+
dstPrefix: string;
|
|
9
|
+
maxNumThreads?: number;
|
|
10
|
+
maxRetries?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare class S3LocationSyncRatchet {
|
|
13
|
+
private config;
|
|
14
|
+
constructor(config: S3LocationSyncRatchetConfig);
|
|
15
|
+
updateSrcPrefix(prefix: string): void;
|
|
16
|
+
updateDstPrefix(prefix: string): void;
|
|
17
|
+
copyObject(key: string, size: number, express?: boolean): Promise<void>;
|
|
18
|
+
listObjects(bucket: string, prefix: string, s3: S3Client): Promise<any>;
|
|
19
|
+
startSyncing(): Promise<boolean>;
|
|
20
|
+
private compareSrcAndDst;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RatchetTemplateRenderer } from './ratchet-template-renderer.js';
|
|
2
|
+
import { S3CacheRatchet } from '../s3/s3-cache-ratchet.js';
|
|
3
|
+
export interface MailerConfig {
|
|
4
|
+
defaultSendingAddress?: string;
|
|
5
|
+
autoBccAddresses?: string[];
|
|
6
|
+
templateRenderer?: RatchetTemplateRenderer;
|
|
7
|
+
allowedDestinationEmails?: RegExp[];
|
|
8
|
+
archive?: S3CacheRatchet;
|
|
9
|
+
archivePrefix?: string;
|
|
10
|
+
maxMessageBodySizeInBytes?: number;
|
|
11
|
+
maxAttachmentSizeInBase64Bytes?: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReadyToSendEmail } from './ready-to-send-email.js';
|
|
2
|
+
import { SendRawEmailResponse } from '@aws-sdk/client-ses';
|
|
3
|
+
import { ResolvedReadyToSendEmail } from './resolved-ready-to-send-email.js';
|
|
4
|
+
export interface MailerLike {
|
|
5
|
+
fillEmailBody(rts: ReadyToSendEmail, context: any, htmlTemplateName: string, txtTemplateName?: string, layoutName?: string, partialNames?: string[]): Promise<ReadyToSendEmail>;
|
|
6
|
+
fillEmailBodyAndSend(rts: ReadyToSendEmail, context: any, htmlTemplateName: string, txtTemplateName?: string, layoutName?: string, partialNames?: string[]): Promise<SendRawEmailResponse>;
|
|
7
|
+
filterEmailsToValid(emails: string[]): string[];
|
|
8
|
+
applyLimitsToBodySizesIfAnyInPlace(rts: ResolvedReadyToSendEmail): void;
|
|
9
|
+
applyLimitsToAttachmentSizesIfAnyInPlace(rts: ResolvedReadyToSendEmail): void;
|
|
10
|
+
sendEmail(inRts: ReadyToSendEmail): Promise<SendRawEmailResponse>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReadyToSendEmail } from './ready-to-send-email.js';
|
|
2
|
+
import { SendRawEmailCommandOutput, SendRawEmailResponse, SESClient } from '@aws-sdk/client-ses';
|
|
3
|
+
import { MailerConfig } from './mailer-config.js';
|
|
4
|
+
import { ResolvedReadyToSendEmail } from './resolved-ready-to-send-email.js';
|
|
5
|
+
import { MailerLike } from './mailer-like.js';
|
|
6
|
+
export declare class Mailer implements MailerLike {
|
|
7
|
+
private ses;
|
|
8
|
+
private config;
|
|
9
|
+
static readonly EMAIL: RegExp;
|
|
10
|
+
constructor(ses: SESClient, config?: MailerConfig);
|
|
11
|
+
get sESClient(): SESClient;
|
|
12
|
+
fillEmailBody(rts: ReadyToSendEmail, context: any, htmlTemplateName: string, txtTemplateName?: string, layoutName?: string, partialNames?: string[]): Promise<ReadyToSendEmail>;
|
|
13
|
+
fillEmailBodyAndSend(rts: ReadyToSendEmail, context: any, htmlTemplateName: string, txtTemplateName?: string, layoutName?: string, partialNames?: string[]): Promise<SendRawEmailResponse>;
|
|
14
|
+
filterEmailsToValid(emails: string[]): string[];
|
|
15
|
+
private archiveEmailIfConfigured;
|
|
16
|
+
applyLimitsToBodySizesIfAnyInPlace(rts: ResolvedReadyToSendEmail): void;
|
|
17
|
+
applyLimitsToAttachmentSizesIfAnyInPlace(rts: ResolvedReadyToSendEmail): void;
|
|
18
|
+
sendEmail(inRts: ReadyToSendEmail): Promise<SendRawEmailCommandOutput>;
|
|
19
|
+
static validEmail(email: string): boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EmailAttachment } from './email-attachment.js';
|
|
2
|
+
export interface ReadyToSendEmail {
|
|
3
|
+
destinationAddresses?: Array<string>;
|
|
4
|
+
bccAddresses?: Array<string>;
|
|
5
|
+
attachments?: Array<EmailAttachment>;
|
|
6
|
+
fromAddress?: string;
|
|
7
|
+
txtMessage?: string;
|
|
8
|
+
htmlMessage?: string;
|
|
9
|
+
subject?: string;
|
|
10
|
+
fromName?: string;
|
|
11
|
+
doNotAutoBcc?: boolean;
|
|
12
|
+
doNotArchive?: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RatchetTemplateRenderer } from './ratchet-template-renderer.js';
|
|
2
|
+
export declare class RemoteHandlebarsTemplateRenderer implements RatchetTemplateRenderer {
|
|
3
|
+
private prefix;
|
|
4
|
+
private suffix;
|
|
5
|
+
private maxCacheTemplates;
|
|
6
|
+
private cache;
|
|
7
|
+
constructor(prefix?: string, suffix?: string, maxCacheTemplates?: number);
|
|
8
|
+
renderTemplate(templateName: string, context: any, layoutName?: string): Promise<string>;
|
|
9
|
+
renderRemoteTemplate(templateName: string, inContext: any, layoutName?: string): Promise<string>;
|
|
10
|
+
renderTemplateDirect(templateText: string, context: any, layoutName?: string): Promise<string>;
|
|
11
|
+
private fetchTemplate;
|
|
12
|
+
private fetchTemplateText;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PublishCommandOutput, SNSClient } from '@aws-sdk/client-sns';
|
|
2
|
+
export declare class SnsRatchet {
|
|
3
|
+
private sns;
|
|
4
|
+
private topicArn;
|
|
5
|
+
constructor(sns: SNSClient, topicArn: string);
|
|
6
|
+
get snsClient(): SNSClient;
|
|
7
|
+
sendMessage(inMsg: any, suppressErrors?: boolean): Promise<PublishCommandOutput>;
|
|
8
|
+
conditionallySendMessage(inMsg: any, condition: boolean, suppressErrors?: boolean): Promise<PublishCommandOutput>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DynamoRatchet } from '../dynamodb/dynamo-ratchet.js';
|
|
2
|
+
import { SyncLockProvider } from './sync-lock-provider.js';
|
|
3
|
+
export declare class DynamoDbSyncLock implements SyncLockProvider {
|
|
4
|
+
private ratchet;
|
|
5
|
+
private tableName;
|
|
6
|
+
constructor(ratchet: DynamoRatchet, tableName: string);
|
|
7
|
+
acquireLock(lockKey: string, expirationSeconds?: number): Promise<boolean>;
|
|
8
|
+
releaseLock(lockKey: string): Promise<void>;
|
|
9
|
+
clearExpiredSyncLocks(): Promise<number>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SyncLockProvider } from './sync-lock-provider.js';
|
|
2
|
+
export declare class MemorySyncLock implements SyncLockProvider {
|
|
3
|
+
private _locks;
|
|
4
|
+
constructor();
|
|
5
|
+
acquireLock(lockKey: string, expirationSeconds?: number): Promise<boolean>;
|
|
6
|
+
releaseLock(lockKey: string): Promise<void>;
|
|
7
|
+
clearExpiredSyncLocks(): Promise<number>;
|
|
8
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bitblit/ratchet-aws",
|
|
3
|
+
"version": "4.0.1-alpha",
|
|
4
|
+
"description": "Common tools for use with AWS browser and node",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib/*",
|
|
9
|
+
"bin/*"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./lib/index.d.ts",
|
|
14
|
+
"import": "./lib/index.mjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"contributors": [
|
|
18
|
+
"Christopher Weiss <bitblit@gmail.com>",
|
|
19
|
+
"William Weiss <npm@codification.org>",
|
|
20
|
+
"Austin Grantham <agrantham@algidious.com>",
|
|
21
|
+
"Lucas Myers <veganbeef@protonmail.com>",
|
|
22
|
+
"Joel Flint <joel@stimulimedia.net>",
|
|
23
|
+
"Bilal Shahid <bshahid@adomni.com>"
|
|
24
|
+
],
|
|
25
|
+
"husky": {
|
|
26
|
+
"hooks": {
|
|
27
|
+
"pre-commit": "pretty-quick --staged"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"prettier": {
|
|
31
|
+
"printWidth": 140,
|
|
32
|
+
"singleQuote": true,
|
|
33
|
+
"arrowParens": "always"
|
|
34
|
+
},
|
|
35
|
+
"config": {},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"watch": "tsc-watch",
|
|
38
|
+
"clean": "shx rm -Rf lib",
|
|
39
|
+
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
|
|
40
|
+
"docs": "typedoc",
|
|
41
|
+
"lint": "eslint src/**/*.ts",
|
|
42
|
+
"lint-fix": "eslint --fix src/**/*.ts",
|
|
43
|
+
"generate-barrels": "barrelsby -q --delete -d src -e .*\\.spec\\.ts && sed -i 's/\\x27;/.js\\x27;/' src/index.ts",
|
|
44
|
+
"build": "yarn clean && yarn generate-barrels && rollup -c rollup.config.js",
|
|
45
|
+
"force-build": "tsc --build --force"
|
|
46
|
+
},
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "https://github.com/bitblit/Ratchet"
|
|
50
|
+
},
|
|
51
|
+
"keywords": [
|
|
52
|
+
"wrench",
|
|
53
|
+
"utility"
|
|
54
|
+
],
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/bitblit/Ratchet/issues"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/bitblit/Ratchet#readme",
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=14.18"
|
|
61
|
+
},
|
|
62
|
+
"license": "Apache-2.0",
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@aws-sdk/abort-controller": "3.329.0",
|
|
65
|
+
"@aws-sdk/client-athena": "3.332.0",
|
|
66
|
+
"@aws-sdk/client-batch": "3.332.0",
|
|
67
|
+
"@aws-sdk/client-cloudwatch": "3.332.0",
|
|
68
|
+
"@aws-sdk/client-cloudwatch-logs": "3.332.0",
|
|
69
|
+
"@aws-sdk/client-dynamodb": "3.332.0",
|
|
70
|
+
"@aws-sdk/client-ec2": "3.332.0",
|
|
71
|
+
"@aws-sdk/client-ec2-instance-connect": "3.332.0",
|
|
72
|
+
"@aws-sdk/client-route-53": "3.332.0",
|
|
73
|
+
"@aws-sdk/client-s3": "3.332.0",
|
|
74
|
+
"@aws-sdk/client-ses": "3.332.0",
|
|
75
|
+
"@aws-sdk/client-sns": "3.332.0",
|
|
76
|
+
"@aws-sdk/client-ssm": "3.332.0",
|
|
77
|
+
"@aws-sdk/lib-dynamodb": "3.332.0",
|
|
78
|
+
"@aws-sdk/lib-storage": "3.332.0",
|
|
79
|
+
"@aws-sdk/s3-request-presigner": "3.332.0",
|
|
80
|
+
"@aws-sdk/smithy-client": "3.329.0",
|
|
81
|
+
"@aws-sdk/types": "3.329.0",
|
|
82
|
+
"@aws-sdk/util-waiter": "3.329.0",
|
|
83
|
+
"@bitblit/ratchet-common": "4.0.1-alpha"
|
|
84
|
+
},
|
|
85
|
+
"optionalDependencies": {},
|
|
86
|
+
"resolutions": {},
|
|
87
|
+
"devDependencies": {
|
|
88
|
+
"@bitblit/ratchet-jest": "4.0.1-alpha",
|
|
89
|
+
"@bitblit/ratchet-node-only": "4.0.1-alpha",
|
|
90
|
+
"@types/aws-lambda": "8.10.115",
|
|
91
|
+
"aws-sdk-client-mock": "2.1.1"
|
|
92
|
+
}
|
|
93
|
+
}
|