fastify 5.6.2 → 5.7.1
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 +34 -33
- package/SECURITY.md +45 -7
- package/SPONSORS.md +1 -1
- package/build/build-validation.js +1 -2
- package/build/sync-version.js +0 -1
- package/docs/Guides/Detecting-When-Clients-Abort.md +1 -1
- package/docs/Guides/Ecosystem.md +12 -15
- package/docs/Guides/Migration-Guide-V4.md +2 -1
- package/docs/Guides/Migration-Guide-V5.md +9 -0
- package/docs/Guides/Serverless.md +25 -7
- package/docs/Guides/Testing.md +2 -2
- package/docs/Reference/Decorators.md +4 -3
- package/docs/Reference/Encapsulation.md +2 -2
- package/docs/Reference/Logging.md +4 -0
- package/docs/Reference/Plugins.md +2 -2
- package/docs/Reference/Principles.md +2 -2
- package/docs/Reference/Reply.md +3 -2
- package/docs/Reference/Server.md +35 -4
- package/docs/Reference/TypeScript.md +2 -1
- package/docs/Reference/Validation-and-Serialization.md +7 -1
- package/examples/benchmark/webstream.js +27 -0
- package/fastify.d.ts +16 -21
- package/fastify.js +14 -9
- package/lib/config-validator.js +189 -223
- package/lib/error-handler.js +2 -5
- package/lib/error-status.js +14 -0
- package/lib/four-oh-four.js +2 -1
- package/lib/handle-request.js +6 -1
- package/lib/reply.js +53 -3
- package/lib/route.js +26 -12
- package/lib/schema-controller.js +2 -2
- package/lib/wrap-thenable.js +3 -0
- package/package.json +4 -4
- package/test/404s.test.js +69 -0
- package/test/diagnostics-channel/error-status.test.js +84 -0
- package/test/internals/schema-controller-perf.test.js +40 -0
- package/test/issue-4959.test.js +34 -9
- package/test/listen.1.test.js +9 -1
- package/test/logger/logging.test.js +38 -1
- package/test/router-options.test.js +169 -0
- package/test/server.test.js +4 -1
- package/test/types/fastify.test-d.ts +28 -7
- package/test/types/instance.test-d.ts +29 -21
- package/test/types/reply.test-d.ts +55 -4
- package/test/types/type-provider.test-d.ts +6 -6
- package/test/web-api.test.js +136 -0
- package/types/instance.d.ts +1 -1
- package/types/reply.d.ts +2 -2
- package/types/type-provider.d.ts +16 -0
- package/.vscode/settings.json +0 -22
- package/test/decorator-namespace.test._js_ +0 -30
package/lib/config-validator.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"use strict";
|
|
4
4
|
module.exports = validate10;
|
|
5
5
|
module.exports.default = validate10;
|
|
6
|
-
const schema11 = {"type":"object","additionalProperties":false,"properties":{"connectionTimeout":{"type":"integer","default":0},"keepAliveTimeout":{"type":"integer","default":72000},"forceCloseConnections":{"oneOf":[{"type":"string","pattern":"idle"},{"type":"boolean"}]},"maxRequestsPerSocket":{"type":"integer","default":0,"nullable":true},"requestTimeout":{"type":"integer","default":0},"bodyLimit":{"type":"integer","default":1048576},"caseSensitive":{"type":"boolean","default":true},"allowUnsafeRegex":{"type":"boolean","default":false},"http2":{"type":"boolean"},"https":{"if":{"not":{"oneOf":[{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":false,"required":["allowHTTP1"],"properties":{"allowHTTP1":{"type":"boolean"}}}]}},"then":{"setDefaultValue":true}},"ignoreTrailingSlash":{"type":"boolean","default":false},"ignoreDuplicateSlashes":{"type":"boolean","default":false},"disableRequestLogging":{"
|
|
6
|
+
const schema11 = {"type":"object","additionalProperties":false,"properties":{"connectionTimeout":{"type":"integer","default":0},"keepAliveTimeout":{"type":"integer","default":72000},"forceCloseConnections":{"oneOf":[{"type":"string","pattern":"idle"},{"type":"boolean"}]},"maxRequestsPerSocket":{"type":"integer","default":0,"nullable":true},"requestTimeout":{"type":"integer","default":0},"bodyLimit":{"type":"integer","default":1048576},"caseSensitive":{"type":"boolean","default":true},"allowUnsafeRegex":{"type":"boolean","default":false},"http2":{"type":"boolean"},"https":{"if":{"not":{"oneOf":[{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":false,"required":["allowHTTP1"],"properties":{"allowHTTP1":{"type":"boolean"}}}]}},"then":{"setDefaultValue":true}},"ignoreTrailingSlash":{"type":"boolean","default":false},"ignoreDuplicateSlashes":{"type":"boolean","default":false},"disableRequestLogging":{"default":false},"maxParamLength":{"type":"integer","default":100},"onProtoPoisoning":{"type":"string","default":"error"},"onConstructorPoisoning":{"type":"string","default":"error"},"pluginTimeout":{"type":"integer","default":10000},"requestIdHeader":{"anyOf":[{"type":"boolean"},{"type":"string"}],"default":false},"requestIdLogLabel":{"type":"string","default":"reqId"},"http2SessionTimeout":{"type":"integer","default":72000},"exposeHeadRoutes":{"type":"boolean","default":true},"useSemicolonDelimiter":{"type":"boolean","default":false},"routerOptions":{"type":"object","additionalProperties":true,"properties":{"ignoreTrailingSlash":{"type":"boolean","default":false},"ignoreDuplicateSlashes":{"type":"boolean","default":false},"maxParamLength":{"type":"integer","default":100},"allowUnsafeRegex":{"type":"boolean","default":false},"useSemicolonDelimiter":{"type":"boolean","default":false}}},"constraints":{"type":"object","additionalProperties":{"type":"object","required":["name","storage","validate","deriveConstraint"],"additionalProperties":true,"properties":{"name":{"type":"string"},"storage":{},"validate":{},"deriveConstraint":{}}}}}};
|
|
7
7
|
const func2 = Object.prototype.hasOwnProperty;
|
|
8
8
|
const pattern0 = new RegExp("idle", "u");
|
|
9
9
|
|
|
@@ -685,56 +685,57 @@ data["ignoreDuplicateSlashes"] = coerced14;
|
|
|
685
685
|
}
|
|
686
686
|
var valid0 = _errs43 === errors;
|
|
687
687
|
if(valid0){
|
|
688
|
-
let data13 = data.
|
|
688
|
+
let data13 = data.maxParamLength;
|
|
689
689
|
const _errs45 = errors;
|
|
690
|
-
if(typeof data13
|
|
690
|
+
if(!(((typeof data13 == "number") && (!(data13 % 1) && !isNaN(data13))) && (isFinite(data13)))){
|
|
691
|
+
let dataType15 = typeof data13;
|
|
691
692
|
let coerced15 = undefined;
|
|
692
693
|
if(!(coerced15 !== undefined)){
|
|
693
|
-
if(
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
else if(data13 === "true" || data13 === 1){
|
|
697
|
-
coerced15 = true;
|
|
694
|
+
if(dataType15 === "boolean" || data13 === null
|
|
695
|
+
|| (dataType15 === "string" && data13 && data13 == +data13 && !(data13 % 1))){
|
|
696
|
+
coerced15 = +data13;
|
|
698
697
|
}
|
|
699
698
|
else {
|
|
700
|
-
validate10.errors = [{instancePath:instancePath+"/
|
|
699
|
+
validate10.errors = [{instancePath:instancePath+"/maxParamLength",schemaPath:"#/properties/maxParamLength/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
701
700
|
return false;
|
|
702
701
|
}
|
|
703
702
|
}
|
|
704
703
|
if(coerced15 !== undefined){
|
|
705
704
|
data13 = coerced15;
|
|
706
705
|
if(data !== undefined){
|
|
707
|
-
data["
|
|
706
|
+
data["maxParamLength"] = coerced15;
|
|
708
707
|
}
|
|
709
708
|
}
|
|
710
709
|
}
|
|
711
710
|
var valid0 = _errs45 === errors;
|
|
712
711
|
if(valid0){
|
|
713
|
-
let data14 = data.
|
|
712
|
+
let data14 = data.onProtoPoisoning;
|
|
714
713
|
const _errs47 = errors;
|
|
715
|
-
if(
|
|
714
|
+
if(typeof data14 !== "string"){
|
|
716
715
|
let dataType16 = typeof data14;
|
|
717
716
|
let coerced16 = undefined;
|
|
718
717
|
if(!(coerced16 !== undefined)){
|
|
719
|
-
if(dataType16
|
|
720
|
-
|
|
721
|
-
|
|
718
|
+
if(dataType16 == "number" || dataType16 == "boolean"){
|
|
719
|
+
coerced16 = "" + data14;
|
|
720
|
+
}
|
|
721
|
+
else if(data14 === null){
|
|
722
|
+
coerced16 = "";
|
|
722
723
|
}
|
|
723
724
|
else {
|
|
724
|
-
validate10.errors = [{instancePath:instancePath+"/
|
|
725
|
+
validate10.errors = [{instancePath:instancePath+"/onProtoPoisoning",schemaPath:"#/properties/onProtoPoisoning/type",keyword:"type",params:{type: "string"},message:"must be string"}];
|
|
725
726
|
return false;
|
|
726
727
|
}
|
|
727
728
|
}
|
|
728
729
|
if(coerced16 !== undefined){
|
|
729
730
|
data14 = coerced16;
|
|
730
731
|
if(data !== undefined){
|
|
731
|
-
data["
|
|
732
|
+
data["onProtoPoisoning"] = coerced16;
|
|
732
733
|
}
|
|
733
734
|
}
|
|
734
735
|
}
|
|
735
736
|
var valid0 = _errs47 === errors;
|
|
736
737
|
if(valid0){
|
|
737
|
-
let data15 = data.
|
|
738
|
+
let data15 = data.onConstructorPoisoning;
|
|
738
739
|
const _errs49 = errors;
|
|
739
740
|
if(typeof data15 !== "string"){
|
|
740
741
|
let dataType17 = typeof data15;
|
|
@@ -747,82 +748,56 @@ else if(data15 === null){
|
|
|
747
748
|
coerced17 = "";
|
|
748
749
|
}
|
|
749
750
|
else {
|
|
750
|
-
validate10.errors = [{instancePath:instancePath+"/
|
|
751
|
+
validate10.errors = [{instancePath:instancePath+"/onConstructorPoisoning",schemaPath:"#/properties/onConstructorPoisoning/type",keyword:"type",params:{type: "string"},message:"must be string"}];
|
|
751
752
|
return false;
|
|
752
753
|
}
|
|
753
754
|
}
|
|
754
755
|
if(coerced17 !== undefined){
|
|
755
756
|
data15 = coerced17;
|
|
756
757
|
if(data !== undefined){
|
|
757
|
-
data["
|
|
758
|
+
data["onConstructorPoisoning"] = coerced17;
|
|
758
759
|
}
|
|
759
760
|
}
|
|
760
761
|
}
|
|
761
762
|
var valid0 = _errs49 === errors;
|
|
762
763
|
if(valid0){
|
|
763
|
-
let data16 = data.
|
|
764
|
+
let data16 = data.pluginTimeout;
|
|
764
765
|
const _errs51 = errors;
|
|
765
|
-
if(typeof data16
|
|
766
|
+
if(!(((typeof data16 == "number") && (!(data16 % 1) && !isNaN(data16))) && (isFinite(data16)))){
|
|
766
767
|
let dataType18 = typeof data16;
|
|
767
768
|
let coerced18 = undefined;
|
|
768
769
|
if(!(coerced18 !== undefined)){
|
|
769
|
-
if(dataType18
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
else if(data16 === null){
|
|
773
|
-
coerced18 = "";
|
|
770
|
+
if(dataType18 === "boolean" || data16 === null
|
|
771
|
+
|| (dataType18 === "string" && data16 && data16 == +data16 && !(data16 % 1))){
|
|
772
|
+
coerced18 = +data16;
|
|
774
773
|
}
|
|
775
774
|
else {
|
|
776
|
-
validate10.errors = [{instancePath:instancePath+"/
|
|
775
|
+
validate10.errors = [{instancePath:instancePath+"/pluginTimeout",schemaPath:"#/properties/pluginTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
777
776
|
return false;
|
|
778
777
|
}
|
|
779
778
|
}
|
|
780
779
|
if(coerced18 !== undefined){
|
|
781
780
|
data16 = coerced18;
|
|
782
781
|
if(data !== undefined){
|
|
783
|
-
data["
|
|
782
|
+
data["pluginTimeout"] = coerced18;
|
|
784
783
|
}
|
|
785
784
|
}
|
|
786
785
|
}
|
|
787
786
|
var valid0 = _errs51 === errors;
|
|
788
787
|
if(valid0){
|
|
789
|
-
let data17 = data.
|
|
788
|
+
let data17 = data.requestIdHeader;
|
|
790
789
|
const _errs53 = errors;
|
|
791
|
-
|
|
792
|
-
let
|
|
790
|
+
const _errs54 = errors;
|
|
791
|
+
let valid6 = false;
|
|
792
|
+
const _errs55 = errors;
|
|
793
|
+
if(typeof data17 !== "boolean"){
|
|
793
794
|
let coerced19 = undefined;
|
|
794
795
|
if(!(coerced19 !== undefined)){
|
|
795
|
-
if(
|
|
796
|
-
|
|
797
|
-
coerced19 = +data17;
|
|
798
|
-
}
|
|
799
|
-
else {
|
|
800
|
-
validate10.errors = [{instancePath:instancePath+"/pluginTimeout",schemaPath:"#/properties/pluginTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
801
|
-
return false;
|
|
796
|
+
if(data17 === "false" || data17 === 0 || data17 === null){
|
|
797
|
+
coerced19 = false;
|
|
802
798
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
data17 = coerced19;
|
|
806
|
-
if(data !== undefined){
|
|
807
|
-
data["pluginTimeout"] = coerced19;
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
var valid0 = _errs53 === errors;
|
|
812
|
-
if(valid0){
|
|
813
|
-
let data18 = data.requestIdHeader;
|
|
814
|
-
const _errs55 = errors;
|
|
815
|
-
const _errs56 = errors;
|
|
816
|
-
let valid6 = false;
|
|
817
|
-
const _errs57 = errors;
|
|
818
|
-
if(typeof data18 !== "boolean"){
|
|
819
|
-
let coerced20 = undefined;
|
|
820
|
-
if(!(coerced20 !== undefined)){
|
|
821
|
-
if(data18 === "false" || data18 === 0 || data18 === null){
|
|
822
|
-
coerced20 = false;
|
|
823
|
-
}
|
|
824
|
-
else if(data18 === "true" || data18 === 1){
|
|
825
|
-
coerced20 = true;
|
|
799
|
+
else if(data17 === "true" || data17 === 1){
|
|
800
|
+
coerced19 = true;
|
|
826
801
|
}
|
|
827
802
|
else {
|
|
828
803
|
const err12 = {instancePath:instancePath+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};
|
|
@@ -835,26 +810,26 @@ vErrors.push(err12);
|
|
|
835
810
|
errors++;
|
|
836
811
|
}
|
|
837
812
|
}
|
|
838
|
-
if(
|
|
839
|
-
|
|
813
|
+
if(coerced19 !== undefined){
|
|
814
|
+
data17 = coerced19;
|
|
840
815
|
if(data !== undefined){
|
|
841
|
-
data["requestIdHeader"] =
|
|
816
|
+
data["requestIdHeader"] = coerced19;
|
|
842
817
|
}
|
|
843
818
|
}
|
|
844
819
|
}
|
|
845
|
-
var _valid3 =
|
|
820
|
+
var _valid3 = _errs55 === errors;
|
|
846
821
|
valid6 = valid6 || _valid3;
|
|
847
822
|
if(!valid6){
|
|
848
|
-
const
|
|
849
|
-
if(typeof
|
|
850
|
-
let
|
|
851
|
-
let
|
|
852
|
-
if(!(
|
|
853
|
-
if(
|
|
854
|
-
|
|
823
|
+
const _errs57 = errors;
|
|
824
|
+
if(typeof data17 !== "string"){
|
|
825
|
+
let dataType20 = typeof data17;
|
|
826
|
+
let coerced20 = undefined;
|
|
827
|
+
if(!(coerced20 !== undefined)){
|
|
828
|
+
if(dataType20 == "number" || dataType20 == "boolean"){
|
|
829
|
+
coerced20 = "" + data17;
|
|
855
830
|
}
|
|
856
|
-
else if(
|
|
857
|
-
|
|
831
|
+
else if(data17 === null){
|
|
832
|
+
coerced20 = "";
|
|
858
833
|
}
|
|
859
834
|
else {
|
|
860
835
|
const err13 = {instancePath:instancePath+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
@@ -867,14 +842,14 @@ vErrors.push(err13);
|
|
|
867
842
|
errors++;
|
|
868
843
|
}
|
|
869
844
|
}
|
|
870
|
-
if(
|
|
871
|
-
|
|
845
|
+
if(coerced20 !== undefined){
|
|
846
|
+
data17 = coerced20;
|
|
872
847
|
if(data !== undefined){
|
|
873
|
-
data["requestIdHeader"] =
|
|
848
|
+
data["requestIdHeader"] = coerced20;
|
|
874
849
|
}
|
|
875
850
|
}
|
|
876
851
|
}
|
|
877
|
-
var _valid3 =
|
|
852
|
+
var _valid3 = _errs57 === errors;
|
|
878
853
|
valid6 = valid6 || _valid3;
|
|
879
854
|
}
|
|
880
855
|
if(!valid6){
|
|
@@ -890,69 +865,94 @@ validate10.errors = vErrors;
|
|
|
890
865
|
return false;
|
|
891
866
|
}
|
|
892
867
|
else {
|
|
893
|
-
errors =
|
|
868
|
+
errors = _errs54;
|
|
894
869
|
if(vErrors !== null){
|
|
895
|
-
if(
|
|
896
|
-
vErrors.length =
|
|
870
|
+
if(_errs54){
|
|
871
|
+
vErrors.length = _errs54;
|
|
897
872
|
}
|
|
898
873
|
else {
|
|
899
874
|
vErrors = null;
|
|
900
875
|
}
|
|
901
876
|
}
|
|
902
877
|
}
|
|
903
|
-
var valid0 =
|
|
878
|
+
var valid0 = _errs53 === errors;
|
|
904
879
|
if(valid0){
|
|
905
|
-
let
|
|
880
|
+
let data18 = data.requestIdLogLabel;
|
|
881
|
+
const _errs59 = errors;
|
|
882
|
+
if(typeof data18 !== "string"){
|
|
883
|
+
let dataType21 = typeof data18;
|
|
884
|
+
let coerced21 = undefined;
|
|
885
|
+
if(!(coerced21 !== undefined)){
|
|
886
|
+
if(dataType21 == "number" || dataType21 == "boolean"){
|
|
887
|
+
coerced21 = "" + data18;
|
|
888
|
+
}
|
|
889
|
+
else if(data18 === null){
|
|
890
|
+
coerced21 = "";
|
|
891
|
+
}
|
|
892
|
+
else {
|
|
893
|
+
validate10.errors = [{instancePath:instancePath+"/requestIdLogLabel",schemaPath:"#/properties/requestIdLogLabel/type",keyword:"type",params:{type: "string"},message:"must be string"}];
|
|
894
|
+
return false;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
if(coerced21 !== undefined){
|
|
898
|
+
data18 = coerced21;
|
|
899
|
+
if(data !== undefined){
|
|
900
|
+
data["requestIdLogLabel"] = coerced21;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
var valid0 = _errs59 === errors;
|
|
905
|
+
if(valid0){
|
|
906
|
+
let data19 = data.http2SessionTimeout;
|
|
906
907
|
const _errs61 = errors;
|
|
907
|
-
if(typeof data19
|
|
908
|
+
if(!(((typeof data19 == "number") && (!(data19 % 1) && !isNaN(data19))) && (isFinite(data19)))){
|
|
908
909
|
let dataType22 = typeof data19;
|
|
909
910
|
let coerced22 = undefined;
|
|
910
911
|
if(!(coerced22 !== undefined)){
|
|
911
|
-
if(dataType22
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
else if(data19 === null){
|
|
915
|
-
coerced22 = "";
|
|
912
|
+
if(dataType22 === "boolean" || data19 === null
|
|
913
|
+
|| (dataType22 === "string" && data19 && data19 == +data19 && !(data19 % 1))){
|
|
914
|
+
coerced22 = +data19;
|
|
916
915
|
}
|
|
917
916
|
else {
|
|
918
|
-
validate10.errors = [{instancePath:instancePath+"/
|
|
917
|
+
validate10.errors = [{instancePath:instancePath+"/http2SessionTimeout",schemaPath:"#/properties/http2SessionTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
919
918
|
return false;
|
|
920
919
|
}
|
|
921
920
|
}
|
|
922
921
|
if(coerced22 !== undefined){
|
|
923
922
|
data19 = coerced22;
|
|
924
923
|
if(data !== undefined){
|
|
925
|
-
data["
|
|
924
|
+
data["http2SessionTimeout"] = coerced22;
|
|
926
925
|
}
|
|
927
926
|
}
|
|
928
927
|
}
|
|
929
928
|
var valid0 = _errs61 === errors;
|
|
930
929
|
if(valid0){
|
|
931
|
-
let data20 = data.
|
|
930
|
+
let data20 = data.exposeHeadRoutes;
|
|
932
931
|
const _errs63 = errors;
|
|
933
|
-
if(
|
|
934
|
-
let dataType23 = typeof data20;
|
|
932
|
+
if(typeof data20 !== "boolean"){
|
|
935
933
|
let coerced23 = undefined;
|
|
936
934
|
if(!(coerced23 !== undefined)){
|
|
937
|
-
if(
|
|
938
|
-
|
|
939
|
-
|
|
935
|
+
if(data20 === "false" || data20 === 0 || data20 === null){
|
|
936
|
+
coerced23 = false;
|
|
937
|
+
}
|
|
938
|
+
else if(data20 === "true" || data20 === 1){
|
|
939
|
+
coerced23 = true;
|
|
940
940
|
}
|
|
941
941
|
else {
|
|
942
|
-
validate10.errors = [{instancePath:instancePath+"/
|
|
942
|
+
validate10.errors = [{instancePath:instancePath+"/exposeHeadRoutes",schemaPath:"#/properties/exposeHeadRoutes/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
943
943
|
return false;
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
946
|
if(coerced23 !== undefined){
|
|
947
947
|
data20 = coerced23;
|
|
948
948
|
if(data !== undefined){
|
|
949
|
-
data["
|
|
949
|
+
data["exposeHeadRoutes"] = coerced23;
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
var valid0 = _errs63 === errors;
|
|
954
954
|
if(valid0){
|
|
955
|
-
let data21 = data.
|
|
955
|
+
let data21 = data.useSemicolonDelimiter;
|
|
956
956
|
const _errs65 = errors;
|
|
957
957
|
if(typeof data21 !== "boolean"){
|
|
958
958
|
let coerced24 = undefined;
|
|
@@ -964,72 +964,65 @@ else if(data21 === "true" || data21 === 1){
|
|
|
964
964
|
coerced24 = true;
|
|
965
965
|
}
|
|
966
966
|
else {
|
|
967
|
-
validate10.errors = [{instancePath:instancePath+"/
|
|
967
|
+
validate10.errors = [{instancePath:instancePath+"/useSemicolonDelimiter",schemaPath:"#/properties/useSemicolonDelimiter/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
968
968
|
return false;
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
if(coerced24 !== undefined){
|
|
972
972
|
data21 = coerced24;
|
|
973
973
|
if(data !== undefined){
|
|
974
|
-
data["
|
|
974
|
+
data["useSemicolonDelimiter"] = coerced24;
|
|
975
975
|
}
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
978
|
var valid0 = _errs65 === errors;
|
|
979
979
|
if(valid0){
|
|
980
|
-
|
|
980
|
+
if(data.routerOptions !== undefined){
|
|
981
|
+
let data22 = data.routerOptions;
|
|
981
982
|
const _errs67 = errors;
|
|
982
|
-
if(
|
|
983
|
+
if(errors === _errs67){
|
|
984
|
+
if(data22 && typeof data22 == "object" && !Array.isArray(data22)){
|
|
985
|
+
if(data22.ignoreTrailingSlash === undefined){
|
|
986
|
+
data22.ignoreTrailingSlash = false;
|
|
987
|
+
}
|
|
988
|
+
if(data22.ignoreDuplicateSlashes === undefined){
|
|
989
|
+
data22.ignoreDuplicateSlashes = false;
|
|
990
|
+
}
|
|
991
|
+
if(data22.maxParamLength === undefined){
|
|
992
|
+
data22.maxParamLength = 100;
|
|
993
|
+
}
|
|
994
|
+
if(data22.allowUnsafeRegex === undefined){
|
|
995
|
+
data22.allowUnsafeRegex = false;
|
|
996
|
+
}
|
|
997
|
+
if(data22.useSemicolonDelimiter === undefined){
|
|
998
|
+
data22.useSemicolonDelimiter = false;
|
|
999
|
+
}
|
|
1000
|
+
let data23 = data22.ignoreTrailingSlash;
|
|
1001
|
+
const _errs70 = errors;
|
|
1002
|
+
if(typeof data23 !== "boolean"){
|
|
983
1003
|
let coerced25 = undefined;
|
|
984
1004
|
if(!(coerced25 !== undefined)){
|
|
985
|
-
if(
|
|
1005
|
+
if(data23 === "false" || data23 === 0 || data23 === null){
|
|
986
1006
|
coerced25 = false;
|
|
987
1007
|
}
|
|
988
|
-
else if(
|
|
1008
|
+
else if(data23 === "true" || data23 === 1){
|
|
989
1009
|
coerced25 = true;
|
|
990
1010
|
}
|
|
991
1011
|
else {
|
|
992
|
-
validate10.errors = [{instancePath:instancePath+"/
|
|
1012
|
+
validate10.errors = [{instancePath:instancePath+"/routerOptions/ignoreTrailingSlash",schemaPath:"#/properties/routerOptions/properties/ignoreTrailingSlash/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
993
1013
|
return false;
|
|
994
1014
|
}
|
|
995
1015
|
}
|
|
996
1016
|
if(coerced25 !== undefined){
|
|
997
|
-
|
|
998
|
-
if(
|
|
999
|
-
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
var valid0 = _errs67 === errors;
|
|
1004
|
-
if(valid0){
|
|
1005
|
-
if(data.routerOptions !== undefined){
|
|
1006
|
-
let data23 = data.routerOptions;
|
|
1007
|
-
const _errs69 = errors;
|
|
1008
|
-
if(errors === _errs69){
|
|
1009
|
-
if(data23 && typeof data23 == "object" && !Array.isArray(data23)){
|
|
1010
|
-
if(data23.ignoreTrailingSlash === undefined){
|
|
1011
|
-
data23.ignoreTrailingSlash = false;
|
|
1012
|
-
}
|
|
1013
|
-
if(data23.ignoreDuplicateSlashes === undefined){
|
|
1014
|
-
data23.ignoreDuplicateSlashes = false;
|
|
1015
|
-
}
|
|
1016
|
-
if(data23.maxParamLength === undefined){
|
|
1017
|
-
data23.maxParamLength = 100;
|
|
1018
|
-
}
|
|
1019
|
-
if(data23.allowUnsafeRegex === undefined){
|
|
1020
|
-
data23.allowUnsafeRegex = false;
|
|
1017
|
+
data23 = coerced25;
|
|
1018
|
+
if(data22 !== undefined){
|
|
1019
|
+
data22["ignoreTrailingSlash"] = coerced25;
|
|
1021
1020
|
}
|
|
1022
|
-
if(data23.useSemicolonDelimiter === undefined){
|
|
1023
|
-
data23.useSemicolonDelimiter = false;
|
|
1024
1021
|
}
|
|
1025
|
-
const _errs71 = errors;
|
|
1026
|
-
for(const key2 in data23){
|
|
1027
|
-
if(!(((((key2 === "ignoreTrailingSlash") || (key2 === "ignoreDuplicateSlashes")) || (key2 === "maxParamLength")) || (key2 === "allowUnsafeRegex")) || (key2 === "useSemicolonDelimiter"))){
|
|
1028
|
-
delete data23[key2];
|
|
1029
1022
|
}
|
|
1030
|
-
|
|
1031
|
-
if(
|
|
1032
|
-
let data24 =
|
|
1023
|
+
var valid7 = _errs70 === errors;
|
|
1024
|
+
if(valid7){
|
|
1025
|
+
let data24 = data22.ignoreDuplicateSlashes;
|
|
1033
1026
|
const _errs72 = errors;
|
|
1034
1027
|
if(typeof data24 !== "boolean"){
|
|
1035
1028
|
let coerced26 = undefined;
|
|
@@ -1041,69 +1034,69 @@ else if(data24 === "true" || data24 === 1){
|
|
|
1041
1034
|
coerced26 = true;
|
|
1042
1035
|
}
|
|
1043
1036
|
else {
|
|
1044
|
-
validate10.errors = [{instancePath:instancePath+"/routerOptions/
|
|
1037
|
+
validate10.errors = [{instancePath:instancePath+"/routerOptions/ignoreDuplicateSlashes",schemaPath:"#/properties/routerOptions/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
1045
1038
|
return false;
|
|
1046
1039
|
}
|
|
1047
1040
|
}
|
|
1048
1041
|
if(coerced26 !== undefined){
|
|
1049
1042
|
data24 = coerced26;
|
|
1050
|
-
if(
|
|
1051
|
-
|
|
1043
|
+
if(data22 !== undefined){
|
|
1044
|
+
data22["ignoreDuplicateSlashes"] = coerced26;
|
|
1052
1045
|
}
|
|
1053
1046
|
}
|
|
1054
1047
|
}
|
|
1055
1048
|
var valid7 = _errs72 === errors;
|
|
1056
1049
|
if(valid7){
|
|
1057
|
-
let data25 =
|
|
1050
|
+
let data25 = data22.maxParamLength;
|
|
1058
1051
|
const _errs74 = errors;
|
|
1059
|
-
if(typeof data25
|
|
1052
|
+
if(!(((typeof data25 == "number") && (!(data25 % 1) && !isNaN(data25))) && (isFinite(data25)))){
|
|
1053
|
+
let dataType27 = typeof data25;
|
|
1060
1054
|
let coerced27 = undefined;
|
|
1061
1055
|
if(!(coerced27 !== undefined)){
|
|
1062
|
-
if(
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
else if(data25 === "true" || data25 === 1){
|
|
1066
|
-
coerced27 = true;
|
|
1056
|
+
if(dataType27 === "boolean" || data25 === null
|
|
1057
|
+
|| (dataType27 === "string" && data25 && data25 == +data25 && !(data25 % 1))){
|
|
1058
|
+
coerced27 = +data25;
|
|
1067
1059
|
}
|
|
1068
1060
|
else {
|
|
1069
|
-
validate10.errors = [{instancePath:instancePath+"/routerOptions/
|
|
1061
|
+
validate10.errors = [{instancePath:instancePath+"/routerOptions/maxParamLength",schemaPath:"#/properties/routerOptions/properties/maxParamLength/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
1070
1062
|
return false;
|
|
1071
1063
|
}
|
|
1072
1064
|
}
|
|
1073
1065
|
if(coerced27 !== undefined){
|
|
1074
1066
|
data25 = coerced27;
|
|
1075
|
-
if(
|
|
1076
|
-
|
|
1067
|
+
if(data22 !== undefined){
|
|
1068
|
+
data22["maxParamLength"] = coerced27;
|
|
1077
1069
|
}
|
|
1078
1070
|
}
|
|
1079
1071
|
}
|
|
1080
1072
|
var valid7 = _errs74 === errors;
|
|
1081
1073
|
if(valid7){
|
|
1082
|
-
let data26 =
|
|
1074
|
+
let data26 = data22.allowUnsafeRegex;
|
|
1083
1075
|
const _errs76 = errors;
|
|
1084
|
-
if(
|
|
1085
|
-
let dataType28 = typeof data26;
|
|
1076
|
+
if(typeof data26 !== "boolean"){
|
|
1086
1077
|
let coerced28 = undefined;
|
|
1087
1078
|
if(!(coerced28 !== undefined)){
|
|
1088
|
-
if(
|
|
1089
|
-
|
|
1090
|
-
|
|
1079
|
+
if(data26 === "false" || data26 === 0 || data26 === null){
|
|
1080
|
+
coerced28 = false;
|
|
1081
|
+
}
|
|
1082
|
+
else if(data26 === "true" || data26 === 1){
|
|
1083
|
+
coerced28 = true;
|
|
1091
1084
|
}
|
|
1092
1085
|
else {
|
|
1093
|
-
validate10.errors = [{instancePath:instancePath+"/routerOptions/
|
|
1086
|
+
validate10.errors = [{instancePath:instancePath+"/routerOptions/allowUnsafeRegex",schemaPath:"#/properties/routerOptions/properties/allowUnsafeRegex/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
1094
1087
|
return false;
|
|
1095
1088
|
}
|
|
1096
1089
|
}
|
|
1097
1090
|
if(coerced28 !== undefined){
|
|
1098
1091
|
data26 = coerced28;
|
|
1099
|
-
if(
|
|
1100
|
-
|
|
1092
|
+
if(data22 !== undefined){
|
|
1093
|
+
data22["allowUnsafeRegex"] = coerced28;
|
|
1101
1094
|
}
|
|
1102
1095
|
}
|
|
1103
1096
|
}
|
|
1104
1097
|
var valid7 = _errs76 === errors;
|
|
1105
1098
|
if(valid7){
|
|
1106
|
-
let data27 =
|
|
1099
|
+
let data27 = data22.useSemicolonDelimiter;
|
|
1107
1100
|
const _errs78 = errors;
|
|
1108
1101
|
if(typeof data27 !== "boolean"){
|
|
1109
1102
|
let coerced29 = undefined;
|
|
@@ -1115,44 +1108,18 @@ else if(data27 === "true" || data27 === 1){
|
|
|
1115
1108
|
coerced29 = true;
|
|
1116
1109
|
}
|
|
1117
1110
|
else {
|
|
1118
|
-
validate10.errors = [{instancePath:instancePath+"/routerOptions/
|
|
1111
|
+
validate10.errors = [{instancePath:instancePath+"/routerOptions/useSemicolonDelimiter",schemaPath:"#/properties/routerOptions/properties/useSemicolonDelimiter/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
1119
1112
|
return false;
|
|
1120
1113
|
}
|
|
1121
1114
|
}
|
|
1122
1115
|
if(coerced29 !== undefined){
|
|
1123
1116
|
data27 = coerced29;
|
|
1124
|
-
if(
|
|
1125
|
-
|
|
1117
|
+
if(data22 !== undefined){
|
|
1118
|
+
data22["useSemicolonDelimiter"] = coerced29;
|
|
1126
1119
|
}
|
|
1127
1120
|
}
|
|
1128
1121
|
}
|
|
1129
1122
|
var valid7 = _errs78 === errors;
|
|
1130
|
-
if(valid7){
|
|
1131
|
-
let data28 = data23.useSemicolonDelimiter;
|
|
1132
|
-
const _errs80 = errors;
|
|
1133
|
-
if(typeof data28 !== "boolean"){
|
|
1134
|
-
let coerced30 = undefined;
|
|
1135
|
-
if(!(coerced30 !== undefined)){
|
|
1136
|
-
if(data28 === "false" || data28 === 0 || data28 === null){
|
|
1137
|
-
coerced30 = false;
|
|
1138
|
-
}
|
|
1139
|
-
else if(data28 === "true" || data28 === 1){
|
|
1140
|
-
coerced30 = true;
|
|
1141
|
-
}
|
|
1142
|
-
else {
|
|
1143
|
-
validate10.errors = [{instancePath:instancePath+"/routerOptions/useSemicolonDelimiter",schemaPath:"#/properties/routerOptions/properties/useSemicolonDelimiter/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
1144
|
-
return false;
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
if(coerced30 !== undefined){
|
|
1148
|
-
data28 = coerced30;
|
|
1149
|
-
if(data23 !== undefined){
|
|
1150
|
-
data23["useSemicolonDelimiter"] = coerced30;
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
var valid7 = _errs80 === errors;
|
|
1155
|
-
}
|
|
1156
1123
|
}
|
|
1157
1124
|
}
|
|
1158
1125
|
}
|
|
@@ -1163,49 +1130,49 @@ validate10.errors = [{instancePath:instancePath+"/routerOptions",schemaPath:"#/p
|
|
|
1163
1130
|
return false;
|
|
1164
1131
|
}
|
|
1165
1132
|
}
|
|
1166
|
-
var valid0 =
|
|
1133
|
+
var valid0 = _errs67 === errors;
|
|
1167
1134
|
}
|
|
1168
1135
|
else {
|
|
1169
1136
|
var valid0 = true;
|
|
1170
1137
|
}
|
|
1171
1138
|
if(valid0){
|
|
1172
1139
|
if(data.constraints !== undefined){
|
|
1173
|
-
let
|
|
1174
|
-
const
|
|
1175
|
-
if(errors ===
|
|
1140
|
+
let data28 = data.constraints;
|
|
1141
|
+
const _errs80 = errors;
|
|
1142
|
+
if(errors === _errs80){
|
|
1143
|
+
if(data28 && typeof data28 == "object" && !Array.isArray(data28)){
|
|
1144
|
+
for(const key2 in data28){
|
|
1145
|
+
let data29 = data28[key2];
|
|
1146
|
+
const _errs83 = errors;
|
|
1147
|
+
if(errors === _errs83){
|
|
1176
1148
|
if(data29 && typeof data29 == "object" && !Array.isArray(data29)){
|
|
1177
|
-
for(const key3 in data29){
|
|
1178
|
-
let data30 = data29[key3];
|
|
1179
|
-
const _errs85 = errors;
|
|
1180
|
-
if(errors === _errs85){
|
|
1181
|
-
if(data30 && typeof data30 == "object" && !Array.isArray(data30)){
|
|
1182
1149
|
let missing1;
|
|
1183
|
-
if(((((
|
|
1184
|
-
validate10.errors = [{instancePath:instancePath+"/constraints/" +
|
|
1150
|
+
if(((((data29.name === undefined) && (missing1 = "name")) || ((data29.storage === undefined) && (missing1 = "storage"))) || ((data29.validate === undefined) && (missing1 = "validate"))) || ((data29.deriveConstraint === undefined) && (missing1 = "deriveConstraint"))){
|
|
1151
|
+
validate10.errors = [{instancePath:instancePath+"/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/constraints/additionalProperties/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];
|
|
1185
1152
|
return false;
|
|
1186
1153
|
}
|
|
1187
1154
|
else {
|
|
1188
|
-
if(
|
|
1189
|
-
let
|
|
1190
|
-
if(typeof
|
|
1191
|
-
let
|
|
1192
|
-
let
|
|
1193
|
-
if(!(
|
|
1194
|
-
if(
|
|
1195
|
-
|
|
1155
|
+
if(data29.name !== undefined){
|
|
1156
|
+
let data30 = data29.name;
|
|
1157
|
+
if(typeof data30 !== "string"){
|
|
1158
|
+
let dataType30 = typeof data30;
|
|
1159
|
+
let coerced30 = undefined;
|
|
1160
|
+
if(!(coerced30 !== undefined)){
|
|
1161
|
+
if(dataType30 == "number" || dataType30 == "boolean"){
|
|
1162
|
+
coerced30 = "" + data30;
|
|
1196
1163
|
}
|
|
1197
|
-
else if(
|
|
1198
|
-
|
|
1164
|
+
else if(data30 === null){
|
|
1165
|
+
coerced30 = "";
|
|
1199
1166
|
}
|
|
1200
1167
|
else {
|
|
1201
|
-
validate10.errors = [{instancePath:instancePath+"/constraints/" +
|
|
1168
|
+
validate10.errors = [{instancePath:instancePath+"/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/name",schemaPath:"#/properties/constraints/additionalProperties/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"}];
|
|
1202
1169
|
return false;
|
|
1203
1170
|
}
|
|
1204
1171
|
}
|
|
1205
|
-
if(
|
|
1206
|
-
|
|
1207
|
-
if(
|
|
1208
|
-
|
|
1172
|
+
if(coerced30 !== undefined){
|
|
1173
|
+
data30 = coerced30;
|
|
1174
|
+
if(data29 !== undefined){
|
|
1175
|
+
data29["name"] = coerced30;
|
|
1209
1176
|
}
|
|
1210
1177
|
}
|
|
1211
1178
|
}
|
|
@@ -1213,11 +1180,11 @@ data30["name"] = coerced31;
|
|
|
1213
1180
|
}
|
|
1214
1181
|
}
|
|
1215
1182
|
else {
|
|
1216
|
-
validate10.errors = [{instancePath:instancePath+"/constraints/" +
|
|
1183
|
+
validate10.errors = [{instancePath:instancePath+"/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/constraints/additionalProperties/type",keyword:"type",params:{type: "object"},message:"must be object"}];
|
|
1217
1184
|
return false;
|
|
1218
1185
|
}
|
|
1219
1186
|
}
|
|
1220
|
-
var valid8 =
|
|
1187
|
+
var valid8 = _errs83 === errors;
|
|
1221
1188
|
if(!valid8){
|
|
1222
1189
|
break;
|
|
1223
1190
|
}
|
|
@@ -1228,7 +1195,7 @@ validate10.errors = [{instancePath:instancePath+"/constraints",schemaPath:"#/pro
|
|
|
1228
1195
|
return false;
|
|
1229
1196
|
}
|
|
1230
1197
|
}
|
|
1231
|
-
var valid0 =
|
|
1198
|
+
var valid0 = _errs80 === errors;
|
|
1232
1199
|
}
|
|
1233
1200
|
else {
|
|
1234
1201
|
var valid0 = true;
|
|
@@ -1257,7 +1224,6 @@ var valid0 = true;
|
|
|
1257
1224
|
}
|
|
1258
1225
|
}
|
|
1259
1226
|
}
|
|
1260
|
-
}
|
|
1261
1227
|
else {
|
|
1262
1228
|
validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];
|
|
1263
1229
|
return false;
|