@platformatic/runtime 3.4.1 → 3.5.0

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/config.d.ts +224 -77
  3. package/eslint.config.js +3 -5
  4. package/index.d.ts +73 -24
  5. package/index.js +173 -29
  6. package/lib/config.js +279 -197
  7. package/lib/errors.js +126 -34
  8. package/lib/generator.js +640 -0
  9. package/lib/logger.js +43 -41
  10. package/lib/management-api.js +109 -118
  11. package/lib/prom-server.js +202 -16
  12. package/lib/runtime.js +1963 -585
  13. package/lib/scheduler.js +119 -0
  14. package/lib/schema.js +22 -234
  15. package/lib/shared-http-cache.js +43 -0
  16. package/lib/upgrade.js +6 -8
  17. package/lib/utils.js +6 -61
  18. package/lib/version.js +7 -0
  19. package/lib/versions/v1.36.0.js +2 -4
  20. package/lib/versions/v1.5.0.js +2 -4
  21. package/lib/versions/v2.0.0.js +3 -5
  22. package/lib/versions/v3.0.0.js +16 -0
  23. package/lib/worker/controller.js +302 -0
  24. package/lib/worker/http-cache.js +171 -0
  25. package/lib/worker/interceptors.js +190 -10
  26. package/lib/worker/itc.js +146 -59
  27. package/lib/worker/main.js +220 -81
  28. package/lib/worker/messaging.js +182 -0
  29. package/lib/worker/round-robin-map.js +62 -0
  30. package/lib/worker/shared-context.js +22 -0
  31. package/lib/worker/symbols.js +14 -5
  32. package/package.json +47 -38
  33. package/schema.json +1383 -55
  34. package/help/compile.txt +0 -8
  35. package/help/help.txt +0 -5
  36. package/help/start.txt +0 -21
  37. package/index.test-d.ts +0 -41
  38. package/lib/build-server.js +0 -69
  39. package/lib/compile.js +0 -98
  40. package/lib/dependencies.js +0 -59
  41. package/lib/generator/README.md +0 -32
  42. package/lib/generator/errors.js +0 -10
  43. package/lib/generator/runtime-generator.d.ts +0 -37
  44. package/lib/generator/runtime-generator.js +0 -498
  45. package/lib/start.js +0 -190
  46. package/lib/worker/app.js +0 -278
  47. package/lib/worker/default-stackable.js +0 -33
  48. package/lib/worker/metrics.js +0 -122
  49. package/runtime.mjs +0 -54
package/schema.json CHANGED
@@ -1,18 +1,33 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.4.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.5.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "title": "Platformatic Runtime Config",
4
5
  "type": "object",
