@bitblit/ratchet-epsilon-common 4.0.183-alpha → 4.0.185-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 (145) hide show
  1. package/lib/background/background-dynamo-log-table-handler.d.ts +11 -0
  2. package/lib/background/background-entry.d.ts +4 -0
  3. package/lib/background/background-execution-event-type.d.ts +7 -0
  4. package/lib/background/background-execution-event.d.ts +8 -0
  5. package/lib/background/background-execution-listener.d.ts +5 -0
  6. package/lib/background/background-handler.d.ts +29 -0
  7. package/lib/background/background-http-adapter-handler.d.ts +22 -0
  8. package/lib/background/background-meta-response-internal.d.ts +5 -0
  9. package/lib/background/background-process-handling.d.ts +4 -0
  10. package/lib/background/background-process-log-table-entry.d.ts +11 -0
  11. package/lib/background/background-queue-response-internal.d.ts +8 -0
  12. package/lib/background/background-validator.d.ts +17 -0
  13. package/lib/background/epsilon-background-process-error.d.ts +30 -0
  14. package/lib/background/internal-background-entry.d.ts +7 -0
  15. package/lib/background/manager/abstract-background-manager.d.ts +19 -0
  16. package/lib/background/manager/aws-sqs-sns-background-manager.d.ts +23 -0
  17. package/lib/background/manager/background-manager-like.d.ts +17 -0
  18. package/lib/background/manager/background-manager.spec.d.ts +1 -0
  19. package/lib/background/manager/single-thread-local-background-manager.d.ts +15 -0
  20. package/lib/background/s3-background-transaction-logger.d.ts +17 -0
  21. package/lib/build/ratchet-epsilon-common-info.d.ts +5 -0
  22. package/lib/built-in/background/echo-processor.d.ts +7 -0
  23. package/lib/built-in/background/log-and-enqueue-echo-processor.d.ts +6 -0
  24. package/lib/built-in/background/log-message-background-error-processor.d.ts +5 -0
  25. package/lib/built-in/background/no-op-processor.d.ts +6 -0
  26. package/lib/built-in/background/retry-processor.d.ts +16 -0
  27. package/lib/built-in/background/sample-delay-processor.d.ts +6 -0
  28. package/lib/built-in/background/sample-input-validated-processor-data.d.ts +4 -0
  29. package/lib/built-in/background/sample-input-validated-processor.d.ts +8 -0
  30. package/lib/built-in/built-in-trace-id-generators.d.ts +5 -0
  31. package/lib/built-in/daemon/daemon-authorizer-function.d.ts +5 -0
  32. package/lib/built-in/daemon/daemon-config.d.ts +8 -0
  33. package/lib/built-in/daemon/daemon-group-selection-function.d.ts +4 -0
  34. package/lib/built-in/daemon/daemon-handler.d.ts +16 -0
  35. package/lib/built-in/daemon/daemon-process-state-list.d.ts +5 -0
  36. package/lib/built-in/http/apollo/apollo-util.d.ts +10 -0
  37. package/lib/built-in/http/apollo/default-epsilon-apollo-context.d.ts +10 -0
  38. package/lib/built-in/http/apollo/epsilon-apollo-cors-method.d.ts +5 -0
  39. package/lib/built-in/http/apollo/epsilon-lambda-apollo-context-function-argument.d.ts +5 -0
  40. package/lib/built-in/http/apollo/epsilon-lambda-apollo-options.d.ts +8 -0
  41. package/lib/built-in/http/apollo-filter.d.ts +10 -0
  42. package/lib/built-in/http/built-in-auth-filters.d.ts +9 -0
  43. package/lib/built-in/http/built-in-authorizers.d.ts +8 -0
  44. package/lib/built-in/http/built-in-filters.d.ts +25 -0
  45. package/lib/built-in/http/built-in-handlers.d.ts +9 -0
  46. package/lib/built-in/http/log-level-manipulation-filter.d.ts +6 -0
  47. package/lib/built-in/http/run-handler-as-filter.d.ts +12 -0
  48. package/lib/built-in/http/run-handler-as-filter.spec.d.ts +1 -0
  49. package/lib/cli/ratchet-cli-handler.d.ts +6 -0
  50. package/lib/cli/run-background-process-from-command-line.d.ts +3 -0
  51. package/lib/config/background/background-aws-config.d.ts +7 -0
  52. package/lib/config/background/background-config.d.ts +14 -0
  53. package/lib/config/background/background-error-processor.d.ts +4 -0
  54. package/lib/config/background/background-processor.d.ts +6 -0
  55. package/lib/config/background/background-transaction-log.d.ts +8 -0
  56. package/lib/config/background/background-transaction-logger.d.ts +5 -0
  57. package/lib/config/cron/abstract-cron-entry.d.ts +12 -0
  58. package/lib/config/cron/cron-background-entry.d.ts +6 -0
  59. package/lib/config/cron/cron-config.d.ts +6 -0
  60. package/lib/config/dynamo-db-config.d.ts +5 -0
  61. package/lib/config/epsilon-config.d.ts +21 -0
  62. package/lib/config/epsilon-lambda-event-handler.d.ts +7 -0
  63. package/lib/config/epsilon-logger-config.d.ts +13 -0
  64. package/lib/config/generic-aws-event-handler-function.d.ts +3 -0
  65. package/lib/config/http/authorizer-function.d.ts +6 -0
  66. package/lib/config/http/epsilon-authorization-context.d.ts +5 -0
  67. package/lib/config/http/extended-api-gateway-event.d.ts +7 -0
  68. package/lib/config/http/filter-chain-context.d.ts +14 -0
  69. package/lib/config/http/filter-function.d.ts +4 -0
  70. package/lib/config/http/handler-function.d.ts +5 -0
  71. package/lib/config/http/http-config.d.ts +15 -0
  72. package/lib/config/http/http-processing-config.d.ts +11 -0
  73. package/lib/config/http/mapped-http-processing-config.d.ts +7 -0
  74. package/lib/config/http/null-returned-object-handling.d.ts +5 -0
  75. package/lib/config/inter-api/inter-api-aws-config.d.ts +5 -0
  76. package/lib/config/inter-api/inter-api-config.d.ts +6 -0
  77. package/lib/config/inter-api/inter-api-process-mapping.d.ts +6 -0
  78. package/lib/config/logging-trace-id-generator.d.ts +4 -0
  79. package/lib/config/open-api/open-api-document-components.d.ts +4 -0
  80. package/lib/config/open-api/open-api-document-path.d.ts +2 -0
  81. package/lib/config/open-api/open-api-document.d.ts +6 -0
  82. package/lib/config/s3-config.d.ts +6 -0
  83. package/lib/config/sns-config.d.ts +5 -0
  84. package/lib/epsilon-global-handler.d.ts +1 -1
  85. package/lib/http/auth/api-gateway-adapter-authentication-handler.d.ts +8 -0
  86. package/lib/http/auth/auth0-web-token-manipulator.d.ts +13 -0
  87. package/lib/http/auth/basic-auth-token.d.ts +4 -0
  88. package/lib/http/auth/google-web-token-manipulator.d.ts +14 -0
  89. package/lib/http/auth/google-web-token-manipulator.spec.d.ts +1 -0
  90. package/lib/http/auth/jwt-ratchet-local-web-token-manipulator.d.ts +11 -0
  91. package/lib/http/auth/local-web-token-manipulator.d.ts +19 -0
  92. package/lib/http/auth/local-web-token-manipulator.spec.d.ts +1 -0
  93. package/lib/http/auth/web-token-manipulator.d.ts +4 -0
  94. package/lib/http/error/bad-gateway.d.ts +5 -0
  95. package/lib/http/error/bad-request-error.d.ts +5 -0
  96. package/lib/http/error/conflict-error.d.ts +5 -0
  97. package/lib/http/error/forbidden-error.d.ts +5 -0
  98. package/lib/http/error/gateway-timeout.d.ts +5 -0
  99. package/lib/http/error/method-not-allowed-error.d.ts +5 -0
  100. package/lib/http/error/misconfigured-error.d.ts +5 -0
  101. package/lib/http/error/not-found-error.d.ts +5 -0
  102. package/lib/http/error/not-implemented.d.ts +5 -0
  103. package/lib/http/error/request-timeout-error.d.ts +5 -0
  104. package/lib/http/error/service-unavailable.d.ts +5 -0
  105. package/lib/http/error/too-many-requests-error.d.ts +5 -0
  106. package/lib/http/error/unauthorized-error.d.ts +5 -0
  107. package/lib/http/event-util.d.ts +27 -0
  108. package/lib/http/event-util.spec.d.ts +1 -0
  109. package/lib/http/response-util.d.ts +11 -0
  110. package/lib/http/response-util.spec.d.ts +1 -0
  111. package/lib/http/route/epsilon-router.d.ts +8 -0
  112. package/lib/http/route/extended-auth-response-context.d.ts +6 -0
  113. package/lib/http/route/route-mapping.d.ts +12 -0
  114. package/lib/http/route/route-validator-config.d.ts +5 -0
  115. package/lib/http/route/router-util.d.ts +23 -0
  116. package/lib/http/route/router-util.spec.d.ts +1 -0
  117. package/lib/http/web-handler.d.ts +23 -0
  118. package/lib/http/web-handler.spec.d.ts +1 -0
  119. package/lib/http/web-v2-handler.d.ts +10 -0
  120. package/lib/index.d.ts +0 -1
  121. package/lib/index.mjs +1 -1
  122. package/lib/index.mjs.map +1 -1
  123. package/lib/inter-api/inter-api-entry.d.ts +7 -0
  124. package/lib/inter-api/inter-api-util.d.ts +10 -0
  125. package/lib/inter-api/inter-api-util.spec.d.ts +1 -0
  126. package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.d.ts +14 -0
  127. package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.spec.d.ts +1 -0
  128. package/lib/lambda-event-handler/dynamo-epsilon-lambda-event-handler.d.ts +11 -0
  129. package/lib/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.d.ts +10 -0
  130. package/lib/lambda-event-handler/inter-api-epsilon-lambda-event-handler.d.ts +10 -0
  131. package/lib/lambda-event-handler/s3-epsilon-lambda-event-handler.d.ts +10 -0
  132. package/lib/open-api-util/open-api-doc-modifications.d.ts +8 -0
  133. package/lib/open-api-util/open-api-doc-modifier.d.ts +7 -0
  134. package/lib/open-api-util/open-api-doc-modifier.spec.d.ts +1 -0
  135. package/lib/open-api-util/yaml-combiner.d.ts +3 -0
  136. package/lib/open-api-util/yaml-combiner.spec.d.ts +1 -0
  137. package/lib/sample/sample-server-components.d.ts +10 -0
  138. package/lib/sample/sample-server-static-files.d.ts +5 -0
  139. package/lib/sample/test-error-server.d.ts +11 -0
  140. package/lib/util/aws-util.d.ts +8 -0
  141. package/lib/util/context-util.d.ts +34 -0
  142. package/lib/util/cron-util.d.ts +11 -0
  143. package/lib/util/cron-util.spec.d.ts +1 -0
  144. package/lib/util/epsilon-config-parser.d.ts +14 -0
  145. package/package.json +15 -34
