@jaypie/express 1.2.29 → 1.2.31

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,4 +1,5 @@
1
1
  import type { Request, Response } from "express";
2
+ import type { ScrubOption } from "@jaypie/kit";
2
3
  export type JaypieHandlerSetup = (req: Request, res: Response) => Promise<void> | void;
3
4
  export type JaypieHandlerTeardown = (req: Request, res: Response) => Promise<void> | void;
4
5
  export type JaypieHandlerValidate = (req: Request, res: Response) => Promise<boolean | void> | boolean | void;
@@ -14,6 +15,7 @@ export interface ExpressHandlerOptions {
14
15
  fabric?: boolean;
15
16
  locals?: Record<string, unknown | ExpressHandlerLocals>;
16
17
  name?: string;
18
+ scrub?: ScrubOption;
17
19
  secrets?: string[];
18
20
  setup?: JaypieHandlerSetup[] | JaypieHandlerSetup;
19
21
  teardown?: JaypieHandlerTeardown[] | JaypieHandlerTeardown;
@@ -1,5 +1,6 @@
1
1
  import type { Request, Response } from "express";
2
2
  import type { StreamFormat } from "@jaypie/aws";
3
+ import type { ScrubOption } from "@jaypie/kit";
3
4
  export type JaypieStreamHandlerSetup = (req: Request, res: Response) => Promise<void> | void;
4
5
  export type JaypieStreamHandlerTeardown = (req: Request, res: Response) => Promise<void> | void;
5
6
  export type JaypieStreamHandlerValidate = (req: Request, res: Response) => Promise<boolean | void> | boolean | void;
@@ -10,6 +11,7 @@ export interface ExpressStreamHandlerOptions {
10
11
  format?: StreamFormat;
11
12
  locals?: Record<string, unknown | ExpressStreamHandlerLocals>;
12
13
  name?: string;
14
+ scrub?: ScrubOption;
13
15
  secrets?: string[];
14
16
  setup?: JaypieStreamHandlerSetup[] | JaypieStreamHandlerSetup;
15
17
  teardown?: JaypieStreamHandlerTeardown[] | JaypieStreamHandlerTeardown;
@@ -1774,7 +1774,7 @@ function expressHandler(handlerOrOptions, optionsOrHandler) {
1774
1774
  //
1775
1775
  // Validate
1776
1776
  //
1777
- let { chaos, fabric, locals, name, secrets, setup = [], teardown = [], unavailable, validate, } = options;
1777
+ let { chaos, fabric, locals, name, scrub, secrets, setup = [], teardown = [], unavailable, validate, } = options;
1778
1778
  if (typeof handler !== "function") {
1779
1779
  throw new errors.BadRequestError(`Argument "${handler}" doesn't match type "function"`);
1780
1780
  }
@@ -1929,6 +1929,7 @@ function expressHandler(handlerOrOptions, optionsOrHandler) {
1929
1929
  jaypieFunction = kit.jaypieHandler(handler, {
1930
1930
  chaos,
1931
1931
  name,
1932
+ scrub,
1932
1933
  setup: requestSetup,
1933
1934
  teardown,
1934
1935
  unavailable,
@@ -2191,7 +2192,7 @@ function expressStreamHandler(handlerOrOptions, optionsOrHandler) {
2191
2192
  // Validate
2192
2193
  //
2193
2194
  const format = options.format ?? "sse";
2194
- let { chaos, contentType = aws.getContentTypeForFormat(format), locals, name, secrets, setup = [], teardown = [], unavailable, validate, } = options;
2195
+ let { chaos, contentType = aws.getContentTypeForFormat(format), locals, name, scrub, secrets, setup = [], teardown = [], unavailable, validate, } = options;
2195
2196
  if (typeof handler !== "function") {
2196
2197
  throw new errors.BadRequestError(`Argument "${handler}" doesn't match type "function"`);
2197
2198
  }
@@ -2312,6 +2313,7 @@ function expressStreamHandler(handlerOrOptions, optionsOrHandler) {
2312
2313
  jaypieFunction = kit.jaypieHandler(handler, {
2313
2314
  chaos,
2314
2315
  name,
2316
+ scrub,
2315
2317
  setup: requestSetup,
2316
2318
  teardown,
2317
2319
  unavailable,