fastify 3.26.0 → 4.0.0-alpha.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 +5 -4
- package/build/build-error-serializer.js +27 -0
- package/build/build-validation.js +49 -35
- package/docs/Guides/Ecosystem.md +2 -1
- package/docs/Guides/Prototype-Poisoning.md +3 -3
- package/docs/Migration-Guide-V4.md +12 -0
- package/docs/Reference/ContentTypeParser.md +8 -1
- package/docs/Reference/Errors.md +51 -6
- package/docs/Reference/Hooks.md +4 -7
- package/docs/Reference/LTS.md +5 -4
- package/docs/Reference/Reply.md +23 -22
- package/docs/Reference/Request.md +1 -3
- package/docs/Reference/Routes.md +17 -10
- package/docs/Reference/Server.md +98 -63
- package/docs/Reference/TypeScript.md +11 -13
- package/docs/Reference/Validation-and-Serialization.md +32 -54
- package/docs/Type-Providers.md +257 -0
- package/examples/hooks.js +1 -1
- package/examples/simple-stream.js +18 -0
- package/fastify.d.ts +36 -22
- package/fastify.js +72 -53
- package/lib/configValidator.js +902 -1023
- package/lib/contentTypeParser.js +6 -16
- package/lib/context.js +36 -10
- package/lib/decorate.js +5 -3
- package/lib/error-handler.js +158 -0
- package/lib/error-serializer.js +257 -0
- package/lib/errors.js +49 -10
- package/lib/fourOhFour.js +31 -20
- package/lib/handleRequest.js +10 -13
- package/lib/hooks.js +14 -9
- package/lib/noop-set.js +10 -0
- package/lib/pluginOverride.js +0 -3
- package/lib/pluginUtils.js +3 -2
- package/lib/reply.js +44 -163
- package/lib/request.js +13 -10
- package/lib/route.js +158 -139
- package/lib/schema-controller.js +3 -3
- package/lib/schemas.js +27 -1
- package/lib/server.js +219 -116
- package/lib/symbols.js +6 -4
- package/lib/validation.js +2 -1
- package/lib/warnings.js +2 -12
- package/lib/wrapThenable.js +4 -11
- package/package.json +40 -45
- package/test/404s.test.js +265 -108
- package/test/500s.test.js +2 -2
- package/test/async-await.test.js +15 -71
- package/test/close.test.js +39 -1
- package/test/content-parser.test.js +32 -0
- package/test/context-config.test.js +56 -4
- package/test/custom-http-server.test.js +14 -7
- package/test/custom-parser-async.test.js +0 -65
- package/test/custom-parser.test.js +54 -121
- package/test/decorator.test.js +1 -3
- package/test/delete.test.js +5 -5
- package/test/encapsulated-error-handler.test.js +50 -0
- package/test/esm/index.test.js +0 -14
- package/test/fastify-instance.test.js +4 -4
- package/test/fluent-schema.test.js +4 -4
- package/test/get.test.js +3 -3
- package/test/helper.js +18 -3
- package/test/hooks-async.test.js +14 -47
- package/test/hooks.on-ready.test.js +9 -4
- package/test/hooks.test.js +58 -99
- package/test/http2/closing.test.js +5 -11
- package/test/http2/unknown-http-method.test.js +3 -9
- package/test/https/custom-https-server.test.js +12 -6
- package/test/inject.test.js +1 -1
- package/test/input-validation.js +2 -2
- package/test/internals/all.test.js +2 -2
- package/test/internals/contentTypeParser.test.js +4 -4
- package/test/internals/handleRequest.test.js +9 -46
- package/test/internals/initialConfig.test.js +33 -12
- package/test/internals/logger.test.js +1 -1
- package/test/internals/reply.test.js +245 -3
- package/test/internals/request.test.js +13 -7
- package/test/internals/server.test.js +88 -0
- package/test/listen.test.js +84 -1
- package/test/logger.test.js +98 -58
- package/test/maxRequestsPerSocket.test.js +8 -6
- package/test/middleware.test.js +2 -25
- package/test/noop-set.test.js +19 -0
- package/test/nullable-validation.test.js +51 -14
- package/test/plugin.test.js +31 -5
- package/test/pretty-print.test.js +22 -10
- package/test/reply-error.test.js +123 -12
- package/test/request-error.test.js +2 -5
- package/test/route-hooks.test.js +17 -17
- package/test/route-prefix.test.js +2 -1
- package/test/route.test.js +216 -20
- package/test/router-options.test.js +1 -1
- package/test/schema-examples.test.js +11 -5
- package/test/schema-feature.test.js +24 -19
- package/test/schema-serialization.test.js +50 -9
- package/test/schema-special-usage.test.js +14 -81
- package/test/schema-validation.test.js +9 -9
- package/test/skip-reply-send.test.js +8 -8
- package/test/stream.test.js +23 -12
- package/test/throw.test.js +8 -5
- package/test/trust-proxy.test.js +1 -1
- package/test/type-provider.test.js +20 -0
- package/test/types/fastify.test-d.ts +12 -18
- package/test/types/hooks.test-d.ts +7 -3
- package/test/types/import.js +2 -0
- package/test/types/import.ts +1 -0
- package/test/types/instance.test-d.ts +61 -15
- package/test/types/logger.test-d.ts +44 -15
- package/test/types/route.test-d.ts +8 -2
- package/test/types/schema.test-d.ts +2 -39
- package/test/types/type-provider.test-d.ts +417 -0
- package/test/validation-error-handling.test.js +9 -9
- package/test/versioned-routes.test.js +29 -17
- package/test/wrapThenable.test.js +7 -6
- package/types/.eslintrc.json +1 -1
- package/types/content-type-parser.d.ts +17 -8
- package/types/hooks.d.ts +107 -60
- package/types/instance.d.ts +137 -105
- package/types/logger.d.ts +18 -104
- package/types/plugin.d.ts +10 -4
- package/types/register.d.ts +1 -1
- package/types/reply.d.ts +16 -11
- package/types/request.d.ts +10 -5
- package/types/route.d.ts +42 -31
- package/types/schema.d.ts +15 -1
- package/types/type-provider.d.ts +99 -0
- package/types/utils.d.ts +1 -1
- package/lib/schema-compilers.js +0 -12
- package/test/emit-warning.test.js +0 -166
package/lib/configValidator.js
CHANGED
|
@@ -1,1028 +1,907 @@
|
|
|
1
1
|
// This file is autogenerated by build/build-validation.js, do not edit
|
|
2
2
|
/* istanbul ignore file */
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
"use strict";
|
|
4
|
+
module.exports = validate10;
|
|
5
|
+
module.exports.default = validate10;
|
|
6
|
+
const schema11 = {"type":"object","additionalProperties":false,"properties":{"connectionTimeout":{"type":"integer","default":0},"keepAliveTimeout":{"type":"integer","default":72000},"forceCloseConnections":{"type":"boolean","default":false},"maxRequestsPerSocket":{"type":"integer","default":0,"nullable":true},"requestTimeout":{"type":"integer","default":0},"bodyLimit":{"type":"integer","default":1048576},"caseSensitive":{"type":"boolean","default":true},"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},"disableRequestLogging":{"type":"boolean","default":false},"jsonShorthand":{"type":"boolean","default":true},"maxParamLength":{"type":"integer","default":100},"onProtoPoisoning":{"type":"string","default":"error"},"onConstructorPoisoning":{"type":"string","default":"error"},"pluginTimeout":{"type":"integer","default":10000},"requestIdHeader":{"type":"string","default":"request-id"},"requestIdLogLabel":{"type":"string","default":"reqId"},"http2SessionTimeout":{"type":"integer","default":72000},"exposeHeadRoutes":{"type":"boolean","default":true},"versioning":{"type":"object","additionalProperties":true,"required":["storage","deriveVersion"],"properties":{"storage":{},"deriveVersion":{}}},"constraints":{"type":"object","additionalProperties":{"type":"object","required":["name","storage","validate","deriveConstraint"],"additionalProperties":true,"properties":{"name":{"type":"string"},"storage":{},"validate":{},"deriveConstraint":{}}}}}};
|
|
7
|
+
const func4 = Object.prototype.hasOwnProperty;
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
var valid1 = errors === errs_1;
|
|
482
|
-
if (valid1) {
|
|
483
|
-
var data1 = data.jsonShorthand;
|
|
484
|
-
var errs_1 = errors;
|
|
485
|
-
if (typeof data1 !== "boolean") {
|
|
486
|
-
var dataType1 = typeof data1;
|
|
487
|
-
var coerced1 = undefined;
|
|
488
|
-
if (coerced1 !== undefined);
|
|
489
|
-
else if (data1 === 'false' || data1 === 0 || data1 === null) coerced1 = false;
|
|
490
|
-
else if (data1 === 'true' || data1 === 1) coerced1 = true;
|
|
491
|
-
else {
|
|
492
|
-
validate.errors = [{
|
|
493
|
-
keyword: 'type',
|
|
494
|
-
dataPath: (dataPath || '') + '.jsonShorthand',
|
|
495
|
-
schemaPath: '#/properties/jsonShorthand/type',
|
|
496
|
-
params: {
|
|
497
|
-
type: 'boolean'
|
|
498
|
-
},
|
|
499
|
-
message: 'should be boolean'
|
|
500
|
-
}];
|
|
501
|
-
return false;
|
|
502
|
-
}
|
|
503
|
-
if (coerced1 !== undefined) {
|
|
504
|
-
data1 = coerced1;
|
|
505
|
-
data['jsonShorthand'] = coerced1;
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
var valid1 = errors === errs_1;
|
|
509
|
-
if (valid1) {
|
|
510
|
-
var data1 = data.maxParamLength;
|
|
511
|
-
var errs_1 = errors;
|
|
512
|
-
if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
|
513
|
-
var dataType1 = typeof data1;
|
|
514
|
-
var coerced1 = undefined;
|
|
515
|
-
if (coerced1 !== undefined);
|
|
516
|
-
else if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
|
517
|
-
else {
|
|
518
|
-
validate.errors = [{
|
|
519
|
-
keyword: 'type',
|
|
520
|
-
dataPath: (dataPath || '') + '.maxParamLength',
|
|
521
|
-
schemaPath: '#/properties/maxParamLength/type',
|
|
522
|
-
params: {
|
|
523
|
-
type: 'integer'
|
|
524
|
-
},
|
|
525
|
-
message: 'should be integer'
|
|
526
|
-
}];
|
|
527
|
-
return false;
|
|
528
|
-
}
|
|
529
|
-
if (coerced1 !== undefined) {
|
|
530
|
-
data1 = coerced1;
|
|
531
|
-
data['maxParamLength'] = coerced1;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
var valid1 = errors === errs_1;
|
|
535
|
-
if (valid1) {
|
|
536
|
-
var data1 = data.onProtoPoisoning;
|
|
537
|
-
var errs_1 = errors;
|
|
538
|
-
if (typeof data1 !== "string") {
|
|
539
|
-
var dataType1 = typeof data1;
|
|
540
|
-
var coerced1 = undefined;
|
|
541
|
-
if (coerced1 !== undefined);
|
|
542
|
-
else if (dataType1 == 'number' || dataType1 == 'boolean') coerced1 = '' + data1;
|
|
543
|
-
else if (data1 === null) coerced1 = '';
|
|
544
|
-
else {
|
|
545
|
-
validate.errors = [{
|
|
546
|
-
keyword: 'type',
|
|
547
|
-
dataPath: (dataPath || '') + '.onProtoPoisoning',
|
|
548
|
-
schemaPath: '#/properties/onProtoPoisoning/type',
|
|
549
|
-
params: {
|
|
550
|
-
type: 'string'
|
|
551
|
-
},
|
|
552
|
-
message: 'should be string'
|
|
553
|
-
}];
|
|
554
|
-
return false;
|
|
555
|
-
}
|
|
556
|
-
if (coerced1 !== undefined) {
|
|
557
|
-
data1 = coerced1;
|
|
558
|
-
data['onProtoPoisoning'] = coerced1;
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
var valid1 = errors === errs_1;
|
|
562
|
-
if (valid1) {
|
|
563
|
-
var data1 = data.onConstructorPoisoning;
|
|
564
|
-
var errs_1 = errors;
|
|
565
|
-
if (typeof data1 !== "string") {
|
|
566
|
-
var dataType1 = typeof data1;
|
|
567
|
-
var coerced1 = undefined;
|
|
568
|
-
if (coerced1 !== undefined);
|
|
569
|
-
else if (dataType1 == 'number' || dataType1 == 'boolean') coerced1 = '' + data1;
|
|
570
|
-
else if (data1 === null) coerced1 = '';
|
|
571
|
-
else {
|
|
572
|
-
validate.errors = [{
|
|
573
|
-
keyword: 'type',
|
|
574
|
-
dataPath: (dataPath || '') + '.onConstructorPoisoning',
|
|
575
|
-
schemaPath: '#/properties/onConstructorPoisoning/type',
|
|
576
|
-
params: {
|
|
577
|
-
type: 'string'
|
|
578
|
-
},
|
|
579
|
-
message: 'should be string'
|
|
580
|
-
}];
|
|
581
|
-
return false;
|
|
582
|
-
}
|
|
583
|
-
if (coerced1 !== undefined) {
|
|
584
|
-
data1 = coerced1;
|
|
585
|
-
data['onConstructorPoisoning'] = coerced1;
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
var valid1 = errors === errs_1;
|
|
589
|
-
if (valid1) {
|
|
590
|
-
var data1 = data.pluginTimeout;
|
|
591
|
-
var errs_1 = errors;
|
|
592
|
-
if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
|
593
|
-
var dataType1 = typeof data1;
|
|
594
|
-
var coerced1 = undefined;
|
|
595
|
-
if (coerced1 !== undefined);
|
|
596
|
-
else if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
|
597
|
-
else {
|
|
598
|
-
validate.errors = [{
|
|
599
|
-
keyword: 'type',
|
|
600
|
-
dataPath: (dataPath || '') + '.pluginTimeout',
|
|
601
|
-
schemaPath: '#/properties/pluginTimeout/type',
|
|
602
|
-
params: {
|
|
603
|
-
type: 'integer'
|
|
604
|
-
},
|
|
605
|
-
message: 'should be integer'
|
|
606
|
-
}];
|
|
607
|
-
return false;
|
|
608
|
-
}
|
|
609
|
-
if (coerced1 !== undefined) {
|
|
610
|
-
data1 = coerced1;
|
|
611
|
-
data['pluginTimeout'] = coerced1;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
var valid1 = errors === errs_1;
|
|
615
|
-
if (valid1) {
|
|
616
|
-
var data1 = data.requestIdHeader;
|
|
617
|
-
var errs_1 = errors;
|
|
618
|
-
if (typeof data1 !== "string") {
|
|
619
|
-
var dataType1 = typeof data1;
|
|
620
|
-
var coerced1 = undefined;
|
|
621
|
-
if (coerced1 !== undefined);
|
|
622
|
-
else if (dataType1 == 'number' || dataType1 == 'boolean') coerced1 = '' + data1;
|
|
623
|
-
else if (data1 === null) coerced1 = '';
|
|
624
|
-
else {
|
|
625
|
-
validate.errors = [{
|
|
626
|
-
keyword: 'type',
|
|
627
|
-
dataPath: (dataPath || '') + '.requestIdHeader',
|
|
628
|
-
schemaPath: '#/properties/requestIdHeader/type',
|
|
629
|
-
params: {
|
|
630
|
-
type: 'string'
|
|
631
|
-
},
|
|
632
|
-
message: 'should be string'
|
|
633
|
-
}];
|
|
634
|
-
return false;
|
|
635
|
-
}
|
|
636
|
-
if (coerced1 !== undefined) {
|
|
637
|
-
data1 = coerced1;
|
|
638
|
-
data['requestIdHeader'] = coerced1;
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
var valid1 = errors === errs_1;
|
|
642
|
-
if (valid1) {
|
|
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 {
|
|
652
|
-
validate.errors = [{
|
|
653
|
-
keyword: 'type',
|
|
654
|
-
dataPath: (dataPath || '') + '.requestIdLogLabel',
|
|
655
|
-
schemaPath: '#/properties/requestIdLogLabel/type',
|
|
656
|
-
params: {
|
|
657
|
-
type: 'string'
|
|
658
|
-
},
|
|
659
|
-
message: 'should be string'
|
|
660
|
-
}];
|
|
661
|
-
return false;
|
|
662
|
-
}
|
|
663
|
-
if (coerced1 !== undefined) {
|
|
664
|
-
data1 = coerced1;
|
|
665
|
-
data['requestIdLogLabel'] = coerced1;
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
var valid1 = errors === errs_1;
|
|
669
|
-
if (valid1) {
|
|
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) {}
|
|
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'))) {
|
|
758
|
-
validate.errors = [{
|
|
759
|
-
keyword: 'required',
|
|
760
|
-
dataPath: (dataPath || '') + '.constraints[\'' + key1 + '\']',
|
|
761
|
-
schemaPath: '#/properties/constraints/additionalProperties/required',
|
|
762
|
-
params: {
|
|
763
|
-
missingProperty: '' + missing2 + ''
|
|
764
|
-
},
|
|
765
|
-
message: 'should have required property \'' + missing2 + '\''
|
|
766
|
-
}];
|
|
767
|
-
return false;
|
|
768
|
-
} else {
|
|
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;
|
|
779
|
-
validate.errors = [{
|
|
780
|
-
keyword: 'required',
|
|
781
|
-
dataPath: (dataPath || '') + '.constraints[\'' + key1 + '\']',
|
|
782
|
-
schemaPath: '#/properties/constraints/additionalProperties/required',
|
|
783
|
-
params: {
|
|
784
|
-
missingProperty: 'name'
|
|
785
|
-
},
|
|
786
|
-
message: 'should have required property \'name\''
|
|
787
|
-
}];
|
|
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;
|
|
815
|
-
}
|
|
816
|
-
if (valid3) {
|
|
817
|
-
if (valid3) {
|
|
818
|
-
if (valid3) {
|
|
819
|
-
if (valid3) {}
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
if (errs__2 == errors) {}
|
|
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;
|
|
837
|
-
}
|
|
838
|
-
if (errors === errs_2) {}
|
|
839
|
-
var valid2 = errors === errs_2;
|
|
840
|
-
if (!valid2) break;
|
|
841
|
-
}
|
|
842
|
-
if (valid2) {}
|
|
843
|
-
if (errs__1 == errors) {}
|
|
844
|
-
} else {
|
|
845
|
-
validate.errors = [{
|
|
846
|
-
keyword: 'type',
|
|
847
|
-
dataPath: (dataPath || '') + '.constraints',
|
|
848
|
-
schemaPath: '#/properties/constraints/type',
|
|
849
|
-
params: {
|
|
850
|
-
type: 'object'
|
|
851
|
-
},
|
|
852
|
-
message: 'should be object'
|
|
853
|
-
}];
|
|
854
|
-
return false;
|
|
855
|
-
}
|
|
856
|
-
if (errors === errs_1) {}
|
|
857
|
-
var valid1 = errors === errs_1;
|
|
858
|
-
}
|
|
859
|
-
if (valid1) {}
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
if (errs__0 == errors) {}
|
|
881
|
-
} else {
|
|
882
|
-
validate.errors = [{
|
|
883
|
-
keyword: 'type',
|
|
884
|
-
dataPath: (dataPath || '') + "",
|
|
885
|
-
schemaPath: '#/type',
|
|
886
|
-
params: {
|
|
887
|
-
type: 'object'
|
|
888
|
-
},
|
|
889
|
-
message: 'should be object'
|
|
890
|
-
}];
|
|
891
|
-
return false;
|
|
892
|
-
}
|
|
893
|
-
if (errors === 0) {}
|
|
894
|
-
validate.errors = vErrors;
|
|
895
|
-
return errors === 0;
|
|
896
|
-
};
|
|
897
|
-
})();
|
|
898
|
-
validate.schema = {
|
|
899
|
-
"type": "object",
|
|
900
|
-
"additionalProperties": false,
|
|
901
|
-
"properties": {
|
|
902
|
-
"connectionTimeout": {
|
|
903
|
-
"type": "integer",
|
|
904
|
-
"default": 0
|
|
905
|
-
},
|
|
906
|
-
"keepAliveTimeout": {
|
|
907
|
-
"type": "integer",
|
|
908
|
-
"default": 5000
|
|
909
|
-
},
|
|
910
|
-
"maxRequestsPerSocket": {
|
|
911
|
-
"type": "integer",
|
|
912
|
-
"default": 0,
|
|
913
|
-
"nullable": true
|
|
914
|
-
},
|
|
915
|
-
"requestTimeout": {
|
|
916
|
-
"type": "integer",
|
|
917
|
-
"default": 0
|
|
918
|
-
},
|
|
919
|
-
"bodyLimit": {
|
|
920
|
-
"type": "integer",
|
|
921
|
-
"default": 1048576
|
|
922
|
-
},
|
|
923
|
-
"caseSensitive": {
|
|
924
|
-
"type": "boolean",
|
|
925
|
-
"default": true
|
|
926
|
-
},
|
|
927
|
-
"http2": {
|
|
928
|
-
"type": "boolean"
|
|
929
|
-
},
|
|
930
|
-
"https": {
|
|
931
|
-
"if": {
|
|
932
|
-
"not": {
|
|
933
|
-
"oneOf": [{
|
|
934
|
-
"type": "boolean"
|
|
935
|
-
}, {
|
|
936
|
-
"type": "null"
|
|
937
|
-
}, {
|
|
938
|
-
"type": "object",
|
|
939
|
-
"additionalProperties": false,
|
|
940
|
-
"required": ["allowHTTP1"],
|
|
941
|
-
"properties": {
|
|
942
|
-
"allowHTTP1": {
|
|
943
|
-
"type": "boolean"
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
}]
|
|
947
|
-
}
|
|
948
|
-
},
|
|
949
|
-
"then": {
|
|
950
|
-
"setDefaultValue": true
|
|
951
|
-
}
|
|
952
|
-
},
|
|
953
|
-
"ignoreTrailingSlash": {
|
|
954
|
-
"type": "boolean",
|
|
955
|
-
"default": false
|
|
956
|
-
},
|
|
957
|
-
"disableRequestLogging": {
|
|
958
|
-
"type": "boolean",
|
|
959
|
-
"default": false
|
|
960
|
-
},
|
|
961
|
-
"jsonShorthand": {
|
|
962
|
-
"type": "boolean",
|
|
963
|
-
"default": true
|
|
964
|
-
},
|
|
965
|
-
"maxParamLength": {
|
|
966
|
-
"type": "integer",
|
|
967
|
-
"default": 100
|
|
968
|
-
},
|
|
969
|
-
"onProtoPoisoning": {
|
|
970
|
-
"type": "string",
|
|
971
|
-
"default": "error"
|
|
972
|
-
},
|
|
973
|
-
"onConstructorPoisoning": {
|
|
974
|
-
"type": "string",
|
|
975
|
-
"default": "error"
|
|
976
|
-
},
|
|
977
|
-
"pluginTimeout": {
|
|
978
|
-
"type": "integer",
|
|
979
|
-
"default": 10000
|
|
980
|
-
},
|
|
981
|
-
"requestIdHeader": {
|
|
982
|
-
"type": "string",
|
|
983
|
-
"default": "request-id"
|
|
984
|
-
},
|
|
985
|
-
"requestIdLogLabel": {
|
|
986
|
-
"type": "string",
|
|
987
|
-
"default": "reqId"
|
|
988
|
-
},
|
|
989
|
-
"http2SessionTimeout": {
|
|
990
|
-
"type": "integer",
|
|
991
|
-
"default": 5000
|
|
992
|
-
},
|
|
993
|
-
"versioning": {
|
|
994
|
-
"type": "object",
|
|
995
|
-
"additionalProperties": true,
|
|
996
|
-
"required": ["storage", "deriveVersion"],
|
|
997
|
-
"properties": {
|
|
998
|
-
"storage": {},
|
|
999
|
-
"deriveVersion": {}
|
|
1000
|
-
}
|
|
1001
|
-
},
|
|
1002
|
-
"constraints": {
|
|
1003
|
-
"type": "object",
|
|
1004
|
-
"additionalProperties": {
|
|
1005
|
-
"type": "object",
|
|
1006
|
-
"required": ["name", "storage", "validate", "deriveConstraint"],
|
|
1007
|
-
"additionalProperties": true,
|
|
1008
|
-
"properties": {
|
|
1009
|
-
"name": {
|
|
1010
|
-
"type": "string"
|
|
1011
|
-
},
|
|
1012
|
-
"storage": {},
|
|
1013
|
-
"validate": {},
|
|
1014
|
-
"deriveConstraint": {}
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
};
|
|
1020
|
-
validate.errors = null;
|
|
1021
|
-
module.exports = validate;
|
|
1022
|
-
|
|
1023
|
-
function customRule0 (schemaParamValue, validatedParamValue, validationSchemaObject, currentDataPath, validatedParamObject, validatedParam) {
|
|
1024
|
-
validatedParamObject[validatedParam] = schemaParamValue
|
|
1025
|
-
return true
|
|
9
|
+
function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){
|
|
10
|
+
let vErrors = null;
|
|
11
|
+
let errors = 0;
|
|
12
|
+
if(errors === 0){
|
|
13
|
+
if(data && typeof data == "object" && !Array.isArray(data)){
|
|
14
|
+
if(data.connectionTimeout === undefined){
|
|
15
|
+
data.connectionTimeout = 0;
|
|
16
|
+
}
|
|
17
|
+
if(data.keepAliveTimeout === undefined){
|
|
18
|
+
data.keepAliveTimeout = 72000;
|
|
19
|
+
}
|
|
20
|
+
if(data.forceCloseConnections === undefined){
|
|
21
|
+
data.forceCloseConnections = false;
|
|
22
|
+
}
|
|
23
|
+
if(data.maxRequestsPerSocket === undefined){
|
|
24
|
+
data.maxRequestsPerSocket = 0;
|
|
25
|
+
}
|
|
26
|
+
if(data.requestTimeout === undefined){
|
|
27
|
+
data.requestTimeout = 0;
|
|
28
|
+
}
|
|
29
|
+
if(data.bodyLimit === undefined){
|
|
30
|
+
data.bodyLimit = 1048576;
|
|
31
|
+
}
|
|
32
|
+
if(data.caseSensitive === undefined){
|
|
33
|
+
data.caseSensitive = true;
|
|
34
|
+
}
|
|
35
|
+
if(data.ignoreTrailingSlash === undefined){
|
|
36
|
+
data.ignoreTrailingSlash = false;
|
|
37
|
+
}
|
|
38
|
+
if(data.disableRequestLogging === undefined){
|
|
39
|
+
data.disableRequestLogging = false;
|
|
40
|
+
}
|
|
41
|
+
if(data.jsonShorthand === undefined){
|
|
42
|
+
data.jsonShorthand = true;
|
|
43
|
+
}
|
|
44
|
+
if(data.maxParamLength === undefined){
|
|
45
|
+
data.maxParamLength = 100;
|
|
46
|
+
}
|
|
47
|
+
if(data.onProtoPoisoning === undefined){
|
|
48
|
+
data.onProtoPoisoning = "error";
|
|
49
|
+
}
|
|
50
|
+
if(data.onConstructorPoisoning === undefined){
|
|
51
|
+
data.onConstructorPoisoning = "error";
|
|
52
|
+
}
|
|
53
|
+
if(data.pluginTimeout === undefined){
|
|
54
|
+
data.pluginTimeout = 10000;
|
|
55
|
+
}
|
|
56
|
+
if(data.requestIdHeader === undefined){
|
|
57
|
+
data.requestIdHeader = "request-id";
|
|
58
|
+
}
|
|
59
|
+
if(data.requestIdLogLabel === undefined){
|
|
60
|
+
data.requestIdLogLabel = "reqId";
|
|
61
|
+
}
|
|
62
|
+
if(data.http2SessionTimeout === undefined){
|
|
63
|
+
data.http2SessionTimeout = 72000;
|
|
64
|
+
}
|
|
65
|
+
if(data.exposeHeadRoutes === undefined){
|
|
66
|
+
data.exposeHeadRoutes = true;
|
|
67
|
+
}
|
|
68
|
+
const _errs1 = errors;
|
|
69
|
+
for(const key0 in data){
|
|
70
|
+
if(!(func4.call(schema11.properties, key0))){
|
|
71
|
+
delete data[key0];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if(_errs1 === errors){
|
|
75
|
+
let data0 = data.connectionTimeout;
|
|
76
|
+
const _errs2 = errors;
|
|
77
|
+
if(!(((typeof data0 == "number") && (!(data0 % 1) && !isNaN(data0))) && (isFinite(data0)))){
|
|
78
|
+
let dataType0 = typeof data0;
|
|
79
|
+
let coerced0 = undefined;
|
|
80
|
+
if(!(coerced0 !== undefined)){
|
|
81
|
+
if(dataType0 === "boolean" || data0 === null
|
|
82
|
+
|| (dataType0 === "string" && data0 && data0 == +data0 && !(data0 % 1))){
|
|
83
|
+
coerced0 = +data0;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
validate10.errors = [{instancePath:instancePath+"/connectionTimeout",schemaPath:"#/properties/connectionTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if(coerced0 !== undefined){
|
|
91
|
+
data0 = coerced0;
|
|
92
|
+
if(data !== undefined){
|
|
93
|
+
data["connectionTimeout"] = coerced0;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
var valid0 = _errs2 === errors;
|
|
98
|
+
if(valid0){
|
|
99
|
+
let data1 = data.keepAliveTimeout;
|
|
100
|
+
const _errs4 = errors;
|
|
101
|
+
if(!(((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){
|
|
102
|
+
let dataType1 = typeof data1;
|
|
103
|
+
let coerced1 = undefined;
|
|
104
|
+
if(!(coerced1 !== undefined)){
|
|
105
|
+
if(dataType1 === "boolean" || data1 === null
|
|
106
|
+
|| (dataType1 === "string" && data1 && data1 == +data1 && !(data1 % 1))){
|
|
107
|
+
coerced1 = +data1;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
validate10.errors = [{instancePath:instancePath+"/keepAliveTimeout",schemaPath:"#/properties/keepAliveTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if(coerced1 !== undefined){
|
|
115
|
+
data1 = coerced1;
|
|
116
|
+
if(data !== undefined){
|
|
117
|
+
data["keepAliveTimeout"] = coerced1;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
var valid0 = _errs4 === errors;
|
|
122
|
+
if(valid0){
|
|
123
|
+
let data2 = data.forceCloseConnections;
|
|
124
|
+
const _errs6 = errors;
|
|
125
|
+
if(typeof data2 !== "boolean"){
|
|
126
|
+
let coerced2 = undefined;
|
|
127
|
+
if(!(coerced2 !== undefined)){
|
|
128
|
+
if(data2 === "false" || data2 === 0 || data2 === null){
|
|
129
|
+
coerced2 = false;
|
|
130
|
+
}
|
|
131
|
+
else if(data2 === "true" || data2 === 1){
|
|
132
|
+
coerced2 = true;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
validate10.errors = [{instancePath:instancePath+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if(coerced2 !== undefined){
|
|
140
|
+
data2 = coerced2;
|
|
141
|
+
if(data !== undefined){
|
|
142
|
+
data["forceCloseConnections"] = coerced2;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
var valid0 = _errs6 === errors;
|
|
147
|
+
if(valid0){
|
|
148
|
+
let data3 = data.maxRequestsPerSocket;
|
|
149
|
+
const _errs8 = errors;
|
|
150
|
+
if((!(((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3))) && (isFinite(data3)))) && (data3 !== null)){
|
|
151
|
+
let dataType3 = typeof data3;
|
|
152
|
+
let coerced3 = undefined;
|
|
153
|
+
if(!(coerced3 !== undefined)){
|
|
154
|
+
if(dataType3 === "boolean" || data3 === null
|
|
155
|
+
|| (dataType3 === "string" && data3 && data3 == +data3 && !(data3 % 1))){
|
|
156
|
+
coerced3 = +data3;
|
|
157
|
+
}
|
|
158
|
+
else if(data3 === "" || data3 === 0 || data3 === false){
|
|
159
|
+
coerced3 = null;
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
validate10.errors = [{instancePath:instancePath+"/maxRequestsPerSocket",schemaPath:"#/properties/maxRequestsPerSocket/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if(coerced3 !== undefined){
|
|
167
|
+
data3 = coerced3;
|
|
168
|
+
if(data !== undefined){
|
|
169
|
+
data["maxRequestsPerSocket"] = coerced3;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
var valid0 = _errs8 === errors;
|
|
174
|
+
if(valid0){
|
|
175
|
+
let data4 = data.requestTimeout;
|
|
176
|
+
const _errs11 = errors;
|
|
177
|
+
if(!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))){
|
|
178
|
+
let dataType4 = typeof data4;
|
|
179
|
+
let coerced4 = undefined;
|
|
180
|
+
if(!(coerced4 !== undefined)){
|
|
181
|
+
if(dataType4 === "boolean" || data4 === null
|
|
182
|
+
|| (dataType4 === "string" && data4 && data4 == +data4 && !(data4 % 1))){
|
|
183
|
+
coerced4 = +data4;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
validate10.errors = [{instancePath:instancePath+"/requestTimeout",schemaPath:"#/properties/requestTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if(coerced4 !== undefined){
|
|
191
|
+
data4 = coerced4;
|
|
192
|
+
if(data !== undefined){
|
|
193
|
+
data["requestTimeout"] = coerced4;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
var valid0 = _errs11 === errors;
|
|
198
|
+
if(valid0){
|
|
199
|
+
let data5 = data.bodyLimit;
|
|
200
|
+
const _errs13 = errors;
|
|
201
|
+
if(!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))){
|
|
202
|
+
let dataType5 = typeof data5;
|
|
203
|
+
let coerced5 = undefined;
|
|
204
|
+
if(!(coerced5 !== undefined)){
|
|
205
|
+
if(dataType5 === "boolean" || data5 === null
|
|
206
|
+
|| (dataType5 === "string" && data5 && data5 == +data5 && !(data5 % 1))){
|
|
207
|
+
coerced5 = +data5;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
validate10.errors = [{instancePath:instancePath+"/bodyLimit",schemaPath:"#/properties/bodyLimit/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if(coerced5 !== undefined){
|
|
215
|
+
data5 = coerced5;
|
|
216
|
+
if(data !== undefined){
|
|
217
|
+
data["bodyLimit"] = coerced5;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
var valid0 = _errs13 === errors;
|
|
222
|
+
if(valid0){
|
|
223
|
+
let data6 = data.caseSensitive;
|
|
224
|
+
const _errs15 = errors;
|
|
225
|
+
if(typeof data6 !== "boolean"){
|
|
226
|
+
let coerced6 = undefined;
|
|
227
|
+
if(!(coerced6 !== undefined)){
|
|
228
|
+
if(data6 === "false" || data6 === 0 || data6 === null){
|
|
229
|
+
coerced6 = false;
|
|
230
|
+
}
|
|
231
|
+
else if(data6 === "true" || data6 === 1){
|
|
232
|
+
coerced6 = true;
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
validate10.errors = [{instancePath:instancePath+"/caseSensitive",schemaPath:"#/properties/caseSensitive/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if(coerced6 !== undefined){
|
|
240
|
+
data6 = coerced6;
|
|
241
|
+
if(data !== undefined){
|
|
242
|
+
data["caseSensitive"] = coerced6;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
var valid0 = _errs15 === errors;
|
|
247
|
+
if(valid0){
|
|
248
|
+
if(data.http2 !== undefined){
|
|
249
|
+
let data7 = data.http2;
|
|
250
|
+
const _errs17 = errors;
|
|
251
|
+
if(typeof data7 !== "boolean"){
|
|
252
|
+
let coerced7 = undefined;
|
|
253
|
+
if(!(coerced7 !== undefined)){
|
|
254
|
+
if(data7 === "false" || data7 === 0 || data7 === null){
|
|
255
|
+
coerced7 = false;
|
|
256
|
+
}
|
|
257
|
+
else if(data7 === "true" || data7 === 1){
|
|
258
|
+
coerced7 = true;
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
validate10.errors = [{instancePath:instancePath+"/http2",schemaPath:"#/properties/http2/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if(coerced7 !== undefined){
|
|
266
|
+
data7 = coerced7;
|
|
267
|
+
if(data !== undefined){
|
|
268
|
+
data["http2"] = coerced7;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
var valid0 = _errs17 === errors;
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
var valid0 = true;
|
|
276
|
+
}
|
|
277
|
+
if(valid0){
|
|
278
|
+
if(data.https !== undefined){
|
|
279
|
+
let data8 = data.https;
|
|
280
|
+
const _errs19 = errors;
|
|
281
|
+
const _errs20 = errors;
|
|
282
|
+
let valid1 = true;
|
|
283
|
+
const _errs21 = errors;
|
|
284
|
+
const _errs22 = errors;
|
|
285
|
+
const _errs23 = errors;
|
|
286
|
+
const _errs24 = errors;
|
|
287
|
+
let valid3 = false;
|
|
288
|
+
let passing0 = null;
|
|
289
|
+
const _errs25 = errors;
|
|
290
|
+
if(typeof data8 !== "boolean"){
|
|
291
|
+
let coerced8 = undefined;
|
|
292
|
+
if(!(coerced8 !== undefined)){
|
|
293
|
+
if(data8 === "false" || data8 === 0 || data8 === null){
|
|
294
|
+
coerced8 = false;
|
|
295
|
+
}
|
|
296
|
+
else if(data8 === "true" || data8 === 1){
|
|
297
|
+
coerced8 = true;
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
const err0 = {};
|
|
301
|
+
if(vErrors === null){
|
|
302
|
+
vErrors = [err0];
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
vErrors.push(err0);
|
|
306
|
+
}
|
|
307
|
+
errors++;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if(coerced8 !== undefined){
|
|
311
|
+
data8 = coerced8;
|
|
312
|
+
if(data !== undefined){
|
|
313
|
+
data["https"] = coerced8;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
var _valid1 = _errs25 === errors;
|
|
318
|
+
if(_valid1){
|
|
319
|
+
valid3 = true;
|
|
320
|
+
passing0 = 0;
|
|
321
|
+
}
|
|
322
|
+
const _errs27 = errors;
|
|
323
|
+
if(data8 !== null){
|
|
324
|
+
let coerced9 = undefined;
|
|
325
|
+
if(!(coerced9 !== undefined)){
|
|
326
|
+
if(data8 === "" || data8 === 0 || data8 === false){
|
|
327
|
+
coerced9 = null;
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
const err1 = {};
|
|
331
|
+
if(vErrors === null){
|
|
332
|
+
vErrors = [err1];
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
vErrors.push(err1);
|
|
336
|
+
}
|
|
337
|
+
errors++;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
if(coerced9 !== undefined){
|
|
341
|
+
data8 = coerced9;
|
|
342
|
+
if(data !== undefined){
|
|
343
|
+
data["https"] = coerced9;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
var _valid1 = _errs27 === errors;
|
|
348
|
+
if(_valid1 && valid3){
|
|
349
|
+
valid3 = false;
|
|
350
|
+
passing0 = [passing0, 1];
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
if(_valid1){
|
|
354
|
+
valid3 = true;
|
|
355
|
+
passing0 = 1;
|
|
356
|
+
}
|
|
357
|
+
const _errs29 = errors;
|
|
358
|
+
if(errors === _errs29){
|
|
359
|
+
if(data8 && typeof data8 == "object" && !Array.isArray(data8)){
|
|
360
|
+
let missing0;
|
|
361
|
+
if((data8.allowHTTP1 === undefined) && (missing0 = "allowHTTP1")){
|
|
362
|
+
const err2 = {};
|
|
363
|
+
if(vErrors === null){
|
|
364
|
+
vErrors = [err2];
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
vErrors.push(err2);
|
|
368
|
+
}
|
|
369
|
+
errors++;
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
const _errs31 = errors;
|
|
373
|
+
for(const key1 in data8){
|
|
374
|
+
if(!(key1 === "allowHTTP1")){
|
|
375
|
+
delete data8[key1];
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if(_errs31 === errors){
|
|
379
|
+
if(data8.allowHTTP1 !== undefined){
|
|
380
|
+
let data9 = data8.allowHTTP1;
|
|
381
|
+
if(typeof data9 !== "boolean"){
|
|
382
|
+
let coerced10 = undefined;
|
|
383
|
+
if(!(coerced10 !== undefined)){
|
|
384
|
+
if(data9 === "false" || data9 === 0 || data9 === null){
|
|
385
|
+
coerced10 = false;
|
|
386
|
+
}
|
|
387
|
+
else if(data9 === "true" || data9 === 1){
|
|
388
|
+
coerced10 = true;
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
const err3 = {};
|
|
392
|
+
if(vErrors === null){
|
|
393
|
+
vErrors = [err3];
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
vErrors.push(err3);
|
|
397
|
+
}
|
|
398
|
+
errors++;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
if(coerced10 !== undefined){
|
|
402
|
+
data9 = coerced10;
|
|
403
|
+
if(data8 !== undefined){
|
|
404
|
+
data8["allowHTTP1"] = coerced10;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
const err4 = {};
|
|
414
|
+
if(vErrors === null){
|
|
415
|
+
vErrors = [err4];
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
vErrors.push(err4);
|
|
419
|
+
}
|
|
420
|
+
errors++;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
var _valid1 = _errs29 === errors;
|
|
424
|
+
if(_valid1 && valid3){
|
|
425
|
+
valid3 = false;
|
|
426
|
+
passing0 = [passing0, 2];
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
if(_valid1){
|
|
430
|
+
valid3 = true;
|
|
431
|
+
passing0 = 2;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
if(!valid3){
|
|
436
|
+
const err5 = {};
|
|
437
|
+
if(vErrors === null){
|
|
438
|
+
vErrors = [err5];
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
vErrors.push(err5);
|
|
442
|
+
}
|
|
443
|
+
errors++;
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
errors = _errs24;
|
|
447
|
+
if(vErrors !== null){
|
|
448
|
+
if(_errs24){
|
|
449
|
+
vErrors.length = _errs24;
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
vErrors = null;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
var valid2 = _errs23 === errors;
|
|
457
|
+
if(valid2){
|
|
458
|
+
const err6 = {};
|
|
459
|
+
if(vErrors === null){
|
|
460
|
+
vErrors = [err6];
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
vErrors.push(err6);
|
|
464
|
+
}
|
|
465
|
+
errors++;
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
errors = _errs22;
|
|
469
|
+
if(vErrors !== null){
|
|
470
|
+
if(_errs22){
|
|
471
|
+
vErrors.length = _errs22;
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
vErrors = null;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
var _valid0 = _errs21 === errors;
|
|
479
|
+
errors = _errs20;
|
|
480
|
+
if(vErrors !== null){
|
|
481
|
+
if(_errs20){
|
|
482
|
+
vErrors.length = _errs20;
|
|
1026
483
|
}
|
|
484
|
+
else {
|
|
485
|
+
vErrors = null;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
if(_valid0){
|
|
489
|
+
const _errs34 = errors;
|
|
490
|
+
data["https"] = true;
|
|
491
|
+
var _valid0 = _errs34 === errors;
|
|
492
|
+
valid1 = _valid0;
|
|
493
|
+
}
|
|
494
|
+
if(!valid1){
|
|
495
|
+
const err7 = {instancePath:instancePath+"/https",schemaPath:"#/properties/https/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};
|
|
496
|
+
if(vErrors === null){
|
|
497
|
+
vErrors = [err7];
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
vErrors.push(err7);
|
|
501
|
+
}
|
|
502
|
+
errors++;
|
|
503
|
+
validate10.errors = vErrors;
|
|
504
|
+
return false;
|
|
505
|
+
}
|
|
506
|
+
var valid0 = _errs19 === errors;
|
|
507
|
+
}
|
|
508
|
+
else {
|
|
509
|
+
var valid0 = true;
|
|
510
|
+
}
|
|
511
|
+
if(valid0){
|
|
512
|
+
let data10 = data.ignoreTrailingSlash;
|
|
513
|
+
const _errs35 = errors;
|
|
514
|
+
if(typeof data10 !== "boolean"){
|
|
515
|
+
let coerced11 = undefined;
|
|
516
|
+
if(!(coerced11 !== undefined)){
|
|
517
|
+
if(data10 === "false" || data10 === 0 || data10 === null){
|
|
518
|
+
coerced11 = false;
|
|
519
|
+
}
|
|
520
|
+
else if(data10 === "true" || data10 === 1){
|
|
521
|
+
coerced11 = true;
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
validate10.errors = [{instancePath:instancePath+"/ignoreTrailingSlash",schemaPath:"#/properties/ignoreTrailingSlash/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
if(coerced11 !== undefined){
|
|
529
|
+
data10 = coerced11;
|
|
530
|
+
if(data !== undefined){
|
|
531
|
+
data["ignoreTrailingSlash"] = coerced11;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
var valid0 = _errs35 === errors;
|
|
536
|
+
if(valid0){
|
|
537
|
+
let data11 = data.disableRequestLogging;
|
|
538
|
+
const _errs37 = errors;
|
|
539
|
+
if(typeof data11 !== "boolean"){
|
|
540
|
+
let coerced12 = undefined;
|
|
541
|
+
if(!(coerced12 !== undefined)){
|
|
542
|
+
if(data11 === "false" || data11 === 0 || data11 === null){
|
|
543
|
+
coerced12 = false;
|
|
544
|
+
}
|
|
545
|
+
else if(data11 === "true" || data11 === 1){
|
|
546
|
+
coerced12 = true;
|
|
547
|
+
}
|
|
548
|
+
else {
|
|
549
|
+
validate10.errors = [{instancePath:instancePath+"/disableRequestLogging",schemaPath:"#/properties/disableRequestLogging/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
550
|
+
return false;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
if(coerced12 !== undefined){
|
|
554
|
+
data11 = coerced12;
|
|
555
|
+
if(data !== undefined){
|
|
556
|
+
data["disableRequestLogging"] = coerced12;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
var valid0 = _errs37 === errors;
|
|
561
|
+
if(valid0){
|
|
562
|
+
let data12 = data.jsonShorthand;
|
|
563
|
+
const _errs39 = errors;
|
|
564
|
+
if(typeof data12 !== "boolean"){
|
|
565
|
+
let coerced13 = undefined;
|
|
566
|
+
if(!(coerced13 !== undefined)){
|
|
567
|
+
if(data12 === "false" || data12 === 0 || data12 === null){
|
|
568
|
+
coerced13 = false;
|
|
569
|
+
}
|
|
570
|
+
else if(data12 === "true" || data12 === 1){
|
|
571
|
+
coerced13 = true;
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
validate10.errors = [{instancePath:instancePath+"/jsonShorthand",schemaPath:"#/properties/jsonShorthand/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
575
|
+
return false;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
if(coerced13 !== undefined){
|
|
579
|
+
data12 = coerced13;
|
|
580
|
+
if(data !== undefined){
|
|
581
|
+
data["jsonShorthand"] = coerced13;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
var valid0 = _errs39 === errors;
|
|
586
|
+
if(valid0){
|
|
587
|
+
let data13 = data.maxParamLength;
|
|
588
|
+
const _errs41 = errors;
|
|
589
|
+
if(!(((typeof data13 == "number") && (!(data13 % 1) && !isNaN(data13))) && (isFinite(data13)))){
|
|
590
|
+
let dataType14 = typeof data13;
|
|
591
|
+
let coerced14 = undefined;
|
|
592
|
+
if(!(coerced14 !== undefined)){
|
|
593
|
+
if(dataType14 === "boolean" || data13 === null
|
|
594
|
+
|| (dataType14 === "string" && data13 && data13 == +data13 && !(data13 % 1))){
|
|
595
|
+
coerced14 = +data13;
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
validate10.errors = [{instancePath:instancePath+"/maxParamLength",schemaPath:"#/properties/maxParamLength/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
599
|
+
return false;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
if(coerced14 !== undefined){
|
|
603
|
+
data13 = coerced14;
|
|
604
|
+
if(data !== undefined){
|
|
605
|
+
data["maxParamLength"] = coerced14;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
var valid0 = _errs41 === errors;
|
|
610
|
+
if(valid0){
|
|
611
|
+
let data14 = data.onProtoPoisoning;
|
|
612
|
+
const _errs43 = errors;
|
|
613
|
+
if(typeof data14 !== "string"){
|
|
614
|
+
let dataType15 = typeof data14;
|
|
615
|
+
let coerced15 = undefined;
|
|
616
|
+
if(!(coerced15 !== undefined)){
|
|
617
|
+
if(dataType15 == "number" || dataType15 == "boolean"){
|
|
618
|
+
coerced15 = "" + data14;
|
|
619
|
+
}
|
|
620
|
+
else if(data14 === null){
|
|
621
|
+
coerced15 = "";
|
|
622
|
+
}
|
|
623
|
+
else {
|
|
624
|
+
validate10.errors = [{instancePath:instancePath+"/onProtoPoisoning",schemaPath:"#/properties/onProtoPoisoning/type",keyword:"type",params:{type: "string"},message:"must be string"}];
|
|
625
|
+
return false;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
if(coerced15 !== undefined){
|
|
629
|
+
data14 = coerced15;
|
|
630
|
+
if(data !== undefined){
|
|
631
|
+
data["onProtoPoisoning"] = coerced15;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
var valid0 = _errs43 === errors;
|
|
636
|
+
if(valid0){
|
|
637
|
+
let data15 = data.onConstructorPoisoning;
|
|
638
|
+
const _errs45 = errors;
|
|
639
|
+
if(typeof data15 !== "string"){
|
|
640
|
+
let dataType16 = typeof data15;
|
|
641
|
+
let coerced16 = undefined;
|
|
642
|
+
if(!(coerced16 !== undefined)){
|
|
643
|
+
if(dataType16 == "number" || dataType16 == "boolean"){
|
|
644
|
+
coerced16 = "" + data15;
|
|
645
|
+
}
|
|
646
|
+
else if(data15 === null){
|
|
647
|
+
coerced16 = "";
|
|
648
|
+
}
|
|
649
|
+
else {
|
|
650
|
+
validate10.errors = [{instancePath:instancePath+"/onConstructorPoisoning",schemaPath:"#/properties/onConstructorPoisoning/type",keyword:"type",params:{type: "string"},message:"must be string"}];
|
|
651
|
+
return false;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
if(coerced16 !== undefined){
|
|
655
|
+
data15 = coerced16;
|
|
656
|
+
if(data !== undefined){
|
|
657
|
+
data["onConstructorPoisoning"] = coerced16;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
var valid0 = _errs45 === errors;
|
|
662
|
+
if(valid0){
|
|
663
|
+
let data16 = data.pluginTimeout;
|
|
664
|
+
const _errs47 = errors;
|
|
665
|
+
if(!(((typeof data16 == "number") && (!(data16 % 1) && !isNaN(data16))) && (isFinite(data16)))){
|
|
666
|
+
let dataType17 = typeof data16;
|
|
667
|
+
let coerced17 = undefined;
|
|
668
|
+
if(!(coerced17 !== undefined)){
|
|
669
|
+
if(dataType17 === "boolean" || data16 === null
|
|
670
|
+
|| (dataType17 === "string" && data16 && data16 == +data16 && !(data16 % 1))){
|
|
671
|
+
coerced17 = +data16;
|
|
672
|
+
}
|
|
673
|
+
else {
|
|
674
|
+
validate10.errors = [{instancePath:instancePath+"/pluginTimeout",schemaPath:"#/properties/pluginTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
675
|
+
return false;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
if(coerced17 !== undefined){
|
|
679
|
+
data16 = coerced17;
|
|
680
|
+
if(data !== undefined){
|
|
681
|
+
data["pluginTimeout"] = coerced17;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
var valid0 = _errs47 === errors;
|
|
686
|
+
if(valid0){
|
|
687
|
+
let data17 = data.requestIdHeader;
|
|
688
|
+
const _errs49 = errors;
|
|
689
|
+
if(typeof data17 !== "string"){
|
|
690
|
+
let dataType18 = typeof data17;
|
|
691
|
+
let coerced18 = undefined;
|
|
692
|
+
if(!(coerced18 !== undefined)){
|
|
693
|
+
if(dataType18 == "number" || dataType18 == "boolean"){
|
|
694
|
+
coerced18 = "" + data17;
|
|
695
|
+
}
|
|
696
|
+
else if(data17 === null){
|
|
697
|
+
coerced18 = "";
|
|
698
|
+
}
|
|
699
|
+
else {
|
|
700
|
+
validate10.errors = [{instancePath:instancePath+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/type",keyword:"type",params:{type: "string"},message:"must be string"}];
|
|
701
|
+
return false;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
if(coerced18 !== undefined){
|
|
705
|
+
data17 = coerced18;
|
|
706
|
+
if(data !== undefined){
|
|
707
|
+
data["requestIdHeader"] = coerced18;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
var valid0 = _errs49 === errors;
|
|
712
|
+
if(valid0){
|
|
713
|
+
let data18 = data.requestIdLogLabel;
|
|
714
|
+
const _errs51 = errors;
|
|
715
|
+
if(typeof data18 !== "string"){
|
|
716
|
+
let dataType19 = typeof data18;
|
|
717
|
+
let coerced19 = undefined;
|
|
718
|
+
if(!(coerced19 !== undefined)){
|
|
719
|
+
if(dataType19 == "number" || dataType19 == "boolean"){
|
|
720
|
+
coerced19 = "" + data18;
|
|
721
|
+
}
|
|
722
|
+
else if(data18 === null){
|
|
723
|
+
coerced19 = "";
|
|
724
|
+
}
|
|
725
|
+
else {
|
|
726
|
+
validate10.errors = [{instancePath:instancePath+"/requestIdLogLabel",schemaPath:"#/properties/requestIdLogLabel/type",keyword:"type",params:{type: "string"},message:"must be string"}];
|
|
727
|
+
return false;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
if(coerced19 !== undefined){
|
|
731
|
+
data18 = coerced19;
|
|
732
|
+
if(data !== undefined){
|
|
733
|
+
data["requestIdLogLabel"] = coerced19;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
var valid0 = _errs51 === errors;
|
|
738
|
+
if(valid0){
|
|
739
|
+
let data19 = data.http2SessionTimeout;
|
|
740
|
+
const _errs53 = errors;
|
|
741
|
+
if(!(((typeof data19 == "number") && (!(data19 % 1) && !isNaN(data19))) && (isFinite(data19)))){
|
|
742
|
+
let dataType20 = typeof data19;
|
|
743
|
+
let coerced20 = undefined;
|
|
744
|
+
if(!(coerced20 !== undefined)){
|
|
745
|
+
if(dataType20 === "boolean" || data19 === null
|
|
746
|
+
|| (dataType20 === "string" && data19 && data19 == +data19 && !(data19 % 1))){
|
|
747
|
+
coerced20 = +data19;
|
|
748
|
+
}
|
|
749
|
+
else {
|
|
750
|
+
validate10.errors = [{instancePath:instancePath+"/http2SessionTimeout",schemaPath:"#/properties/http2SessionTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
|
|
751
|
+
return false;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
if(coerced20 !== undefined){
|
|
755
|
+
data19 = coerced20;
|
|
756
|
+
if(data !== undefined){
|
|
757
|
+
data["http2SessionTimeout"] = coerced20;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
var valid0 = _errs53 === errors;
|
|
762
|
+
if(valid0){
|
|
763
|
+
let data20 = data.exposeHeadRoutes;
|
|
764
|
+
const _errs55 = errors;
|
|
765
|
+
if(typeof data20 !== "boolean"){
|
|
766
|
+
let coerced21 = undefined;
|
|
767
|
+
if(!(coerced21 !== undefined)){
|
|
768
|
+
if(data20 === "false" || data20 === 0 || data20 === null){
|
|
769
|
+
coerced21 = false;
|
|
770
|
+
}
|
|
771
|
+
else if(data20 === "true" || data20 === 1){
|
|
772
|
+
coerced21 = true;
|
|
773
|
+
}
|
|
774
|
+
else {
|
|
775
|
+
validate10.errors = [{instancePath:instancePath+"/exposeHeadRoutes",schemaPath:"#/properties/exposeHeadRoutes/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
|
|
776
|
+
return false;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
if(coerced21 !== undefined){
|
|
780
|
+
data20 = coerced21;
|
|
781
|
+
if(data !== undefined){
|
|
782
|
+
data["exposeHeadRoutes"] = coerced21;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
var valid0 = _errs55 === errors;
|
|
787
|
+
if(valid0){
|
|
788
|
+
if(data.versioning !== undefined){
|
|
789
|
+
let data21 = data.versioning;
|
|
790
|
+
const _errs57 = errors;
|
|
791
|
+
if(errors === _errs57){
|
|
792
|
+
if(data21 && typeof data21 == "object" && !Array.isArray(data21)){
|
|
793
|
+
let missing1;
|
|
794
|
+
if(((data21.storage === undefined) && (missing1 = "storage")) || ((data21.deriveVersion === undefined) && (missing1 = "deriveVersion"))){
|
|
795
|
+
validate10.errors = [{instancePath:instancePath+"/versioning",schemaPath:"#/properties/versioning/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];
|
|
796
|
+
return false;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
else {
|
|
800
|
+
validate10.errors = [{instancePath:instancePath+"/versioning",schemaPath:"#/properties/versioning/type",keyword:"type",params:{type: "object"},message:"must be object"}];
|
|
801
|
+
return false;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
var valid0 = _errs57 === errors;
|
|
805
|
+
}
|
|
806
|
+
else {
|
|
807
|
+
var valid0 = true;
|
|
808
|
+
}
|
|
809
|
+
if(valid0){
|
|
810
|
+
if(data.constraints !== undefined){
|
|
811
|
+
let data22 = data.constraints;
|
|
812
|
+
const _errs60 = errors;
|
|
813
|
+
if(errors === _errs60){
|
|
814
|
+
if(data22 && typeof data22 == "object" && !Array.isArray(data22)){
|
|
815
|
+
for(const key2 in data22){
|
|
816
|
+
let data23 = data22[key2];
|
|
817
|
+
const _errs63 = errors;
|
|
818
|
+
if(errors === _errs63){
|
|
819
|
+
if(data23 && typeof data23 == "object" && !Array.isArray(data23)){
|
|
820
|
+
let missing2;
|
|
821
|
+
if(((((data23.name === undefined) && (missing2 = "name")) || ((data23.storage === undefined) && (missing2 = "storage"))) || ((data23.validate === undefined) && (missing2 = "validate"))) || ((data23.deriveConstraint === undefined) && (missing2 = "deriveConstraint"))){
|
|
822
|
+
validate10.errors = [{instancePath:instancePath+"/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/constraints/additionalProperties/required",keyword:"required",params:{missingProperty: missing2},message:"must have required property '"+missing2+"'"}];
|
|
823
|
+
return false;
|
|
824
|
+
}
|
|
825
|
+
else {
|
|
826
|
+
if(data23.name !== undefined){
|
|
827
|
+
let data24 = data23.name;
|
|
828
|
+
if(typeof data24 !== "string"){
|
|
829
|
+
let dataType22 = typeof data24;
|
|
830
|
+
let coerced22 = undefined;
|
|
831
|
+
if(!(coerced22 !== undefined)){
|
|
832
|
+
if(dataType22 == "number" || dataType22 == "boolean"){
|
|
833
|
+
coerced22 = "" + data24;
|
|
834
|
+
}
|
|
835
|
+
else if(data24 === null){
|
|
836
|
+
coerced22 = "";
|
|
837
|
+
}
|
|
838
|
+
else {
|
|
839
|
+
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"}];
|
|
840
|
+
return false;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
if(coerced22 !== undefined){
|
|
844
|
+
data24 = coerced22;
|
|
845
|
+
if(data23 !== undefined){
|
|
846
|
+
data23["name"] = coerced22;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
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"}];
|
|
855
|
+
return false;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
var valid5 = _errs63 === errors;
|
|
859
|
+
if(!valid5){
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
else {
|
|
865
|
+
validate10.errors = [{instancePath:instancePath+"/constraints",schemaPath:"#/properties/constraints/type",keyword:"type",params:{type: "object"},message:"must be object"}];
|
|
866
|
+
return false;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
var valid0 = _errs60 === errors;
|
|
870
|
+
}
|
|
871
|
+
else {
|
|
872
|
+
var valid0 = true;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
else {
|
|
898
|
+
validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];
|
|
899
|
+
return false;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
validate10.errors = vErrors;
|
|
903
|
+
return errors === 0;
|
|
904
|
+
}
|
|
905
|
+
|
|
1027
906
|
|
|
1028
|
-
module.exports.defaultInitOptions = {"connectionTimeout":0,"keepAliveTimeout":
|
|
907
|
+
module.exports.defaultInitOptions = {"connectionTimeout":0,"keepAliveTimeout":72000,"forceCloseConnections":false,"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":72000,"exposeHeadRoutes":true}
|