@@ -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
+ }
@@ -0,0 +1,6 @@
1
+ import { GenericAwsEventHandlerFunction } from './generic-aws-event-handler-function.js';
2
+ import { S3Event } from 'aws-lambda';
3
+ export interface S3Config {
4
+ createHandlers: Map<string, GenericAwsEventHandlerFunction<S3Event>>;
5
+ removeHandlers: Map<string, GenericAwsEventHandlerFunction<S3Event>>;
6
+ }
@@ -0,0 +1,5 @@
1
+ import { GenericAwsEventHandlerFunction } from './generic-aws-event-handler-function.js';
2
+ import { SNSEvent } from 'aws-lambda';
3
+ export interface SnsConfig {
4
+ handlers: Map<string, GenericAwsEventHandlerFunction<SNSEvent>>;
5
+ }
@@ -1,7 +1,7 @@
1
1
  import { Context, ProxyResult } from 'aws-lambda';
2
+ import { LoggerOptions } from '@bitblit/ratchet-common';
2
3
  import { BackgroundEntry } from './background/background-entry.js';
3
4
  import { EpsilonInstance } from './epsilon-instance.js';
4
- import { LoggerOptions } from '@bitblit/ratchet-common';
5
5
  export declare class EpsilonGlobalHandler {
6
6
  private _epsilon;
7
7
  private static LOGGER_CONFIGURED;
@@ -0,0 +1,8 @@
1
+ import { Callback, Context, CustomAuthorizerEvent } from 'aws-lambda';
2
+ export declare class ApiGatewayAdapterAuthenticationHandler {
3
+ private webTokenManipulator;
4
+ constructor(issuer: string, encryptionKeys: string);
5
+ lambdaHandler(event: CustomAuthorizerEvent, context: Context, callback: Callback): void;
6
+ private createPolicy;
7
+ static extractTokenStringFromAuthorizerEvent(event: CustomAuthorizerEvent): string;
8
+ }
@@ -0,0 +1,13 @@
1
+ import { JwtTokenBase } from '@bitblit/ratchet-common';
2
+ import { WebTokenManipulator } from './web-token-manipulator.js';
3
+ export declare class Auth0WebTokenManipulator implements WebTokenManipulator<JwtTokenBase> {
4
+ private clientId;
5
+ private jwksUri;
6
+ private issuer;
7
+ private jwksClient;
8
+ constructor(clientId: string, jwksUri: string, issuer: string);
9
+ extractTokenFromAuthorizationHeader<T>(authHeader: string): Promise<JwtTokenBase>;
10
+ parseAndValidateAuth0Token<T>(auth0Token: string, allowExpired?: boolean): Promise<JwtTokenBase>;
11
+ private fetchSigningKey;
12
+ private fetchJwksClient;
13
+ }
@@ -0,0 +1,4 @@
1
+ export interface BasicAuthToken {
2
+ username: string;
3
+ password: string;
4
+ }
@@ -0,0 +1,14 @@
1
+ import { WebTokenManipulator } from './web-token-manipulator.js';
2
+ import { JwtTokenBase } from '@bitblit/ratchet-common';
3
+ export declare class GoogleWebTokenManipulator implements WebTokenManipulator<JwtTokenBase> {
4
+ private clientId;
5
+ private static readonly GOOGLE_DISCOVERY_DOCUMENT;
6
+ private cacheGoogleDiscoveryDocument;
7
+ private jwksClient;
8
+ constructor(clientId: string);
9
+ extractTokenFromAuthorizationHeader<T extends JwtTokenBase>(authHeader: string): Promise<JwtTokenBase>;
10
+ parseAndValidateGoogleToken<T extends JwtTokenBase>(googleToken: string, allowExpired?: boolean): Promise<JwtTokenBase>;
11
+ private fetchSigningKey;
12
+ private fetchJwksClient;
13
+ private fetchGoogleDiscoveryDocument;
14
+ }
@@ -0,0 +1,11 @@
1
+ import { WebTokenManipulator } from './web-token-manipulator.js';
2
+ import { JwtTokenBase } from '@bitblit/ratchet-common';
3
+ import { JwtRatchetLike } from '@bitblit/ratchet-common';
4
+ export declare class JwtRatchetLocalWebTokenManipulator<T extends JwtTokenBase> implements WebTokenManipulator<T> {
5
+ private _jwtRatchet;
6
+ private _issuer;
7
+ constructor(_jwtRatchet: JwtRatchetLike, _issuer: string);
8
+ get jwtRatchet(): JwtRatchetLike;
9
+ get issuer(): string;
10
+ extractTokenFromAuthorizationHeader<T>(header: string): Promise<T>;
11
+ }
@@ -0,0 +1,19 @@
1
+ import { WebTokenManipulator } from './web-token-manipulator.js';
2
+ import { LoggerLevelName } from '@bitblit/ratchet-common';
3
+ import { JwtTokenBase } from '@bitblit/ratchet-common';
4
+ import { JwtRatchet } from '@bitblit/ratchet-common';
5
+ export declare class LocalWebTokenManipulator<T extends JwtTokenBase> implements WebTokenManipulator<T> {
6
+ private encryptionKeys;
7
+ private issuer;
8
+ private _ratchet;
9
+ constructor(encryptionKeys: string[], issuer: string);
10
+ withExtraDecryptionKeys(keys: string[]): LocalWebTokenManipulator<T>;
11
+ withParseFailureLogLevel(logLevel: LoggerLevelName): LocalWebTokenManipulator<T>;
12
+ withOldKeyUseLogLevel(logLevel: LoggerLevelName): LocalWebTokenManipulator<T>;
13
+ get jwtRatchet(): JwtRatchet;
14
+ get selectRandomEncryptionKey(): Promise<string>;
15
+ createRefreshedJWTString(tokenString: string, expirationSeconds: number, allowExpired?: boolean): Promise<string>;
16
+ parseAndValidateJWTStringAsync<T extends JwtTokenBase>(tokenString: string): Promise<T>;
17
+ createJWTStringAsync<T>(principal: string, userObject: T, roles?: string[], expirationSeconds?: number, proxyUser?: T): Promise<string>;
18
+ extractTokenFromAuthorizationHeader<T extends JwtTokenBase>(header: string): Promise<T>;
19
+ }
@@ -0,0 +1,4 @@
1
+ import { JwtTokenBase } from '@bitblit/ratchet-common';
2
+ export interface WebTokenManipulator<T extends JwtTokenBase> {
3
+ extractTokenFromAuthorizationHeader(header: string): Promise<T>;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class BadGateway<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class BadRequestError<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class ConflictError<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class ForbiddenError<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class GatewayTimeout<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class MethodNotAllowedError<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class MisconfiguredError<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class NotFoundError<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class NotImplemented<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class RequestTimeoutError<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class ServiceUnavailable<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class TooManyRequestsError<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
2
+ export declare class UnauthorizedError<T = void> extends RestfulApiHttpError<T> {
3
+ static readonly HTTP_CODE: number;
4
+ constructor(...errors: string[]);
5
+ }
@@ -0,0 +1,27 @@
1
+ import { APIGatewayEvent, APIGatewayEventRequestContext, AuthResponseContext } from 'aws-lambda';
2
+ import { EpsilonLoggerConfig } from '../config/epsilon-logger-config.js';
3
+ import { LoggerLevelName } from '@bitblit/ratchet-common';
4
+ import { BasicAuthToken } from './auth/basic-auth-token.js';
5
+ export declare class EventUtil {
6
+ private constructor();
7
+ static extractStage(event: APIGatewayEvent): string;
8
+ static extractHostHeader(event: APIGatewayEvent): string;
9
+ static extractProtocol(event: APIGatewayEvent): string;
10
+ static extractApiGatewayStage(event: APIGatewayEvent): string;
11
+ static extractRequestContext(event: APIGatewayEvent): APIGatewayEventRequestContext;
12
+ static extractAuthorizer(event: APIGatewayEvent): AuthResponseContext;
13
+ static ipAddressChain(event: APIGatewayEvent): string[];
14
+ static ipAddress(event: APIGatewayEvent): string;
15
+ static extractFullPath(event: APIGatewayEvent, overrideProtocol?: string): string;
16
+ static extractFullPrefix(event: APIGatewayEvent, overrideProtocol?: string): string;
17
+ static jsonBodyToObject(event: APIGatewayEvent): any;
18
+ static calcLogLevelViaEventOrEnvParam(curLevel: LoggerLevelName, event: APIGatewayEvent, rConfig: EpsilonLoggerConfig): LoggerLevelName;
19
+ static fixStillEncodedQueryParams(event: APIGatewayEvent): void;
20
+ static applyTokenToEventForTesting(event: APIGatewayEvent, jwtToken: string): void;
21
+ static extractBasicAuthenticationToken(event: APIGatewayEvent, throwErrorOnMissingBad?: boolean): BasicAuthToken;
22
+ static eventIsAGraphQLIntrospection(event: APIGatewayEvent): boolean;
23
+ static extractAuthorizationHeaderCaseInsensitive(evt: APIGatewayEvent): string;
24
+ static extractBearerTokenFromEvent(evt: APIGatewayEvent): string;
25
+ static hostIsLocal(host: string): boolean;
26
+ static hostIsLocalOrNotRoutableIP4(host: string): boolean;
27
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { ProxyResult } from 'aws-lambda';
3
+ import { RestfulApiHttpError } from '@bitblit/ratchet-common';
4
+ export declare class ResponseUtil {
5
+ private constructor();
6
+ static errorResponse<T>(err: RestfulApiHttpError<T>): ProxyResult;
7
+ static redirect(target: string, code?: number, queryParams?: any): ProxyResult;
8
+ static coerceToProxyResult(input: any): ProxyResult;
9
+ static applyGzipIfPossible(encodingHeader: string, proxyResult: ProxyResult): Promise<ProxyResult>;
10
+ static gzip(input: Buffer): Promise<Buffer>;
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { RouteMapping } from './route-mapping.js';
2
+ import { ModelValidator } from '@bitblit/ratchet-misc';
3
+ import { HttpConfig } from '../../config/http/http-config.js';
4
+ export interface EpsilonRouter {
5
+ routes: RouteMapping[];
6
+ openApiModelValidator: ModelValidator;
7
+ config: HttpConfig;
8
+ }
@@ -0,0 +1,6 @@
1
+ import { AuthResponseContext } from 'aws-lambda';
2
+ export interface ExtendedAuthResponseContext extends AuthResponseContext {
3
+ userData: any;
4
+ userDataJSON: string;
5
+ srcData: string;
6
+ }
@@ -0,0 +1,12 @@
1
+ import { RouteValidatorConfig } from './route-validator-config.js';
2
+ import { HandlerFunction } from '../../config/http/handler-function.js';
3
+ import { HttpProcessingConfig } from '../../config/http/http-processing-config.js';
4
+ export interface RouteMapping {
5
+ method: string;
6
+ path: string;
7
+ function: HandlerFunction<any>;
8
+ metaProcessingConfig: HttpProcessingConfig;
9
+ validation: RouteValidatorConfig;
10
+ outboundValidation: RouteValidatorConfig;
11
+ authorizerName: string;
12
+ }
@@ -0,0 +1,5 @@
1
+ export interface RouteValidatorConfig {
2
+ modelName: string;
3
+ emptyAllowed: boolean;
4
+ extraPropertiesAllowed: boolean;
5
+ }
@@ -0,0 +1,23 @@
1
+ import { EpsilonRouter } from './epsilon-router.js';
2
+ import { JwtTokenBase } from '@bitblit/ratchet-common';
3
+ import { OpenApiDocument } from '../../config/open-api/open-api-document.js';
4
+ import { ModelValidator } from '@bitblit/ratchet-misc';
5
+ import { BackgroundHttpAdapterHandler } from '../../background/background-http-adapter-handler.js';
6
+ import { HttpConfig } from '../../config/http/http-config.js';
7
+ import { HttpProcessingConfig } from '../../config/http/http-processing-config.js';
8
+ import { WebTokenManipulator } from '../auth/web-token-manipulator.js';
9
+ import { FilterFunction } from '../../config/http/filter-function.js';
10
+ export declare class RouterUtil {
11
+ private constructor();
12
+ static defaultAuthenticationHeaderParsingEpsilonPreFilters(webTokenManipulator: WebTokenManipulator<JwtTokenBase>): FilterFunction[];
13
+ static defaultEpsilonPreFilters(): FilterFunction[];
14
+ static defaultEpsilonPostFilters(): FilterFunction[];
15
+ static defaultEpsilonErrorFilters(): FilterFunction[];
16
+ static defaultHttpMetaProcessingConfigWithAuthenticationHeaderParsing(webTokenManipulator: WebTokenManipulator<JwtTokenBase>): HttpProcessingConfig;
17
+ static defaultHttpMetaProcessingConfig(): HttpProcessingConfig;
18
+ static assignDefaultsOnHttpConfig(cfg: HttpConfig): HttpConfig;
19
+ static findApplicableMeta(httpConfig: HttpConfig, method: string, path: string): HttpProcessingConfig;
20
+ static openApiYamlToRouterConfig(httpConfig: HttpConfig, openApiDoc: OpenApiDocument, modelValidator: ModelValidator, backgroundHttpAdapterHandler: BackgroundHttpAdapterHandler): EpsilonRouter;
21
+ private static findAndValidateModelName;
22
+ static openApiPathToRouteParserPath(input: string): string;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { EpsilonRouter } from './route/epsilon-router.js';
2
+ import { APIGatewayEvent, Context, ProxyResult } from 'aws-lambda';
3
+ import Route from 'route-parser';
4
+ import { RouteMapping } from './route/route-mapping.js';
5
+ import { ExtendedAPIGatewayEvent } from '../config/http/extended-api-gateway-event.js';
6
+ import { EpsilonLambdaEventHandler } from '../config/epsilon-lambda-event-handler.js';
7
+ export declare class WebHandler implements EpsilonLambdaEventHandler<APIGatewayEvent> {
8
+ private routerConfig;
9
+ static readonly MAXIMUM_LAMBDA_BODY_SIZE_BYTES: number;
10
+ constructor(routerConfig: EpsilonRouter);
11
+ get router(): EpsilonRouter;
12
+ extractLabel(evt: APIGatewayEvent, context: Context): string;
13
+ handlesEvent(evt: any): boolean;
14
+ processEvent(event: APIGatewayEvent, context: Context): Promise<ProxyResult>;
15
+ openApiLambdaHandler(evt: ExtendedAPIGatewayEvent, context: Context): Promise<ProxyResult>;
16
+ findBestMatchingRoute(event: APIGatewayEvent): RouteAndParse;
17
+ private cleanPath;
18
+ }
19
+ export interface RouteAndParse {
20
+ mapping: RouteMapping;
21
+ route: Route;
22
+ parsed: any;
23
+ }
@@ -0,0 +1 @@
1
+ export {};