fastify 3.21.6 → 3.23.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/build/build-validation.js +4 -0
- package/docs/Ecosystem.md +1 -0
- package/docs/Hooks.md +2 -2
- package/docs/Recommendations.md +55 -19
- package/docs/Request.md +1 -1
- package/docs/Server.md +27 -3
- package/docs/TypeScript.md +3 -0
- package/docs/Validation-and-Serialization.md +10 -2
- package/fastify.d.ts +15 -0
- package/fastify.js +5 -2
- package/lib/configValidator.js +498 -433
- package/lib/logger.js +1 -1
- package/lib/reply.js +4 -2
- package/lib/request.js +9 -3
- package/lib/schema-controller.js +11 -2
- package/lib/server.js +7 -0
- package/out +431 -0
- package/package.json +3 -4
- package/test/bundler/README.md +7 -7
- package/test/internals/initialConfig.test.js +4 -0
- package/test/internals/logger.test.js +20 -0
- package/test/internals/reply.test.js +1 -1
- package/test/internals/request.test.js +47 -0
- package/test/maxRequestsPerSocket.test.js +104 -0
- package/test/reply-error.test.js +28 -0
- package/test/requestTimeout.test.js +50 -0
- package/test/schema-feature.test.js +315 -0
- package/test/schema-special-usage.test.js +1 -1
- package/test/stream.test.js +2 -2
- package/test/types/content-type-parser.test-d.ts +1 -1
- package/test/types/fastify.test-d.ts +15 -0
- package/test/types/instance.test-d.ts +1 -1
- package/test/types/logger.test-d.ts +1 -1
- package/test/types/register.test-d.ts +13 -1
- package/types/register.d.ts +2 -1
package/lib/configValidator.js
CHANGED
|
@@ -14,6 +14,8 @@ var validate = (function() {
|
|
|
14
14
|
if ((data && typeof data === "object" && !Array.isArray(data))) {
|
|
15
15
|
if (data.connectionTimeout === undefined) data.connectionTimeout = 0;
|
|
16
16
|
if (data.keepAliveTimeout === undefined) data.keepAliveTimeout = 5000;
|
|
17
|
+
if (data.maxRequestsPerSocket === undefined) data.maxRequestsPerSocket = 0;
|
|
18
|
+
if (data.requestTimeout === undefined) data.requestTimeout = 0;
|
|
17
19
|
if (data.bodyLimit === undefined) data.bodyLimit = 1048576;
|
|
18
20
|
if (data.caseSensitive === undefined) data.caseSensitive = true;
|
|
19
21
|
if (data.ignoreTrailingSlash === undefined) data.ignoreTrailingSlash = false;
|
|
@@ -87,7 +89,7 @@ var validate = (function() {
|
|
|
87
89
|
}
|
|
88
90
|
var valid1 = errors === errs_1;
|
|
89
91
|
if (valid1) {
|
|
90
|
-
var data1 = data.
|
|
92
|
+
var data1 = data.maxRequestsPerSocket;
|
|
91
93
|
var errs_1 = errors;
|
|
92
94
|
if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
|
93
95
|
var dataType1 = typeof data1;
|
|
@@ -97,8 +99,8 @@ var validate = (function() {
|
|
|
97
99
|
else {
|
|
98
100
|
validate.errors = [{
|
|
99
101
|
keyword: 'type',
|
|
100
|
-
dataPath: (dataPath || '') + '.
|
|
101
|
-
schemaPath: '#/properties/
|
|
102
|
+
dataPath: (dataPath || '') + '.maxRequestsPerSocket',
|
|
103
|
+
schemaPath: '#/properties/maxRequestsPerSocket/type',
|
|
102
104
|
params: {
|
|
103
105
|
type: 'integer'
|
|
104
106
|
},
|
|
@@ -108,42 +110,64 @@ var validate = (function() {
|
|
|
108
110
|
}
|
|
109
111
|
if (coerced1 !== undefined) {
|
|
110
112
|
data1 = coerced1;
|
|
111
|
-
data['
|
|
113
|
+
data['maxRequestsPerSocket'] = coerced1;
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
var valid1 = errors === errs_1;
|
|
115
117
|
if (valid1) {
|
|
116
|
-
var data1 = data.
|
|
118
|
+
var data1 = data.requestTimeout;
|
|
117
119
|
var errs_1 = errors;
|
|
118
|
-
if (typeof data1 !== "
|
|
120
|
+
if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
|
119
121
|
var dataType1 = typeof data1;
|
|
120
122
|
var coerced1 = undefined;
|
|
121
123
|
if (coerced1 !== undefined);
|
|
122
|
-
else if (
|
|
123
|
-
else if (data1 === 'true' || data1 === 1) coerced1 = true;
|
|
124
|
+
else if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
|
124
125
|
else {
|
|
125
126
|
validate.errors = [{
|
|
126
127
|
keyword: 'type',
|
|
127
|
-
dataPath: (dataPath || '') + '.
|
|
128
|
-
schemaPath: '#/properties/
|
|
128
|
+
dataPath: (dataPath || '') + '.requestTimeout',
|
|
129
|
+
schemaPath: '#/properties/requestTimeout/type',
|
|
129
130
|
params: {
|
|
130
|
-
type: '
|
|
131
|
+
type: 'integer'
|
|
131
132
|
},
|
|
132
|
-
message: 'should be
|
|
133
|
+
message: 'should be integer'
|
|
133
134
|
}];
|
|
134
135
|
return false;
|
|
135
136
|
}
|
|
136
137
|
if (coerced1 !== undefined) {
|
|
137
138
|
data1 = coerced1;
|
|
138
|
-
data['
|
|
139
|
+
data['requestTimeout'] = coerced1;
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
142
|
var valid1 = errors === errs_1;
|
|
142
143
|
if (valid1) {
|
|
143
|
-
var data1 = data.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
var data1 = data.bodyLimit;
|
|
145
|
+
var errs_1 = errors;
|
|
146
|
+
if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
|
147
|
+
var dataType1 = typeof data1;
|
|
148
|
+
var coerced1 = undefined;
|
|
149
|
+
if (coerced1 !== undefined);
|
|
150
|
+
else if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
|
151
|
+
else {
|
|
152
|
+
validate.errors = [{
|
|
153
|
+
keyword: 'type',
|
|
154
|
+
dataPath: (dataPath || '') + '.bodyLimit',
|
|
155
|
+
schemaPath: '#/properties/bodyLimit/type',
|
|
156
|
+
params: {
|
|
157
|
+
type: 'integer'
|
|
158
|
+
},
|
|
159
|
+
message: 'should be integer'
|
|
160
|
+
}];
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
if (coerced1 !== undefined) {
|
|
164
|
+
data1 = coerced1;
|
|
165
|
+
data['bodyLimit'] = coerced1;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
var valid1 = errors === errs_1;
|
|
169
|
+
if (valid1) {
|
|
170
|
+
var data1 = data.caseSensitive;
|
|
147
171
|
var errs_1 = errors;
|
|
148
172
|
if (typeof data1 !== "boolean") {
|
|
149
173
|
var dataType1 = typeof data1;
|
|
@@ -154,8 +178,8 @@ var validate = (function() {
|
|
|
154
178
|
else {
|
|
155
179
|
validate.errors = [{
|
|
156
180
|
keyword: 'type',
|
|
157
|
-
dataPath: (dataPath || '') + '.
|
|
158
|
-
schemaPath: '#/properties/
|
|
181
|
+
dataPath: (dataPath || '') + '.caseSensitive',
|
|
182
|
+
schemaPath: '#/properties/caseSensitive/type',
|
|
159
183
|
params: {
|
|
160
184
|
type: 'boolean'
|
|
161
185
|
},
|
|
@@ -165,241 +189,15 @@ var validate = (function() {
|
|
|
165
189
|
}
|
|
166
190
|
if (coerced1 !== undefined) {
|
|
167
191
|
data1 = coerced1;
|
|
168
|
-
data['
|
|
192
|
+
data['caseSensitive'] = coerced1;
|
|
169
193
|
}
|
|
170
194
|
}
|
|
171
195
|
var valid1 = errors === errs_1;
|
|
172
|
-
}
|
|
173
|
-
if (valid1) {
|
|
174
|
-
var data1 = data.https;
|
|
175
|
-
if (data1 === undefined) {
|
|
176
|
-
valid1 = true;
|
|
177
|
-
} else {
|
|
178
|
-
var errs_1 = errors;
|
|
179
|
-
var errs__1 = errors;
|
|
180
|
-
var valid1 = true;
|
|
181
|
-
var errs_2 = errors;
|
|
182
|
-
var errs__2 = errors;
|
|
183
|
-
var errs_3 = errors;
|
|
184
|
-
var errs__3 = errors,
|
|
185
|
-
prevValid3 = false,
|
|
186
|
-
valid3 = false,
|
|
187
|
-
passingSchemas3 = null;
|
|
188
|
-
var errs_4 = errors;
|
|
189
|
-
if (typeof data1 !== "boolean") {
|
|
190
|
-
var dataType4 = typeof data1;
|
|
191
|
-
var coerced4 = undefined;
|
|
192
|
-
if (coerced4 !== undefined);
|
|
193
|
-
else if (data1 === 'false' || data1 === 0 || data1 === null) coerced4 = false;
|
|
194
|
-
else if (data1 === 'true' || data1 === 1) coerced4 = true;
|
|
195
|
-
else {
|
|
196
|
-
var err = {};
|
|
197
|
-
if (vErrors === null) vErrors = [err];
|
|
198
|
-
else vErrors.push(err);
|
|
199
|
-
errors++;
|
|
200
|
-
}
|
|
201
|
-
if (coerced4 !== undefined) {
|
|
202
|
-
data1 = coerced4;
|
|
203
|
-
data['https'] = coerced4;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
var valid4 = errors === errs_4;
|
|
207
|
-
if (valid4) {
|
|
208
|
-
valid3 = prevValid3 = true;
|
|
209
|
-
passingSchemas3 = 0;
|
|
210
|
-
}
|
|
211
|
-
var errs_4 = errors;
|
|
212
|
-
if (data1 !== null) {
|
|
213
|
-
var dataType4 = typeof data1;
|
|
214
|
-
var coerced4 = undefined;
|
|
215
|
-
if (coerced4 !== undefined);
|
|
216
|
-
else if (data1 === '' || data1 === 0 || data1 === false) coerced4 = null;
|
|
217
|
-
else {
|
|
218
|
-
var err = {};
|
|
219
|
-
if (vErrors === null) vErrors = [err];
|
|
220
|
-
else vErrors.push(err);
|
|
221
|
-
errors++;
|
|
222
|
-
}
|
|
223
|
-
if (coerced4 !== undefined) {
|
|
224
|
-
data1 = coerced4;
|
|
225
|
-
data['https'] = coerced4;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
var valid4 = errors === errs_4;
|
|
229
|
-
if (valid4 && prevValid3) {
|
|
230
|
-
valid3 = false;
|
|
231
|
-
passingSchemas3 = [passingSchemas3, 1];
|
|
232
|
-
} else {
|
|
233
|
-
if (valid4) {
|
|
234
|
-
valid3 = prevValid3 = true;
|
|
235
|
-
passingSchemas3 = 1;
|
|
236
|
-
}
|
|
237
|
-
var errs_4 = errors;
|
|
238
|
-
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
|
|
239
|
-
if (true) {
|
|
240
|
-
var errs__4 = errors;
|
|
241
|
-
var valid5 = true;
|
|
242
|
-
for (var key4 in data1) {
|
|
243
|
-
var isAdditional4 = !(false || key4 == 'allowHTTP1');
|
|
244
|
-
if (isAdditional4) {
|
|
245
|
-
delete data1[key4];
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
if (valid5) {
|
|
249
|
-
var data2 = data1.allowHTTP1;
|
|
250
|
-
if (data2 === undefined) {
|
|
251
|
-
valid5 = false;
|
|
252
|
-
var err = {};
|
|
253
|
-
if (vErrors === null) vErrors = [err];
|
|
254
|
-
else vErrors.push(err);
|
|
255
|
-
errors++;
|
|
256
|
-
} else {
|
|
257
|
-
var errs_5 = errors;
|
|
258
|
-
if (typeof data2 !== "boolean") {
|
|
259
|
-
var dataType5 = typeof data2;
|
|
260
|
-
var coerced5 = undefined;
|
|
261
|
-
if (coerced5 !== undefined);
|
|
262
|
-
else if (data2 === 'false' || data2 === 0 || data2 === null) coerced5 = false;
|
|
263
|
-
else if (data2 === 'true' || data2 === 1) coerced5 = true;
|
|
264
|
-
else {
|
|
265
|
-
var err = {};
|
|
266
|
-
if (vErrors === null) vErrors = [err];
|
|
267
|
-
else vErrors.push(err);
|
|
268
|
-
errors++;
|
|
269
|
-
}
|
|
270
|
-
if (coerced5 !== undefined) {
|
|
271
|
-
data2 = coerced5;
|
|
272
|
-
data1['allowHTTP1'] = coerced5;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
var valid5 = errors === errs_5;
|
|
276
|
-
}
|
|
277
|
-
if (valid5) {}
|
|
278
|
-
}
|
|
279
|
-
if (errs__4 == errors) {}
|
|
280
|
-
}
|
|
281
|
-
} else {
|
|
282
|
-
var err = {};
|
|
283
|
-
if (vErrors === null) vErrors = [err];
|
|
284
|
-
else vErrors.push(err);
|
|
285
|
-
errors++;
|
|
286
|
-
}
|
|
287
|
-
if (errors === errs_4) {}
|
|
288
|
-
var valid4 = errors === errs_4;
|
|
289
|
-
if (valid4 && prevValid3) {
|
|
290
|
-
valid3 = false;
|
|
291
|
-
passingSchemas3 = [passingSchemas3, 2];
|
|
292
|
-
} else {
|
|
293
|
-
if (valid4) {
|
|
294
|
-
valid3 = prevValid3 = true;
|
|
295
|
-
passingSchemas3 = 2;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
if (!valid3) {
|
|
300
|
-
var err = {};
|
|
301
|
-
if (vErrors === null) vErrors = [err];
|
|
302
|
-
else vErrors.push(err);
|
|
303
|
-
errors++;
|
|
304
|
-
} else {
|
|
305
|
-
errors = errs__3;
|
|
306
|
-
if (vErrors !== null) {
|
|
307
|
-
if (errs__3) vErrors.length = errs__3;
|
|
308
|
-
else vErrors = null;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
if (errors === errs_3) {}
|
|
312
|
-
var valid3 = errors === errs_3;
|
|
313
|
-
if (valid3) {
|
|
314
|
-
var err = {};
|
|
315
|
-
if (vErrors === null) vErrors = [err];
|
|
316
|
-
else vErrors.push(err);
|
|
317
|
-
errors++;
|
|
318
|
-
} else {
|
|
319
|
-
errors = errs__2;
|
|
320
|
-
if (vErrors !== null) {
|
|
321
|
-
if (errs__2) vErrors.length = errs__2;
|
|
322
|
-
else vErrors = null;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
if (errors === errs_2) {}
|
|
326
|
-
var valid2 = errors === errs_2;
|
|
327
|
-
errors = errs__1;
|
|
328
|
-
if (vErrors !== null) {
|
|
329
|
-
if (errs__1) vErrors.length = errs__1;
|
|
330
|
-
else vErrors = null;
|
|
331
|
-
}
|
|
332
|
-
if (valid2) {
|
|
333
|
-
var errs_2 = errors;
|
|
334
|
-
customRule0.errors = null;
|
|
335
|
-
var errs__2 = errors;
|
|
336
|
-
var valid2;
|
|
337
|
-
valid2 = customRule0.call(self, validate.schema.properties.https.then.setDefaultValue, data1, validate.schema.properties.https.then, (dataPath || '') + '.https', data, 'https', rootData);
|
|
338
|
-
if (data) data1 = data['https'];
|
|
339
|
-
if (!valid2) {
|
|
340
|
-
validate.errors = [{
|
|
341
|
-
keyword: 'setDefaultValue',
|
|
342
|
-
dataPath: (dataPath || '') + '.https',
|
|
343
|
-
schemaPath: '#/properties/https/then/setDefaultValue',
|
|
344
|
-
params: {
|
|
345
|
-
keyword: 'setDefaultValue'
|
|
346
|
-
},
|
|
347
|
-
message: 'should pass "setDefaultValue" keyword validation'
|
|
348
|
-
}];
|
|
349
|
-
return false;
|
|
350
|
-
} else {}
|
|
351
|
-
if (errors === errs_2) {}
|
|
352
|
-
var valid2 = errors === errs_2;
|
|
353
|
-
valid1 = valid2;
|
|
354
|
-
}
|
|
355
|
-
if (!valid1) {
|
|
356
|
-
var err = {
|
|
357
|
-
keyword: 'if',
|
|
358
|
-
dataPath: (dataPath || '') + '.https',
|
|
359
|
-
schemaPath: '#/properties/https/if',
|
|
360
|
-
params: {
|
|
361
|
-
failingKeyword: 'then'
|
|
362
|
-
},
|
|
363
|
-
message: 'should match "' + 'then' + '" schema'
|
|
364
|
-
};
|
|
365
|
-
if (vErrors === null) vErrors = [err];
|
|
366
|
-
else vErrors.push(err);
|
|
367
|
-
errors++;
|
|
368
|
-
validate.errors = vErrors;
|
|
369
|
-
return false;
|
|
370
|
-
} else {}
|
|
371
|
-
if (errors === errs_1) {}
|
|
372
|
-
var valid1 = errors === errs_1;
|
|
373
|
-
}
|
|
374
196
|
if (valid1) {
|
|
375
|
-
var data1 = data.
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
var coerced1 = undefined;
|
|
380
|
-
if (coerced1 !== undefined);
|
|
381
|
-
else if (data1 === 'false' || data1 === 0 || data1 === null) coerced1 = false;
|
|
382
|
-
else if (data1 === 'true' || data1 === 1) coerced1 = true;
|
|
383
|
-
else {
|
|
384
|
-
validate.errors = [{
|
|
385
|
-
keyword: 'type',
|
|
386
|
-
dataPath: (dataPath || '') + '.ignoreTrailingSlash',
|
|
387
|
-
schemaPath: '#/properties/ignoreTrailingSlash/type',
|
|
388
|
-
params: {
|
|
389
|
-
type: 'boolean'
|
|
390
|
-
},
|
|
391
|
-
message: 'should be boolean'
|
|
392
|
-
}];
|
|
393
|
-
return false;
|
|
394
|
-
}
|
|
395
|
-
if (coerced1 !== undefined) {
|
|
396
|
-
data1 = coerced1;
|
|
397
|
-
data['ignoreTrailingSlash'] = coerced1;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
var valid1 = errors === errs_1;
|
|
401
|
-
if (valid1) {
|
|
402
|
-
var data1 = data.disableRequestLogging;
|
|
197
|
+
var data1 = data.http2;
|
|
198
|
+
if (data1 === undefined) {
|
|
199
|
+
valid1 = true;
|
|
200
|
+
} else {
|
|
403
201
|
var errs_1 = errors;
|
|
404
202
|
if (typeof data1 !== "boolean") {
|
|
405
203
|
var dataType1 = typeof data1;
|
|
@@ -410,8 +208,8 @@ var validate = (function() {
|
|
|
410
208
|
else {
|
|
411
209
|
validate.errors = [{
|
|
412
210
|
keyword: 'type',
|
|
413
|
-
dataPath: (dataPath || '') + '.
|
|
414
|
-
schemaPath: '#/properties/
|
|
211
|
+
dataPath: (dataPath || '') + '.http2',
|
|
212
|
+
schemaPath: '#/properties/http2/type',
|
|
415
213
|
params: {
|
|
416
214
|
type: 'boolean'
|
|
417
215
|
},
|
|
@@ -421,12 +219,214 @@ var validate = (function() {
|
|
|
421
219
|
}
|
|
422
220
|
if (coerced1 !== undefined) {
|
|
423
221
|
data1 = coerced1;
|
|
424
|
-
data['
|
|
222
|
+
data['http2'] = coerced1;
|
|
425
223
|
}
|
|
426
224
|
}
|
|
427
225
|
var valid1 = errors === errs_1;
|
|
226
|
+
}
|
|
227
|
+
if (valid1) {
|
|
228
|
+
var data1 = data.https;
|
|
229
|
+
if (data1 === undefined) {
|
|
230
|
+
valid1 = true;
|
|
231
|
+
} else {
|
|
232
|
+
var errs_1 = errors;
|
|
233
|
+
var errs__1 = errors;
|
|
234
|
+
var valid1 = true;
|
|
235
|
+
var errs_2 = errors;
|
|
236
|
+
var errs__2 = errors;
|
|
237
|
+
var errs_3 = errors;
|
|
238
|
+
var errs__3 = errors,
|
|
239
|
+
prevValid3 = false,
|
|
240
|
+
valid3 = false,
|
|
241
|
+
passingSchemas3 = null;
|
|
242
|
+
var errs_4 = errors;
|
|
243
|
+
if (typeof data1 !== "boolean") {
|
|
244
|
+
var dataType4 = typeof data1;
|
|
245
|
+
var coerced4 = undefined;
|
|
246
|
+
if (coerced4 !== undefined);
|
|
247
|
+
else if (data1 === 'false' || data1 === 0 || data1 === null) coerced4 = false;
|
|
248
|
+
else if (data1 === 'true' || data1 === 1) coerced4 = true;
|
|
249
|
+
else {
|
|
250
|
+
var err = {};
|
|
251
|
+
if (vErrors === null) vErrors = [err];
|
|
252
|
+
else vErrors.push(err);
|
|
253
|
+
errors++;
|
|
254
|
+
}
|
|
255
|
+
if (coerced4 !== undefined) {
|
|
256
|
+
data1 = coerced4;
|
|
257
|
+
data['https'] = coerced4;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
var valid4 = errors === errs_4;
|
|
261
|
+
if (valid4) {
|
|
262
|
+
valid3 = prevValid3 = true;
|
|
263
|
+
passingSchemas3 = 0;
|
|
264
|
+
}
|
|
265
|
+
var errs_4 = errors;
|
|
266
|
+
if (data1 !== null) {
|
|
267
|
+
var dataType4 = typeof data1;
|
|
268
|
+
var coerced4 = undefined;
|
|
269
|
+
if (coerced4 !== undefined);
|
|
270
|
+
else if (data1 === '' || data1 === 0 || data1 === false) coerced4 = null;
|
|
271
|
+
else {
|
|
272
|
+
var err = {};
|
|
273
|
+
if (vErrors === null) vErrors = [err];
|
|
274
|
+
else vErrors.push(err);
|
|
275
|
+
errors++;
|
|
276
|
+
}
|
|
277
|
+
if (coerced4 !== undefined) {
|
|
278
|
+
data1 = coerced4;
|
|
279
|
+
data['https'] = coerced4;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
var valid4 = errors === errs_4;
|
|
283
|
+
if (valid4 && prevValid3) {
|
|
284
|
+
valid3 = false;
|
|
285
|
+
passingSchemas3 = [passingSchemas3, 1];
|
|
286
|
+
} else {
|
|
287
|
+
if (valid4) {
|
|
288
|
+
valid3 = prevValid3 = true;
|
|
289
|
+
passingSchemas3 = 1;
|
|
290
|
+
}
|
|
291
|
+
var errs_4 = errors;
|
|
292
|
+
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
|
|
293
|
+
if (true) {
|
|
294
|
+
var errs__4 = errors;
|
|
295
|
+
var valid5 = true;
|
|
296
|
+
for (var key4 in data1) {
|
|
297
|
+
var isAdditional4 = !(false || key4 == 'allowHTTP1');
|
|
298
|
+
if (isAdditional4) {
|
|
299
|
+
delete data1[key4];
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
if (valid5) {
|
|
303
|
+
var data2 = data1.allowHTTP1;
|
|
304
|
+
if (data2 === undefined) {
|
|
305
|
+
valid5 = false;
|
|
306
|
+
var err = {};
|
|
307
|
+
if (vErrors === null) vErrors = [err];
|
|
308
|
+
else vErrors.push(err);
|
|
309
|
+
errors++;
|
|
310
|
+
} else {
|
|
311
|
+
var errs_5 = errors;
|
|
312
|
+
if (typeof data2 !== "boolean") {
|
|
313
|
+
var dataType5 = typeof data2;
|
|
314
|
+
var coerced5 = undefined;
|
|
315
|
+
if (coerced5 !== undefined);
|
|
316
|
+
else if (data2 === 'false' || data2 === 0 || data2 === null) coerced5 = false;
|
|
317
|
+
else if (data2 === 'true' || data2 === 1) coerced5 = true;
|
|
318
|
+
else {
|
|
319
|
+
var err = {};
|
|
320
|
+
if (vErrors === null) vErrors = [err];
|
|
321
|
+
else vErrors.push(err);
|
|
322
|
+
errors++;
|
|
323
|
+
}
|
|
324
|
+
if (coerced5 !== undefined) {
|
|
325
|
+
data2 = coerced5;
|
|
326
|
+
data1['allowHTTP1'] = coerced5;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
var valid5 = errors === errs_5;
|
|
330
|
+
}
|
|
331
|
+
if (valid5) {}
|
|
332
|
+
}
|
|
333
|
+
if (errs__4 == errors) {}
|
|
334
|
+
}
|
|
335
|
+
} else {
|
|
336
|
+
var err = {};
|
|
337
|
+
if (vErrors === null) vErrors = [err];
|
|
338
|
+
else vErrors.push(err);
|
|
339
|
+
errors++;
|
|
340
|
+
}
|
|
341
|
+
if (errors === errs_4) {}
|
|
342
|
+
var valid4 = errors === errs_4;
|
|
343
|
+
if (valid4 && prevValid3) {
|
|
344
|
+
valid3 = false;
|
|
345
|
+
passingSchemas3 = [passingSchemas3, 2];
|
|
346
|
+
} else {
|
|
347
|
+
if (valid4) {
|
|
348
|
+
valid3 = prevValid3 = true;
|
|
349
|
+
passingSchemas3 = 2;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
if (!valid3) {
|
|
354
|
+
var err = {};
|
|
355
|
+
if (vErrors === null) vErrors = [err];
|
|
356
|
+
else vErrors.push(err);
|
|
357
|
+
errors++;
|
|
358
|
+
} else {
|
|
359
|
+
errors = errs__3;
|
|
360
|
+
if (vErrors !== null) {
|
|
361
|
+
if (errs__3) vErrors.length = errs__3;
|
|
362
|
+
else vErrors = null;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
if (errors === errs_3) {}
|
|
366
|
+
var valid3 = errors === errs_3;
|
|
367
|
+
if (valid3) {
|
|
368
|
+
var err = {};
|
|
369
|
+
if (vErrors === null) vErrors = [err];
|
|
370
|
+
else vErrors.push(err);
|
|
371
|
+
errors++;
|
|
372
|
+
} else {
|
|
373
|
+
errors = errs__2;
|
|
374
|
+
if (vErrors !== null) {
|
|
375
|
+
if (errs__2) vErrors.length = errs__2;
|
|
376
|
+
else vErrors = null;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
if (errors === errs_2) {}
|
|
380
|
+
var valid2 = errors === errs_2;
|
|
381
|
+
errors = errs__1;
|
|
382
|
+
if (vErrors !== null) {
|
|
383
|
+
if (errs__1) vErrors.length = errs__1;
|
|
384
|
+
else vErrors = null;
|
|
385
|
+
}
|
|
386
|
+
if (valid2) {
|
|
387
|
+
var errs_2 = errors;
|
|
388
|
+
customRule0.errors = null;
|
|
389
|
+
var errs__2 = errors;
|
|
390
|
+
var valid2;
|
|
391
|
+
valid2 = customRule0.call(self, validate.schema.properties.https.then.setDefaultValue, data1, validate.schema.properties.https.then, (dataPath || '') + '.https', data, 'https', rootData);
|
|
392
|
+
if (data) data1 = data['https'];
|
|
393
|
+
if (!valid2) {
|
|
394
|
+
validate.errors = [{
|
|
395
|
+
keyword: 'setDefaultValue',
|
|
396
|
+
dataPath: (dataPath || '') + '.https',
|
|
397
|
+
schemaPath: '#/properties/https/then/setDefaultValue',
|
|
398
|
+
params: {
|
|
399
|
+
keyword: 'setDefaultValue'
|
|
400
|
+
},
|
|
401
|
+
message: 'should pass "setDefaultValue" keyword validation'
|
|
402
|
+
}];
|
|
403
|
+
return false;
|
|
404
|
+
} else {}
|
|
405
|
+
if (errors === errs_2) {}
|
|
406
|
+
var valid2 = errors === errs_2;
|
|
407
|
+
valid1 = valid2;
|
|
408
|
+
}
|
|
409
|
+
if (!valid1) {
|
|
410
|
+
var err = {
|
|
411
|
+
keyword: 'if',
|
|
412
|
+
dataPath: (dataPath || '') + '.https',
|
|
413
|
+
schemaPath: '#/properties/https/if',
|
|
414
|
+
params: {
|
|
415
|
+
failingKeyword: 'then'
|
|
416
|
+
},
|
|
417
|
+
message: 'should match "' + 'then' + '" schema'
|
|
418
|
+
};
|
|
419
|
+
if (vErrors === null) vErrors = [err];
|
|
420
|
+
else vErrors.push(err);
|
|
421
|
+
errors++;
|
|
422
|
+
validate.errors = vErrors;
|
|
423
|
+
return false;
|
|
424
|
+
} else {}
|
|
425
|
+
if (errors === errs_1) {}
|
|
426
|
+
var valid1 = errors === errs_1;
|
|
427
|
+
}
|
|
428
428
|
if (valid1) {
|
|
429
|
-
var data1 = data.
|
|
429
|
+
var data1 = data.ignoreTrailingSlash;
|
|
430
430
|
var errs_1 = errors;
|
|
431
431
|
if (typeof data1 !== "boolean") {
|
|
432
432
|
var dataType1 = typeof data1;
|
|
@@ -437,8 +437,8 @@ var validate = (function() {
|
|
|
437
437
|
else {
|
|
438
438
|
validate.errors = [{
|
|
439
439
|
keyword: 'type',
|
|
440
|
-
dataPath: (dataPath || '') + '.
|
|
441
|
-
schemaPath: '#/properties/
|
|
440
|
+
dataPath: (dataPath || '') + '.ignoreTrailingSlash',
|
|
441
|
+
schemaPath: '#/properties/ignoreTrailingSlash/type',
|
|
442
442
|
params: {
|
|
443
443
|
type: 'boolean'
|
|
444
444
|
},
|
|
@@ -448,118 +448,119 @@ var validate = (function() {
|
|
|
448
448
|
}
|
|
449
449
|
if (coerced1 !== undefined) {
|
|
450
450
|
data1 = coerced1;
|
|
451
|
-
data['
|
|
451
|
+
data['ignoreTrailingSlash'] = coerced1;
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
var valid1 = errors === errs_1;
|
|
455
455
|
if (valid1) {
|
|
456
|
-
var data1 = data.
|
|
456
|
+
var data1 = data.disableRequestLogging;
|
|
457
457
|
var errs_1 = errors;
|
|
458
|
-
if (
|
|
458
|
+
if (typeof data1 !== "boolean") {
|
|
459
459
|
var dataType1 = typeof data1;
|
|
460
460
|
var coerced1 = undefined;
|
|
461
461
|
if (coerced1 !== undefined);
|
|
462
|
-
else if (
|
|
462
|
+
else if (data1 === 'false' || data1 === 0 || data1 === null) coerced1 = false;
|
|
463
|
+
else if (data1 === 'true' || data1 === 1) coerced1 = true;
|
|
463
464
|
else {
|
|
464
465
|
validate.errors = [{
|
|
465
466
|
keyword: 'type',
|
|
466
|
-
dataPath: (dataPath || '') + '.
|
|
467
|
-
schemaPath: '#/properties/
|
|
467
|
+
dataPath: (dataPath || '') + '.disableRequestLogging',
|
|
468
|
+
schemaPath: '#/properties/disableRequestLogging/type',
|
|
468
469
|
params: {
|
|
469
|
-
type: '
|
|
470
|
+
type: 'boolean'
|
|
470
471
|
},
|
|
471
|
-
message: 'should be
|
|
472
|
+
message: 'should be boolean'
|
|
472
473
|
}];
|
|
473
474
|
return false;
|
|
474
475
|
}
|
|
475
476
|
if (coerced1 !== undefined) {
|
|
476
477
|
data1 = coerced1;
|
|
477
|
-
data['
|
|
478
|
+
data['disableRequestLogging'] = coerced1;
|
|
478
479
|
}
|
|
479
480
|
}
|
|
480
481
|
var valid1 = errors === errs_1;
|
|
481
482
|
if (valid1) {
|
|
482
|
-
var data1 = data.
|
|
483
|
+
var data1 = data.jsonShorthand;
|
|
483
484
|
var errs_1 = errors;
|
|
484
|
-
if (typeof data1 !== "
|
|
485
|
+
if (typeof data1 !== "boolean") {
|
|
485
486
|
var dataType1 = typeof data1;
|
|
486
487
|
var coerced1 = undefined;
|
|
487
488
|
if (coerced1 !== undefined);
|
|
488
|
-
else if (
|
|
489
|
-
else if (data1 ===
|
|
489
|
+
else if (data1 === 'false' || data1 === 0 || data1 === null) coerced1 = false;
|
|
490
|
+
else if (data1 === 'true' || data1 === 1) coerced1 = true;
|
|
490
491
|
else {
|
|
491
492
|
validate.errors = [{
|
|
492
493
|
keyword: 'type',
|
|
493
|
-
dataPath: (dataPath || '') + '.
|
|
494
|
-
schemaPath: '#/properties/
|
|
494
|
+
dataPath: (dataPath || '') + '.jsonShorthand',
|
|
495
|
+
schemaPath: '#/properties/jsonShorthand/type',
|
|
495
496
|
params: {
|
|
496
|
-
type: '
|
|
497
|
+
type: 'boolean'
|
|
497
498
|
},
|
|
498
|
-
message: 'should be
|
|
499
|
+
message: 'should be boolean'
|
|
499
500
|
}];
|
|
500
501
|
return false;
|
|
501
502
|
}
|
|
502
503
|
if (coerced1 !== undefined) {
|
|
503
504
|
data1 = coerced1;
|
|
504
|
-
data['
|
|
505
|
+
data['jsonShorthand'] = coerced1;
|
|
505
506
|
}
|
|
506
507
|
}
|
|
507
508
|
var valid1 = errors === errs_1;
|
|
508
509
|
if (valid1) {
|
|
509
|
-
var data1 = data.
|
|
510
|
+
var data1 = data.maxParamLength;
|
|
510
511
|
var errs_1 = errors;
|
|
511
|
-
if (typeof data1 !== "
|
|
512
|
+
if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
|
512
513
|
var dataType1 = typeof data1;
|
|
513
514
|
var coerced1 = undefined;
|
|
514
515
|
if (coerced1 !== undefined);
|
|
515
|
-
else if (dataType1 == '
|
|
516
|
-
else if (data1 === null) coerced1 = '';
|
|
516
|
+
else if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
|
517
517
|
else {
|
|
518
518
|
validate.errors = [{
|
|
519
519
|
keyword: 'type',
|
|
520
|
-
dataPath: (dataPath || '') + '.
|
|
521
|
-
schemaPath: '#/properties/
|
|
520
|
+
dataPath: (dataPath || '') + '.maxParamLength',
|
|
521
|
+
schemaPath: '#/properties/maxParamLength/type',
|
|
522
522
|
params: {
|
|
523
|
-
type: '
|
|
523
|
+
type: 'integer'
|
|
524
524
|
},
|
|
525
|
-
message: 'should be
|
|
525
|
+
message: 'should be integer'
|
|
526
526
|
}];
|
|
527
527
|
return false;
|
|
528
528
|
}
|
|
529
529
|
if (coerced1 !== undefined) {
|
|
530
530
|
data1 = coerced1;
|
|
531
|
-
data['
|
|
531
|
+
data['maxParamLength'] = coerced1;
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
var valid1 = errors === errs_1;
|
|
535
535
|
if (valid1) {
|
|
536
|
-
var data1 = data.
|
|
536
|
+
var data1 = data.onProtoPoisoning;
|
|
537
537
|
var errs_1 = errors;
|
|
538
|
-
if (
|
|
538
|
+
if (typeof data1 !== "string") {
|
|
539
539
|
var dataType1 = typeof data1;
|
|
540
540
|
var coerced1 = undefined;
|
|
541
541
|
if (coerced1 !== undefined);
|
|
542
|
-
else if (dataType1 == '
|
|
542
|
+
else if (dataType1 == 'number' || dataType1 == 'boolean') coerced1 = '' + data1;
|
|
543
|
+
else if (data1 === null) coerced1 = '';
|
|
543
544
|
else {
|
|
544
545
|
validate.errors = [{
|
|
545
546
|
keyword: 'type',
|
|
546
|
-
dataPath: (dataPath || '') + '.
|
|
547
|
-
schemaPath: '#/properties/
|
|
547
|
+
dataPath: (dataPath || '') + '.onProtoPoisoning',
|
|
548
|
+
schemaPath: '#/properties/onProtoPoisoning/type',
|
|
548
549
|
params: {
|
|
549
|
-
type: '
|
|
550
|
+
type: 'string'
|
|
550
551
|
},
|
|
551
|
-
message: 'should be
|
|
552
|
+
message: 'should be string'
|
|
552
553
|
}];
|
|
553
554
|
return false;
|
|
554
555
|
}
|
|
555
556
|
if (coerced1 !== undefined) {
|
|
556
557
|
data1 = coerced1;
|
|
557
|
-
data['
|
|
558
|
+
data['onProtoPoisoning'] = coerced1;
|
|
558
559
|
}
|
|
559
560
|
}
|
|
560
561
|
var valid1 = errors === errs_1;
|
|
561
562
|
if (valid1) {
|
|
562
|
-
var data1 = data.
|
|
563
|
+
var data1 = data.onConstructorPoisoning;
|
|
563
564
|
var errs_1 = errors;
|
|
564
565
|
if (typeof data1 !== "string") {
|
|
565
566
|
var dataType1 = typeof data1;
|
|
@@ -570,8 +571,8 @@ var validate = (function() {
|
|
|
570
571
|
else {
|
|
571
572
|
validate.errors = [{
|
|
572
573
|
keyword: 'type',
|
|
573
|
-
dataPath: (dataPath || '') + '.
|
|
574
|
-
schemaPath: '#/properties/
|
|
574
|
+
dataPath: (dataPath || '') + '.onConstructorPoisoning',
|
|
575
|
+
schemaPath: '#/properties/onConstructorPoisoning/type',
|
|
575
576
|
params: {
|
|
576
577
|
type: 'string'
|
|
577
578
|
},
|
|
@@ -581,199 +582,270 @@ var validate = (function() {
|
|
|
581
582
|
}
|
|
582
583
|
if (coerced1 !== undefined) {
|
|
583
584
|
data1 = coerced1;
|
|
584
|
-
data['
|
|
585
|
+
data['onConstructorPoisoning'] = coerced1;
|
|
585
586
|
}
|
|
586
587
|
}
|
|
587
588
|
var valid1 = errors === errs_1;
|
|
588
589
|
if (valid1) {
|
|
589
|
-
var data1 = data.
|
|
590
|
+
var data1 = data.pluginTimeout;
|
|
590
591
|
var errs_1 = errors;
|
|
591
|
-
if (typeof data1 !== "
|
|
592
|
+
if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
|
592
593
|
var dataType1 = typeof data1;
|
|
593
594
|
var coerced1 = undefined;
|
|
594
595
|
if (coerced1 !== undefined);
|
|
595
|
-
else if (dataType1 == '
|
|
596
|
-
else if (data1 === null) coerced1 = '';
|
|
596
|
+
else if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
|
597
597
|
else {
|
|
598
598
|
validate.errors = [{
|
|
599
599
|
keyword: 'type',
|
|
600
|
-
dataPath: (dataPath || '') + '.
|
|
601
|
-
schemaPath: '#/properties/
|
|
600
|
+
dataPath: (dataPath || '') + '.pluginTimeout',
|
|
601
|
+
schemaPath: '#/properties/pluginTimeout/type',
|
|
602
602
|
params: {
|
|
603
|
-
type: '
|
|
603
|
+
type: 'integer'
|
|
604
604
|
},
|
|
605
|
-
message: 'should be
|
|
605
|
+
message: 'should be integer'
|
|
606
606
|
}];
|
|
607
607
|
return false;
|
|
608
608
|
}
|
|
609
609
|
if (coerced1 !== undefined) {
|
|
610
610
|
data1 = coerced1;
|
|
611
|
-
data['
|
|
611
|
+
data['pluginTimeout'] = coerced1;
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
var valid1 = errors === errs_1;
|
|
615
615
|
if (valid1) {
|
|
616
|
-
var data1 = data.
|
|
616
|
+
var data1 = data.requestIdHeader;
|
|
617
617
|
var errs_1 = errors;
|
|
618
|
-
if (
|
|
618
|
+
if (typeof data1 !== "string") {
|
|
619
619
|
var dataType1 = typeof data1;
|
|
620
620
|
var coerced1 = undefined;
|
|
621
621
|
if (coerced1 !== undefined);
|
|
622
|
-
else if (dataType1 == '
|
|
622
|
+
else if (dataType1 == 'number' || dataType1 == 'boolean') coerced1 = '' + data1;
|
|
623
|
+
else if (data1 === null) coerced1 = '';
|
|
623
624
|
else {
|
|
624
625
|
validate.errors = [{
|
|
625
626
|
keyword: 'type',
|
|
626
|
-
dataPath: (dataPath || '') + '.
|
|
627
|
-
schemaPath: '#/properties/
|
|
627
|
+
dataPath: (dataPath || '') + '.requestIdHeader',
|
|
628
|
+
schemaPath: '#/properties/requestIdHeader/type',
|
|
628
629
|
params: {
|
|
629
|
-
type: '
|
|
630
|
+
type: 'string'
|
|
630
631
|
},
|
|
631
|
-
message: 'should be
|
|
632
|
+
message: 'should be string'
|
|
632
633
|
}];
|
|
633
634
|
return false;
|
|
634
635
|
}
|
|
635
636
|
if (coerced1 !== undefined) {
|
|
636
637
|
data1 = coerced1;
|
|
637
|
-
data['
|
|
638
|
+
data['requestIdHeader'] = coerced1;
|
|
638
639
|
}
|
|
639
640
|
}
|
|
640
641
|
var valid1 = errors === errs_1;
|
|
641
642
|
if (valid1) {
|
|
642
|
-
var data1 = data.
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
var
|
|
647
|
-
if (
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
keyword: 'required',
|
|
652
|
-
dataPath: (dataPath || '') + '.versioning',
|
|
653
|
-
schemaPath: '#/properties/versioning/required',
|
|
654
|
-
params: {
|
|
655
|
-
missingProperty: '' + missing1 + ''
|
|
656
|
-
},
|
|
657
|
-
message: 'should have required property \'' + missing1 + '\''
|
|
658
|
-
}];
|
|
659
|
-
return false;
|
|
660
|
-
} else {
|
|
661
|
-
var errs__1 = errors;
|
|
662
|
-
var valid2 = true;
|
|
663
|
-
for (var key1 in data1) {
|
|
664
|
-
var isAdditional1 = !(false || key1 == 'storage' || key1 == 'deriveVersion');
|
|
665
|
-
if (isAdditional1) {}
|
|
666
|
-
}
|
|
667
|
-
if (valid2) {
|
|
668
|
-
if (valid2) {
|
|
669
|
-
if (valid2) {}
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
if (errs__1 == errors) {}
|
|
673
|
-
}
|
|
674
|
-
} else {
|
|
643
|
+
var data1 = data.requestIdLogLabel;
|
|
644
|
+
var errs_1 = errors;
|
|
645
|
+
if (typeof data1 !== "string") {
|
|
646
|
+
var dataType1 = typeof data1;
|
|
647
|
+
var coerced1 = undefined;
|
|
648
|
+
if (coerced1 !== undefined);
|
|
649
|
+
else if (dataType1 == 'number' || dataType1 == 'boolean') coerced1 = '' + data1;
|
|
650
|
+
else if (data1 === null) coerced1 = '';
|
|
651
|
+
else {
|
|
675
652
|
validate.errors = [{
|
|
676
653
|
keyword: 'type',
|
|
677
|
-
dataPath: (dataPath || '') + '.
|
|
678
|
-
schemaPath: '#/properties/
|
|
654
|
+
dataPath: (dataPath || '') + '.requestIdLogLabel',
|
|
655
|
+
schemaPath: '#/properties/requestIdLogLabel/type',
|
|
679
656
|
params: {
|
|
680
|
-
type: '
|
|
657
|
+
type: 'string'
|
|
681
658
|
},
|
|
682
|
-
message: 'should be
|
|
659
|
+
message: 'should be string'
|
|
683
660
|
}];
|
|
684
661
|
return false;
|
|
685
662
|
}
|
|
686
|
-
if (
|
|
687
|
-
|
|
663
|
+
if (coerced1 !== undefined) {
|
|
664
|
+
data1 = coerced1;
|
|
665
|
+
data['requestIdLogLabel'] = coerced1;
|
|
666
|
+
}
|
|
688
667
|
}
|
|
668
|
+
var valid1 = errors === errs_1;
|
|
689
669
|
if (valid1) {
|
|
690
|
-
var data1 = data.
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
var
|
|
695
|
-
if (
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
670
|
+
var data1 = data.http2SessionTimeout;
|
|
671
|
+
var errs_1 = errors;
|
|
672
|
+
if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
|
673
|
+
var dataType1 = typeof data1;
|
|
674
|
+
var coerced1 = undefined;
|
|
675
|
+
if (coerced1 !== undefined);
|
|
676
|
+
else if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
|
677
|
+
else {
|
|
678
|
+
validate.errors = [{
|
|
679
|
+
keyword: 'type',
|
|
680
|
+
dataPath: (dataPath || '') + '.http2SessionTimeout',
|
|
681
|
+
schemaPath: '#/properties/http2SessionTimeout/type',
|
|
682
|
+
params: {
|
|
683
|
+
type: 'integer'
|
|
684
|
+
},
|
|
685
|
+
message: 'should be integer'
|
|
686
|
+
}];
|
|
687
|
+
return false;
|
|
688
|
+
}
|
|
689
|
+
if (coerced1 !== undefined) {
|
|
690
|
+
data1 = coerced1;
|
|
691
|
+
data['http2SessionTimeout'] = coerced1;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
var valid1 = errors === errs_1;
|
|
695
|
+
if (valid1) {
|
|
696
|
+
var data1 = data.versioning;
|
|
697
|
+
if (data1 === undefined) {
|
|
698
|
+
valid1 = true;
|
|
699
|
+
} else {
|
|
700
|
+
var errs_1 = errors;
|
|
701
|
+
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
|
|
702
|
+
var missing1;
|
|
703
|
+
if (((data1.storage === undefined) && (missing1 = '.storage')) || ((data1.deriveVersion === undefined) && (missing1 = '.deriveVersion'))) {
|
|
704
|
+
validate.errors = [{
|
|
705
|
+
keyword: 'required',
|
|
706
|
+
dataPath: (dataPath || '') + '.versioning',
|
|
707
|
+
schemaPath: '#/properties/versioning/required',
|
|
708
|
+
params: {
|
|
709
|
+
missingProperty: '' + missing1 + ''
|
|
710
|
+
},
|
|
711
|
+
message: 'should have required property \'' + missing1 + '\''
|
|
712
|
+
}];
|
|
713
|
+
return false;
|
|
714
|
+
} else {
|
|
715
|
+
var errs__1 = errors;
|
|
716
|
+
var valid2 = true;
|
|
717
|
+
for (var key1 in data1) {
|
|
718
|
+
var isAdditional1 = !(false || key1 == 'storage' || key1 == 'deriveVersion');
|
|
719
|
+
if (isAdditional1) {}
|
|
720
|
+
}
|
|
721
|
+
if (valid2) {
|
|
722
|
+
if (valid2) {
|
|
723
|
+
if (valid2) {}
|
|
720
724
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
+
}
|
|
726
|
+
if (errs__1 == errors) {}
|
|
727
|
+
}
|
|
728
|
+
} else {
|
|
729
|
+
validate.errors = [{
|
|
730
|
+
keyword: 'type',
|
|
731
|
+
dataPath: (dataPath || '') + '.versioning',
|
|
732
|
+
schemaPath: '#/properties/versioning/type',
|
|
733
|
+
params: {
|
|
734
|
+
type: 'object'
|
|
735
|
+
},
|
|
736
|
+
message: 'should be object'
|
|
737
|
+
}];
|
|
738
|
+
return false;
|
|
739
|
+
}
|
|
740
|
+
if (errors === errs_1) {}
|
|
741
|
+
var valid1 = errors === errs_1;
|
|
742
|
+
}
|
|
743
|
+
if (valid1) {
|
|
744
|
+
var data1 = data.constraints;
|
|
745
|
+
if (data1 === undefined) {
|
|
746
|
+
valid1 = true;
|
|
747
|
+
} else {
|
|
748
|
+
var errs_1 = errors;
|
|
749
|
+
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
|
|
750
|
+
var errs__1 = errors;
|
|
751
|
+
var valid2 = true;
|
|
752
|
+
for (var key1 in data1) {
|
|
753
|
+
var data2 = data1[key1];
|
|
754
|
+
var errs_2 = errors;
|
|
755
|
+
if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) {
|
|
756
|
+
var missing2;
|
|
757
|
+
if (((data2.storage === undefined) && (missing2 = '.storage')) || ((data2.validate === undefined) && (missing2 = '.validate')) || ((data2.deriveConstraint === undefined) && (missing2 = '.deriveConstraint'))) {
|
|
725
758
|
validate.errors = [{
|
|
726
759
|
keyword: 'required',
|
|
727
760
|
dataPath: (dataPath || '') + '.constraints[\'' + key1 + '\']',
|
|
728
761
|
schemaPath: '#/properties/constraints/additionalProperties/required',
|
|
729
762
|
params: {
|
|
730
|
-
missingProperty: '
|
|
763
|
+
missingProperty: '' + missing2 + ''
|
|
731
764
|
},
|
|
732
|
-
message: 'should have required property \'
|
|
765
|
+
message: 'should have required property \'' + missing2 + '\''
|
|
733
766
|
}];
|
|
734
767
|
return false;
|
|
735
768
|
} else {
|
|
736
|
-
var
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
var
|
|
740
|
-
if (
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
769
|
+
var errs__2 = errors;
|
|
770
|
+
var valid3 = true;
|
|
771
|
+
for (var key2 in data2) {
|
|
772
|
+
var isAdditional2 = !(false || key2 == 'name' || key2 == 'storage' || key2 == 'validate' || key2 == 'deriveConstraint');
|
|
773
|
+
if (isAdditional2) {}
|
|
774
|
+
}
|
|
775
|
+
if (valid3) {
|
|
776
|
+
var data3 = data2.name;
|
|
777
|
+
if (data3 === undefined) {
|
|
778
|
+
valid3 = false;
|
|
744
779
|
validate.errors = [{
|
|
745
|
-
keyword: '
|
|
746
|
-
dataPath: (dataPath || '') + '.constraints[\'' + key1 + '\']
|
|
747
|
-
schemaPath: '#/properties/constraints/additionalProperties/
|
|
780
|
+
keyword: 'required',
|
|
781
|
+
dataPath: (dataPath || '') + '.constraints[\'' + key1 + '\']',
|
|
782
|
+
schemaPath: '#/properties/constraints/additionalProperties/required',
|
|
748
783
|
params: {
|
|
749
|
-
|
|
784
|
+
missingProperty: 'name'
|
|
750
785
|
},
|
|
751
|
-
message: 'should
|
|
786
|
+
message: 'should have required property \'name\''
|
|
752
787
|
}];
|
|
753
788
|
return false;
|
|
789
|
+
} else {
|
|
790
|
+
var errs_3 = errors;
|
|
791
|
+
if (typeof data3 !== "string") {
|
|
792
|
+
var dataType3 = typeof data3;
|
|
793
|
+
var coerced3 = undefined;
|
|
794
|
+
if (coerced3 !== undefined);
|
|
795
|
+
else if (dataType3 == 'number' || dataType3 == 'boolean') coerced3 = '' + data3;
|
|
796
|
+
else if (data3 === null) coerced3 = '';
|
|
797
|
+
else {
|
|
798
|
+
validate.errors = [{
|
|
799
|
+
keyword: 'type',
|
|
800
|
+
dataPath: (dataPath || '') + '.constraints[\'' + key1 + '\'].name',
|
|
801
|
+
schemaPath: '#/properties/constraints/additionalProperties/properties/name/type',
|
|
802
|
+
params: {
|
|
803
|
+
type: 'string'
|
|
804
|
+
},
|
|
805
|
+
message: 'should be string'
|
|
806
|
+
}];
|
|
807
|
+
return false;
|
|
808
|
+
}
|
|
809
|
+
if (coerced3 !== undefined) {
|
|
810
|
+
data3 = coerced3;
|
|
811
|
+
data2['name'] = coerced3;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
var valid3 = errors === errs_3;
|
|
754
815
|
}
|
|
755
|
-
if (coerced3 !== undefined) {
|
|
756
|
-
data3 = coerced3;
|
|
757
|
-
data2['name'] = coerced3;
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
var valid3 = errors === errs_3;
|
|
761
|
-
}
|
|
762
|
-
if (valid3) {
|
|
763
|
-
if (valid3) {
|
|
764
816
|
if (valid3) {
|
|
765
|
-
if (valid3) {
|
|
817
|
+
if (valid3) {
|
|
818
|
+
if (valid3) {
|
|
819
|
+
if (valid3) {}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
766
822
|
}
|
|
767
823
|
}
|
|
824
|
+
if (errs__2 == errors) {}
|
|
768
825
|
}
|
|
826
|
+
} else {
|
|
827
|
+
validate.errors = [{
|
|
828
|
+
keyword: 'type',
|
|
829
|
+
dataPath: (dataPath || '') + '.constraints[\'' + key1 + '\']',
|
|
830
|
+
schemaPath: '#/properties/constraints/additionalProperties/type',
|
|
831
|
+
params: {
|
|
832
|
+
type: 'object'
|
|
833
|
+
},
|
|
834
|
+
message: 'should be object'
|
|
835
|
+
}];
|
|
836
|
+
return false;
|
|
769
837
|
}
|
|
770
|
-
if (
|
|
838
|
+
if (errors === errs_2) {}
|
|
839
|
+
var valid2 = errors === errs_2;
|
|
840
|
+
if (!valid2) break;
|
|
771
841
|
}
|
|
842
|
+
if (valid2) {}
|
|
843
|
+
if (errs__1 == errors) {}
|
|
772
844
|
} else {
|
|
773
845
|
validate.errors = [{
|
|
774
846
|
keyword: 'type',
|
|
775
|
-
dataPath: (dataPath || '') + '.constraints
|
|
776
|
-
schemaPath: '#/properties/constraints/
|
|
847
|
+
dataPath: (dataPath || '') + '.constraints',
|
|
848
|
+
schemaPath: '#/properties/constraints/type',
|
|
777
849
|
params: {
|
|
778
850
|
type: 'object'
|
|
779
851
|
},
|
|
@@ -781,28 +853,12 @@ var validate = (function() {
|
|
|
781
853
|
}];
|
|
782
854
|
return false;
|
|
783
855
|
}
|
|
784
|
-
if (errors ===
|
|
785
|
-
var
|
|
786
|
-
if (!valid2) break;
|
|
856
|
+
if (errors === errs_1) {}
|
|
857
|
+
var valid1 = errors === errs_1;
|
|
787
858
|
}
|
|
788
|
-
if (
|
|
789
|
-
if (errs__1 == errors) {}
|
|
790
|
-
} else {
|
|
791
|
-
validate.errors = [{
|
|
792
|
-
keyword: 'type',
|
|
793
|
-
dataPath: (dataPath || '') + '.constraints',
|
|
794
|
-
schemaPath: '#/properties/constraints/type',
|
|
795
|
-
params: {
|
|
796
|
-
type: 'object'
|
|
797
|
-
},
|
|
798
|
-
message: 'should be object'
|
|
799
|
-
}];
|
|
800
|
-
return false;
|
|
859
|
+
if (valid1) {}
|
|
801
860
|
}
|
|
802
|
-
if (errors === errs_1) {}
|
|
803
|
-
var valid1 = errors === errs_1;
|
|
804
861
|
}
|
|
805
|
-
if (valid1) {}
|
|
806
862
|
}
|
|
807
863
|
}
|
|
808
864
|
}
|
|
@@ -851,6 +907,15 @@ validate.schema = {
|
|
|
851
907
|
"type": "integer",
|
|
852
908
|
"default": 5000
|
|
853
909
|
},
|
|
910
|
+
"maxRequestsPerSocket": {
|
|
911
|
+
"type": "integer",
|
|
912
|
+
"default": 0,
|
|
913
|
+
"nullable": true
|
|
914
|
+
},
|
|
915
|
+
"requestTimeout": {
|
|
916
|
+
"type": "integer",
|
|
917
|
+
"default": 0
|
|
918
|
+
},
|
|
854
919
|
"bodyLimit": {
|
|
855
920
|
"type": "integer",
|
|
856
921
|
"default": 1048576
|
|
@@ -960,4 +1025,4 @@ function customRule0 (schemaParamValue, validatedParamValue, validationSchemaObj
|
|
|
960
1025
|
return true
|
|
961
1026
|
}
|
|
962
1027
|
|
|
963
|
-
module.exports.defaultInitOptions = {"connectionTimeout":0,"keepAliveTimeout":5000,"bodyLimit":1048576,"caseSensitive":true,"disableRequestLogging":false,"jsonShorthand":true,"ignoreTrailingSlash":false,"maxParamLength":100,"onProtoPoisoning":"error","onConstructorPoisoning":"error","pluginTimeout":10000,"requestIdHeader":"request-id","requestIdLogLabel":"reqId","http2SessionTimeout":5000}
|
|
1028
|
+
module.exports.defaultInitOptions = {"connectionTimeout":0,"keepAliveTimeout":5000,"maxRequestsPerSocket":0,"requestTimeout":0,"bodyLimit":1048576,"caseSensitive":true,"disableRequestLogging":false,"jsonShorthand":true,"ignoreTrailingSlash":false,"maxParamLength":100,"onProtoPoisoning":"error","onConstructorPoisoning":"error","pluginTimeout":10000,"requestIdHeader":"request-id","requestIdLogLabel":"reqId","http2SessionTimeout":5000}
|