5
6
  "properties": {
6
7
  "$schema": {
7
8
  "type": "string"
8
9
  },
9
10
  "preload": {
10
- "type": "string",
11
- "resolvePath": true
11
+ "anyOf": [
12
+ {
13
+ "type": "string",
14
+ "resolvePath": true
15
+ },
16
+ {
17
+ "type": "array",
18
+ "items": {
19
+ "type": "string",
20
+ "resolvePath": true
21
+ }
22
+ }
23
+ ]
12
24
  },
13
25
  "entrypoint": {
14
26
  "type": "string"
15
27
  },
28
+ "basePath": {
29
+ "type": "string"
30
+ },
16
31
  "autoload": {
17
32
  "type": "object",
18
33
  "additionalProperties": false,
@@ -48,6 +63,379 @@
48
63
  },
49
64
  "useHttp": {
50
65
  "type": "boolean"
66
+ },
67
+ "workers": {
68
+ "anyOf": [
69
+ {
70
+ "type": "number",
71
+ "minimum": 1
72
+ },
73
+ {
74
+ "type": "string"
75
+ }
76
+ ]
77
+ },
78
+ "health": {
79
+ "type": "object",
80
+ "default": {},
81
+ "properties": {
82
+ "enabled": {
83
+ "anyOf": [
84
+ {
85
+ "type": "boolean"
86
+ },
87
+ {
88
+ "type": "string"
89
+ }
90
+ ]
91
+ },
92
+ "interval": {
93
+ "anyOf": [
94
+ {
95
+ "type": "number",
96
+ "minimum": 0
97
+ },
98
+ {
99
+ "type": "string"
100
+ }
101
+ ]
102
+ },
103
+ "gracePeriod": {
104
+ "anyOf": [
105
+ {
106
+ "type": "number",
107
+ "minimum": 0
108
+ },
109
+ {
110
+ "type": "string"
111
+ }
112
+ ]
113
+ },
114
+ "maxUnhealthyChecks": {
115
+ "anyOf": [
116
+ {
117
+ "type": "number",
118
+ "minimum": 1
119
+ },
120
+ {
121
+ "type": "string"
122
+ }
123
+ ]
124
+ },
125
+ "maxELU": {
126
+ "anyOf": [
127
+ {
128
+ "type": "number",
129
+ "minimum": 0,
130
+ "maximum": 1
131
+ },
132
+ {
133
+ "type": "string"
134
+ }
135
+ ]
136
+ },
137
+ "maxHeapUsed": {
138
+ "anyOf": [
139
+ {
140
+ "type": "number",
141
+ "minimum": 0,
142
+ "maximum": 1
143
+ },
144
+ {
145
+ "type": "string"
146
+ }
147
+ ]
148
+ },
149
+ "maxHeapTotal": {
150
+ "anyOf": [
151
+ {
152
+ "type": "number",
153
+ "minimum": 0
154
+ },
155
+ {
156
+ "type": "string"
157
+ }
158
+ ]
159
+ },
160
+ "maxYoungGeneration": {
161
+ "anyOf": [
162
+ {
163
+ "type": "number",
164
+ "minimum": 0
165
+ },
166
+ {
167
+ "type": "string"
168
+ }
169
+ ]
170
+ }
171
+ },
172
+ "additionalProperties": false
173
+ },
174
+ "preload": {
175
+ "anyOf": [
176
+ {
177
+ "type": "string",
178
+ "resolvePath": true
179
+ },
180
+ {
181
+ "type": "array",
182
+ "items": {
183
+ "type": "string",
184
+ "resolvePath": true
185
+ }
186
+ }
187
+ ]
188
+ },
189
+ "dependencies": {
190
+ "type": "array",
191
+ "items": {
192
+ "type": "string"
193
+ }
194
+ },
195
+ "arguments": {
196
+ "type": "array",
197
+ "items": {
198
+ "type": "string"
199
+ }
200
+ },
201
+ "nodeOptions": {
202
+ "type": "string"
203
+ }
204
+ }
205
+ }
206
+ }
207
+ }
208
+ },
209
+ "applications": {
210
+ "type": "array",
211
+ "items": {
212
+ "type": "object",
213
+ "anyOf": [
214
+ {
215
+ "required": [
216
+ "id",
217
+ "path"
218
+ ]
219
+ },
220
+ {
221
+ "required": [
222
+ "id",
223
+ "url"
224
+ ]
225
+ }
226
+ ],
227
+ "properties": {
228
+ "id": {
229
+ "type": "string"
230
+ },
231
+ "path": {
232
+ "type": "string",
233
+ "allowEmptyPaths": true,
234
+ "resolvePath": true
235
+ },
236
+ "config": {
237
+ "type": "string"
238
+ },
239
+ "url": {
240
+ "type": "string"
241
+ },
242
+ "gitBranch": {
243
+ "type": "string",
244
+ "default": "main"
245
+ },
246
+ "useHttp": {
247
+ "type": "boolean"
248
+ },
249
+ "workers": {
250
+ "anyOf": [
251
+ {
252
+ "type": "number",
253
+ "minimum": 1
254
+ },
255
+ {
256
+ "type": "string"
257
+ }
258
+ ]
259
+ },
260
+ "health": {
261
+ "type": "object",
262
+ "default": {},
263
+ "properties": {
264
+ "enabled": {
265
+ "anyOf": [
266
+ {
267
+ "type": "boolean"
268
+ },
269
+ {
270
+ "type": "string"
271
+ }
272
+ ]
273
+ },
274
+ "interval": {
275
+ "anyOf": [
276
+ {
277
+ "type": "number",
278
+ "minimum": 0
279
+ },
280
+ {
281
+ "type": "string"
282
+ }
283
+ ]
284
+ },
285
+ "gracePeriod": {
286
+ "anyOf": [
287
+ {
288
+ "type": "number",
289
+ "minimum": 0
290
+ },
291
+ {
292
+ "type": "string"
293
+ }
294
+ ]
295
+ },
296
+ "maxUnhealthyChecks": {
297
+ "anyOf": [
298
+ {
299
+ "type": "number",
300
+ "minimum": 1
301
+ },
302
+ {
303
+ "type": "string"
304
+ }
305
+ ]
306
+ },
307
+ "maxELU": {
308
+ "anyOf": [
309
+ {
310
+ "type": "number",
311
+ "minimum": 0,
312
+ "maximum": 1
313
+ },
314
+ {
315
+ "type": "string"
316
+ }
317
+ ]
318
+ },
319
+ "maxHeapUsed": {
320
+ "anyOf": [
321
+ {
322
+ "type": "number",
323
+ "minimum": 0,
324
+ "maximum": 1
325
+ },
326
+ {
327
+ "type": "string"
328
+ }
329
+ ]
330
+ },
331
+ "maxHeapTotal": {
332
+ "anyOf": [
333
+ {
334
+ "type": "number",
335
+ "minimum": 0
336
+ },
337
+ {
338
+ "type": "string"
339
+ }
340
+ ]
341
+ },
342
+ "maxYoungGeneration": {
343
+ "anyOf": [
344
+ {
345
+ "type": "number",
346
+ "minimum": 0
347
+ },
348
+ {
349
+ "type": "string"
350
+ }
351
+ ]
352
+ }
353
+ },
354
+ "additionalProperties": false
355
+ },
356
+ "dependencies": {
357
+ "type": "array",
358
+ "items": {
359
+ "type": "string"
360
+ },
361
+ "default": []
362
+ },
363
+ "arguments": {
364
+ "type": "array",
365
+ "items": {
366
+ "type": "string"
367
+ }
368
+ },
369
+ "env": {
370
+ "type": "object",
371
+ "additionalProperties": {
372
+ "type": "string"
373
+ }
374
+ },
375
+ "envfile": {
376
+ "type": "string"
377
+ },
378
+ "sourceMaps": {
379
+ "type": "boolean",
380
+ "default": false
381
+ },
382
+ "packageManager": {
383
+ "type": "string",
384
+ "enum": [
385
+ "npm",
386
+ "pnpm",
387
+ "yarn"
388
+ ]
389
+ },
390
+ "preload": {
391
+ "anyOf": [
392
+ {
393
+ "type": "string",
394
+ "resolvePath": true
395
+ },
396
+ {
397
+ "type": "array",
398
+ "items": {
399
+ "type": "string",
400
+ "resolvePath": true
401
+ }
402
+ }
403
+ ]
404
+ },
405
+ "nodeOptions": {
406
+ "type": "string"
407
+ },
408
+ "telemetry": {
409
+ "type": "object",
410
+ "properties": {
411
+ "instrumentations": {
412
+ "type": "array",
413
+ "description": "An array of instrumentations loaded if telemetry is enabled",
414
+ "items": {
415
+ "oneOf": [
416
+ {
417
+ "type": "string"
418
+ },
419
+ {
420
+ "type": "object",
421
+ "properties": {
422
+ "package": {
423
+ "type": "string"
424
+ },
425
+ "exportName": {
426
+ "type": "string"
427
+ },
428
+ "options": {
429
+ "type": "object",
430
+ "additionalProperties": true
431
+ }
432
+ },
433
+ "required": [
434
+ "package"
435
+ ]
436
+ }
437
+ ]
438
+ }
51
439
  }
52
440
  }
53
441
  }
@@ -78,6 +466,7 @@
78
466
  },
79
467
  "path": {
80
468
  "type": "string",
469
+ "allowEmptyPaths": true,
81
470
  "resolvePath": true
82
471
  },
83
472
  "config": {
@@ -86,8 +475,205 @@
86
475
  "url": {
87
476
  "type": "string"
88
477
  },
478
+ "gitBranch": {
479
+ "type": "string",
480
+ "default": "main"
481
+ },
89
482
  "useHttp": {
90
483
  "type": "boolean"
484
+ },
485
+ "workers": {
486
+ "anyOf": [
487
+ {
488
+ "type": "number",
489
+ "minimum": 1
490
+ },
491
+ {
492
+ "type": "string"
493
+ }
494
+ ]
495
+ },
496
+ "health": {
497
+ "type": "object",
498
+ "default": {},
499
+ "properties": {
500
+ "enabled": {
501
+ "anyOf": [
502
+ {
503
+ "type": "boolean"
504
+ },
505
+ {
506
+ "type": "string"
507
+ }
508
+ ]
509
+ },
510
+ "interval": {
511
+ "anyOf": [
512
+ {
513
+ "type": "number",
514
+ "minimum": 0
515
+ },
516
+ {
517
+ "type": "string"
518
+ }
519
+ ]
520
+ },
521
+ "gracePeriod": {
522
+ "anyOf": [
523
+ {
524
+ "type": "number",
525
+ "minimum": 0
526
+ },
527
+ {
528
+ "type": "string"
529
+ }
530
+ ]
531
+ },
532
+ "maxUnhealthyChecks": {
533
+ "anyOf": [
534
+ {
535
+ "type": "number",
536
+ "minimum": 1
537
+ },
538
+ {
539
+ "type": "string"
540
+ }
541
+ ]
542
+ },
543
+ "maxELU": {
544
+ "anyOf": [
545
+ {
546
+ "type": "number",
547
+ "minimum": 0,
548
+ "maximum": 1
549
+ },
550
+ {
551
+ "type": "string"
552
+ }
553
+ ]
554
+ },
555
+ "maxHeapUsed": {
556
+ "anyOf": [
557
+ {
558
+ "type": "number",
559
+ "minimum": 0,
560
+ "maximum": 1
561
+ },
562
+ {
563
+ "type": "string"
564
+ }
565
+ ]
566
+ },
567
+ "maxHeapTotal": {
568
+ "anyOf": [
569
+ {
570
+ "type": "number",
571
+ "minimum": 0
572
+ },
573
+ {
574
+ "type": "string"
575
+ }
576
+ ]
577
+ },
578
+ "maxYoungGeneration": {
579
+ "anyOf": [
580
+ {
581
+ "type": "number",
582
+ "minimum": 0
583
+ },
584
+ {
585
+ "type": "string"
586
+ }
587
+ ]
588
+ }
589
+ },
590
+ "additionalProperties": false
591
+ },
592
+ "dependencies": {
593
+ "type": "array",
594
+ "items": {
595
+ "type": "string"
596
+ },
597
+ "default": []
598
+ },
599
+ "arguments": {
600
+ "type": "array",
601
+ "items": {
602
+ "type": "string"
603
+ }
604
+ },
605
+ "env": {
606
+ "type": "object",
607
+ "additionalProperties": {
608
+ "type": "string"
609
+ }
610
+ },
611
+ "envfile": {
612
+ "type": "string"
613
+ },
614
+ "sourceMaps": {
615
+ "type": "boolean",
616
+ "default": false
617
+ },
618
+ "packageManager": {
619
+ "type": "string",
620
+ "enum": [
621
+ "npm",
622
+ "pnpm",
623
+ "yarn"
624
+ ]
625
+ },
626
+ "preload": {
627
+ "anyOf": [
628
+ {
629
+ "type": "string",
630
+ "resolvePath": true
631
+ },
632
+ {
633
+ "type": "array",
634
+ "items": {
635
+ "type": "string",
636
+ "resolvePath": true
637
+ }
638
+ }
639
+ ]
640
+ },
641
+ "nodeOptions": {
642
+ "type": "string"
643
+ },
644
+ "telemetry": {
645
+ "type": "object",
646
+ "properties": {
647
+ "instrumentations": {
648
+ "type": "array",
649
+ "description": "An array of instrumentations loaded if telemetry is enabled",
650
+ "items": {
651
+ "oneOf": [
652
+ {
653
+ "type": "string"
654
+ },
655
+ {
656
+ "type": "object",
657
+ "properties": {
658
+ "package": {
659
+ "type": "string"
660
+ },
661
+ "exportName": {
662
+ "type": "string"
663
+ },
664
+ "options": {
665
+ "type": "object",
666
+ "additionalProperties": true
667
+ }
668
+ },
669
+ "required": [
670
+ "package"
671
+ ]
672
+ }
673
+ ]
674
+ }
675
+ }
676
+ }
91
677
  }
92
678
  }
93
679
  }
@@ -116,6 +702,7 @@
116
702
  },
