@jaypie/express 1.2.30 → 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.
- package/dist/cjs/expressHandler.d.ts +2 -0
- package/dist/cjs/expressStreamHandler.d.ts +2 -0
- package/dist/cjs/index.cjs +4 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +3 -0
- package/dist/esm/expressHandler.d.ts +2 -0
- package/dist/esm/expressStreamHandler.d.ts +2 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +4 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as express from 'express';
|
|
2
2
|
import { Application, Request, Response, NextFunction } from 'express';
|
|
3
|
+
import { ScrubOption } from '@jaypie/kit';
|
|
3
4
|
import { StreamFormat } from '@jaypie/aws';
|
|
4
5
|
import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'node:http';
|
|
5
6
|
import { Readable, Writable } from 'node:stream';
|
|
@@ -366,6 +367,7 @@ interface ExpressHandlerOptions {
|
|
|
366
367
|
fabric?: boolean;
|
|
367
368
|
locals?: Record<string, unknown | ExpressHandlerLocals>;
|
|
368
369
|
name?: string;
|
|
370
|
+
scrub?: ScrubOption;
|
|
369
371
|
secrets?: string[];
|
|
370
372
|
setup?: JaypieHandlerSetup[] | JaypieHandlerSetup;
|
|
371
373
|
teardown?: JaypieHandlerTeardown[] | JaypieHandlerTeardown;
|
|
@@ -388,6 +390,7 @@ interface ExpressStreamHandlerOptions {
|
|
|
388
390
|
format?: StreamFormat;
|
|
389
391
|
locals?: Record<string, unknown | ExpressStreamHandlerLocals>;
|
|
390
392
|
name?: string;
|
|
393
|
+
scrub?: ScrubOption;
|
|
391
394
|
secrets?: string[];
|
|
392
395
|
setup?: JaypieStreamHandlerSetup[] | JaypieStreamHandlerSetup;
|
|
393
396
|
teardown?: JaypieStreamHandlerTeardown[] | JaypieStreamHandlerTeardown;
|
|
@@ -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;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as express from 'express';
|
|
2
2
|
import { Application, Request, Response, NextFunction } from 'express';
|
|
3
|
+
import { ScrubOption } from '@jaypie/kit';
|
|
3
4
|
import { StreamFormat } from '@jaypie/aws';
|
|
4
5
|
import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'node:http';
|
|
5
6
|
import { Readable, Writable } from 'node:stream';
|
|
@@ -366,6 +367,7 @@ interface ExpressHandlerOptions {
|
|
|
366
367
|
fabric?: boolean;
|
|
367
368
|
locals?: Record<string, unknown | ExpressHandlerLocals>;
|
|
368
369
|
name?: string;
|
|
370
|
+
scrub?: ScrubOption;
|
|
369
371
|
secrets?: string[];
|
|
370
372
|
setup?: JaypieHandlerSetup[] | JaypieHandlerSetup;
|
|
371
373
|
teardown?: JaypieHandlerTeardown[] | JaypieHandlerTeardown;
|
|
@@ -388,6 +390,7 @@ interface ExpressStreamHandlerOptions {
|
|
|
388
390
|
format?: StreamFormat;
|
|
389
391
|
locals?: Record<string, unknown | ExpressStreamHandlerLocals>;
|
|
390
392
|
name?: string;
|
|
393
|
+
scrub?: ScrubOption;
|
|
391
394
|
secrets?: string[];
|
|
392
395
|
setup?: JaypieStreamHandlerSetup[] | JaypieStreamHandlerSetup;
|
|
393
396
|
teardown?: JaypieStreamHandlerTeardown[] | JaypieStreamHandlerTeardown;
|
package/dist/esm/index.js
CHANGED
|
@@ -1772,7 +1772,7 @@ function expressHandler(handlerOrOptions, optionsOrHandler) {
|
|
|
1772
1772
|
//
|
|
1773
1773
|
// Validate
|
|
1774
1774
|
//
|
|
1775
|
-
let { chaos, fabric, locals, name, secrets, setup = [], teardown = [], unavailable, validate, } = options;
|
|
1775
|
+
let { chaos, fabric, locals, name, scrub, secrets, setup = [], teardown = [], unavailable, validate, } = options;
|
|
1776
1776
|
if (typeof handler !== "function") {
|
|
1777
1777
|
throw new BadRequestError(`Argument "${handler}" doesn't match type "function"`);
|
|
1778
1778
|
}
|
|
@@ -1927,6 +1927,7 @@ function expressHandler(handlerOrOptions, optionsOrHandler) {
|
|
|
1927
1927
|
jaypieFunction = jaypieHandler(handler, {
|
|
1928
1928
|
chaos,
|
|
1929
1929
|
name,
|
|
1930
|
+
scrub,
|
|
1930
1931
|
setup: requestSetup,
|
|
1931
1932
|
teardown,
|
|
1932
1933
|
unavailable,
|
|
@@ -2189,7 +2190,7 @@ function expressStreamHandler(handlerOrOptions, optionsOrHandler) {
|
|
|
2189
2190
|
// Validate
|
|
2190
2191
|
//
|
|
2191
2192
|
const format = options.format ?? "sse";
|
|
2192
|
-
let { chaos, contentType = getContentTypeForFormat(format), locals, name, secrets, setup = [], teardown = [], unavailable, validate, } = options;
|
|
2193
|
+
let { chaos, contentType = getContentTypeForFormat(format), locals, name, scrub, secrets, setup = [], teardown = [], unavailable, validate, } = options;
|
|
2193
2194
|
if (typeof handler !== "function") {
|
|
2194
2195
|
throw new BadRequestError(`Argument "${handler}" doesn't match type "function"`);
|
|
2195
2196
|
}
|
|
@@ -2310,6 +2311,7 @@ function expressStreamHandler(handlerOrOptions, optionsOrHandler) {
|
|
|
2310
2311
|
jaypieFunction = jaypieHandler(handler, {
|
|
2311
2312
|
chaos,
|
|
2312
2313
|
name,
|
|
2314
|
+
scrub,
|
|
2313
2315
|
setup: requestSetup,
|
|
2314
2316
|
teardown,
|
|
2315
2317
|
unavailable,
|