@platformatic/runtime 2.0.0-alpha.1 → 2.0.0-alpha.10

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 (177) hide show
  1. package/config.d.ts +284 -0
  2. package/eslint.config.js +8 -0
  3. package/fixtures/botched-start/platformatic.runtime.json +1 -1
  4. package/fixtures/botched-start/services/a/platformatic.service.json +1 -1
  5. package/fixtures/composerApp/platformatic.composer.json +1 -1
  6. package/fixtures/configs/invalid-autoload-with-services.json +1 -1
  7. package/fixtures/configs/invalid-entrypoint.json +1 -1
  8. package/fixtures/configs/invalid-schema-type.config.json +1 -1
  9. package/fixtures/configs/missing-property.config.json +1 -1
  10. package/fixtures/configs/missing-service-config.json +1 -1
  11. package/fixtures/configs/monorepo-composer-no-autoload.json +2 -2
  12. package/fixtures/configs/monorepo-composer.json +2 -2
  13. package/fixtures/configs/monorepo-create-cycle.json +2 -2
  14. package/fixtures/configs/monorepo-missing-dependencies.json +2 -2
  15. package/fixtures/configs/monorepo-no-cycles.json +2 -2
  16. package/fixtures/configs/monorepo-openapi.json +2 -2
  17. package/fixtures/configs/{monorepo-hotreload-env.json → monorepo-watch-env.json} +2 -2
  18. package/fixtures/configs/monorepo-watch-single.json +12 -0
  19. package/fixtures/configs/monorepo-watch.json +26 -9
  20. package/fixtures/configs/monorepo-with-dependencies.json +2 -2
  21. package/fixtures/configs/monorepo-with-management-api-without-metrics.json +21 -0
  22. package/fixtures/configs/monorepo-with-management-api.json +2 -2
  23. package/fixtures/configs/{monorepo-hotreload.json → monorepo-with-metrics.json} +5 -4
  24. package/fixtures/configs/monorepo.json +2 -2
  25. package/fixtures/configs/no-services.config.json +1 -1
  26. package/fixtures/configs/no-sources.config.json +1 -1
  27. package/fixtures/configs/service-throws-on-start.json +1 -1
  28. package/fixtures/configs/service-with-env-port.json +2 -2
  29. package/fixtures/configs/service-with-stdio.json +12 -0
  30. package/fixtures/configs/{hotreload.json → watch.json} +2 -2
  31. package/fixtures/crash-on-bootstrap/platformatic.runtime.json +15 -0
  32. package/fixtures/crash-on-bootstrap/services/service-1/platformatic.service.json +14 -0
  33. package/fixtures/crash-on-bootstrap/services/service-1/plugin.js +5 -0
  34. package/fixtures/crash-on-bootstrap/services/service-2/platformatic.service.json +14 -0
  35. package/fixtures/crash-on-bootstrap/services/service-2/plugin.js +5 -0
  36. package/fixtures/dbApp/platformatic.db.json +1 -1
  37. package/fixtures/dbAppNoName/platformatic.db.json +1 -1
  38. package/fixtures/dbAppNoPackageJson/platformatic.db.json +1 -1
  39. package/fixtures/dbAppWithMigrationError/platformatic.db.json +1 -1
  40. package/fixtures/do-not-reload-dependencies/platformatic.service.json +1 -1
  41. package/fixtures/do-not-restart-on-crash/platformatic.runtime.json +3 -2
  42. package/fixtures/do-not-restart-on-crash/services/a/platformatic.service.json +1 -1
  43. package/fixtures/express/platformatic.runtime.json +1 -1
  44. package/fixtures/express/services/a/platformatic.service.json +1 -1
  45. package/fixtures/express/services/b/platformatic.service.json +1 -1
  46. package/fixtures/external-client/platformatic.service.json +1 -1
  47. package/fixtures/interceptors/idp.js +2 -2
  48. package/fixtures/interceptors/platformatic.runtime.json +1 -1
  49. package/fixtures/interceptors/services/a/platformatic.service.json +1 -1
  50. package/fixtures/interceptors-2/platformatic.runtime.json +1 -1
  51. package/fixtures/interceptors-2/services/a/platformatic.service.json +1 -1
  52. package/fixtures/leven/platformatic.runtime.json +2 -2
  53. package/fixtures/leven/services/deeply-spittle/platformatic.service.json +1 -1
  54. package/fixtures/leven/services/rainy-empire/platformatic.composer.json +1 -1
  55. package/fixtures/management-api/platformatic.json +8 -3
  56. package/fixtures/management-api/services/service-1/platformatic.json +1 -1
  57. package/fixtures/management-api/services/service-1/plugin.js +4 -3
  58. package/fixtures/management-api/services/service-2/platformatic.json +1 -1
  59. package/fixtures/management-api/services/service-db/platformatic.db.json +1 -1
  60. package/fixtures/management-api-custom-labels/platformatic.json +2 -2
  61. package/fixtures/management-api-custom-labels/services/service-1/platformatic.json +1 -1
  62. package/fixtures/management-api-custom-labels/services/service-1/plugin.js +4 -3
  63. package/fixtures/management-api-custom-labels/services/service-2/platformatic.json +1 -1
  64. package/fixtures/management-api-custom-labels/services/service-db/platformatic.db.json +1 -1
  65. package/fixtures/management-api-without-metrics/platformatic.json +3 -2
  66. package/fixtures/management-api-without-metrics/services/service-1/platformatic.json +1 -1
  67. package/fixtures/monorepo/composerApp/platformatic.composer.json +1 -1
  68. package/fixtures/monorepo/dbApp/platformatic.db.json +1 -1
  69. package/fixtures/monorepo/serviceApp/platformatic.service.json +3 -2
  70. package/fixtures/monorepo/serviceApp/with-logger/with-logger.cjs +2 -2
  71. package/fixtures/monorepo/serviceApp/with-logger/with-logger.d.ts +7 -7
  72. package/fixtures/monorepo/serviceAppWithLogger/platformatic.service.json +1 -1
  73. package/fixtures/monorepo/serviceAppWithLogger/plugin.js +12 -0
  74. package/fixtures/monorepo/serviceAppWithMultiplePlugins/platformatic.service.json +3 -2
  75. package/fixtures/monorepo-missing-dependencies/composer/platformatic.json +1 -1
  76. package/fixtures/monorepo-openapi/serviceAppWithoutOpenapi/platformatic.service.json +1 -1
  77. package/fixtures/monorepo-watch/service1/platformatic.service.json +1 -1
  78. package/fixtures/monorepo-with-dependencies/main/platformatic.json +1 -1
  79. package/fixtures/monorepo-with-dependencies/service-1/platformatic.json +1 -1
  80. package/fixtures/monorepo-with-dependencies/service-2/platformatic.json +1 -1
  81. package/fixtures/no-env.service.json +1 -1
  82. package/fixtures/preload/platformatic.runtime.json +1 -1
  83. package/fixtures/preload/services/a/platformatic.service.json +1 -1
  84. package/fixtures/prom-server/platformatic.json +2 -2
  85. package/fixtures/prom-server/services/service-1/platformatic.json +1 -1
  86. package/fixtures/prom-server/services/service-2/platformatic.json +1 -1
  87. package/fixtures/restart-on-crash/platformatic.runtime.json +1 -1
  88. package/fixtures/restart-on-crash/services/a/platformatic.service.json +1 -1
  89. package/fixtures/sample-runtime/package.json +1 -1
  90. package/fixtures/sample-runtime/platformatic.json +2 -2
  91. package/fixtures/sample-runtime/services/rival/package.json +1 -1
  92. package/fixtures/sample-runtime/services/rival/platformatic.json +1 -1
  93. package/fixtures/sample-runtime-with-2-services/package.json +1 -1
  94. package/fixtures/sample-runtime-with-2-services/platformatic.json +2 -2
  95. package/fixtures/sample-runtime-with-2-services/services/foobar/package.json +1 -1
  96. package/fixtures/sample-runtime-with-2-services/services/foobar/platformatic.json +1 -1
  97. package/fixtures/sample-runtime-with-2-services/services/rival/package.json +1 -1
  98. package/fixtures/sample-runtime-with-2-services/services/rival/platformatic.json +1 -1
  99. package/fixtures/server/logger-transport/platformatic.runtime.json +2 -2
  100. package/fixtures/server/logger-transport/services/echo/platformatic.service.json +1 -1
  101. package/fixtures/server/overrides-service/platformatic.runtime.json +2 -2
  102. package/fixtures/server/overrides-service/services/echo/platformatic.service.json +1 -1
  103. package/fixtures/server/runtime-server/platformatic.runtime.json +2 -2
  104. package/fixtures/server/runtime-server/services/echo/platformatic.service.json +1 -1
  105. package/fixtures/serviceAppThrowsOnStart/platformatic.service.json +1 -1
  106. package/fixtures/stackables/node_modules/foo/foo.js +2 -1
  107. package/fixtures/start-command-in-runtime.js +1 -1
  108. package/fixtures/stdio/platformatic.service.json +6 -0
  109. package/fixtures/stdio/plugin.js +24 -0
  110. package/fixtures/telemetry/platformatic.runtime.json +2 -2
  111. package/fixtures/telemetry/services/echo/platformatic.service.json +1 -1
  112. package/fixtures/telemetry/services/echo/routes/span.js +16 -2
  113. package/fixtures/telemetry/services/service-1/platformatic.service.json +19 -0
  114. package/fixtures/telemetry/services/service-1/routes/echo.js +7 -0
  115. package/fixtures/typescript/platformatic.runtime.json +2 -2
  116. package/fixtures/typescript/services/composer/platformatic.composer.json +1 -1
  117. package/fixtures/typescript/services/movies/global.d.ts +2 -3
  118. package/fixtures/typescript/services/movies/platformatic.db.json +1 -1
  119. package/fixtures/typescript/services/movies/types/Movie.d.ts +3 -3
  120. package/fixtures/typescript/services/movies/types/index.d.ts +6 -6
  121. package/fixtures/typescript/services/titles/client/client.d.ts +35 -35
  122. package/fixtures/typescript/services/titles/platformatic.service.json +1 -1
  123. package/fixtures/typescript-custom-flags/platformatic.runtime.json +2 -2
  124. package/fixtures/typescript-custom-flags/services/composer/platformatic.composer.json +1 -1
  125. package/fixtures/typescript-custom-flags/services/movies/global.d.ts +2 -3
  126. package/fixtures/typescript-custom-flags/services/movies/platformatic.db.json +1 -1
  127. package/fixtures/typescript-custom-flags/services/movies/types/Movie.d.ts +3 -3
  128. package/fixtures/typescript-custom-flags/services/movies/types/index.d.ts +6 -6
  129. package/fixtures/typescript-custom-flags/services/titles/client/client.d.ts +35 -35
  130. package/fixtures/typescript-custom-flags/services/titles/platformatic.service.json +1 -1
  131. package/fixtures/typescript-no-env/platformatic.runtime.json +2 -2
  132. package/fixtures/typescript-no-env/services/composer/platformatic.composer.json +1 -1
  133. package/fixtures/typescript-no-env/services/movies/global.d.ts +2 -3
  134. package/fixtures/typescript-no-env/services/movies/platformatic.db.json +1 -1
  135. package/fixtures/typescript-no-env/services/movies/types/Movie.d.ts +3 -3
  136. package/fixtures/typescript-no-env/services/movies/types/index.d.ts +6 -6
  137. package/fixtures/typescript-no-env/services/titles/client/client.d.ts +35 -35
  138. package/fixtures/typescript-no-env/services/titles/platformatic.service.json +1 -1
  139. package/index.d.ts +7 -8
  140. package/index.js +15 -10
  141. package/index.test-d.ts +10 -12
  142. package/lib/build-server.js +11 -13
  143. package/lib/compile.js +11 -10
  144. package/lib/config.js +21 -14
  145. package/lib/dependencies.js +2 -1
  146. package/lib/errors.js +5 -2
  147. package/lib/generator/errors.js +1 -1
  148. package/lib/generator/runtime-generator.d.ts +15 -15
  149. package/lib/generator/runtime-generator.js +93 -64
  150. package/lib/logger.js +55 -0
  151. package/lib/management-api.js +29 -44
  152. package/lib/prom-server.js +5 -9
  153. package/lib/runtime.js +1005 -0
  154. package/lib/schema.js +46 -41
  155. package/lib/start.js +42 -109
  156. package/lib/upgrade.js +4 -3
  157. package/lib/utils.js +49 -1
  158. package/lib/versions/v1.36.0.js +1 -1
  159. package/lib/versions/v1.5.0.js +1 -1
  160. package/lib/versions/v2.0.0.js +17 -0
  161. package/lib/worker/app.js +266 -0
  162. package/lib/worker/default-stackable.js +32 -0
  163. package/lib/worker/itc.js +149 -0
  164. package/lib/worker/main.js +129 -0
  165. package/lib/worker/metrics.js +106 -0
  166. package/lib/worker/symbols.js +7 -0
  167. package/package.json +34 -31
  168. package/runtime.mjs +5 -5
  169. package/schema.json +840 -0
  170. package/lib/api-client.js +0 -500
  171. package/lib/api.js +0 -420
  172. package/lib/app.js +0 -397
  173. package/lib/load-config.js +0 -12
  174. package/lib/loader.mjs +0 -103
  175. package/lib/message-port-writable.js +0 -50
  176. package/lib/worker.js +0 -182
  177. /package/lib/{interceptors.js → worker/interceptors.js} +0 -0