117
703
  "path": {
118
704
  "type": "string",
705
+ "allowEmptyPaths": true,
119
706
  "resolvePath": true
120
707
  },
121
708
  "config": {
@@ -124,12 +711,221 @@
124
711
  "url": {
125
712
  "type": "string"
126
713
  },
714
+ "gitBranch": {
715
+ "type": "string",
716
+ "default": "main"
717
+ },
127
718
  "useHttp": {
128
719
  "type": "boolean"
720
+ },
721
+ "workers": {
722
+ "anyOf": [
723
+ {
724
+ "type": "number",
725
+ "minimum": 1
726
+ },
727
+ {
728
+ "type": "string"
729
+ }
730
+ ]
731
+ },
732
+ "health": {
733
+ "type": "object",
734
+ "default": {},
735
+ "properties": {
736
+ "enabled": {
737
+ "anyOf": [
738
+ {
739
+ "type": "boolean"
740
+ },
741
+ {
742
+ "type": "string"
743
+ }
744
+ ]
745
+ },
746
+ "interval": {
747
+ "anyOf": [
748
+ {
749
+ "type": "number",
750
+ "minimum": 0
751
+ },
752
+ {
753
+ "type": "string"
754
+ }
755
+ ]
756
+ },
757
+ "gracePeriod": {
758
+ "anyOf": [
759
+ {
760
+ "type": "number",
761
+ "minimum": 0
762
+ },
763
+ {
764
+ "type": "string"
765
+ }
766
+ ]
767
+ },
768
+ "maxUnhealthyChecks": {
769
+ "anyOf": [
770
+ {
771
+ "type": "number",
772
+ "minimum": 1
773
+ },
774
+ {
775
+ "type": "string"
776
+ }
777
+ ]
778
+ },
779
+ "maxELU": {
780
+ "anyOf": [
781
+ {
782
+ "type": "number",
783
+ "minimum": 0,
784
+ "maximum": 1
785
+ },
786
+ {
787
+ "type": "string"
788
+ }
789
+ ]
790
+ },
791
+ "maxHeapUsed": {
792
+ "anyOf": [
793
+ {
794
+ "type": "number",
795
+ "minimum": 0,
796
+ "maximum": 1
797
+ },
798
+ {
799
+ "type": "string"
800
+ }
801
+ ]
802
+ },
803
+ "maxHeapTotal": {
804
+ "anyOf": [
805
+ {
806
+ "type": "number",
807
+ "minimum": 0
808
+ },
809
+ {
810
+ "type": "string"
811
+ }
812
+ ]
813
+ },
814
+ "maxYoungGeneration": {
815
+ "anyOf": [
816
+ {
817
+ "type": "number",
818
+ "minimum": 0
819
+ },
820
+ {
821
+ "type": "string"
822
+ }
823
+ ]
824
+ }
825
+ },
826
+ "additionalProperties": false
827
+ },
828
+ "dependencies": {
829
+ "type": "array",
830
+ "items": {
831
+ "type": "string"
832
+ },
833
+ "default": []
834
+ },
835
+ "arguments": {
836
+ "type": "array",
837
+ "items": {
838
+ "type": "string"
839
+ }
840
+ },
841
+ "env": {
842
+ "type": "object",
843
+ "additionalProperties": {
844
+ "type": "string"
845
+ }
846
+ },
847
+ "envfile": {
848
+ "type": "string"
849
+ },
850
+ "sourceMaps": {
851
+ "type": "boolean",
852
+ "default": false
853
+ },
854
+ "packageManager": {
855
+ "type": "string",
856
+ "enum": [
857
+ "npm",
858
+ "pnpm",
859
+ "yarn"
860
+ ]
861
+ },
862
+ "preload": {
863
+ "anyOf": [
864
+ {
865
+ "type": "string",
866
+ "resolvePath": true
867
+ },
868
+ {
869
+ "type": "array",
870
+ "items": {
871
+ "type": "string",
872
+ "resolvePath": true
873
+ }
874
+ }
875
+ ]
876
+ },
877
+ "nodeOptions": {
878
+ "type": "string"
879
+ },
880
+ "telemetry": {
881
+ "type": "object",
882
+ "properties": {
883
+ "instrumentations": {
884
+ "type": "array",
885
+ "description": "An array of instrumentations loaded if telemetry is enabled",
886
+ "items": {
887
+ "oneOf": [
888
+ {
889
+ "type": "string"
890
+ },
891
+ {
892
+ "type": "object",
893
+ "properties": {
894
+ "package": {
895
+ "type": "string"
896
+ },
897
+ "exportName": {
898
+ "type": "string"
899
+ },
900
+ "options": {
901
+ "type": "object",
902
+ "additionalProperties": true
903
+ }
904
+ },
905
+ "required": [
906
+ "package"
907
+ ]
908
+ }
909
+ ]
910
+ }
911
+ }
912
+ }
129
913
  }
130
914
  }
