@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.
Files changed (154) hide show
  1. package/CHANGELOG.md +177 -0
  2. package/License.txt +13 -0
  3. package/README.md +242 -0
  4. package/bin/cli.js +10 -0
  5. package/lib/background/background-dynamo-log-table-handler.d.ts +11 -0
  6. package/lib/background/background-entry.d.ts +4 -0
  7. package/lib/background/background-execution-event-type.d.ts +7 -0
  8. package/lib/background/background-execution-event.d.ts +8 -0
  9. package/lib/background/background-execution-listener.d.ts +5 -0
  10. package/lib/background/background-handler.d.ts +29 -0
  11. package/lib/background/background-http-adapter-handler.d.ts +22 -0
  12. package/lib/background/background-meta-response-internal.d.ts +5 -0
  13. package/lib/background/background-process-handling.d.ts +4 -0
  14. package/lib/background/background-process-log-table-entry.d.ts +11 -0
  15. package/lib/background/background-queue-response-internal.d.ts +8 -0
  16. package/lib/background/background-validator.d.ts +17 -0
  17. package/lib/background/epsilon-background-process-error.d.ts +30 -0
  18. package/lib/background/internal-background-entry.d.ts +7 -0
  19. package/lib/background/manager/abstract-background-manager.d.ts +19 -0
  20. package/lib/background/manager/aws-sqs-sns-background-manager.d.ts +23 -0
  21. package/lib/background/manager/background-manager-like.d.ts +17 -0
  22. package/lib/background/manager/background-manager.spec.d.ts +1 -0
  23. package/lib/background/manager/single-thread-local-background-manager.d.ts +15 -0
  24. package/lib/background/s3-background-transaction-logger.d.ts +17 -0
  25. package/lib/build/ratchet-epsilon-common-info.d.ts +5 -0
  26. package/lib/built-in/background/echo-processor.d.ts +7 -0
  27. package/lib/built-in/background/log-and-enqueue-echo-processor.d.ts +6 -0
  28. package/lib/built-in/background/log-message-background-error-processor.d.ts +5 -0
  29. package/lib/built-in/background/no-op-processor.d.ts +6 -0
  30. package/lib/built-in/background/retry-processor.d.ts +16 -0
  31. package/lib/built-in/background/sample-delay-processor.d.ts +6 -0
  32. package/lib/built-in/background/sample-input-validated-processor-data.d.ts +4 -0
  33. package/lib/built-in/background/sample-input-validated-processor.d.ts +8 -0
  34. package/lib/built-in/built-in-trace-id-generators.d.ts +5 -0
  35. package/lib/built-in/daemon/daemon-authorizer-function.d.ts +5 -0
  36. package/lib/built-in/daemon/daemon-config.d.ts +8 -0
  37. package/lib/built-in/daemon/daemon-group-selection-function.d.ts +4 -0
  38. package/lib/built-in/daemon/daemon-handler.d.ts +16 -0
  39. package/lib/built-in/daemon/daemon-process-state-list.d.ts +5 -0
  40. package/lib/built-in/http/apollo-filter.d.ts +10 -0
  41. package/lib/built-in/http/built-in-auth-filters.d.ts +9 -0
  42. package/lib/built-in/http/built-in-authorizers.d.ts +8 -0
  43. package/lib/built-in/http/built-in-filters.d.ts +25 -0
  44. package/lib/built-in/http/built-in-handlers.d.ts +9 -0
  45. package/lib/built-in/http/log-level-manipulation-filter.d.ts +6 -0
  46. package/lib/built-in/http/run-handler-as-filter.d.ts +12 -0
  47. package/lib/built-in/http/run-handler-as-filter.spec.d.ts +1 -0
  48. package/lib/cli/ratchet-cli-handler.d.ts +6 -0
  49. package/lib/cli/run-background-process-from-command-line.d.ts +3 -0
  50. package/lib/config/background/background-aws-config.d.ts +7 -0
  51. package/lib/config/background/background-config.d.ts +14 -0
  52. package/lib/config/background/background-error-processor.d.ts +4 -0
  53. package/lib/config/background/background-processor.d.ts +6 -0
  54. package/lib/config/background/background-transaction-log.d.ts +8 -0
  55. package/lib/config/background/background-transaction-logger.d.ts +5 -0
  56. package/lib/config/cron/abstract-cron-entry.d.ts +12 -0
  57. package/lib/config/cron/cron-background-entry.d.ts +6 -0
  58. package/lib/config/cron/cron-config.d.ts +6 -0
  59. package/lib/config/dynamo-db-config.d.ts +5 -0
  60. package/lib/config/epsilon-config.d.ts +21 -0
  61. package/lib/config/epsilon-lambda-event-handler.d.ts +7 -0
  62. package/lib/config/epsilon-logger-config.d.ts +13 -0
  63. package/lib/config/generic-aws-event-handler-function.d.ts +3 -0
  64. package/lib/config/http/authorizer-function.d.ts +6 -0
  65. package/lib/config/http/epsilon-authorization-context.d.ts +5 -0
  66. package/lib/config/http/extended-api-gateway-event.d.ts +7 -0
  67. package/lib/config/http/filter-chain-context.d.ts +14 -0
  68. package/lib/config/http/filter-function.d.ts +4 -0
  69. package/lib/config/http/handler-function.d.ts +5 -0
  70. package/lib/config/http/http-config.d.ts +15 -0
  71. package/lib/config/http/http-processing-config.d.ts +11 -0
  72. package/lib/config/http/mapped-http-processing-config.d.ts +7 -0
  73. package/lib/config/http/null-returned-object-handling.d.ts +5 -0
  74. package/lib/config/inter-api/inter-api-aws-config.d.ts +5 -0
  75. package/lib/config/inter-api/inter-api-config.d.ts +6 -0
  76. package/lib/config/inter-api/inter-api-process-mapping.d.ts +6 -0
  77. package/lib/config/logging-trace-id-generator.d.ts +4 -0
  78. package/lib/config/open-api/open-api-document-components.d.ts +4 -0
  79. package/lib/config/open-api/open-api-document-path.d.ts +2 -0
  80. package/lib/config/open-api/open-api-document.d.ts +6 -0
  81. package/lib/config/s3-config.d.ts +6 -0
  82. package/lib/config/sns-config.d.ts +5 -0
  83. package/lib/epsilon-build-properties.d.ts +9 -0
  84. package/lib/epsilon-constants.d.ts +16 -0
  85. package/lib/epsilon-global-handler.d.ts +20 -0
  86. package/lib/epsilon-instance.d.ts +14 -0
  87. package/lib/epsilon-logging-extension-processor.d.ts +6 -0
  88. package/lib/http/auth/api-gateway-adapter-authentication-handler.d.ts +8 -0
  89. package/lib/http/auth/auth0-web-token-manipulator.d.ts +13 -0
  90. package/lib/http/auth/basic-auth-token.d.ts +4 -0
  91. package/lib/http/auth/google-web-token-manipulator.d.ts +14 -0
  92. package/lib/http/auth/google-web-token-manipulator.spec.d.ts +1 -0
  93. package/lib/http/auth/jwt-ratchet-local-web-token-manipulator.d.ts +11 -0
  94. package/lib/http/auth/local-web-token-manipulator.d.ts +19 -0
  95. package/lib/http/auth/local-web-token-manipulator.spec.d.ts +1 -0
  96. package/lib/http/auth/web-token-manipulator.d.ts +4 -0
  97. package/lib/http/error/bad-gateway.d.ts +5 -0
  98. package/lib/http/error/bad-request-error.d.ts +5 -0
  99. package/lib/http/error/conflict-error.d.ts +5 -0
  100. package/lib/http/error/epsilon-http-error.d.ts +41 -0
  101. package/lib/http/error/epsilon-http-error.spec.d.ts +1 -0
  102. package/lib/http/error/forbidden-error.d.ts +5 -0
  103. package/lib/http/error/gateway-timeout.d.ts +5 -0
  104. package/lib/http/error/method-not-allowed-error.d.ts +5 -0
  105. package/lib/http/error/misconfigured-error.d.ts +5 -0
  106. package/lib/http/error/not-found-error.d.ts +5 -0
  107. package/lib/http/error/not-implemented.d.ts +5 -0
  108. package/lib/http/error/request-timeout-error.d.ts +5 -0
  109. package/lib/http/error/service-unavailable.d.ts +5 -0
  110. package/lib/http/error/too-many-requests-error.d.ts +5 -0
  111. package/lib/http/error/unauthorized-error.d.ts +5 -0
  112. package/lib/http/event-util.d.ts +25 -0
  113. package/lib/http/event-util.spec.d.ts +1 -0
  114. package/lib/http/response-util.d.ts +11 -0
  115. package/lib/http/response-util.spec.d.ts +1 -0
  116. package/lib/http/route/epsilon-router.d.ts +8 -0
  117. package/lib/http/route/extended-auth-response-context.d.ts +6 -0
  118. package/lib/http/route/route-mapping.d.ts +12 -0
  119. package/lib/http/route/route-validator-config.d.ts +5 -0
  120. package/lib/http/route/router-util.d.ts +23 -0
  121. package/lib/http/route/router-util.spec.d.ts +1 -0
  122. package/lib/http/web-handler.d.ts +23 -0
  123. package/lib/http/web-handler.spec.d.ts +1 -0
  124. package/lib/http/web-v2-handler.d.ts +10 -0
  125. package/lib/index.d.ts +132 -0
  126. package/lib/index.mjs +344 -0
  127. package/lib/index.mjs.map +1 -0
  128. package/lib/inter-api/inter-api-entry.d.ts +7 -0
  129. package/lib/inter-api/inter-api-util.d.ts +10 -0
  130. package/lib/inter-api/inter-api-util.spec.d.ts +1 -0
  131. package/lib/inter-api-manager.d.ts +14 -0
  132. package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.d.ts +14 -0
  133. package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.spec.d.ts +1 -0
  134. package/lib/lambda-event-handler/dynamo-epsilon-lambda-event-handler.d.ts +11 -0
  135. package/lib/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.d.ts +10 -0
  136. package/lib/lambda-event-handler/inter-api-epsilon-lambda-event-handler.d.ts +10 -0
  137. package/lib/lambda-event-handler/s3-epsilon-lambda-event-handler.d.ts +10 -0
  138. package/lib/local-container-server.d.ts +11 -0
  139. package/lib/local-server-cert.d.ts +5 -0
  140. package/lib/local-server.d.ts +18 -0
  141. package/lib/open-api-util/open-api-doc-modifications.d.ts +8 -0
  142. package/lib/open-api-util/open-api-doc-modifier.d.ts +7 -0
  143. package/lib/open-api-util/open-api-doc-modifier.spec.d.ts +1 -0
  144. package/lib/open-api-util/yaml-combiner.d.ts +3 -0
  145. package/lib/open-api-util/yaml-combiner.spec.d.ts +1 -0
  146. package/lib/sample/sample-server-components.d.ts +10 -0
  147. package/lib/sample/sample-server-static-files.d.ts +5 -0
  148. package/lib/sample/test-error-server.d.ts +11 -0
  149. package/lib/util/aws-util.d.ts +8 -0
  150. package/lib/util/context-util.d.ts +33 -0
  151. package/lib/util/cron-util.d.ts +11 -0
  152. package/lib/util/cron-util.spec.d.ts +1 -0
  153. package/lib/util/epsilon-config-parser.d.ts +14 -0
  154. 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,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,5 @@