package/schema.json ADDED
@@ -0,0 +1,840 @@
1
+ {
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/2.0.0-alpha.10.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "type": "object",
5
+ "properties": {
6
+ "$schema": {
7
+ "type": "string"
8
+ },
9
+ "preload": {
10
+ "type": "string",
11
+ "resolvePath": true
12
+ },
13
+ "autoload": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "required": [
17
+ "path"
18
+ ],
19
+ "properties": {
20
+ "path": {
21
+ "type": "string",
22
+ "resolvePath": true
23
+ },
24
+ "exclude": {
25
+ "type": "array",
26
+ "default": [],
27
+ "items": {
28
+ "type": "string"
29
+ }
30
+ },
31
+ "mappings": {
32
+ "type": "object",
33
+ "additionalProperties": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": [
37
+ "id"
38
+ ],
39
+ "properties": {
40
+ "id": {
41
+ "type": "string"
42
+ },
43
+ "config": {
44
+ "type": "string"
45
+ },
46
+ "useHttp": {
47
+ "type": "boolean"
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ },
54
+ "telemetry": {
55
+ "$id": "/OpenTelemetry",
56
+ "type": "object",
57
+ "properties": {
58
+ "serviceName": {
59
+ "type": "string",
60
+ "description": "The name of the service. Defaults to the folder name if not specified."
61
+ },
62
+ "version": {
63
+ "type": "string",
64
+ "description": "The version of the service (optional)"
65
+ },
66
+ "skip": {
67
+ "type": "array",
68
+ "description": "An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.",
69
+ "items": {
70
+ "type": "object",
71
+ "properties": {
72
+ "path": {
73
+ "type": "string",
74
+ "description": "The path to skip. Can be a string or a regex."
75
+ },
76
+ "method": {
77
+ "description": "HTTP method to skip",
78
+ "type": "string",
79
+ "enum": [
80
+ "GET",
81
+ "POST",
82
+ "PUT",
83
+ "DELETE",
84
+ "PATCH",
85
+ "HEAD",
86
+ "OPTIONS"
87
+ ]
88
+ }
89
+ }
90
+ }
91
+ },
92
+ "exporter": {
93
+ "anyOf": [
94
+ {
95
+ "type": "array",
96
+ "items": {
97
+ "type": "object",
98
+ "properties": {
99
+ "type": {
100
+ "type": "string",
101
+ "enum": [
102
+ "console",
103
+ "otlp",
104
+ "zipkin",
105
+ "memory"
106
+ ],
107
+ "default": "console"
108
+ },
109
+ "options": {
110
+ "type": "object",
111
+ "description": "Options for the exporter. These are passed directly to the exporter.",
112
+ "properties": {
113
+ "url": {
114
+ "type": "string",
115
+ "description": "The URL to send the traces to. Not used for console or memory exporters."
116
+ },
117
+ "headers": {
118
+ "type": "object",
119
+ "description": "Headers to send to the exporter. Not used for console or memory exporters."
120
+ }
121
+ }
122
+ },
123
+ "additionalProperties": false
124
+ }
125
+ }
126
+ },
127
+ {
128
+ "type": "object",
129
+ "properties": {
130
+ "type": {
131
+ "type": "string",
132
+ "enum": [
133
+ "console",
134
+ "otlp",
135
+ "zipkin",
136
+ "memory"
137
+ ],
138
+ "default": "console"
139
+ },
140
+ "options": {
141
+ "type": "object",
142
+ "description": "Options for the exporter. These are passed directly to the exporter.",
143
+ "properties": {
144
+ "url": {
145
+ "type": "string",
146
+ "description": "The URL to send the traces to. Not used for console or memory exporters."
147
+ },
148
+ "headers": {
149
+ "type": "object",
150
+ "description": "Headers to send to the exporter. Not used for console or memory exporters."
151
+ }
152
+ }
153
+ },
154
+ "additionalProperties": false
155
+ }
156
+ }
157
+ ]
158
+ }
159
+ },
160
+ "required": [
161
+ "serviceName"
162
+ ],
163
+ "additionalProperties": false
164
+ },
165
+ "server": {
166
+ "type": "object",
167
+ "properties": {
168
+ "hostname": {
169
+ "type": "string"
170
+ },
171
+ "port": {
172
+ "anyOf": [
173
+ {
174
+ "type": "integer"
175
+ },
176
+ {
177
+ "type": "string"
178
+ }
179
+ ]
180
+ },
181
+ "pluginTimeout": {
182
+ "type": "integer"
183
+ },
184
+ "healthCheck": {
185
+ "anyOf": [
186
+ {
187
+ "type": "boolean"
188
+ },
189
+ {
190
+ "type": "object",
191
+ "properties": {
192
+ "enabled": {
193
+ "type": "boolean"
194
+ },
195
+ "interval": {
196
+ "type": "integer"
197
+ }
198
+ },
199
+ "additionalProperties": true
200
+ }
201
+ ]
202
+ },
203
+ "ignoreTrailingSlash": {
204
+ "type": "boolean"
205
+ },
206
+ "ignoreDuplicateSlashes": {
207
+ "type": "boolean"
208
+ },
209
+ "connectionTimeout": {
210
+ "type": "integer"
211
+ },
212
+ "keepAliveTimeout": {
213
+ "type": "integer",
214
+ "default": 5000
215
+ },
216
+ "maxRequestsPerSocket": {
217
+ "type": "integer"
218
+ },
219
+ "forceCloseConnections": {
220
+ "anyOf": [
221
+ {
222
+ "type": "boolean"
223
+ },
224
+ {
225
+ "type": "string",
226
+ "pattern": "^idle$"
227
+ }
228
+ ]
229
+ },
230
+ "requestTimeout": {
231
+ "type": "integer"
232
+ },
233
+ "bodyLimit": {
234
+ "type": "integer"
235
+ },
236
+ "maxParamLength": {
237
+ "type": "integer"
238
+ },
239
+ "disableRequestLogging": {
240
+ "type": "boolean"
241
+ },
242
+ "exposeHeadRoutes": {
243
+ "type": "boolean"
244
+ },
245
+ "logger": {
246
+ "anyOf": [
247
+ {
248
+ "type": "boolean"
249
+ },
250
+ {
251
+ "type": "object",
252
+ "properties": {
253
+ "level": {
254
+ "type": "string"
255
+ },
256
+ "transport": {
257
+ "anyOf": [
258
+ {
259
+ "type": "object",
260
+ "properties": {
261
+ "target": {
262
+ "type": "string",
263
+ "resolveModule": true
264
+ },
265
+ "options": {
266
+ "type": "object"
267
+ }
268
+ },
269
+ "additionalProperties": false
270
+ },
271
+ {
272
+ "type": "object",
273
+ "properties": {
274
+ "targets": {
275
+ "type": "array",
276
+ "items": {
277
+ "type": "object",
278
+ "properties": {
279
+ "target": {
280
+ "type": "string",
281
+ "resolveModule": true
282
+ },
283
+ "options": {
284
+ "type": "object"
285
+ },
286
+ "level": {
287
+ "type": "string"
288
+ },
289
+ "additionalProperties": false
290
+ }
291
+ }
292
+ },
293
+ "options": {
294
+ "type": "object"
295
+ }
296
+ },
297
+ "additionalProperties": false
298
+ }
299
+ ]
300
+ },
301
+ "pipeline": {
302
+ "type": "object",
303
+ "properties": {
304
+ "target": {
305
+ "type": "string",
306
+ "resolveModule": true
307
+ },
308
+ "options": {
309
+ "type": "object"
310
+ }
311
+ },
312
+ "additionalProperties": false
313
+ }
314
+ },
315
+ "additionalProperties": true
316
+ }
317
+ ]
318
+ },
319
+ "loggerInstance": {
320
+ "type": "object"
321
+ },
322
+ "serializerOpts": {
323
+ "type": "object",
324
+ "properties": {
325
+ "schema": {
326
+ "type": "object"
327
+ },
328
+ "ajv": {
329
+ "type": "object"
330
+ },
331
+ "rounding": {
332
+ "type": "string",
333
+ "enum": [
334
+ "floor",
335
+ "ceil",
336
+ "round",
337
+ "trunc"
338
+ ],
339
+ "default": "trunc"
340
+ },
341
+ "debugMode": {
342
+ "type": "boolean"
343
+ },
344
+ "mode": {
345
+ "type": "string",
346
+ "enum": [
347
+ "debug",
348
+ "standalone"
349
+ ]
350
+ },
351
+ "largeArraySize": {
352
+ "anyOf": [
353
+ {
354
+ "type": "integer"
355
+ },
356
+ {
357
+ "type": "string"
358
+ }
359
+ ],
360
+ "default": 20000
361
+ },
362
+ "largeArrayMechanism": {
363
+ "type": "string",
364
+ "enum": [
365
+ "default",
366
+ "json-stringify"
367
+ ],
368
+ "default": "default"
369
+ }
370
+ }
371
+ },
372
+ "caseSensitive": {
373
+ "type": "boolean"
374
+ },
375
+ "requestIdHeader": {
376
+ "anyOf": [
377
+ {
378
+ "type": "string"
379
+ },
380
+ {
381
+ "type": "boolean",
382
+ "const": false
383
+ }
384
+ ]
385
+ },
386
+ "requestIdLogLabel": {
387
+ "type": "string"
388
+ },
389
+ "jsonShorthand": {
390
+ "type": "boolean"
391
+ },
392
+ "trustProxy": {
393
+ "anyOf": [
394
+ {
395
+ "type": "boolean"
396
+ },
397
+ {
398
+ "type": "string"
399
+ },
400
+ {
401
+ "type": "array",
402
+ "items": {
403
+ "type": "string"
404
+ }
405
+ },
406
+ {
407
+ "type": "integer"
408
+ }
409
+ ]
410
+ },
411
+ "http2": {
412
+ "type": "boolean"
413
+ },
414
+ "https": {
415
+ "type": "object",
416
+ "properties": {
417
+ "allowHTTP1": {
418
+ "type": "boolean"
419
+ },
420
+ "key": {
421
+ "anyOf": [
422
+ {
423
+ "type": "string"
424
+ },
425
+ {
426
+ "type": "object",
427
+ "properties": {
428
+ "path": {
429
+ "type": "string",
430
+ "resolvePath": true
431
+ }
432
+ },
433
+ "additionalProperties": false
434
+ },
435
+ {
436
+ "type": "array",
437
+ "items": {
438
+ "anyOf": [
439
+ {
440
+ "type": "string"
441
+ },
442
+ {
443
+ "type": "object",
444
+ "properties": {
445
+ "path": {
446
+ "type": "string",
447
+ "resolvePath": true
448
+ }
449
+ },
450
+ "additionalProperties": false
451
+ }
452
+ ]
453
+ }
454
+ }
455
+ ]
456
+ },
457
+ "cert": {
458
+ "anyOf": [
459
+ {
460
+ "type": "string"
461
+ },
462
+ {
463
+ "type": "object",
464
+ "properties": {
465
+ "path": {
466
+ "type": "string",
467
+ "resolvePath": true
468
+ }
469
+ },
470
+ "additionalProperties": false
471
+ },
472
+ {
473
+ "type": "array",
474
+ "items": {
475
+ "anyOf": [
476
+ {
477
+ "type": "string"
478
+ },
479
+ {
480
+ "type": "object",
481
+ "properties": {
482
+ "path": {
483
+ "type": "string",
484
+ "resolvePath": true
485
+ }
486
+ },
487
+ "additionalProperties": false
488
+ }
489
+ ]
490
+ }
491
+ }
492
+ ]
493
+ },
494
+ "requestCert": {
495
+ "type": "boolean"
496
+ },
497
+ "rejectUnauthorized": {
498
+ "type": "boolean"
499
+ }
500
+ },
501
+ "additionalProperties": false,
502
+ "required": [
503
+ "key",
504
+ "cert"
505
+ ]
506
+ },
507
+ "cors": {
508
+ "type": "object",
509
+ "$comment": "See https://github.com/fastify/fastify-cors",
510
+ "properties": {
511
+ "origin": {
512
+ "anyOf": [
513
+ {
514
+ "type": "boolean"
515
+ },
516
+ {
517
+ "type": "string"
518
+ },
519
+ {
520
+ "type": "array",
521
+ "items": {
522
+ "anyOf": [
523
+ {
524
+ "type": "string"
525
+ },
526
+ {
527
+ "type": "object",
528
+ "properties": {
529
+ "regexp": {
530
+ "type": "string"
531
+ }
532
+ },
533
+ "required": [
534
+ "regexp"
535
+ ]
536
+ }
537
+ ]
538
+ }
539
+ },
540
+ {
541
+ "type": "object",
542
+ "properties": {
543
+ "regexp": {
544
+ "type": "string"
545
+ }
546
+ },
547
+ "required": [
548
+ "regexp"
549
+ ]
550
+ }
551
+ ]
552
+ },
553
+ "methods": {
554
+ "type": "array",
555
+ "items": {
556
+ "type": "string"
557
+ }
558
+ },
559
+ "allowedHeaders": {
560
+ "type": "string",
561
+ "description": "Comma separated string of allowed headers."
562
+ },
563
+ "exposedHeaders": {
564
+ "anyOf": [
565
+ {
566
+ "type": "array",
567
+ "items": {
568
+ "type": "string"
569
+ }
570
+ },
571
+ {
572
+ "type": "string",
573
+ "description": "Comma separated string of exposed headers."
574
+ }
575
+ ]
576
+ },
577
+ "credentials": {
578
+ "type": "boolean"
579
+ },
580
+ "maxAge": {
581
+ "type": "integer"
582
+ },
583
+ "preflightContinue": {
584
+ "type": "boolean",
585
+ "default": false
586
+ },
587
+ "optionsSuccessStatus": {
588
+ "type": "integer",
589
+ "default": 204
590
+ },
591
+ "preflight": {
592
+ "type": "boolean",
593
+ "default": true
594
+ },
595
+ "strictPreflight": {
596
+ "type": "boolean",
597
+ "default": true
598
+ },
599
+ "hideOptionsRoute": {
600
+ "type": "boolean",
601
+ "default": true
602
+ }
603
+ },
604
+ "additionalProperties": false
605
+ }
606
+ },
607
+ "additionalProperties": false
608
+ },
609
+ "entrypoint": {
610
+ "type": "string"
611
+ },
612
+ "watch": {
613
+ "anyOf": [
614
+ {
615
+ "type": "boolean"
616
+ },
617
+ {
618
+ "type": "string"
619
+ }
620
+ ]
621
+ },
622
+ "inspectorOptions": {
623
+ "type": "object",
624
+ "properties": {
625
+ "host": {
626
+ "type": "string"
627
+ },
628
+ "port": {
629
+ "type": "number"
630
+ },
631
+ "breakFirstLine": {
632
+ "type": "boolean"
633
+ },
634
+ "watchDisabled": {
635
+ "type": "boolean"
636
+ }
637
+ }
638
+ },
639
+ "undici": {
640
+ "type": "object",
641
+ "properties": {
642
+ "agentOptions": {
643
+ "type": "object",
644
+ "additionalProperties": true
645
+ },
646
+ "interceptors": {
647
+ "anyOf": [
648
+ {
649
+ "type": "array",
650
+ "items": {
651
+ "$ref": "#/$defs/undiciInterceptor"
652
+ }
653
+ },
654
+ {
655
+ "type": "object",
656
+ "properties": {
657
+ "Client": {
658
+ "type": "array",
659
+ "items": {
660
+ "$ref": "#/$defs/undiciInterceptor"
661
+ }
662
+ },
663
+ "Pool": {
664
+ "type": "array",
665
+ "items": {
666
+ "$ref": "#/$defs/undiciInterceptor"
667
+ }
668
+ },
669
+ "Agent": {
670
+ "type": "array",
671
+ "items": {
672
+ "$ref": "#/$defs/undiciInterceptor"
673
+ }
674
+ }
675
+ }
676
+ }
677
+ ]
678
+ }
679
+ }
680
+ },
681
+ "managementApi": {
682
+ "anyOf": [
683
+ {
684
+ "type": "boolean"
685
+ },
686
+ {
687
+ "type": "string"
688
+ },
689
+ {
690
+ "type": "object",
691
+ "properties": {
692
+ "logs": {
693
+ "maxSize": {
694
+ "type": "number",
695
+ "minimum": 5,
696
+ "default": 200
697
+ }
698
+ }
699
+ },
700
+ "additionalProperties": false
701
+ }
702
+ ],
703
+ "default": true
704
+ },
705
+ "metrics": {
706
+ "anyOf": [
707
+ {
708
+ "type": "boolean"
709
+ },
710
+ {
711
+ "type": "object",
712
+ "properties": {
713
+ "port": {
714
+ "anyOf": [
715
+ {
716
+ "type": "integer"
717
+ },
718
+ {
719
+ "type": "string"
720
+ }
721
+ ]
722
+ },
723
+ "hostname": {
724
+ "type": "string"
725
+ },
726
+ "endpoint": {
727
+ "type": "string"
728
+ },
729
+ "auth": {
730
+ "type": "object",
731
+ "properties": {
732
+ "username": {
733
+ "type": "string"
734
+ },
735
+ "password": {
736
+ "type": "string"
737
+ }
738
+ },
739
+ "additionalProperties": false,
740
+ "required": [
741
+ "username",
742
+ "password"
743
+ ]
744
+ },
745
+ "labels": {
746
+ "type": "object",
747
+ "additionalProperties": {
748
+ "type": "string"
749
+ }
750
+ }
751
+ },
752
+ "additionalProperties": false
753
+ }
754
+ ]
755
+ },
756
+ "restartOnError": {
757
+ "default": true,
758
+ "anyOf": [
759
+ {
760
+ "type": "boolean"
761
+ },
762
+ {
763
+ "type": "number",
764
+ "minimum": 100
765
+ }
766
+ ]
767
+ },
768
+ "services": {
769
+ "type": "array",
770
+ "items": {
771
+ "type": "object",
772
+ "anyOf": [
773
+ {
774
+ "required": [
775
+ "id",
776
+ "path"
777
+ ]
778
+ },
779
+ {
780
+ "required": [
781
+ "id",
782
+ "url"
783
+ ]
784
+ }
785
+ ],
786
+ "properties": {
787
+ "id": {
788
+ "type": "string"
789
+ },
790
+ "path": {
791
+ "type": "string",
792
+ "resolvePath": true
793
+ },
794
+ "config": {
795
+ "type": "string"
796
+ },
797
+ "url": {
798
+ "type": "string"
799
+ },
800
+ "useHttp": {
801
+ "type": "boolean"
802
+ }
803
+ }
804
+ }
805
+ }
806
+ },
807
+ "anyOf": [
808
+ {
809
+ "required": [
810
+ "autoload",
811
+ "entrypoint"
812
+ ]
813
+ },
814
+ {
815
+ "required": [
816
+ "services",
817
+ "entrypoint"
818
+ ]
819
+ }
820
+ ],
821
+ "additionalProperties": false,
822
+ "$defs": {
823
+ "undiciInterceptor": {
824
+ "type": "object",
825
+ "properties": {
826
+ "module": {
827
+ "type": "string"
828
+ },
829
+ "options": {
830
+ "type": "object",
831
+ "additionalProperties": true
832
+ }
833
+ },
834
+ "required": [
835
+ "module",
836
+ "options"
837
+ ]
838
+ }
839
+ }
840
+ }