131
915
  }
132
916
  },
917
+ "workers": {
918
+ "anyOf": [
919
+ {
920
+ "type": "number",
921
+ "minimum": 1
922
+ },
923
+ {
924
+ "type": "string"
925
+ }
926
+ ],
927
+ "default": 1
928
+ },
133
929
  "logger": {
134
930
  "type": "object",
135
931
  "properties": {
@@ -177,17 +973,25 @@
177
973
  "type": "object",
178
974
  "properties": {
179
975
  "target": {
180
- "type": "string",
181
- "resolveModule": true
976
+ "anyOf": [
977
+ {
978
+ "type": "string",
979
+ "resolveModule": true
980
+ },
981
+ {
982
+ "type": "string",
983
+ "resolvePath": true
984
+ }
985
+ ]
182
986
  },
183
987
  "options": {
184
988
  "type": "object"
185
989
  },
186
990
  "level": {
187
991
  "type": "string"
188
- },
189
- "additionalProperties": false
190
- }
992
+ }
993
+ },
994
+ "additionalProperties": false
191
995
  }
192
996
  },
193
997
  "options": {
@@ -210,6 +1014,68 @@
210
1014
  }
211
1015
  },
212
1016
  "additionalProperties": false
1017
+ },
1018
+ "formatters": {
1019
+ "type": "object",
1020
+ "properties": {
1021
+ "path": {
1022
+ "type": "string",
1023
+ "resolvePath": true
1024
+ }
1025
+ },
1026
+ "required": [
1027
+ "path"
1028
+ ],
1029
+ "additionalProperties": false
1030
+ },
1031
+ "timestamp": {
1032
+ "enum": [
1033
+ "epochTime",
1034
+ "unixTime",
1035
+ "nullTime",
1036
+ "isoTime"
1037
+ ]
1038
+ },
1039
+ "redact": {
1040
+ "type": "object",
1041
+ "properties": {
1042
+ "paths": {
1043
+ "type": "array",
1044
+ "items": {
1045
+ "type": "string"
1046
+ }
1047
+ },
1048
+ "censor": {
1049
+ "type": "string",
1050
+ "default": "[redacted]"
1051
+ }
1052
+ },
1053
+ "required": [
1054
+ "paths"
1055
+ ],
1056
+ "additionalProperties": false
1057
+ },
1058
+ "base": {
1059
+ "anyOf": [
1060
+ {
1061
+ "type": "object",
1062
+ "additionalProperties": true
1063
+ },
1064
+ {
1065
+ "type": "null"
1066
+ }
1067
+ ]
1068
+ },
1069
+ "messageKey": {
1070
+ "type": "string"
1071
+ },
1072
+ "customLevels": {
1073
+ "type": "object",
1074
+ "additionalProperties": true
1075
+ },
1076
+ "captureStdio": {
1077
+ "type": "boolean",
1078
+ "default": true
213
1079
  }
