@bitblit/ratchet-epsilon-common 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/CHANGELOG.md +177 -0
- package/License.txt +13 -0
- package/README.md +242 -0
- package/bin/cli.js +10 -0
- package/lib/background/background-dynamo-log-table-handler.d.ts +11 -0
- package/lib/background/background-entry.d.ts +4 -0
- package/lib/background/background-execution-event-type.d.ts +7 -0
- package/lib/background/background-execution-event.d.ts +8 -0
- package/lib/background/background-execution-listener.d.ts +5 -0
- package/lib/background/background-handler.d.ts +29 -0
- package/lib/background/background-http-adapter-handler.d.ts +22 -0
- package/lib/background/background-meta-response-internal.d.ts +5 -0
- package/lib/background/background-process-handling.d.ts +4 -0
- package/lib/background/background-process-log-table-entry.d.ts +11 -0
- package/lib/background/background-queue-response-internal.d.ts +8 -0
- package/lib/background/background-validator.d.ts +17 -0
- package/lib/background/epsilon-background-process-error.d.ts +30 -0
- package/lib/background/internal-background-entry.d.ts +7 -0
- package/lib/background/manager/abstract-background-manager.d.ts +19 -0
- package/lib/background/manager/aws-sqs-sns-background-manager.d.ts +23 -0
- package/lib/background/manager/background-manager-like.d.ts +17 -0
- package/lib/background/manager/background-manager.spec.d.ts +1 -0
- package/lib/background/manager/single-thread-local-background-manager.d.ts +15 -0
- package/lib/background/s3-background-transaction-logger.d.ts +17 -0
- package/lib/build/ratchet-epsilon-common-info.d.ts +5 -0
- package/lib/built-in/background/echo-processor.d.ts +7 -0
- package/lib/built-in/background/log-and-enqueue-echo-processor.d.ts +6 -0
- package/lib/built-in/background/log-message-background-error-processor.d.ts +5 -0
- package/lib/built-in/background/no-op-processor.d.ts +6 -0
- package/lib/built-in/background/retry-processor.d.ts +16 -0
- package/lib/built-in/background/sample-delay-processor.d.ts +6 -0
- package/lib/built-in/background/sample-input-validated-processor-data.d.ts +4 -0
- package/lib/built-in/background/sample-input-validated-processor.d.ts +8 -0
- package/lib/built-in/built-in-trace-id-generators.d.ts +5 -0
- package/lib/built-in/daemon/daemon-authorizer-function.d.ts +5 -0
- package/lib/built-in/daemon/daemon-config.d.ts +8 -0
- package/lib/built-in/daemon/daemon-group-selection-function.d.ts +4 -0
- package/lib/built-in/daemon/daemon-handler.d.ts +16 -0
- package/lib/built-in/daemon/daemon-process-state-list.d.ts +5 -0
- package/lib/built-in/http/apollo-filter.d.ts +10 -0
- package/lib/built-in/http/built-in-auth-filters.d.ts +9 -0
- package/lib/built-in/http/built-in-authorizers.d.ts +8 -0
- package/lib/built-in/http/built-in-filters.d.ts +25 -0
- package/lib/built-in/http/built-in-handlers.d.ts +9 -0
- package/lib/built-in/http/log-level-manipulation-filter.d.ts +6 -0
- package/lib/built-in/http/run-handler-as-filter.d.ts +12 -0
- package/lib/built-in/http/run-handler-as-filter.spec.d.ts +1 -0
- package/lib/cli/ratchet-cli-handler.d.ts +6 -0
- package/lib/cli/run-background-process-from-command-line.d.ts +3 -0
- package/lib/config/background/background-aws-config.d.ts +7 -0
- package/lib/config/background/background-config.d.ts +14 -0
- package/lib/config/background/background-error-processor.d.ts +4 -0
- package/lib/config/background/background-processor.d.ts +6 -0
- package/lib/config/background/background-transaction-log.d.ts +8 -0
- package/lib/config/background/background-transaction-logger.d.ts +5 -0
- package/lib/config/cron/abstract-cron-entry.d.ts +12 -0
- package/lib/config/cron/cron-background-entry.d.ts +6 -0
- package/lib/config/cron/cron-config.d.ts +6 -0
- package/lib/config/dynamo-db-config.d.ts +5 -0
- package/lib/config/epsilon-config.d.ts +21 -0
- package/lib/config/epsilon-lambda-event-handler.d.ts +7 -0
- package/lib/config/epsilon-logger-config.d.ts +13 -0
- package/lib/config/generic-aws-event-handler-function.d.ts +3 -0
- package/lib/config/http/authorizer-function.d.ts +6 -0
- package/lib/config/http/epsilon-authorization-context.d.ts +5 -0
- package/lib/config/http/extended-api-gateway-event.d.ts +7 -0
- package/lib/config/http/filter-chain-context.d.ts +14 -0
- package/lib/config/http/filter-function.d.ts +4 -0
- package/lib/config/http/handler-function.d.ts +5 -0
- package/lib/config/http/http-config.d.ts +15 -0
- package/lib/config/http/http-processing-config.d.ts +11 -0
- package/lib/config/http/mapped-http-processing-config.d.ts +7 -0
- package/lib/config/http/null-returned-object-handling.d.ts +5 -0
- package/lib/config/inter-api/inter-api-aws-config.d.ts +5 -0
- package/lib/config/inter-api/inter-api-config.d.ts +6 -0
- package/lib/config/inter-api/inter-api-process-mapping.d.ts +6 -0
- package/lib/config/logging-trace-id-generator.d.ts +4 -0
- package/lib/config/open-api/open-api-document-components.d.ts +4 -0
- package/lib/config/open-api/open-api-document-path.d.ts +2 -0
- package/lib/config/open-api/open-api-document.d.ts +6 -0
- package/lib/config/s3-config.d.ts +6 -0
- package/lib/config/sns-config.d.ts +5 -0
- package/lib/epsilon-build-properties.d.ts +9 -0
- package/lib/epsilon-constants.d.ts +16 -0
- package/lib/epsilon-global-handler.d.ts +20 -0
- package/lib/epsilon-instance.d.ts +14 -0
- package/lib/epsilon-logging-extension-processor.d.ts +6 -0
- package/lib/http/auth/api-gateway-adapter-authentication-handler.d.ts +8 -0
- package/lib/http/auth/auth0-web-token-manipulator.d.ts +13 -0
- package/lib/http/auth/basic-auth-token.d.ts +4 -0
- package/lib/http/auth/google-web-token-manipulator.d.ts +14 -0
- package/lib/http/auth/google-web-token-manipulator.spec.d.ts +1 -0
- package/lib/http/auth/jwt-ratchet-local-web-token-manipulator.d.ts +11 -0
- package/lib/http/auth/local-web-token-manipulator.d.ts +19 -0
- package/lib/http/auth/local-web-token-manipulator.spec.d.ts +1 -0
- package/lib/http/auth/web-token-manipulator.d.ts +4 -0
- package/lib/http/error/bad-gateway.d.ts +5 -0
- package/lib/http/error/bad-request-error.d.ts +5 -0
- package/lib/http/error/conflict-error.d.ts +5 -0
- package/lib/http/error/epsilon-http-error.d.ts +41 -0
- package/lib/http/error/epsilon-http-error.spec.d.ts +1 -0
- package/lib/http/error/forbidden-error.d.ts +5 -0
- package/lib/http/error/gateway-timeout.d.ts +5 -0
- package/lib/http/error/method-not-allowed-error.d.ts +5 -0
- package/lib/http/error/misconfigured-error.d.ts +5 -0
- package/lib/http/error/not-found-error.d.ts +5 -0
- package/lib/http/error/not-implemented.d.ts +5 -0
- package/lib/http/error/request-timeout-error.d.ts +5 -0
- package/lib/http/error/service-unavailable.d.ts +5 -0
- package/lib/http/error/too-many-requests-error.d.ts +5 -0
- package/lib/http/error/unauthorized-error.d.ts +5 -0
- package/lib/http/event-util.d.ts +25 -0
- package/lib/http/event-util.spec.d.ts +1 -0
- package/lib/http/response-util.d.ts +11 -0
- package/lib/http/response-util.spec.d.ts +1 -0
- package/lib/http/route/epsilon-router.d.ts +8 -0
- package/lib/http/route/extended-auth-response-context.d.ts +6 -0
- package/lib/http/route/route-mapping.d.ts +12 -0
- package/lib/http/route/route-validator-config.d.ts +5 -0
- package/lib/http/route/router-util.d.ts +23 -0
- package/lib/http/route/router-util.spec.d.ts +1 -0
- package/lib/http/web-handler.d.ts +23 -0
- package/lib/http/web-handler.spec.d.ts +1 -0
- package/lib/http/web-v2-handler.d.ts +10 -0
- package/lib/index.d.ts +132 -0
- package/lib/index.mjs +344 -0
- package/lib/index.mjs.map +1 -0
- package/lib/inter-api/inter-api-entry.d.ts +7 -0
- package/lib/inter-api/inter-api-util.d.ts +10 -0
- package/lib/inter-api/inter-api-util.spec.d.ts +1 -0
- package/lib/inter-api-manager.d.ts +14 -0
- package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.d.ts +14 -0
- package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.spec.d.ts +1 -0
- package/lib/lambda-event-handler/dynamo-epsilon-lambda-event-handler.d.ts +11 -0
- package/lib/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.d.ts +10 -0
- package/lib/lambda-event-handler/inter-api-epsilon-lambda-event-handler.d.ts +10 -0
- package/lib/lambda-event-handler/s3-epsilon-lambda-event-handler.d.ts +10 -0
- package/lib/local-container-server.d.ts +11 -0
- package/lib/local-server-cert.d.ts +5 -0
- package/lib/local-server.d.ts +18 -0
- package/lib/open-api-util/open-api-doc-modifications.d.ts +8 -0
- package/lib/open-api-util/open-api-doc-modifier.d.ts +7 -0
- package/lib/open-api-util/open-api-doc-modifier.spec.d.ts +1 -0
- package/lib/open-api-util/yaml-combiner.d.ts +3 -0
- package/lib/open-api-util/yaml-combiner.spec.d.ts +1 -0
- package/lib/sample/sample-server-components.d.ts +10 -0
- package/lib/sample/sample-server-static-files.d.ts +5 -0
- package/lib/sample/test-error-server.d.ts +11 -0
- package/lib/util/aws-util.d.ts +8 -0
- package/lib/util/context-util.d.ts +33 -0
- package/lib/util/cron-util.d.ts +11 -0
- package/lib/util/cron-util.spec.d.ts +1 -0
- package/lib/util/epsilon-config-parser.d.ts +14 -0
- package/package.json +129 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GetQueueAttributesCommandOutput, SQSClient } from '@aws-sdk/client-sqs';
|
|
2
|
+
import { BackgroundEntry } from '../background-entry.js';
|
|
3
|
+
import { BackgroundAwsConfig } from '../../config/background/background-aws-config.js';
|
|
4
|
+
import { InternalBackgroundEntry } from '../internal-background-entry.js';
|
|
5
|
+
import { AbstractBackgroundManager } from './abstract-background-manager.js';
|
|
6
|
+
import { SNSClient } from '@aws-sdk/client-sns';
|
|
7
|
+
export declare class AwsSqsSnsBackgroundManager extends AbstractBackgroundManager {
|
|
8
|
+
private _awsConfig;
|
|
9
|
+
private _sqs;
|
|
10
|
+
private _sns;
|
|
11
|
+
constructor(_awsConfig: BackgroundAwsConfig, _sqs: SQSClient, _sns: SNSClient);
|
|
12
|
+
get backgroundManagerName(): string;
|
|
13
|
+
get awsConfig(): BackgroundAwsConfig;
|
|
14
|
+
get sqs(): SQSClient;
|
|
15
|
+
get sns(): SNSClient;
|
|
16
|
+
addEntryToQueue<T>(entry: BackgroundEntry<T>, fireStartMessage?: boolean): Promise<string>;
|
|
17
|
+
fireImmediateProcessRequest<T>(entry: BackgroundEntry<T>): Promise<string>;
|
|
18
|
+
fireStartProcessingRequest(): Promise<string>;
|
|
19
|
+
fetchApproximateNumberOfQueueEntries(): Promise<number>;
|
|
20
|
+
fetchCurrentQueueAttributes(): Promise<GetQueueAttributesCommandOutput>;
|
|
21
|
+
writeMessageToSnsTopic(message: string): Promise<string>;
|
|
22
|
+
takeEntryFromBackgroundQueue(): Promise<InternalBackgroundEntry<any>[]>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BackgroundEntry } from '../background-entry.js';
|
|
2
|
+
import { InternalBackgroundEntry } from '../internal-background-entry.js';
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
|
+
export interface BackgroundManagerLike {
|
|
5
|
+
get backgroundManagerName(): string;
|
|
6
|
+
immediateProcessQueue?(): Subject<InternalBackgroundEntry<any>>;
|
|
7
|
+
createEntry<T>(type: string, data?: T): BackgroundEntry<T>;
|
|
8
|
+
wrapEntryForInternal<T>(entry: BackgroundEntry<T>, overrideTraceId?: string, overrideTraceDepth?: number): InternalBackgroundEntry<T>;
|
|
9
|
+
addEntryToQueueByParts<T>(type: string, data?: T, fireStartMessage?: boolean): Promise<string>;
|
|
10
|
+
addEntryToQueue<T>(entry: BackgroundEntry<T>, fireStartMessage?: boolean): Promise<string>;
|
|
11
|
+
addEntriesToQueue(entries: BackgroundEntry<any>[], fireStartMessage?: boolean): Promise<string[]>;
|
|
12
|
+
fireImmediateProcessRequestByParts<T>(type: string, data?: T): Promise<string>;
|
|
13
|
+
fireImmediateProcessRequest<T>(entry: BackgroundEntry<T>): Promise<string>;
|
|
14
|
+
fireStartProcessingRequest(): Promise<string>;
|
|
15
|
+
fetchApproximateNumberOfQueueEntries(): Promise<number>;
|
|
16
|
+
takeEntryFromBackgroundQueue(): Promise<InternalBackgroundEntry<any>[]>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Subject } from 'rxjs';
|
|
2
|
+
import { BackgroundEntry } from '../background-entry.js';
|
|
3
|
+
import { InternalBackgroundEntry } from '../internal-background-entry.js';
|
|
4
|
+
import { AbstractBackgroundManager } from './abstract-background-manager.js';
|
|
5
|
+
export declare class SingleThreadLocalBackgroundManager extends AbstractBackgroundManager {
|
|
6
|
+
private _localBus;
|
|
7
|
+
get backgroundManagerName(): string;
|
|
8
|
+
constructor();
|
|
9
|
+
immediateProcessQueue?(): Subject<InternalBackgroundEntry<any>>;
|
|
10
|
+
addEntryToQueue<T>(entry: BackgroundEntry<T>, fireStartMessage?: boolean): Promise<string>;
|
|
11
|
+
fireImmediateProcessRequest<T>(entry: BackgroundEntry<T>): Promise<string>;
|
|
12
|
+
fireStartProcessingRequest(): Promise<string>;
|
|
13
|
+
fetchApproximateNumberOfQueueEntries(): Promise<number>;
|
|
14
|
+
takeEntryFromBackgroundQueue(): Promise<InternalBackgroundEntry<any>[]>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BackgroundTransactionLogger } from '../config/background/background-transaction-logger.js';
|
|
2
|
+
import { BackgroundTransactionLog } from '../config/background/background-transaction-log.js';
|
|
3
|
+
import { S3Client } from '@aws-sdk/client-s3';
|
|
4
|
+
export declare class S3BackgroundTransactionLogger implements BackgroundTransactionLogger {
|
|
5
|
+
private cfg;
|
|
6
|
+
private s3TransactionLogCacheRatchet;
|
|
7
|
+
constructor(cfg: BackgroundS3TransactionLoggingConfig);
|
|
8
|
+
logTransaction(txLog: BackgroundTransactionLog): Promise<void>;
|
|
9
|
+
readTransactionLog(txGuid: string): Promise<BackgroundTransactionLog>;
|
|
10
|
+
static validateConfig(cfg: BackgroundS3TransactionLoggingConfig): string[];
|
|
11
|
+
}
|
|
12
|
+
export interface BackgroundS3TransactionLoggingConfig {
|
|
13
|
+
s3: S3Client;
|
|
14
|
+
bucket: string;
|
|
15
|
+
timeToLiveDays: number;
|
|
16
|
+
prefix?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BackgroundProcessor } from '../../config/background/background-processor.js';
|
|
2
|
+
import { BackgroundManagerLike } from '../../background/manager/background-manager-like.js';
|
|
3
|
+
export declare class EchoProcessor implements BackgroundProcessor<any> {
|
|
4
|
+
static TYPE_NAME: string;
|
|
5
|
+
get typeName(): string;
|
|
6
|
+
handleEvent(data: any, mgr?: BackgroundManagerLike): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BackgroundProcessor } from '../../config/background/background-processor.js';
|
|
2
|
+
import { BackgroundManagerLike } from '../../background/manager/background-manager-like.js';
|
|
3
|
+
export declare class LogAndEnqueueEchoProcessor implements BackgroundProcessor<any> {
|
|
4
|
+
get typeName(): string;
|
|
5
|
+
handleEvent(data: any, cfg: BackgroundManagerLike): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BackgroundErrorProcessor } from '../../config/background/background-error-processor.js';
|
|
2
|
+
import { InternalBackgroundEntry } from '../../background/internal-background-entry.js';
|
|
3
|
+
export declare class LogMessageBackgroundErrorProcessor implements BackgroundErrorProcessor {
|
|
4
|
+
handleError(submission: InternalBackgroundEntry<any>, error: Error): Promise<void>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BackgroundProcessor } from '../../config/background/background-processor.js';
|
|
2
|
+
import { BackgroundManagerLike } from '../../background/manager/background-manager-like.js';
|
|
3
|
+
export declare class NoOpProcessor implements BackgroundProcessor<any> {
|
|
4
|
+
get typeName(): string;
|
|
5
|
+
handleEvent(data: any, mgr?: BackgroundManagerLike): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BackgroundProcessor } from '../../config/background/background-processor.js';
|
|
2
|
+
import { BackgroundManagerLike } from '../../background/manager/background-manager-like.js';
|
|
3
|
+
export declare class RetryProcessor implements BackgroundProcessor<any> {
|
|
4
|
+
private delegate;
|
|
5
|
+
private opts;
|
|
6
|
+
private static readonly RETRY_FIELD_NAME;
|
|
7
|
+
constructor(delegate: BackgroundProcessor<any>, opts: RetryProcessorOptions);
|
|
8
|
+
get typeName(): string;
|
|
9
|
+
handleEvent(data: any, mgr: BackgroundManagerLike): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export interface RetryProcessorOptions {
|
|
12
|
+
retryCount?: number;
|
|
13
|
+
baseDelayMS?: number;
|
|
14
|
+
typePrefix?: string;
|
|
15
|
+
typeSuffix?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BackgroundProcessor } from '../../config/background/background-processor.js';
|
|
2
|
+
import { BackgroundManagerLike } from '../../background/manager/background-manager-like.js';
|
|
3
|
+
export declare class SampleDelayProcessor implements BackgroundProcessor<any> {
|
|
4
|
+
get typeName(): string;
|
|
5
|
+
handleEvent(data: any, mgr?: BackgroundManagerLike): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BackgroundProcessor } from '../../config/background/background-processor.js';
|
|
2
|
+
import { SampleInputValidatedProcessorData } from './sample-input-validated-processor-data.js';
|
|
3
|
+
import { BackgroundManagerLike } from '../../background/manager/background-manager-like.js';
|
|
4
|
+
export declare class SampleInputValidatedProcessor implements BackgroundProcessor<SampleInputValidatedProcessorData> {
|
|
5
|
+
get typeName(): string;
|
|
6
|
+
handleEvent(data: SampleInputValidatedProcessorData, mgr?: BackgroundManagerLike): Promise<void>;
|
|
7
|
+
get dataSchemaName(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DaemonProcessState } from '@bitblit/ratchet-aws';
|
|
2
|
+
import { ExtendedAPIGatewayEvent } from '../../config/http/extended-api-gateway-event.js';
|
|
3
|
+
export interface DaemonAuthorizerFunction {
|
|
4
|
+
(evt: ExtendedAPIGatewayEvent, proc: DaemonProcessState): Promise<boolean>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DaemonAuthorizerFunction } from './daemon-authorizer-function.js';
|
|
2
|
+
import { DaemonGroupSelectionFunction } from './daemon-group-selection-function.js';
|
|
3
|
+
export interface DaemonConfig {
|
|
4
|
+
authorizer?: DaemonAuthorizerFunction;
|
|
5
|
+
groupSelector?: DaemonGroupSelectionFunction;
|
|
6
|
+
fetchDaemonStatusPathParameter?: string;
|
|
7
|
+
fetchDaemonStatusByPublicTokenPathParameter?: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DaemonLike } from '@bitblit/ratchet-aws';
|
|
2
|
+
import { DaemonProcessState } from '@bitblit/ratchet-aws';
|
|
3
|
+
import { DaemonAuthorizerFunction } from './daemon-authorizer-function.js';
|
|
4
|
+
import { ExtendedAPIGatewayEvent } from '../../config/http/extended-api-gateway-event.js';
|
|
5
|
+
import { DaemonProcessStateList } from './daemon-process-state-list.js';
|
|
6
|
+
import { DaemonConfig } from './daemon-config.js';
|
|
7
|
+
export declare class DaemonHandler {
|
|
8
|
+
private daemon;
|
|
9
|
+
private inConfig?;
|
|
10
|
+
static readonly ALLOW_EVERYTHING_AUTHORIZER: DaemonAuthorizerFunction;
|
|
11
|
+
private config;
|
|
12
|
+
constructor(daemon: DaemonLike, inConfig?: DaemonConfig);
|
|
13
|
+
fetchDaemonStatusByPublicToken(evt: ExtendedAPIGatewayEvent): Promise<DaemonProcessState>;
|
|
14
|
+
fetchDaemonStatus(evt: ExtendedAPIGatewayEvent): Promise<DaemonProcessState>;
|
|
15
|
+
listDaemonStatus(evt: ExtendedAPIGatewayEvent): Promise<DaemonProcessStateList>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { APIGatewayEvent, Context, ProxyResult } from 'aws-lambda';
|
|
2
|
+
import { ApolloServer, CreateHandlerOptions } from 'apollo-server-lambda';
|
|
3
|
+
import { FilterFunction } from '../../config/http/filter-function.js';
|
|
4
|
+
import { FilterChainContext } from '../../config/http/filter-chain-context.js';
|
|
5
|
+
export declare class ApolloFilter {
|
|
6
|
+
private static CACHE_APOLLO_HANDLER;
|
|
7
|
+
static handlePathWithApollo(fCtx: FilterChainContext, apolloPathRegex: RegExp, apolloServer: ApolloServer, createHandlerOptions: CreateHandlerOptions): Promise<boolean>;
|
|
8
|
+
static processApolloRequest(event: APIGatewayEvent, context: Context, apolloServer: ApolloServer, createHandlerOptions: CreateHandlerOptions): Promise<ProxyResult>;
|
|
9
|
+
static addApolloFilterToList(filters: FilterFunction[], apolloPathRegex: RegExp, apolloServer: ApolloServer, createHandlerOptions: CreateHandlerOptions): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FilterChainContext } from '../../config/http/filter-chain-context.js';
|
|
2
|
+
import { WebTokenManipulator } from '../../http/auth/web-token-manipulator.js';
|
|
3
|
+
import { JwtTokenBase } from '@bitblit/ratchet-common';
|
|
4
|
+
export declare class BuiltInAuthFilters {
|
|
5
|
+
static requireAllRolesInCommonJwt(fCtx: FilterChainContext, requiredRoleAllOf: string[]): Promise<boolean>;
|
|
6
|
+
static requireAnyRoleInCommonJwt(fCtx: FilterChainContext, requiredRoleOneOf: string[]): Promise<boolean>;
|
|
7
|
+
static parseAuthorizationHeader(fCtx: FilterChainContext, webTokenManipulators: WebTokenManipulator<JwtTokenBase> | WebTokenManipulator<JwtTokenBase>[]): Promise<boolean>;
|
|
8
|
+
static applyOpenApiAuthorization(fCtx: FilterChainContext): Promise<boolean>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { APIGatewayEvent } from 'aws-lambda';
|
|
2
|
+
import { RouteMapping } from '../../http/route/route-mapping.js';
|
|
3
|
+
import { EpsilonAuthorizationContext } from '../../config/http/epsilon-authorization-context.js';
|
|
4
|
+
export declare class BuiltInAuthorizers {
|
|
5
|
+
static simpleNoAuthenticationLogAccess(authorizationContext: EpsilonAuthorizationContext<any>, evt: APIGatewayEvent): Promise<boolean>;
|
|
6
|
+
static simpleLoggedInAuth(authorizationContext: EpsilonAuthorizationContext<any>, evt: APIGatewayEvent): Promise<boolean>;
|
|
7
|
+
static simpleRoleRouteAuth(authorizationContext: EpsilonAuthorizationContext<any>, event: APIGatewayEvent, route: RouteMapping, requiredRoleOneOf?: string[], requiredRoleAllOf?: string[]): Promise<boolean>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FilterFunction } from '../../config/http/filter-function.js';
|
|
2
|
+
import { FilterChainContext } from '../../config/http/filter-chain-context.js';
|
|
3
|
+
export declare class BuiltInFilters {
|
|
4
|
+
static readonly MAXIMUM_LAMBDA_BODY_SIZE_BYTES: number;
|
|
5
|
+
static combineFilters(fCtx: FilterChainContext, filters: FilterFunction[]): Promise<boolean>;
|
|
6
|
+
static applyGzipIfPossible(fCtx: FilterChainContext): Promise<boolean>;
|
|
7
|
+
static addConstantHeaders(fCtx: FilterChainContext, headers: Record<string, string>): Promise<boolean>;
|
|
8
|
+
static addAWSRequestIdHeader(fCtx: FilterChainContext, headerName?: string): Promise<boolean>;
|
|
9
|
+
static addAllowEverythingCORSHeaders(fCtx: FilterChainContext): Promise<boolean>;
|
|
10
|
+
static addAllowReflectionCORSHeaders(fCtx: FilterChainContext): Promise<boolean>;
|
|
11
|
+
static uriDecodeQueryParams(fCtx: FilterChainContext): Promise<boolean>;
|
|
12
|
+
static fixStillEncodedQueryParams(fCtx: FilterChainContext): Promise<boolean>;
|
|
13
|
+
static disallowStringNullAsPathParameter(fCtx: FilterChainContext): Promise<boolean>;
|
|
14
|
+
static disallowStringNullAsQueryStringParameter(fCtx: FilterChainContext): Promise<boolean>;
|
|
15
|
+
static ensureEventMaps(fCtx: FilterChainContext): Promise<boolean>;
|
|
16
|
+
static parseJsonBodyToObject(fCtx: FilterChainContext): Promise<boolean>;
|
|
17
|
+
static checkMaximumLambdaBodySize(fCtx: FilterChainContext): Promise<boolean>;
|
|
18
|
+
static validateInboundBody(fCtx: FilterChainContext): Promise<boolean>;
|
|
19
|
+
static validateInboundQueryParams(fCtx: FilterChainContext): Promise<boolean>;
|
|
20
|
+
static validateInboundPathParams(fCtx: FilterChainContext): Promise<boolean>;
|
|
21
|
+
static validateOutboundResponse(fCtx: FilterChainContext): Promise<boolean>;
|
|
22
|
+
static autoRespondToOptionsRequestWithCors(fCtx: FilterChainContext): Promise<boolean>;
|
|
23
|
+
static autoRespond(fCtx: FilterChainContext, inBody: any): Promise<boolean>;
|
|
24
|
+
static secureOutboundServerErrorForProduction(fCtx: FilterChainContext, errorMessage: string, errCode: number): Promise<boolean>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { APIGatewayEvent, Context } from 'aws-lambda';
|
|
2
|
+
import { ExtendedAPIGatewayEvent } from '../../config/http/extended-api-gateway-event.js';
|
|
3
|
+
import { EpsilonRouter } from '../../http/route/epsilon-router.js';
|
|
4
|
+
export declare class BuiltInHandlers {
|
|
5
|
+
static expectedHandledByFilter(evt: ExtendedAPIGatewayEvent, flag?: string): Promise<any>;
|
|
6
|
+
static handleNotImplemented(evt: ExtendedAPIGatewayEvent, flag?: string): Promise<any>;
|
|
7
|
+
static sample(evt: ExtendedAPIGatewayEvent, flag?: string, context?: Context): Promise<any>;
|
|
8
|
+
static defaultErrorProcessor(event: APIGatewayEvent, err: Error, cfg: EpsilonRouter): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FilterChainContext } from '../../config/http/filter-chain-context.js';
|
|
2
|
+
export declare class LogLevelManipulationFilter {
|
|
3
|
+
private static LOG_LEVEL_BEFORE_CHANGE;
|
|
4
|
+
static setLogLevelForTransaction(fCtx: FilterChainContext): Promise<boolean>;
|
|
5
|
+
static clearLogLevelForTransaction(fCtx: FilterChainContext): Promise<boolean>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Context } from 'aws-lambda';
|
|
2
|
+
import { ExtendedAPIGatewayEvent } from '../../config/http/extended-api-gateway-event.js';
|
|
3
|
+
import { RouteAndParse } from '../../http/web-handler.js';
|
|
4
|
+
import { NullReturnedObjectHandling } from '../../config/http/null-returned-object-handling.js';
|
|
5
|
+
import { FilterFunction } from '../../config/http/filter-function.js';
|
|
6
|
+
import { FilterChainContext } from '../../config/http/filter-chain-context.js';
|
|
7
|
+
export declare class RunHandlerAsFilter {
|
|
8
|
+
static runHandler(fCtx: FilterChainContext, rm: RouteAndParse): Promise<boolean>;
|
|
9
|
+
static applyNullReturnedObjectHandling(result: any, handling: NullReturnedObjectHandling): any;
|
|
10
|
+
static findHandler(rm: RouteAndParse, event: ExtendedAPIGatewayEvent, context: Context, add404OnMissing?: boolean): Promise<any>;
|
|
11
|
+
static addRunHandlerAsFilterToList(filters: FilterFunction[], rm: RouteAndParse): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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,14 @@
|
|
|
1
|
+
import { BackgroundProcessor } from './background-processor.js';
|
|
2
|
+
import { BackgroundErrorProcessor } from './background-error-processor.js';
|
|
3
|
+
import { BackgroundExecutionListener } from '../../background/background-execution-listener.js';
|
|
4
|
+
import { BackgroundTransactionLogger } from './background-transaction-logger.js';
|
|
5
|
+
export interface BackgroundConfig {
|
|
6
|
+
transactionLogger?: BackgroundTransactionLogger;
|
|
7
|
+
errorProcessor?: BackgroundErrorProcessor;
|
|
8
|
+
httpStatusEndpoint?: string;
|
|
9
|
+
httpMetaEndpoint?: string;
|
|
10
|
+
httpSubmissionPath: string;
|
|
11
|
+
implyTypeFromPathSuffix: boolean;
|
|
12
|
+
processors: BackgroundProcessor<any>[];
|
|
13
|
+
executionListeners?: BackgroundExecutionListener<any>[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface AbstractCronEntry {
|
|
2
|
+
name?: string;
|
|
3
|
+
eventFilter?: RegExp;
|
|
4
|
+
minuteFilter?: number[];
|
|
5
|
+
hourFilter?: number[];
|
|
6
|
+
dayOfWeekFilter?: number[];
|
|
7
|
+
dayOfMonthFilter?: number[];
|
|
8
|
+
monthOfYearFilter?: number[];
|
|
9
|
+
contextMatchFilter?: RegExp;
|
|
10
|
+
contextNoMatchFilter?: RegExp;
|
|
11
|
+
overrideTimezone?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HttpConfig } from './http/http-config.js';
|
|
2
|
+
import { BackgroundConfig } from './background/background-config.js';
|
|
3
|
+
import { CronConfig } from './cron/cron-config.js';
|
|
4
|
+
import { DynamoDbConfig } from './dynamo-db-config.js';
|
|
5
|
+
import { S3Config } from './s3-config.js';
|
|
6
|
+
import { SnsConfig } from './sns-config.js';
|
|
7
|
+
import { EpsilonLoggerConfig } from './epsilon-logger-config.js';
|
|
8
|
+
import { InterApiConfig } from './inter-api/inter-api-config.js';
|
|
9
|
+
export interface EpsilonConfig {
|
|
10
|
+
label?: string;
|
|
11
|
+
disableLastResortTimeout?: boolean;
|
|
12
|
+
openApiYamlString: string;
|
|
13
|
+
httpConfig?: HttpConfig;
|
|
14
|
+
backgroundConfig?: BackgroundConfig;
|
|
15
|
+
interApiConfig?: InterApiConfig;
|
|
16
|
+
cron?: CronConfig;
|
|
17
|
+
dynamoDb?: DynamoDbConfig;
|
|
18
|
+
s3?: S3Config;
|
|
19
|
+
sns?: SnsConfig;
|
|
20
|
+
loggerConfig?: EpsilonLoggerConfig;
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context, ProxyResult } from 'aws-lambda';
|
|
2
|
+
export interface EpsilonLambdaEventHandler<T> {
|
|
3
|
+
handlesEvent(evt: any): boolean;
|
|
4
|
+
extractLabel(evt: T, context: Context): string;
|
|
5
|
+
processEvent(evt: T, context: Context): Promise<ProxyResult>;
|
|
6
|
+
processUncaughtError?(evt: T, context: Context, err: Error): Promise<ProxyResult>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LoggerLevelName } from '@bitblit/ratchet-common';
|
|
2
|
+
import { LogMessageFormatType } from '@bitblit/ratchet-common';
|
|
3
|
+
import { LoggingTraceIdGenerator } from './logging-trace-id-generator.js';
|
|
4
|
+
export interface EpsilonLoggerConfig {
|
|
5
|
+
envParamLogLevelName?: string;
|
|
6
|
+
queryParamLogLevelName?: string;
|
|
7
|
+
queryParamTracePrefixName?: string;
|
|
8
|
+
traceIdGenerator?: LoggingTraceIdGenerator;
|
|
9
|
+
logMessageFormatType?: LogMessageFormatType;
|
|
10
|
+
traceHeaderName?: string;
|
|
11
|
+
traceDepthHeaderName?: string;
|
|
12
|
+
epsilonStartEndMessageLogLevel?: LoggerLevelName;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RouteMapping } from '../../http/route/route-mapping.js';
|
|
2
|
+
import { EpsilonAuthorizationContext } from './epsilon-authorization-context.js';
|
|
3
|
+
import { ExtendedAPIGatewayEvent } from './extended-api-gateway-event.js';
|
|
4
|
+
export interface AuthorizerFunction {
|
|
5
|
+
(authData: EpsilonAuthorizationContext<any>, event?: ExtendedAPIGatewayEvent, route?: RouteMapping): Promise<boolean>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { APIGatewayEvent } from 'aws-lambda';
|
|
2
|
+
import { EpsilonAuthorizationContext } from './epsilon-authorization-context.js';
|
|
3
|
+
export interface ExtendedAPIGatewayEvent extends APIGatewayEvent {
|
|
4
|
+
parsedBody: any;
|
|
5
|
+
authorization: EpsilonAuthorizationContext<any>;
|
|
6
|
+
convertedFromV2Event: boolean;
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context, ProxyResult } from 'aws-lambda';
|
|
2
|
+
import { ExtendedAPIGatewayEvent } from './extended-api-gateway-event.js';
|
|
3
|
+
import { RouteAndParse } from '../../http/web-handler.js';
|
|
4
|
+
import { ModelValidator } from '@bitblit/ratchet-misc';
|
|
5
|
+
import { AuthorizerFunction } from './authorizer-function.js';
|
|
6
|
+
export interface FilterChainContext {
|
|
7
|
+
event: ExtendedAPIGatewayEvent;
|
|
8
|
+
context: Context;
|
|
9
|
+
rawResult: any;
|
|
10
|
+
result: ProxyResult;
|
|
11
|
+
routeAndParse: RouteAndParse;
|
|
12
|
+
modelValidator: ModelValidator;
|
|
13
|
+
authenticators: Map<string, AuthorizerFunction>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HandlerFunction } from './handler-function.js';
|
|
2
|
+
import { AuthorizerFunction } from './authorizer-function.js';
|
|
3
|
+
import { HttpProcessingConfig } from './http-processing-config.js';
|
|
4
|
+
import { ModelValidator } from '@bitblit/ratchet-misc';
|
|
5
|
+
import { MappedHttpProcessingConfig } from './mapped-http-processing-config.js';
|
|
6
|
+
export interface HttpConfig {
|
|
7
|
+
defaultMetaHandling: HttpProcessingConfig;
|
|
8
|
+
overrideMetaHandling?: MappedHttpProcessingConfig[];
|
|
9
|
+
handlers: Map<string, HandlerFunction<any>>;
|
|
10
|
+
authorizers?: Map<string, AuthorizerFunction>;
|
|
11
|
+
staticContentRoutes?: Record<string, string>;
|
|
12
|
+
prefixesToStripBeforeRouteMatch?: string[];
|
|
13
|
+
overrideModelValidator?: ModelValidator;
|
|
14
|
+
filterHandledRouteMatches?: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NullReturnedObjectHandling } from './null-returned-object-handling.js';
|
|
2
|
+
import { FilterFunction } from './filter-function.js';
|
|
3
|
+
export interface HttpProcessingConfig {
|
|
4
|
+
configName?: string;
|
|
5
|
+
timeoutMS: number;
|
|
6
|
+
overrideAuthorizerName?: string;
|
|
7
|
+
preFilters?: FilterFunction[];
|
|
8
|
+
postFilters?: FilterFunction[];
|
|
9
|
+
errorFilters?: FilterFunction[];
|
|
10
|
+
nullReturnedObjectHandling?: NullReturnedObjectHandling;
|
|
11
|
+
}
|