@jaypie/express 1.2.4-rc9 → 1.2.5

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.
@@ -3,8 +3,6 @@ export type { ApiGatewayV1Event, CreateLambdaHandlerOptions, FunctionUrlEvent, L
3
3
  export { EXPRESS } from "./constants.js";
4
4
  export { default as cors } from "./cors.helper.js";
5
5
  export type { CorsConfig } from "./cors.helper.js";
6
- export { default as createServer } from "./createServer.js";
7
- export type { CreateServerOptions, ServerResult } from "./createServer.js";
8
6
  export { default as expressHandler } from "./expressHandler.js";
9
7
  export type { ExpressHandlerLocals, ExpressHandlerOptions, JaypieHandlerSetup, JaypieHandlerTeardown, JaypieHandlerValidate, } from "./expressHandler.js";
10
8
  export { default as expressHttpCodeHandler } from "./http.handler.js";
@@ -8,6 +8,7 @@ interface LambdaRequestOptions {
8
8
  lambdaEvent: LambdaEvent;
9
9
  method: string;
10
10
  protocol: string;
11
+ query?: Record<string, string | string[]>;
11
12
  remoteAddress: string;
12
13
  url: string;
13
14
  }
@@ -1,6 +1,7 @@
1
1
  import type { OutgoingHttpHeaders } from "node:http";
2
2
  import { Writable } from "node:stream";
3
3
  import type { LambdaResponse } from "./types.js";
4
+ export declare const JAYPIE_LAMBDA_MOCK: unique symbol;
4
5
  /**
5
6
  * Mock ServerResponse that buffers the response.
6
7
  * Collects status, headers, and body chunks, then returns a Lambda response.
@@ -12,10 +13,15 @@ export declare class LambdaResponseBuffered extends Writable {
12
13
  remoteAddress: string;
13
14
  };
14
15
  _chunks: Buffer[];
16
+ _ended: boolean;
15
17
  _headers: Map<string, string | string[]>;
16
18
  _headersSent: boolean;
17
19
  _resolve: ((result: LambdaResponse) => void) | null;
18
20
  constructor();
21
+ _internalGetHeader(name: string): string | undefined;
22
+ _internalSetHeader(name: string, value: string): void;
23
+ _internalHasHeader(name: string): boolean;
24
+ _internalRemoveHeader(name: string): void;
19
25
  getResult(): Promise<LambdaResponse>;
20
26
  setHeader(name: string, value: number | string | string[]): this;
21
27
  getHeader(name: string): number | string | string[] | undefined;
@@ -26,6 +32,7 @@ export declare class LambdaResponseBuffered extends Writable {
26
32
  /**
27
33
  * Proxy for direct header access (e.g., res.headers['content-type']).
28
34
  * Required for compatibility with middleware like helmet that access headers directly.
35
+ * Uses direct _headers access to bypass dd-trace interception.
29
36
  */
30
37
  get headers(): Record<string, string | string[] | undefined>;
31
38
  writeHead(statusCode: number, statusMessageOrHeaders?: OutgoingHttpHeaders | string, headers?: OutgoingHttpHeaders): this;
@@ -48,6 +55,7 @@ export declare class LambdaResponseBuffered extends Writable {
48
55
  /**
49
56
  * Add a field to the Vary response header.
50
57
  * Used by CORS middleware to indicate response varies by Origin.
58
+ * Uses direct _headers access to bypass dd-trace interception.
51
59
  */
52
60
  vary(field: string): this;
53
61
  _write(chunk: Buffer | string, encoding: BufferEncoding, // eslint-disable-line no-undef
@@ -11,12 +11,16 @@ export declare class LambdaResponseStreaming extends Writable {
11
11
  readonly socket: {
12
12
  remoteAddress: string;
13
13
  };
14
- private _headers;
15
- private _headersSent;
14
+ _headers: Map<string, string | string[]>;
15
+ _headersSent: boolean;
16
16
  private _pendingWrites;
17
17
  private _responseStream;
18
18
  private _wrappedStream;
19
19
  constructor(responseStream: ResponseStream);
20
+ _internalGetHeader(name: string): string | undefined;
21
+ _internalSetHeader(name: string, value: string): void;
22
+ _internalHasHeader(name: string): boolean;
23
+ _internalRemoveHeader(name: string): void;
20
24
  setHeader(name: string, value: number | string | string[]): this;
21
25
  getHeader(name: string): number | string | string[] | undefined;
22
26
  removeHeader(name: string): void;
@@ -26,6 +30,7 @@ export declare class LambdaResponseStreaming extends Writable {
26
30
  /**
27
31
  * Proxy for direct header access (e.g., res.headers['content-type']).
28
32
  * Required for compatibility with middleware like helmet that access headers directly.
33
+ * Uses direct _headers access to bypass dd-trace interception.
29
34
  */
30
35
  get headers(): Record<string, string | string[] | undefined>;
31
36
  writeHead(statusCode: number, statusMessageOrHeaders?: OutgoingHttpHeaders | string, headers?: OutgoingHttpHeaders): this;
@@ -49,6 +54,7 @@ export declare class LambdaResponseStreaming extends Writable {
49
54
  /**
50
55
  * Add a field to the Vary response header.
51
56
  * Used by CORS middleware to indicate response varies by Origin.
57
+ * Uses direct _headers access to bypass dd-trace interception.
52
58
  */
53
59
  vary(field: string): this;
54
60
  _write(chunk: Buffer | string, encoding: BufferEncoding, // eslint-disable-line no-undef
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { Request, Response } from "express";
2
+ import type { StreamFormat } from "@jaypie/aws";
2
3
  export type JaypieStreamHandlerSetup = (req: Request, res: Response) => Promise<void> | void;
3
4
  export type JaypieStreamHandlerTeardown = (req: Request, res: Response) => Promise<void> | void;
4
5
  export type JaypieStreamHandlerValidate = (req: Request, res: Response) => Promise<boolean> | boolean;
@@ -6,6 +7,7 @@ export type ExpressStreamHandlerLocals = (req: Request, res: Response) => Promis
6
7
  export interface ExpressStreamHandlerOptions {
7
8
  chaos?: string;
8
9
  contentType?: string;
10
+ format?: StreamFormat;
9
11
  locals?: Record<string, unknown | ExpressStreamHandlerLocals>;
10
12
  name?: string;
11
13
  secrets?: string[];
@@ -1,10 +1,10 @@
1
1
  import type { Request } from "express";
2
2
  /**
3
3
  * Get the current invoke UUID from Lambda context.
4
- * Works with Jaypie Lambda adapter and Lambda Web Adapter mode.
4
+ * Works with Jaypie Lambda adapter (createLambdaHandler/createLambdaStreamHandler).
5
5
  *
6
6
  * @param req - Optional Express request object. Used to extract context
7
- * from Web Adapter headers or Jaypie adapter's _lambdaContext.
7
+ * from Jaypie adapter's _lambdaContext.
8
8
  * @returns The AWS request ID or undefined if not in Lambda context
9
9
  */
10
10
  declare function getCurrentInvokeUuid(req?: Request): string | undefined;
@@ -3,8 +3,6 @@ export type { ApiGatewayV1Event, CreateLambdaHandlerOptions, FunctionUrlEvent, L
3
3
  export { EXPRESS } from "./constants.js";
4
4
  export { default as cors } from "./cors.helper.js";
5
5
  export type { CorsConfig } from "./cors.helper.js";
6
- export { default as createServer } from "./createServer.js";
7
- export type { CreateServerOptions, ServerResult } from "./createServer.js";
8
6
  export { default as expressHandler } from "./expressHandler.js";
9
7
  export type { ExpressHandlerLocals, ExpressHandlerOptions, JaypieHandlerSetup, JaypieHandlerTeardown, JaypieHandlerValidate, } from "./expressHandler.js";
10
8
  export { default as expressHttpCodeHandler } from "./http.handler.js";