214
1080
  },
215
1081
  "required": [
@@ -241,6 +1107,9 @@
241
1107
  "https": {
242
1108
  "type": "object",
243
1109
  "properties": {
1110
+ "allowHTTP1": {
1111
+ "type": "boolean"
1112
+ },
244
1113
  "key": {
245
1114
  "anyOf": [
246
1115
  {
@@ -314,29 +1183,182 @@
314
1183
  }
315
1184
  }
316
1185
  ]
1186
+ },
1187
+ "requestCert": {
1188
+ "type": "boolean"
1189
+ },
1190
+ "rejectUnauthorized": {
1191
+ "type": "boolean"
1192
+ }
1193
+ },
1194
+ "additionalProperties": false,
1195
+ "required": [
1196
+ "key",
1197
+ "cert"
1198
+ ]
1199
+ }
1200
+ },
1201
+ "additionalProperties": false
1202
+ },
1203
+ "startTimeout": {
1204
+ "default": 30000,
1205
+ "type": "number",
1206
+ "minimum": 0
1207
+ },
1208
+ "restartOnError": {
1209
+ "default": true,
1210
+ "anyOf": [
1211
+ {
1212
+ "type": "boolean"
1213
+ },
1214
+ {
1215
+ "type": "number",
1216
+ "minimum": 0
1217
+ }
1218
+ ]
1219
+ },
1220
+ "exitOnUnhandledErrors": {
1221
+ "default": true,
1222
+ "type": "boolean"
1223
+ },
1224
+ "gracefulShutdown": {
1225
+ "type": "object",
1226
+ "properties": {
1227
+ "runtime": {
1228
+ "anyOf": [
1229
+ {
1230
+ "type": "number",
1231
+ "minimum": 1
1232
+ },
1233
+ {
1234
+ "type": "string"
1235
+ }
1236
+ ],
1237
+ "default": 10000
1238
+ },
1239
+ "application": {
1240
+ "anyOf": [
1241
+ {
1242
+ "type": "number",
1243
+ "minimum": 1
1244
+ },
1245
+ {
1246
+ "type": "string"
1247
+ }
1248
+ ],
1249
+ "default": 10000
1250
+ }
1251
+ },
1252
+ "default": {},
1253
+ "required": [
1254
+ "runtime",
1255
+ "application"
1256
+ ],
1257
+ "additionalProperties": false
1258
+ },
1259
+ "health": {
1260
+ "type": "object",
1261
+ "default": {},
1262
+ "properties": {
1263
+ "enabled": {
1264
+ "anyOf": [
1265
+ {
1266
+ "type": "boolean"
1267
+ },
1268
+ {
1269
+ "type": "string"
1270
+ }
1271
+ ],
1272
+ "default": true
1273
+ },
1274
+ "interval": {
1275
+ "anyOf": [
1276
+ {
1277
+ "type": "number",
1278
+ "minimum": 0
1279
+ },
1280
+ {
1281
+ "type": "string"
1282
+ }
1283
+ ],
1284
+ "default": 30000
1285
+ },
1286
+ "gracePeriod": {
1287
+ "anyOf": [
1288
+ {
1289
+ "type": "number",
1290
+ "minimum": 0
1291
+ },
1292
+ {
1293
+ "type": "string"
1294
+ }
1295
+ ],
1296
+ "default": 30000
1297
+ },
1298
+ "maxUnhealthyChecks": {
1299
+ "anyOf": [
1300
+ {
1301
+ "type": "number",
1302
+ "minimum": 1
1303
+ },
1304
+ {
1305
+ "type": "string"
1306
+ }
1307
+ ],
1308
+ "default": 10
1309
+ },
1310
+ "maxELU": {
1311
+ "anyOf": [
1312
+ {
1313
+ "type": "number",
1314
+ "minimum": 0,
1315
+ "maximum": 1
1316
+ },
1317
+ {
1318
+ "type": "string"
1319
+ }
1320
+ ],
1321
+ "default": 0.99
1322
+ },
1323
+ "maxHeapUsed": {
1324
+ "anyOf": [
1325
+ {
1326
+ "type": "number",
1327
+ "minimum": 0,
1328
+ "maximum": 1
1329
+ },
1330
+ {
1331
+ "type": "string"
1332
+ }
1333
+ ],
1334
+ "default": 0.99
1335
+ },
1336
+ "maxHeapTotal": {
1337
+ "anyOf": [
1338
+ {
1339
+ "type": "number",
1340
+ "minimum": 0
1341
+ },
1342
+ {
1343
+ "type": "string"
1344
+ }
1345
+ ],
1346
+ "default": 4294967296
1347
+ },
1348
+ "maxYoungGeneration": {
1349
+ "anyOf": [
1350
+ {
1351
+ "type": "number",
1352
+ "minimum": 0
1353
+ },
1354
+ {
1355
+ "type": "string"
317
1356
  }
318
- },
319
- "additionalProperties": false,
320
- "required": [
321
- "key",
322
- "cert"
323
1357
  ]
324
1358
  }
325
1359
  },
326
1360
  "additionalProperties": false
327
1361
  },
