@bitblit/ratchet-aws-node-only 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/bin/cli.js +10 -0
- package/lib/athena/alb-athena-log-ratchet.d.ts +57 -0
- package/lib/athena/alb-athena-log-ratchet.spec.d.ts +1 -0
- package/lib/athena/athena-ratchet.d.ts +16 -0
- package/lib/athena/athena-ratchet.spec.d.ts +1 -0
- package/lib/build/ratchet-aws-node-only-info.d.ts +5 -0
- package/lib/cli/dynamo-exporter.d.ts +13 -0
- package/lib/cli/ratchet-cli-handler.d.ts +6 -0
- package/lib/cli/site-uploader/site-uploader.d.ts +12 -0
- package/lib/cli/start-instance-and-ssh.d.ts +12 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.mjs +29 -0
- package/lib/index.mjs.map +1 -0
- package/lib/mail/inbound/email-to-db-insert-processor.d.ts +10 -0
- package/lib/mail/inbound/inbound-email-ratchet.d.ts +10 -0
- package/lib/mail/inbound/inbound-email-ratchet.spec.d.ts +1 -0
- package/lib/mail/inbound/parsed-email-processor.d.ts +5 -0
- package/lib/mail/inbound/sample-email-processor.d.ts +6 -0
- package/package.json +80 -0
package/bin/cli.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { RatchetCliHandler } from '../lib/index.mjs';
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
//const RatchetCliHandler = await import('../dist/cli-bootstrap/ratchet-cli-handler.js');
|
|
6
|
+
await new RatchetCliHandler().findAndExecuteHandler();
|
|
7
|
+
} catch (err) {
|
|
8
|
+
console.error('Error : %s', err);
|
|
9
|
+
process.exit(-1);
|
|
10
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ReadStream } from 'fs';
|
|
3
|
+
import { AthenaRatchet } from './athena-ratchet.js';
|
|
4
|
+
import { S3Client } from '@aws-sdk/client-s3';
|
|
5
|
+
export declare class AlbAthenaLogRatchet {
|
|
6
|
+
private athena;
|
|
7
|
+
private athenaTableName;
|
|
8
|
+
constructor(athena: AthenaRatchet, athenaTableName: string);
|
|
9
|
+
updatePartitions(rootPath: string, s3: S3Client, startTimeEpochMS?: number, endTimeEpochMS?: number): Promise<string[]>;
|
|
10
|
+
createTable(rootPath: string, replaceIfPresent?: boolean): Promise<boolean>;
|
|
11
|
+
static readLogObjectsFromCsvStream(readStream: ReadStream): Promise<AlbLogRecord[]>;
|
|
12
|
+
static readLogObjectsFromFile(fileName: string): Promise<AlbLogRecord[]>;
|
|
13
|
+
fetchAlbLogRecords(qry: AlbLogRecordQuery): Promise<AlbLogRecord[]>;
|
|
14
|
+
fetchAlbLogRecordsToFile(qry: AlbLogRecordQuery, outputFileName?: string): Promise<string>;
|
|
15
|
+
static readonly CREATE_TABLE_STATEMENT: string;
|
|
16
|
+
}
|
|
17
|
+
export interface AlbLogRecordQuery {
|
|
18
|
+
startTimeEpochMS?: number;
|
|
19
|
+
endTimeEpochMS?: number;
|
|
20
|
+
requestUrlFilter?: string;
|
|
21
|
+
limit?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface AlbLogRecord {
|
|
24
|
+
type: string;
|
|
25
|
+
time: string;
|
|
26
|
+
elb: string;
|
|
27
|
+
client_ip: string;
|
|
28
|
+
client_port: string;
|
|
29
|
+
target_ip: string;
|
|
30
|
+
target_port: string;
|
|
31
|
+
request_processing_time: string;
|
|
32
|
+
target_processing_time: string;
|
|
33
|
+
response_processing_time: string;
|
|
34
|
+
elb_status_code: string;
|
|
35
|
+
target_status_code: string;
|
|
36
|
+
received_bytes: string;
|
|
37
|
+
sent_bytes: string;
|
|
38
|
+
request_verb: string;
|
|
39
|
+
request_url: string;
|
|
40
|
+
request_proto: string;
|
|
41
|
+
user_agent: string;
|
|
42
|
+
ssl_cipher: string;
|
|
43
|
+
ssl_protocol: string;
|
|
44
|
+
target_group_arn: string;
|
|
45
|
+
trace_id: string;
|
|
46
|
+
domain_name: string;
|
|
47
|
+
chosen_cert_arn: string;
|
|
48
|
+
matched_rule_priority: string;
|
|
49
|
+
request_creation_time: string;
|
|
50
|
+
actions_executed: string;
|
|
51
|
+
redirect_url: string;
|
|
52
|
+
lambda_error_reason: string;
|
|
53
|
+
target_port_list: string;
|
|
54
|
+
target_status_code_list: string;
|
|
55
|
+
new_field: string;
|
|
56
|
+
date_utc_partition: string;
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AthenaClient, NamedQuery, Row } from '@aws-sdk/client-athena';
|
|
2
|
+
import { S3Client } from '@aws-sdk/client-s3';
|
|
3
|
+
export declare class AthenaRatchet {
|
|
4
|
+
private athena;
|
|
5
|
+
private s3;
|
|
6
|
+
private outputLocation;
|
|
7
|
+
constructor(athena: AthenaClient, s3: S3Client, outputLocation: string);
|
|
8
|
+
static athenaRowsToObject<T>(input: Row[]): T[];
|
|
9
|
+
static applyParamsToQuery<T>(query: string, queryParams: T): string;
|
|
10
|
+
fetchQueryIds(): Promise<string[]>;
|
|
11
|
+
listQueries(): Promise<NamedQuery[]>;
|
|
12
|
+
findQueryByName(name: string): Promise<NamedQuery>;
|
|
13
|
+
runQueryToObjects<T>(queryIn: string, queryParams?: any, pingTimeMS?: number): Promise<T[]>;
|
|
14
|
+
runQueryToFile(queryIn: string, queryParams?: any, targetDataFileIn?: string, pingTimeMS?: number): Promise<string>;
|
|
15
|
+
private runQueryToOutputLocation;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { WriteStream } from 'fs';
|
|
3
|
+
import { DynamoRatchet } from '@bitblit/ratchet-aws';
|
|
4
|
+
import { QueryCommandInput, ScanCommandInput } from '@aws-sdk/client-dynamodb';
|
|
5
|
+
export declare class DynamoExporter {
|
|
6
|
+
private constructor();
|
|
7
|
+
static importJsonLFileToTable(dynamo: DynamoRatchet, tableName: string, filename: string): Promise<number>;
|
|
8
|
+
static exportScanToJsonLFile(dynamo: DynamoRatchet, scan: ScanCommandInput, filename: string): Promise<number>;
|
|
9
|
+
static exportQueryToJsonLFile(dynamo: DynamoRatchet, qry: QueryCommandInput, filename: string): Promise<number>;
|
|
10
|
+
static exportScanToJsonLWriteStream(dynamo: DynamoRatchet, scan: ScanCommandInput, target: WriteStream): Promise<number>;
|
|
11
|
+
static exportQueryToJsonLWriteStream(dynamo: DynamoRatchet, qry: QueryCommandInput, target: WriteStream): Promise<number>;
|
|
12
|
+
static writeItemToJsonLStream(item: any, target: WriteStream, includeNulls?: boolean): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AbstractRatchetCliHandler } from '@bitblit/ratchet-node-only';
|
|
2
|
+
import { BuildInformation } from '@bitblit/ratchet-common';
|
|
3
|
+
export declare class RatchetCliHandler extends AbstractRatchetCliHandler {
|
|
4
|
+
fetchHandlerMap(): Record<string, any>;
|
|
5
|
+
fetchVersionInfo(): BuildInformation;
|
|
6
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class SiteUploader {
|
|
2
|
+
private srcDir;
|
|
3
|
+
private bucketName;
|
|
4
|
+
private config;
|
|
5
|
+
private readonly s3;
|
|
6
|
+
constructor(srcDir: string, bucketName: string, configFile: string);
|
|
7
|
+
static createFromArgs(args: string[]): SiteUploader;
|
|
8
|
+
static runFromCliArgs(args: string[]): Promise<void>;
|
|
9
|
+
findMatch(prefix: string, fileName: string, config: any): any;
|
|
10
|
+
findMime(fileName: string, config: any): string;
|
|
11
|
+
runPump(): Promise<any>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class StartInstanceAndSsh {
|
|
2
|
+
private instanceId;
|
|
3
|
+
private publicKeyFile;
|
|
4
|
+
private instanceOsUser;
|
|
5
|
+
private region;
|
|
6
|
+
private availabilityZone;
|
|
7
|
+
private ec2Ratchet;
|
|
8
|
+
constructor(instanceId: string, publicKeyFile?: string, instanceOsUser?: string, region?: string, availabilityZone?: string);
|
|
9
|
+
static createFromArgs(args: string[]): StartInstanceAndSsh;
|
|
10
|
+
static runFromCliArgs(args: string[]): Promise<void>;
|
|
11
|
+
run(): Promise<any>;
|
|
12
|
+
}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './athena/alb-athena-log-ratchet.js';
|
|
2
|
+
export * from './athena/athena-ratchet.js';
|
|
3
|
+
export * from './build/ratchet-aws-node-only-info.js';
|
|
4
|
+
export * from './cli/dynamo-exporter.js';
|
|
5
|
+
export * from './cli/ratchet-cli-handler.js';
|
|
6
|
+
export * from './cli/start-instance-and-ssh.js';
|
|
7
|
+
export * from './cli/site-uploader/site-uploader.js';
|
|
8
|
+
export * from './mail/inbound/email-to-db-insert-processor.js';
|
|
9
|
+
export * from './mail/inbound/inbound-email-ratchet.js';
|
|
10
|
+
export * from './mail/inbound/parsed-email-processor.js';
|
|
11
|
+
export * from './mail/inbound/sample-email-processor.js';
|