@tahminator/sapling 2.0.4 → 2.0.5-beta.23c37926
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/README.md +94 -4
- package/dist/index.cjs +305 -138
- package/dist/index.d.cts +429 -13
- package/dist/index.d.mts +429 -13
- package/dist/index.mjs +287 -139
- package/package.json +8 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e, { ErrorRequestHandler, NextFunction, Request, Response, Router } from "express";
|
|
1
|
+
import e, { ErrorRequestHandler, NextFunction, Request, RequestHandler, Response as Response$1, Router } from "express";
|
|
2
2
|
|
|
3
3
|
//#region src/html/404.d.ts
|
|
4
4
|
/**
|
|
@@ -26,7 +26,7 @@ type RouteDefinition = {
|
|
|
26
26
|
};
|
|
27
27
|
type Class<T> = new (...args: any[]) => T;
|
|
28
28
|
type HttpHeaders = Record<string, string>;
|
|
29
|
-
type ExpressMiddlewareFn = ($1: Request, $2: Response, $3: NextFunction) => void;
|
|
29
|
+
type ExpressMiddlewareFn = ($1: Request, $2: Response$1, $3: NextFunction) => void;
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/annotation/controller.d.ts
|
|
32
32
|
declare const _ControllerRegistry: WeakMap<Function, Router | ErrorRequestHandler>;
|
|
@@ -230,6 +230,45 @@ declare namespace StandardSchemaV1 {
|
|
|
230
230
|
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
231
231
|
}
|
|
232
232
|
/** The Standard JSON Schema interface. */
|
|
233
|
+
interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
|
|
234
|
+
/** The Standard JSON Schema properties. */
|
|
235
|
+
readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
|
|
236
|
+
}
|
|
237
|
+
declare namespace StandardJSONSchemaV1 {
|
|
238
|
+
/** The Standard JSON Schema properties interface. */
|
|
239
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
240
|
+
/** Methods for generating the input/output JSON Schema. */
|
|
241
|
+
readonly jsonSchema: StandardJSONSchemaV1.Converter;
|
|
242
|
+
}
|
|
243
|
+
/** The Standard JSON Schema converter interface. */
|
|
244
|
+
interface Converter {
|
|
245
|
+
/** Converts the input type to JSON Schema. May throw if conversion is not supported. */
|
|
246
|
+
readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
247
|
+
/** Converts the output type to JSON Schema. May throw if conversion is not supported. */
|
|
248
|
+
readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* The target version of the generated JSON Schema.
|
|
252
|
+
*
|
|
253
|
+
* It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
|
|
254
|
+
*
|
|
255
|
+
* The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
|
|
256
|
+
*/
|
|
257
|
+
type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
|
|
258
|
+
/** The options for the input/output methods. */
|
|
259
|
+
interface Options {
|
|
260
|
+
/** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
|
|
261
|
+
readonly target: Target;
|
|
262
|
+
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
263
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
264
|
+
}
|
|
265
|
+
/** The Standard types interface. */
|
|
266
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
267
|
+
/** Infers the input type of a Standard. */
|
|
268
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
269
|
+
/** Infers the output type of a Standard. */
|
|
270
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
271
|
+
}
|
|
233
272
|
//#endregion
|
|
234
273
|
//#region src/helper/redirect.d.ts
|
|
235
274
|
/**
|
|
@@ -408,6 +447,15 @@ declare class ParserError extends ResponseStatusError {
|
|
|
408
447
|
}
|
|
409
448
|
//#endregion
|
|
410
449
|
//#region src/helper/sapling.d.ts
|
|
450
|
+
type Settings = {
|
|
451
|
+
serialize: (value: any) => string;
|
|
452
|
+
deserialize: (value: string) => any;
|
|
453
|
+
doc: {
|
|
454
|
+
openApiPath: string;
|
|
455
|
+
swaggerPath: string;
|
|
456
|
+
};
|
|
457
|
+
};
|
|
458
|
+
declare const _settings: Settings;
|
|
411
459
|
/**
|
|
412
460
|
* Collection of utility functions which are essential for Sapling to function.
|
|
413
461
|
*/
|
|
@@ -481,13 +529,354 @@ declare class Sapling {
|
|
|
481
529
|
* Replace the function used for `deserialize`
|
|
482
530
|
*/
|
|
483
531
|
static setDeserializeFn(this: void, fn: (value: string) => any): void;
|
|
532
|
+
static setOpenApiPath(this: void, path: string): void;
|
|
533
|
+
static setSwaggerPath(this: void, path: string): void;
|
|
484
534
|
}
|
|
485
535
|
//#endregion
|
|
536
|
+
//#region node_modules/.pnpm/openapi-types@12.1.3/node_modules/openapi-types/dist/index.d.ts
|
|
537
|
+
declare namespace OpenAPIV3 {
|
|
538
|
+
interface Document<T extends {} = {}> {
|
|
539
|
+
openapi: string;
|
|
540
|
+
info: InfoObject;
|
|
541
|
+
servers?: ServerObject[];
|
|
542
|
+
paths: PathsObject<T>;
|
|
543
|
+
components?: ComponentsObject;
|
|
544
|
+
security?: SecurityRequirementObject[];
|
|
545
|
+
tags?: TagObject[];
|
|
546
|
+
externalDocs?: ExternalDocumentationObject;
|
|
547
|
+
'x-express-openapi-additional-middleware'?: (((request: any, response: any, next: any) => Promise<void>) | ((request: any, response: any, next: any) => void))[];
|
|
548
|
+
'x-express-openapi-validation-strict'?: boolean;
|
|
549
|
+
}
|
|
550
|
+
interface InfoObject {
|
|
551
|
+
title: string;
|
|
552
|
+
description?: string;
|
|
553
|
+
termsOfService?: string;
|
|
554
|
+
contact?: ContactObject;
|
|
555
|
+
license?: LicenseObject;
|
|
556
|
+
version: string;
|
|
557
|
+
}
|
|
558
|
+
interface ContactObject {
|
|
559
|
+
name?: string;
|
|
560
|
+
url?: string;
|
|
561
|
+
email?: string;
|
|
562
|
+
}
|
|
563
|
+
interface LicenseObject {
|
|
564
|
+
name: string;
|
|
565
|
+
url?: string;
|
|
566
|
+
}
|
|
567
|
+
interface ServerObject {
|
|
568
|
+
url: string;
|
|
569
|
+
description?: string;
|
|
570
|
+
variables?: {
|
|
571
|
+
[variable: string]: ServerVariableObject;
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
interface ServerVariableObject {
|
|
575
|
+
enum?: string[];
|
|
576
|
+
default: string;
|
|
577
|
+
description?: string;
|
|
578
|
+
}
|
|
579
|
+
interface PathsObject<T extends {} = {}, P extends {} = {}> {
|
|
580
|
+
[pattern: string]: (PathItemObject<T> & P) | undefined;
|
|
581
|
+
}
|
|
582
|
+
enum HttpMethods {
|
|
583
|
+
GET = "get",
|
|
584
|
+
PUT = "put",
|
|
585
|
+
POST = "post",
|
|
586
|
+
DELETE = "delete",
|
|
587
|
+
OPTIONS = "options",
|
|
588
|
+
HEAD = "head",
|
|
589
|
+
PATCH = "patch",
|
|
590
|
+
TRACE = "trace"
|
|
591
|
+
}
|
|
592
|
+
type PathItemObject<T extends {} = {}> = {
|
|
593
|
+
$ref?: string;
|
|
594
|
+
summary?: string;
|
|
595
|
+
description?: string;
|
|
596
|
+
servers?: ServerObject[];
|
|
597
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
598
|
+
} & { [method in HttpMethods]?: OperationObject<T> };
|
|
599
|
+
type OperationObject<T extends {} = {}> = {
|
|
600
|
+
tags?: string[];
|
|
601
|
+
summary?: string;
|
|
602
|
+
description?: string;
|
|
603
|
+
externalDocs?: ExternalDocumentationObject;
|
|
604
|
+
operationId?: string;
|
|
605
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
606
|
+
requestBody?: ReferenceObject | RequestBodyObject;
|
|
607
|
+
responses: ResponsesObject;
|
|
608
|
+
callbacks?: {
|
|
609
|
+
[callback: string]: ReferenceObject | CallbackObject;
|
|
610
|
+
};
|
|
611
|
+
deprecated?: boolean;
|
|
612
|
+
security?: SecurityRequirementObject[];
|
|
613
|
+
servers?: ServerObject[];
|
|
614
|
+
} & T;
|
|
615
|
+
interface ExternalDocumentationObject {
|
|
616
|
+
description?: string;
|
|
617
|
+
url: string;
|
|
618
|
+
}
|
|
619
|
+
interface ParameterObject extends ParameterBaseObject {
|
|
620
|
+
name: string;
|
|
621
|
+
in: string;
|
|
622
|
+
}
|
|
623
|
+
interface HeaderObject extends ParameterBaseObject {}
|
|
624
|
+
interface ParameterBaseObject {
|
|
625
|
+
description?: string;
|
|
626
|
+
required?: boolean;
|
|
627
|
+
deprecated?: boolean;
|
|
628
|
+
allowEmptyValue?: boolean;
|
|
629
|
+
style?: string;
|
|
630
|
+
explode?: boolean;
|
|
631
|
+
allowReserved?: boolean;
|
|
632
|
+
schema?: ReferenceObject | SchemaObject;
|
|
633
|
+
example?: any;
|
|
634
|
+
examples?: {
|
|
635
|
+
[media: string]: ReferenceObject | ExampleObject;
|
|
636
|
+
};
|
|
637
|
+
content?: {
|
|
638
|
+
[media: string]: MediaTypeObject;
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
type NonArraySchemaObjectType = 'boolean' | 'object' | 'number' | 'string' | 'integer';
|
|
642
|
+
type ArraySchemaObjectType = 'array';
|
|
643
|
+
type SchemaObject = ArraySchemaObject | NonArraySchemaObject;
|
|
644
|
+
interface ArraySchemaObject extends BaseSchemaObject {
|
|
645
|
+
type: ArraySchemaObjectType;
|
|
646
|
+
items: ReferenceObject | SchemaObject;
|
|
647
|
+
}
|
|
648
|
+
interface NonArraySchemaObject extends BaseSchemaObject {
|
|
649
|
+
type?: NonArraySchemaObjectType;
|
|
650
|
+
}
|
|
651
|
+
interface BaseSchemaObject {
|
|
652
|
+
title?: string;
|
|
653
|
+
description?: string;
|
|
654
|
+
format?: string;
|
|
655
|
+
default?: any;
|
|
656
|
+
multipleOf?: number;
|
|
657
|
+
maximum?: number;
|
|
658
|
+
exclusiveMaximum?: boolean;
|
|
659
|
+
minimum?: number;
|
|
660
|
+
exclusiveMinimum?: boolean;
|
|
661
|
+
maxLength?: number;
|
|
662
|
+
minLength?: number;
|
|
663
|
+
pattern?: string;
|
|
664
|
+
additionalProperties?: boolean | ReferenceObject | SchemaObject;
|
|
665
|
+
maxItems?: number;
|
|
666
|
+
minItems?: number;
|
|
667
|
+
uniqueItems?: boolean;
|
|
668
|
+
maxProperties?: number;
|
|
669
|
+
minProperties?: number;
|
|
670
|
+
required?: string[];
|
|
671
|
+
enum?: any[];
|
|
672
|
+
properties?: {
|
|
673
|
+
[name: string]: ReferenceObject | SchemaObject;
|
|
674
|
+
};
|
|
675
|
+
allOf?: (ReferenceObject | SchemaObject)[];
|
|
676
|
+
oneOf?: (ReferenceObject | SchemaObject)[];
|
|
677
|
+
anyOf?: (ReferenceObject | SchemaObject)[];
|
|
678
|
+
not?: ReferenceObject | SchemaObject;
|
|
679
|
+
nullable?: boolean;
|
|
680
|
+
discriminator?: DiscriminatorObject;
|
|
681
|
+
readOnly?: boolean;
|
|
682
|
+
writeOnly?: boolean;
|
|
683
|
+
xml?: XMLObject;
|
|
684
|
+
externalDocs?: ExternalDocumentationObject;
|
|
685
|
+
example?: any;
|
|
686
|
+
deprecated?: boolean;
|
|
687
|
+
}
|
|
688
|
+
interface DiscriminatorObject {
|
|
689
|
+
propertyName: string;
|
|
690
|
+
mapping?: {
|
|
691
|
+
[value: string]: string;
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
interface XMLObject {
|
|
695
|
+
name?: string;
|
|
696
|
+
namespace?: string;
|
|
697
|
+
prefix?: string;
|
|
698
|
+
attribute?: boolean;
|
|
699
|
+
wrapped?: boolean;
|
|
700
|
+
}
|
|
701
|
+
interface ReferenceObject {
|
|
702
|
+
$ref: string;
|
|
703
|
+
}
|
|
704
|
+
interface ExampleObject {
|
|
705
|
+
summary?: string;
|
|
706
|
+
description?: string;
|
|
707
|
+
value?: any;
|
|
708
|
+
externalValue?: string;
|
|
709
|
+
}
|
|
710
|
+
interface MediaTypeObject {
|
|
711
|
+
schema?: ReferenceObject | SchemaObject;
|
|
712
|
+
example?: any;
|
|
713
|
+
examples?: {
|
|
714
|
+
[media: string]: ReferenceObject | ExampleObject;
|
|
715
|
+
};
|
|
716
|
+
encoding?: {
|
|
717
|
+
[media: string]: EncodingObject;
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
interface EncodingObject {
|
|
721
|
+
contentType?: string;
|
|
722
|
+
headers?: {
|
|
723
|
+
[header: string]: ReferenceObject | HeaderObject;
|
|
724
|
+
};
|
|
725
|
+
style?: string;
|
|
726
|
+
explode?: boolean;
|
|
727
|
+
allowReserved?: boolean;
|
|
728
|
+
}
|
|
729
|
+
interface RequestBodyObject {
|
|
730
|
+
description?: string;
|
|
731
|
+
content: {
|
|
732
|
+
[media: string]: MediaTypeObject;
|
|
733
|
+
};
|
|
734
|
+
required?: boolean;
|
|
735
|
+
}
|
|
736
|
+
interface ResponsesObject {
|
|
737
|
+
[code: string]: ReferenceObject | ResponseObject;
|
|
738
|
+
}
|
|
739
|
+
interface ResponseObject {
|
|
740
|
+
description: string;
|
|
741
|
+
headers?: {
|
|
742
|
+
[header: string]: ReferenceObject | HeaderObject;
|
|
743
|
+
};
|
|
744
|
+
content?: {
|
|
745
|
+
[media: string]: MediaTypeObject;
|
|
746
|
+
};
|
|
747
|
+
links?: {
|
|
748
|
+
[link: string]: ReferenceObject | LinkObject;
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
interface LinkObject {
|
|
752
|
+
operationRef?: string;
|
|
753
|
+
operationId?: string;
|
|
754
|
+
parameters?: {
|
|
755
|
+
[parameter: string]: any;
|
|
756
|
+
};
|
|
757
|
+
requestBody?: any;
|
|
758
|
+
description?: string;
|
|
759
|
+
server?: ServerObject;
|
|
760
|
+
}
|
|
761
|
+
interface CallbackObject {
|
|
762
|
+
[url: string]: PathItemObject;
|
|
763
|
+
}
|
|
764
|
+
interface SecurityRequirementObject {
|
|
765
|
+
[name: string]: string[];
|
|
766
|
+
}
|
|
767
|
+
interface ComponentsObject {
|
|
768
|
+
schemas?: {
|
|
769
|
+
[key: string]: ReferenceObject | SchemaObject;
|
|
770
|
+
};
|
|
771
|
+
responses?: {
|
|
772
|
+
[key: string]: ReferenceObject | ResponseObject;
|
|
773
|
+
};
|
|
774
|
+
parameters?: {
|
|
775
|
+
[key: string]: ReferenceObject | ParameterObject;
|
|
776
|
+
};
|
|
777
|
+
examples?: {
|
|
778
|
+
[key: string]: ReferenceObject | ExampleObject;
|
|
779
|
+
};
|
|
780
|
+
requestBodies?: {
|
|
781
|
+
[key: string]: ReferenceObject | RequestBodyObject;
|
|
782
|
+
};
|
|
783
|
+
headers?: {
|
|
784
|
+
[key: string]: ReferenceObject | HeaderObject;
|
|
785
|
+
};
|
|
786
|
+
securitySchemes?: {
|
|
787
|
+
[key: string]: ReferenceObject | SecuritySchemeObject;
|
|
788
|
+
};
|
|
789
|
+
links?: {
|
|
790
|
+
[key: string]: ReferenceObject | LinkObject;
|
|
791
|
+
};
|
|
792
|
+
callbacks?: {
|
|
793
|
+
[key: string]: ReferenceObject | CallbackObject;
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
type SecuritySchemeObject = HttpSecurityScheme | ApiKeySecurityScheme | OAuth2SecurityScheme | OpenIdSecurityScheme;
|
|
797
|
+
interface HttpSecurityScheme {
|
|
798
|
+
type: 'http';
|
|
799
|
+
description?: string;
|
|
800
|
+
scheme: string;
|
|
801
|
+
bearerFormat?: string;
|
|
802
|
+
}
|
|
803
|
+
interface ApiKeySecurityScheme {
|
|
804
|
+
type: 'apiKey';
|
|
805
|
+
description?: string;
|
|
806
|
+
name: string;
|
|
807
|
+
in: string;
|
|
808
|
+
}
|
|
809
|
+
interface OAuth2SecurityScheme {
|
|
810
|
+
type: 'oauth2';
|
|
811
|
+
description?: string;
|
|
812
|
+
flows: {
|
|
813
|
+
implicit?: {
|
|
814
|
+
authorizationUrl: string;
|
|
815
|
+
refreshUrl?: string;
|
|
816
|
+
scopes: {
|
|
817
|
+
[scope: string]: string;
|
|
818
|
+
};
|
|
819
|
+
};
|
|
820
|
+
password?: {
|
|
821
|
+
tokenUrl: string;
|
|
822
|
+
refreshUrl?: string;
|
|
823
|
+
scopes: {
|
|
824
|
+
[scope: string]: string;
|
|
825
|
+
};
|
|
826
|
+
};
|
|
827
|
+
clientCredentials?: {
|
|
828
|
+
tokenUrl: string;
|
|
829
|
+
refreshUrl?: string;
|
|
830
|
+
scopes: {
|
|
831
|
+
[scope: string]: string;
|
|
832
|
+
};
|
|
833
|
+
};
|
|
834
|
+
authorizationCode?: {
|
|
835
|
+
authorizationUrl: string;
|
|
836
|
+
tokenUrl: string;
|
|
837
|
+
refreshUrl?: string;
|
|
838
|
+
scopes: {
|
|
839
|
+
[scope: string]: string;
|
|
840
|
+
};
|
|
841
|
+
};
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
interface OpenIdSecurityScheme {
|
|
845
|
+
type: 'openIdConnect';
|
|
846
|
+
description?: string;
|
|
847
|
+
openIdConnectUrl: string;
|
|
848
|
+
}
|
|
849
|
+
interface TagObject {
|
|
850
|
+
name: string;
|
|
851
|
+
description?: string;
|
|
852
|
+
externalDocs?: ExternalDocumentationObject;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
//#endregion
|
|
856
|
+
//#region src/helper/openapi.d.ts
|
|
857
|
+
type OpenAPIConfig = {
|
|
858
|
+
title: string;
|
|
859
|
+
version: string;
|
|
860
|
+
description?: string;
|
|
861
|
+
};
|
|
862
|
+
declare class OpenAPIGenerator {
|
|
863
|
+
private controllers;
|
|
864
|
+
private config;
|
|
865
|
+
setConfig(config: OpenAPIConfig): void;
|
|
866
|
+
registerController(controllerClass: Function, prefix: string): void;
|
|
867
|
+
generateSpec(): OpenAPIV3.Document;
|
|
868
|
+
private toJsonSchema;
|
|
869
|
+
}
|
|
870
|
+
declare const openApiGenerator: OpenAPIGenerator;
|
|
871
|
+
declare function _registerControllerClass(controllerClass: Function, prefix: string): void;
|
|
872
|
+
declare function _setOpenApiConfig(config: OpenAPIConfig): void;
|
|
873
|
+
declare function _generateOpenApiSpec(): OpenAPIV3.Document;
|
|
874
|
+
//#endregion
|
|
486
875
|
//#region src/annotation/request.d.ts
|
|
487
876
|
type RequestSchemaDefinition = {
|
|
488
|
-
body?: StandardSchemaV1;
|
|
489
|
-
param?: StandardSchemaV1;
|
|
490
|
-
query?: StandardSchemaV1;
|
|
877
|
+
body?: StandardSchemaV1 & StandardJSONSchemaV1;
|
|
878
|
+
param?: StandardSchemaV1 & StandardJSONSchemaV1;
|
|
879
|
+
query?: StandardSchemaV1 & StandardJSONSchemaV1;
|
|
491
880
|
};
|
|
492
881
|
/**
|
|
493
882
|
* Apply to a route method to have `request.body` be parsed by `schema`.
|
|
@@ -514,7 +903,7 @@ type RequestSchemaDefinition = {
|
|
|
514
903
|
* }
|
|
515
904
|
* ```
|
|
516
905
|
*/
|
|
517
|
-
declare function RequestBody(schema: StandardSchemaV1): MethodDecorator;
|
|
906
|
+
declare function RequestBody(schema: StandardSchemaV1 & StandardJSONSchemaV1): MethodDecorator;
|
|
518
907
|
/**
|
|
519
908
|
* Apply to a route method to have `request.param` be parsed by `schema`.
|
|
520
909
|
*
|
|
@@ -539,7 +928,7 @@ declare function RequestBody(schema: StandardSchemaV1): MethodDecorator;
|
|
|
539
928
|
* }
|
|
540
929
|
* ```
|
|
541
930
|
*/
|
|
542
|
-
declare function RequestParam(schema: StandardSchemaV1): MethodDecorator;
|
|
931
|
+
declare function RequestParam(schema: StandardSchemaV1 & StandardJSONSchemaV1): MethodDecorator;
|
|
543
932
|
/**
|
|
544
933
|
* Apply to a route method to have `request.query` be parsed by `schema`.
|
|
545
934
|
*
|
|
@@ -565,27 +954,54 @@ declare function RequestParam(schema: StandardSchemaV1): MethodDecorator;
|
|
|
565
954
|
* }
|
|
566
955
|
* ```
|
|
567
956
|
*/
|
|
568
|
-
declare function RequestQuery(schema: StandardSchemaV1): MethodDecorator;
|
|
957
|
+
declare function RequestQuery(schema: StandardSchemaV1 & StandardJSONSchemaV1): MethodDecorator;
|
|
569
958
|
declare function _getRequestSchemas(ctor: Function, fnName: string): RequestSchemaDefinition | undefined;
|
|
570
959
|
declare function _parseOrThrow<TSchema extends StandardSchemaV1>(schema: TSchema, input: unknown, kind: ParserErrorLocation): Promise<StandardSchemaV1.InferOutput<TSchema>>;
|
|
571
960
|
//#endregion
|
|
572
|
-
//#region src/middleware/default/base.d.ts
|
|
961
|
+
//#region src/middleware/default/error/base.d.ts
|
|
573
962
|
/**
|
|
574
963
|
* This should be registered last in the middleware chain.
|
|
575
964
|
*
|
|
576
965
|
* All exception messages are hidden from the request by default.
|
|
577
966
|
*/
|
|
578
967
|
declare class DefaultBaseErrorMiddleware {
|
|
579
|
-
handle(err: unknown, _request: Request, _response: Response, _next: NextFunction): ResponseEntity<{
|
|
968
|
+
handle(err: unknown, _request: Request, _response: Response$1, _next: NextFunction): ResponseEntity<{
|
|
580
969
|
message: string;
|
|
581
970
|
}>;
|
|
582
971
|
}
|
|
583
972
|
//#endregion
|
|
584
|
-
//#region src/middleware/default/
|
|
973
|
+
//#region src/middleware/default/error/parse.d.ts
|
|
974
|
+
declare class DefaultParserErrorMiddleware {
|
|
975
|
+
handle(err: unknown, _request: Request, _response: Response$1, next: NextFunction): ResponseEntity<{
|
|
976
|
+
message: string;
|
|
977
|
+
}> | undefined;
|
|
978
|
+
}
|
|
979
|
+
//#endregion
|
|
980
|
+
//#region src/middleware/default/error/responsestatus.d.ts
|
|
585
981
|
declare class DefaultResponseStatusErrorMiddleware {
|
|
586
|
-
handle(err: unknown, _request: Request, _response: Response, next: NextFunction): ResponseEntity<{
|
|
982
|
+
handle(err: unknown, _request: Request, _response: Response$1, next: NextFunction): ResponseEntity<{
|
|
587
983
|
message: string;
|
|
588
984
|
}> | undefined;
|
|
589
985
|
}
|
|
590
986
|
//#endregion
|
|
591
|
-
|
|
987
|
+
//#region src/middleware/default/openapi/index.d.ts
|
|
988
|
+
declare class DefaultOpenApiMiddleware {
|
|
989
|
+
handle(_request: Request, _response: Response$1, _next: NextFunction): ResponseEntity<OpenAPIV3.Document<{}>>;
|
|
990
|
+
}
|
|
991
|
+
//#endregion
|
|
992
|
+
//#region src/middleware/default/swagger/index.d.ts
|
|
993
|
+
declare class Serve {
|
|
994
|
+
private readonly handlers;
|
|
995
|
+
handle(_request: Request, _response: Response$1, _next: NextFunction): RequestHandler[];
|
|
996
|
+
}
|
|
997
|
+
declare class Setup {
|
|
998
|
+
private readonly handler;
|
|
999
|
+
constructor();
|
|
1000
|
+
handle(request: Request, response: Response$1, next: NextFunction): unknown;
|
|
1001
|
+
}
|
|
1002
|
+
declare const DefaultSwaggerMiddleware: {
|
|
1003
|
+
Serve: typeof Serve;
|
|
1004
|
+
Setup: typeof Setup;
|
|
1005
|
+
};
|
|
1006
|
+
//#endregion
|
|
1007
|
+
export { Class, Controller, DELETE, DefaultBaseErrorMiddleware, DefaultOpenApiMiddleware, DefaultParserErrorMiddleware, DefaultResponseStatusErrorMiddleware, DefaultSwaggerMiddleware, ExpressMiddlewareFn, ExpressRouterMethodKey, ExpressRouterMethods, GET, HEAD, Html404ErrorPage, HttpHeaders, HttpStatus, Injectable, Middleware, MiddlewareClass, OPTIONS, PATCH, POST, PUT, ParserError, ParserErrorLocation, RedirectView, RequestBody, RequestParam, RequestQuery, ResponseEntity, ResponseEntityBuilder, ResponseStatusError, RouteDefinition, Sapling, _ControllerRegistry, _InjectableDeps, _InjectableRegistry, _Route, _generateOpenApiSpec, _getRequestSchemas, _getRoutes, _parseOrThrow, _registerControllerClass, _resolve, _setOpenApiConfig, _settings, methodResolve, openApiGenerator };
|