328
- "restartOnError": {
329
- "default": true,
330
- "anyOf": [
331
- {
332
- "type": "boolean"
333
- },
334
- {
335
- "type": "number",
336
- "minimum": 100
337
- }
338
- ]
339
- },
340
1362
  "undici": {
341
1363
  "type": "object",
342
1364
  "properties": {
@@ -349,7 +1371,20 @@
349
1371
  {
350
1372
  "type": "array",
351
1373
  "items": {
352
- "$ref": "#/$defs/undiciInterceptor"
1374
+ "type": "object",
1375
+ "properties": {
1376
+ "module": {
1377
+ "type": "string"
1378
+ },
1379
+ "options": {
1380
+ "type": "object",
1381
+ "additionalProperties": true
1382
+ }
1383
+ },
1384
+ "required": [
1385
+ "module",
1386
+ "options"
1387
+ ]
353
1388
  }
354
1389
  },
355
1390
  {
@@ -358,19 +1393,58 @@
358
1393
  "Client": {
359
1394
  "type": "array",
360
1395
  "items": {
361
- "$ref": "#/$defs/undiciInterceptor"
1396
+ "type": "object",
1397
+ "properties": {
1398
+ "module": {
1399
+ "type": "string"
1400
+ },
1401
+ "options": {
1402
+ "type": "object",
1403
+ "additionalProperties": true
1404
+ }
1405
+ },
1406
+ "required": [
1407
+ "module",
1408
+ "options"
1409
+ ]
362
1410
  }
363
1411
  },
364
1412
  "Pool": {
365
1413
  "type": "array",
366
1414
  "items": {
367
- "$ref": "#/$defs/undiciInterceptor"
1415
+ "type": "object",
1416
+ "properties": {
1417
+ "module": {
1418
+ "type": "string"
1419
+ },
1420
+ "options": {
1421
+ "type": "object",
1422
+ "additionalProperties": true
1423
+ }
1424
+ },
1425
+ "required": [
1426
+ "module",
1427
+ "options"
1428
+ ]
368
1429
  }
369
1430
  },
370
1431
  "Agent": {
371
1432
  "type": "array",
372
1433
  "items": {
373
- "$ref": "#/$defs/undiciInterceptor"
1434
+ "type": "object",
1435
+ "properties": {
1436
+ "module": {
1437
+ "type": "string"
1438
+ },
1439
+ "options": {
1440
+ "type": "object",
1441
+ "additionalProperties": true
1442
+ }
1443
+ },
1444
+ "required": [
1445
+ "module",
1446
+ "options"
1447
+ ]
374
1448
  }
375
1449
  }
376
1450
  }
@@ -379,6 +1453,44 @@
379
1453
  }
380
1454
  }
