@bitblit/ratchet-epsilon-common 4.0.135-alpha → 4.0.137-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.
@@ -1,8 +1,10 @@
1
1
  import { BaseContext } from '@apollo/server';
2
2
  import { EpsilonLambdaApolloContextFunctionArgument } from './epsilon-lambda-apollo-context-function-argument.js';
3
+ import { JwtRatchetLike } from '@bitblit/ratchet-common';
3
4
  import { DefaultEpsilonApolloContext } from './default-epsilon-apollo-context.js';
4
5
  export declare class ApolloUtil {
5
6
  private constructor();
6
7
  static emptyContext<T extends BaseContext>(): Promise<T>;
7
- static defaultEpsilonApolloContext(args: EpsilonLambdaApolloContextFunctionArgument): Promise<DefaultEpsilonApolloContext<any>>;
8
+ static defaultEpsilonApolloContext(args: EpsilonLambdaApolloContextFunctionArgument, jwt?: JwtRatchetLike): Promise<DefaultEpsilonApolloContext<any>>;
9
+ static nonRouteableOnlyEpsilonApolloContext(args: EpsilonLambdaApolloContextFunctionArgument, jwt?: JwtRatchetLike): Promise<DefaultEpsilonApolloContext<any>>;
8
10
  }
@@ -1,8 +1,8 @@
1
1
  import { APIGatewayEvent, Context } from 'aws-lambda';
2
2
  import { JwtTokenBase } from '@bitblit/ratchet-common';
3
3
  export interface DefaultEpsilonApolloContext<T extends JwtTokenBase> {
4
- user: T;
5
- bearerTokenString: string;
4
+ user?: T;
5
+ bearerTokenString?: string;
6
6
  headers: Record<string, string>;
7
7
  functionName: string;
8
8
  lambdaEvent: APIGatewayEvent;
@@ -0,0 +1,5 @@
1
+ export declare enum EpsilonApolloCorsMethod {
2
+ None = "None",
3
+ All = "All",
4
+ Reflective = "Reflective"
5
+ }
@@ -1,6 +1,8 @@
1
1
  import { BaseContext, ContextFunction } from '@apollo/server';
2
2
  import { EpsilonLambdaApolloContextFunctionArgument } from './epsilon-lambda-apollo-context-function-argument.js';
3
+ import { EpsilonApolloCorsMethod } from './epsilon-apollo-cors-method.js';
3
4
  export interface EpsilonLambdaApolloOptions<TContext extends BaseContext> {
4
5
  context?: ContextFunction<[EpsilonLambdaApolloContextFunctionArgument], TContext>;
5
6
  timeoutMS?: number;
7
+ corsMethod?: EpsilonApolloCorsMethod;
6
8
  }
@@ -22,4 +22,6 @@ export declare class EventUtil {
22
22
  static eventIsAGraphQLIntrospection(event: APIGatewayEvent): boolean;
23
23
  static extractAuthorizationHeaderCaseInsensitive(evt: APIGatewayEvent): string;
24
24
  static extractBearerTokenFromEvent(evt: APIGatewayEvent): string;
25
+ static hostIsLocal(host: string): boolean;
26
+ static hostIsLocalOrNotRoutableIP4(host: string): boolean;
25
27
  }
package/lib/index.d.ts CHANGED
@@ -50,6 +50,7 @@ export * from './built-in/http/log-level-manipulation-filter.js';
50
50
  export * from './built-in/http/run-handler-as-filter.js';
51
51
  export * from './built-in/http/apollo/apollo-util.js';
52
52
  export * from './built-in/http/apollo/default-epsilon-apollo-context.js';
53
+ export * from './built-in/http/apollo/epsilon-apollo-cors-method.js';
53
54
  export * from './built-in/http/apollo/epsilon-lambda-apollo-context-function-argument.js';
54
55
  export * from './built-in/http/apollo/epsilon-lambda-apollo-options.js';
55
56
  export * from './cli/ratchet-cli-handler.js';