1
+ import { BuildInformation } from '@bitblit/ratchet-common';
2
+ export declare class RatchetEpsilonCommonInfo {
3
+ private constructor();
4
+ static buildInformation(): BuildInformation;
5
+ }
@@ -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,4 @@
1
+ export interface SampleInputValidatedProcessorData {
2
+ nameParam: string;
3
+ numberParam: number;
4
+ }
@@ -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
+ export declare class BuiltInTraceIdGenerators {
2
+ static fullAwsRequestId(): string;
3
+ static shortAwsRequestId(): string;
4
+ static fixedLengthHex(length?: number): string;
5
+ }
@@ -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,4 @@
1
+ import { ExtendedAPIGatewayEvent } from '../../config/http/extended-api-gateway-event.js';
2
+ export interface DaemonGroupSelectionFunction {
3
+ (evt: ExtendedAPIGatewayEvent): Promise<string>;
4
+ }
@@ -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,5 @@
1
+ import { DaemonProcessState } from '@bitblit/ratchet-aws';
2
+ export interface DaemonProcessStateList {
3
+ results: DaemonProcessState[];
4
+ nextToken: string;
5
+ }
@@ -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,3 @@
1
+ export declare class RunBackgroundProcessFromCommandLine {
2
+ static runFromCliArgs(args: string[]): Promise<void>;
3
+ }
@@ -0,0 +1,7 @@
1
+ export interface BackgroundAwsConfig {
2
+ queueUrl: string;
3
+ notificationArn: string;
4
+ sendNotificationOnBackgroundError?: boolean;
5
+ sendNotificationOnBackgroundValidationFailure?: boolean;
6
+ backgroundProcessFailureSnsArn?: string;
7
+ }
@@ -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,4 @@
1
+ import { InternalBackgroundEntry } from '../../background/internal-background-entry.js';
2
+ export interface BackgroundErrorProcessor {
3
+ handleError(submission: InternalBackgroundEntry<any>, error: Error): Promise<void>;
4
+ }
@@ -0,0 +1,6 @@
1
+ import { BackgroundManagerLike } from '../../background/manager/background-manager-like.js';
2
+ export interface BackgroundProcessor<T> {
3
+ typeName: string;
4
+ dataSchemaName?: string;
5
+ handleEvent(data: T, mgr: BackgroundManagerLike): Promise<any>;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { InternalBackgroundEntry } from '../../background/internal-background-entry.js';
2
+ export interface BackgroundTransactionLog {
3
+ request: InternalBackgroundEntry<any>;
4
+ running: boolean;
5
+ runtimeMS?: number;
6
+ result?: any;
7
+ error?: any;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { BackgroundTransactionLog } from './background-transaction-log.js';
2
+ export interface BackgroundTransactionLogger {
3
+ logTransaction(txLog: BackgroundTransactionLog): Promise<void>;
4
+ readTransactionLog(txGuid: string): Promise<BackgroundTransactionLog>;
5
+ }
@@ -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,6 @@
1
+ import { AbstractCronEntry } from './abstract-cron-entry.js';
2
+ export interface CronBackgroundEntry extends AbstractCronEntry {
3
+ backgroundTaskType: string;
4
+ fireImmediate: boolean;
5
+ data?: any;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { CronBackgroundEntry } from './cron-background-entry.js';
2
+ export interface CronConfig {
3
+ timezone: string;
4
+ context: string;
5
+ entries: CronBackgroundEntry[];
6
+ }
@@ -0,0 +1,5 @@
1
+ import { GenericAwsEventHandlerFunction } from './generic-aws-event-handler-function.js';
2
+ import { DynamoDBStreamEvent } from 'aws-lambda';
3
+ export interface DynamoDbConfig {
4
+ handlers: Map<string, GenericAwsEventHandlerFunction<DynamoDBStreamEvent>>;
5
+ }
@@ -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,3 @@
1
+ export interface GenericAwsEventHandlerFunction<T> {
2
+ (event: T): Promise<void>;
3
+ }
@@ -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,5 @@
1
+ export interface EpsilonAuthorizationContext<T> {
2
+ raw: string;
3
+ auth: T;
4
+ error: string;
5
+ }
@@ -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,4 @@
1
+ import { FilterChainContext } from './filter-chain-context.js';
2
+ export interface FilterFunction {
3
+ (fCtx: FilterChainContext): Promise<boolean>;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { Context } from 'aws-lambda';
2
+ import { ExtendedAPIGatewayEvent } from './extended-api-gateway-event.js';
3
+ export interface HandlerFunction<T> {
4
+ (event: ExtendedAPIGatewayEvent, context?: Context): Promise<T>;
5
+ }
@@ -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
+ }
@@ -0,0 +1,7 @@
1
+ import { HttpProcessingConfig } from './http-processing-config.js';
2
+ export interface MappedHttpProcessingConfig {
3
+ methods?: string[];
4
+ pathRegex: string;
5
+ invertPathMatching?: boolean;
6
+ config: HttpProcessingConfig;
7
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum NullReturnedObjectHandling {
2
+ Error = "Error",
3
+ ConvertToEmptyString = "ConvertToEmptyString",
4
+ Return404NotFoundResponse = "Return404NotFoundResponse"
5
+ }
@@ -0,0 +1,5 @@
1
+ export interface InterApiAwsConfig {
2
+ localMode: boolean;
3
+ source: string;
4
+ snsArn: string;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { InterApiAwsConfig } from './inter-api-aws-config.js';
2
+ import { InterApiProcessMapping } from './inter-api-process-mapping.js';
3
+ export interface InterApiConfig {
4
+ aws: InterApiAwsConfig;
5
+ processMappings: InterApiProcessMapping[];
6
+ }
@@ -0,0 +1,6 @@
1
+ export interface InterApiProcessMapping {
2
+ sourceRegex: string;
3
+ typeRegex: string;
4
+ disabled: boolean;
5
+ backgroundProcessTypes: string[];
6
+ }
@@ -0,0 +1,4 @@
1
+ import { Context } from 'aws-lambda';
2
+ export interface LoggingTraceIdGenerator {
3
+ (event?: any, context?: Context): string;
4
+ }
@@ -0,0 +1,4 @@
1
+ export interface OpenApiDocumentComponents {
2
+ securitySchemes: any[];
3
+ schemas: any[];
4
+ }
@@ -0,0 +1,2 @@
1
+ export interface OpenApiDocumentPath {
2
+ }
@@ -0,0 +1,6 @@
1
+ import { OpenApiDocumentComponents } from './open-api-document-components.js';
2
+ import { OpenApiDocumentPath } from './open-api-document-path.js';
3
+ export interface OpenApiDocument {
4
+ components: OpenApiDocumentComponents;
5
+ paths: OpenApiDocumentPath[];
6
+ }