381
1455
  },
1456
+ "httpCache": {
1457
+ "oneOf": [
1458
+ {
1459
+ "type": "boolean"
1460
+ },
1461
+ {
1462
+ "type": "object",
1463
+ "properties": {
1464
+ "store": {
1465
+ "type": "string"
1466
+ },
1467
+ "methods": {
1468
+ "type": "array",
1469
+ "items": {
1470
+ "type": "string"
1471
+ },
1472
+ "default": [
1473
+ "GET",
1474
+ "HEAD"
1475
+ ],
1476
+ "minItems": 1
1477
+ },
1478
+ "cacheTagsHeader": {
1479
+ "type": "string"
1480
+ },
1481
+ "maxSize": {
1482
+ "type": "integer"
1483
+ },
1484
+ "maxEntrySize": {
1485
+ "type": "integer"
1486
+ },
1487
+ "maxCount": {
1488
+ "type": "integer"
1489
+ }
1490
+ }
1491
+ }
1492
+ ]
1493
+ },
382
1494
  "watch": {
383
1495
  "anyOf": [
384
1496
  {
@@ -435,6 +1547,16 @@
435
1547
  }
436
1548
  ]
437
1549
  },
1550
+ "enabled": {
1551
+ "anyOf": [
1552
+ {
1553
+ "type": "boolean"
1554
+ },
1555
+ {
1556
+ "type": "string"
1557
+ }
1558
+ ]
1559
+ },
438
1560
  "hostname": {
439
1561
  "type": "string"
440
1562
  },
@@ -462,6 +1584,102 @@
462
1584
  "additionalProperties": {
463
1585
  "type": "string"
464
1586
  }
1587
+ },
1588
+ "applicationLabel": {
1589
+ "type": "string",
1590
+ "default": "applicationId",
1591
+ "description": "The label name to use for the application identifier in metrics (e.g., applicationId, serviceId)"
1592
+ },
1593
+ "readiness": {
1594
+ "anyOf": [
1595
+ {
1596
+ "type": "boolean"
1597
+ },
1598
+ {
1599
+ "type": "object",
1600
+ "properties": {
1601
+ "endpoint": {
1602
+ "type": "string"
1603
+ },
1604
+ "success": {
1605
+ "type": "object",
1606
+ "properties": {
1607
+ "statusCode": {
1608
+ "type": "number"
1609
+ },
1610
+ "body": {
1611
+ "type": "string"
1612
+ }
1613
+ },
1614
+ "additionalProperties": false
1615
+ },
1616
+ "fail": {
1617
+ "type": "object",
1618
+ "properties": {
1619
+ "statusCode": {
1620
+ "type": "number"
1621
+ },
1622
+ "body": {
1623
+ "type": "string"
1624
+ }
1625
+ },
1626
+ "additionalProperties": false
1627
+ }
1628
+ },
1629
+ "additionalProperties": false
1630
+ }
1631
+ ]
1632
+ },
1633
+ "liveness": {
1634
+ "anyOf": [
1635
+ {
1636
+ "type": "boolean"
1637
+ },
1638
+ {
1639
+ "type": "object",
1640
+ "properties": {
1641
+ "endpoint": {
1642
+ "type": "string"
1643
+ },
1644
+ "success": {
1645
+ "type": "object",
1646
+ "properties": {
1647
+ "statusCode": {
1648
+ "type": "number"
1649
+ },
1650
+ "body": {
1651
+ "type": "string"
1652
+ }
1653
+ },
1654
+ "additionalProperties": false
1655
+ },
1656
+ "fail": {
1657
+ "type": "object",
1658
+ "properties": {
1659
+ "statusCode": {
1660
+ "type": "number"
1661
+ },
1662
+ "body": {
1663
+ "type": "string"
1664
+ }
1665
+ },
1666
+ "additionalProperties": false
1667
+ }
1668
+ },
1669
+ "additionalProperties": false
1670
+ }
1671
+ ]
1672
+ },
1673
+ "plugins": {
1674
+ "type": "array",
1675
+ "items": {
1676
+ "anyOf": [
1677
+ {
1678
+ "type": "string",
1679
+ "resolvePath": true
1680
+ }
1681
+ ]
1682
+ }
465
1683
  }
466
1684
  },
467
1685
  "additionalProperties": false
@@ -469,16 +1687,25 @@
469
1687
  ]
470
1688
  },
471
1689
  "telemetry": {
472
- "$id": "/OpenTelemetry",
473
1690
  "type": "object",
474
1691
  "properties": {
475
- "serviceName": {
1692
+ "enabled": {
1693
+ "anyOf": [
1694
+ {
1695
+ "type": "boolean"
1696
+ },
1697
+ {
1698
+ "type": "string"
1699
+ }
1700
+ ]
1701
+ },
1702
+ "applicationName": {
476
1703
  "type": "string",
477
- "description": "The name of the service. Defaults to the folder name if not specified."
1704
+ "description": "The name of the application. Defaults to the folder name if not specified."
478
1705
  },
479
1706
  "version": {
480
1707
  "type": "string",
481
- "description": "The version of the service (optional)"
1708
+ "description": "The version of the application (optional)"
482
1709
  },
483
1710
  "skip": {
484
1711
  "type": "array",
@@ -519,7 +1746,8 @@
519
1746
  "console",
520
1747
  "otlp",
521
1748
  "zipkin",
522
- "memory"
1749
+ "memory",
1750
+ "file"
523
1751
  ],
524
1752
  "default": "console"
525
1753
  },
@@ -534,6 +1762,10 @@
534
1762
  "headers": {
535
1763
  "type": "object",
536
1764
  "description": "Headers to send to the exporter. Not used for console or memory exporters."
1765
+ },
1766
+ "path": {
1767
+ "type": "string",
1768
+ "description": "The path to write the traces to. Only for file exporter."
537
1769
  }
538
1770
  }
539
1771
  },
@@ -550,7 +1782,8 @@
550
1782
  "console",
551
1783
  "otlp",
552
1784
  "zipkin",
553
- "memory"
1785
+ "memory",
1786
+ "file"
554
1787
  ],
555
1788
  "default": "console"
556
1789
  },
@@ -565,6 +1798,10 @@
565
1798
  "headers": {
566
1799
  "type": "object",
567
1800
  "description": "Headers to send to the exporter. Not used for console or memory exporters."
1801
+ },
1802
+ "path": {
1803
+ "type": "string",
1804
+ "description": "The path to write the traces to. Only for file exporter."
568
1805
  }
569
1806
  }
570
1807
  },
@@ -575,7 +1812,7 @@
575
1812
  }
576
1813
  },
577
1814
  "required": [
578
- "serviceName"
1815
+ "applicationName"
579
1816
  ],
580
1817
  "additionalProperties": false
581
1818
  },
@@ -595,6 +1832,110 @@
595
1832
  "type": "boolean"
596
1833
  }
597
1834
  }
1835
+ },
1836
+ "applicationTimeout": {
1837
+ "anyOf": [
1838
+ {
1839
+ "type": "number",
1840
+ "minimum": 1
1841
+ },
1842
+ {
1843
+ "type": "string"
1844
+ }
1845
+ ],
1846
+ "default": 300000
1847
+ },
1848
+ "messagingTimeout": {
1849
+ "anyOf": [
1850
+ {
1851
+ "type": "number",
1852
+ "minimum": 1
1853
+ },
1854
+ {
1855
+ "type": "string"
1856
+ }
1857
+ ],
1858
+ "default": 30000
1859
+ },
1860
+ "resolvedApplicationsBasePath": {
1861
+ "type": "string",
1862
+ "default": "external"
1863
+ },
1864
+ "env": {
1865
+ "type": "object",
1866
+ "additionalProperties": {
1867
+ "type": "string"
1868
+ }
1869
+ },
1870
+ "sourceMaps": {
1871
+ "type": "boolean",
1872
+ "default": false
1873
+ },
1874
+ "scheduler": {
1875
+ "type": "array",
1876
+ "items": {
1877
+ "type": "object",
1878
+ "properties": {
1879
+ "enabled": {
1880
+ "anyOf": [
1881
+ {
1882
+ "type": "boolean"
1883
+ },
1884
+ {
1885
+ "type": "string"
1886
+ }
1887
+ ],
1888
+ "default": true
1889
+ },
1890
+ "name": {
1891
+ "type": "string"
1892
+ },
1893
+ "cron": {
1894
+ "type": "string"
1895
+ },
1896
+ "callbackUrl": {
1897
+ "type": "string"
1898
+ },
1899
+ "method": {
1900
+ "type": "string",
1901
+ "enum": [
1902
+ "GET",
1903
+ "POST",
1904
+ "PUT",
1905
+ "PATCH",
1906
+ "DELETE"
1907
+ ],
1908
+ "default": "GET"
1909
+ },
1910
+ "headers": {
1911
+ "type": "object",
1912
+ "additionalProperties": {
1913
+ "type": "string"
1914
+ }
1915
+ },
1916
+ "body": {
1917
+ "anyOf": [
1918
+ {
1919
+ "type": "string"
1920
+ },
1921
+ {
1922
+ "type": "object",
1923
+ "additionalProperties": true
1924
+ }
1925
+ ]
1926
+ },
1927
+ "maxRetries": {
1928
+ "type": "number",
1929
+ "minimum": 0,
1930
+ "default": 3
1931
+ }
1932
+ },
1933
+ "required": [
1934
+ "name",
1935
+ "cron",
1936
+ "callbackUrl"
1937
+ ]
1938
+ }
598
1939
  }
599
1940
  },
600
1941
  "anyOf": [
@@ -603,6 +1944,11 @@
603
1944
  "autoload"
604
1945
  ]
605
1946
  },
1947
+ {
1948
+ "required": [
1949
+ "applications"
1950
+ ]
1951
+ },
606
1952
  {
607
1953
  "required": [
608
1954
  "services"
@@ -614,23 +1960,5 @@
614
1960
  ]
615
1961
  }
616
1962
  ],
617
- "additionalProperties": false,
618
- "$defs": {
619
- "undiciInterceptor": {
620
- "type": "object",
621
- "properties": {
622
- "module": {
623
- "type": "string"
624
- },
625
- "options": {
626
- "type": "object",
627
- "additionalProperties": true
628
- }
629
- },
630
- "required": [
631
- "module",
632
- "options"
633
- ]
634
- }
635
- }
1963
+ "additionalProperties": false
636
1964
  }