@platformatic/runtime 4.0.0-new-config.1 → 4.0.0-new-config.5

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/config.d.ts CHANGED
@@ -10,610 +10,40 @@ export type PlatformaticRuntimeConfig = {
10
10
  } & {
11
11
  $schema?: string;
12
12
  preload?: string | string[];
13
- extensions?:
14
- | string
15
- | {
16
- path: string;
17
- options?: {
18
- [k: string]: unknown;
19
- };
20
- build?: boolean;
21
- }
22
- | (
23
- | string
24
- | {
25
- path: string;
26
- options?: {
27
- [k: string]: unknown;
28
- };
29
- build?: boolean;
30
- }
31
- )[];
13
+ extensions?: string | ExtensionEntry | (string | ExtensionEntry1)[];
32
14
  basePath?: string;
33
15
  autoload?: {
34
16
  path: string;
35
17
  exclude?: string[];
36
18
  mappings?: {
37
- [k: string]: {
38
- id: string;
39
- enabled?:
40
- | boolean
41
- | string
42
- | {
43
- [k: string]: boolean;
44
- };
45
- config?:
46
- | string
47
- | {
48
- [k: string]: unknown;
49
- };
50
- reuseTcpPorts?: boolean;
51
- workers?:
52
- | number
53
- | string
54
- | {
55
- static?: number;
56
- minimum?: number;
57
- maximum?: number;
58
- scaleUpELU?: number;
59
- scaleDownELU?: number;
60
- [k: string]: unknown;
61
- };
62
- health?: {
63
- enabled?: boolean | string;
64
- interval?: number | string;
65
- gracePeriod?: number | string;
66
- maxUnhealthyChecks?: number | string;
67
- maxELU?: number | string;
68
- maxEventLoopDelay?: number | string;
69
- maxEventLoopDelayP99?: number | string;
70
- maxHeapUsed?: number | string;
71
- maxHeapTotal?: number | string;
72
- maxYoungGeneration?: number | string;
73
- codeRangeSize?: number | string;
74
- bufferPoolSize?: number | string;
75
- defaultHighWaterMark?: number | string;
76
- };
77
- /**
78
- * Overrides the runtime-level restartOnError for this application. Set to false or 0 to never restart the application when it crashes, a positive number to wait that amount of milliseconds between restarts, or true to use the default delay.
79
- */
80
- restartOnError?: boolean | number;
81
- dependencies?: string[];
82
- arguments?: string[];
83
- env?: {
84
- [k: string]: string;
85
- };
86
- envfile?: string;
87
- sourceMaps?: boolean;
88
- nodeModulesSourceMaps?: string[];
89
- packageManager?: "npm" | "pnpm" | "yarn";
90
- preload?: string | string[];
91
- nodeOptions?: string;
92
- execArgv?: string[];
93
- permissions?: {
94
- fs?: {
95
- read?: string[];
96
- write?: string[];
97
- };
98
- };
99
- telemetry?: {
100
- /**
101
- * An array of instrumentations loaded if telemetry is enabled
102
- */
103
- instrumentations?: (
104
- | string
105
- | {
106
- package: string;
107
- exportName?: string;
108
- options?: {
109
- [k: string]: unknown;
110
- };
111
- [k: string]: unknown;
112
- }
113
- )[];
114
- [k: string]: unknown;
115
- };
116
- compileCache?:
117
- | boolean
118
- | {
119
- /**
120
- * Enable Node.js module compile cache for faster startup
121
- */
122
- enabled?: boolean;
123
- /**
124
- * Directory to store compile cache. Defaults to .plt/compile-cache in app root
125
- */
126
- directory?: string;
127
- };
128
- management?:
129
- | boolean
130
- | {
131
- enabled?: boolean;
132
- operations?: string[];
133
- };
134
- };
19
+ [k: string]: ApplicationEntryOverrides;
135
20
  };
136
21
  };
137
- applications?: {
138
- [k: string]: unknown;
139
- }[];
140
- services?: {
141
- [k: string]: unknown;
142
- }[];
143
- web?: {
144
- [k: string]: unknown;
145
- }[];
146
- workers?:
147
- | number
148
- | string
149
- | {
150
- static?: number;
151
- dynamic?: boolean;
152
- minimum?: number;
153
- maximum?: number;
154
- total?: number;
155
- maxMemory?: number;
156
- cooldown?: number;
157
- gracePeriod?: number;
158
- scaleUpELU?: number;
159
- scaleDownELU?: number;
160
- [k: string]: unknown;
161
- };
22
+ applications?: ApplicationEntry[];
23
+ services?: ApplicationEntry1[];
24
+ web?: ApplicationEntry2[];
25
+ workers?: number | string | WorkersOptions;
162
26
  workersRestartDelay?: number | string;
163
- logger?: {
164
- level?: (
165
- | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
166
- | {
167
- [k: string]: unknown;
168
- }
169
- ) &
170
- string;
171
- transport?:
172
- | {
173
- target?: string;
174
- options?: {
175
- [k: string]: unknown;
176
- };
177
- }
178
- | {
179
- targets?: {
180
- target?: string;
181
- options?: {
182
- [k: string]: unknown;
183
- };
184
- level?: string;
185
- }[];
186
- options?: {
187
- [k: string]: unknown;
188
- };
189
- };
190
- pipeline?: {
191
- target?: string;
192
- options?: {
193
- [k: string]: unknown;
194
- };
195
- };
196
- formatters?: {
197
- path: string;
198
- };
199
- timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime";
200
- redact?: {
201
- paths: string[];
202
- censor?: string;
203
- };
204
- base?: {
205
- [k: string]: unknown;
206
- } | null;
207
- messageKey?: string;
208
- customLevels?: {
209
- [k: string]: unknown;
210
- };
211
- openTelemetryExporter?: {
212
- protocol: "grpc" | "http";
213
- url: string;
214
- };
215
- captureStdio?: boolean;
216
- pino?: {
217
- level?: string;
218
- time?: string;
219
- message?: string;
220
- };
221
- [k: string]: unknown;
222
- };
27
+ logger?: RuntimeLoggerOptions;
223
28
  reuseTcpPorts?: boolean;
224
29
  startTimeout?: number;
225
30
  restartOnError?: boolean | number;
226
31
  exitOnUnhandledErrors?: boolean | number;
227
- gracefulShutdown?: {
228
- runtime: number | string;
229
- application: number | string;
230
- /**
231
- * Add Connection: close header to HTTP responses during graceful shutdown
232
- */
233
- closeConnections?: boolean;
234
- };
235
- health?: {
236
- enabled?: boolean | string;
237
- interval?: number | string;
238
- gracePeriod?: number | string;
239
- maxUnhealthyChecks?: number | string;
240
- maxELU?: number | string;
241
- maxEventLoopDelay?: number | string;
242
- maxEventLoopDelayP99?: number | string;
243
- maxHeapUsed?: number | string;
244
- maxHeapTotal?: number | string;
245
- maxYoungGeneration?: number | string;
246
- codeRangeSize?: number | string;
247
- bufferPoolSize?: number | string;
248
- defaultHighWaterMark?: number | string;
249
- };
250
- healthProbes?:
251
- | boolean
252
- | string
253
- | {
254
- enabled?: boolean | string;
255
- hostname?: string;
256
- port?: number | string;
257
- readiness?:
258
- | boolean
259
- | {
260
- endpoint?: string;
261
- success?: {
262
- statusCode?: number;
263
- body?: string;
264
- };
265
- fail?: {
266
- statusCode?: number;
267
- body?: string;
268
- };
269
- };
270
- liveness?:
271
- | boolean
272
- | {
273
- endpoint?: string;
274
- success?: {
275
- statusCode?: number;
276
- body?: string;
277
- };
278
- fail?: {
279
- statusCode?: number;
280
- body?: string;
281
- };
282
- };
283
- };
284
- undici?: {
285
- agentOptions?: {
286
- [k: string]: unknown;
287
- };
288
- interceptors?:
289
- | {
290
- module: string;
291
- options: {
292
- [k: string]: unknown;
293
- };
294
- [k: string]: unknown;
295
- }[]
296
- | {
297
- Client?: {
298
- module: string;
299
- options: {
300
- [k: string]: unknown;
301
- };
302
- [k: string]: unknown;
303
- }[];
304
- Pool?: {
305
- module: string;
306
- options: {
307
- [k: string]: unknown;
308
- };
309
- [k: string]: unknown;
310
- }[];
311
- Agent?: {
312
- module: string;
313
- options: {
314
- [k: string]: unknown;
315
- };
316
- [k: string]: unknown;
317
- }[];
318
- [k: string]: unknown;
319
- };
320
- [k: string]: unknown;
321
- };
322
- httpCache?:
323
- | boolean
324
- | {
325
- store?: string;
326
- /**
327
- * @minItems 1
328
- */
329
- methods?: [string, ...string[]];
330
- cacheTagsHeader?: string;
331
- maxSize?: number;
332
- maxEntrySize?: number;
333
- maxCount?: number;
334
- /**
335
- * Whitelist of origins to cache. Supports exact strings and regex patterns (e.g., "/https:\\/\\/.*\\.example\\.com/").
336
- */
337
- origins?: string[];
338
- /**
339
- * Default cache duration in seconds for responses without explicit expiration headers.
340
- */
341
- cacheByDefault?: number;
342
- /**
343
- * Cache type. "shared" caches may be shared between users, "private" caches are user-specific.
344
- */
345
- type?: "shared" | "private";
346
- [k: string]: unknown;
347
- };
32
+ gracefulShutdown?: GracefulShutdownOptions;
33
+ health?: HealthOptions;
34
+ healthProbes?: boolean | string | HealthProbesOptions;
35
+ undici?: UndiciOptions;
36
+ httpCache?: boolean | HttpCacheOptions;
348
37
  watch?: boolean | string;
349
- managementApi?:
350
- | boolean
351
- | string
352
- | {
353
- logs?: {
354
- maxSize?: number;
355
- };
356
- /**
357
- * Custom path for the control socket. If not specified, uses the default platform-specific location.
358
- */
359
- socket?: string;
360
- };
38
+ managementApi?: boolean | string | ManagementApiOptions;
361
39
  management?:
362
40
  | boolean
363
41
  | {
364
42
  enabled?: boolean;
365
43
  operations?: string[];
366
44
  };
367
- metrics?:
368
- | boolean
369
- | {
370
- port?: number | string;
371
- enabled?: boolean | string;
372
- hostname?: string;
373
- endpoint?: string;
374
- https?: {
375
- allowHTTP1?: boolean;
376
- key:
377
- | string
378
- | {
379
- path?: string;
380
- }
381
- | (
382
- | string
383
- | {
384
- path?: string;
385
- }
386
- )[];
387
- cert:
388
- | string
389
- | {
390
- path?: string;
391
- }
392
- | (
393
- | string
394
- | {
395
- path?: string;
396
- }
397
- )[];
398
- requestCert?: boolean;
399
- rejectUnauthorized?: boolean;
400
- };
401
- auth?: {
402
- username: string;
403
- password: string;
404
- };
405
- labels?: {
406
- [k: string]: string;
407
- };
408
- /**
409
- * The label name to use for the application identifier in metrics (e.g., applicationId, serviceId)
410
- */
411
- applicationLabel?: string;
412
- /**
413
- * Enable outgoing HTTP client request duration metrics
414
- */
415
- httpClientMetrics?: boolean | string;
416
- readiness?:
417
- | boolean
418
- | {
419
- endpoint?: string;
420
- success?: {
421
- statusCode?: number;
422
- body?: string;
423
- };
424
- fail?: {
425
- statusCode?: number;
426
- body?: string;
427
- };
428
- };
429
- liveness?:
430
- | boolean
431
- | {
432
- endpoint?: string;
433
- success?: {
434
- statusCode?: number;
435
- body?: string;
436
- };
437
- fail?: {
438
- statusCode?: number;
439
- body?: string;
440
- };
441
- };
442
- /**
443
- * @deprecated
444
- * Deprecated. Health probe timeout configuration is no longer used.
445
- */
446
- healthChecksTimeouts?: number | string;
447
- plugins?: string[];
448
- timeout?: number | string;
449
- /**
450
- * Configuration for exporting metrics to an OTLP endpoint
451
- */
452
- otlpExporter?: {
453
- /**
454
- * Enable or disable OTLP metrics export
455
- */
456
- enabled?: boolean | string;
457
- /**
458
- * OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)
459
- */
460
- endpoint: string;
461
- /**
462
- * Interval in milliseconds between metric pushes
463
- */
464
- interval?: number | string;
465
- /**
466
- * Additional HTTP headers for authentication
467
- */
468
- headers?: {
469
- [k: string]: string;
470
- };
471
- /**
472
- * Service name for OTLP resource attributes
473
- */
474
- serviceName?: string;
475
- /**
476
- * Service version for OTLP resource attributes
477
- */
478
- serviceVersion?: string;
479
- };
480
- /**
481
- * Configuration for forwarding user OpenTelemetry metrics to an OTLP endpoint
482
- */
483
- opentelemetry?: {
484
- /**
485
- * Enable or disable OpenTelemetry metrics forwarding
486
- */
487
- enabled?: boolean | string;
488
- /**
489
- * OTLP metrics endpoint URL (e.g., http://collector:4318/v1/metrics)
490
- */
491
- endpoint: string;
492
- /**
493
- * Interval in milliseconds between metric forwards
494
- */
495
- interval?: number | string;
496
- /**
497
- * Additional HTTP headers for authentication
498
- */
499
- headers?: {
500
- [k: string]: string;
501
- };
502
- };
503
- /**
504
- * Custom labels to add to HTTP metrics (http_request_all_duration_seconds). Each label extracts its value from an HTTP request header.
505
- */
506
- httpCustomLabels?: {
507
- /**
508
- * The label name to use in metrics
509
- */
510
- name: string;
511
- /**
512
- * The HTTP request header to extract the value from
513
- */
514
- header: string;
515
- /**
516
- * Default value when header is missing (defaults to "unknown")
517
- */
518
- default?: string;
519
- }[];
520
- };
521
- telemetry?: {
522
- enabled?: boolean | string;
523
- /**
524
- * The name of the application. Defaults to the folder name if not specified.
525
- */
526
- applicationName: string;
527
- /**
528
- * The version of the application (optional)
529
- */
530
- version?: string;
531
- /**
532
- * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
533
- */
534
- skip?: {
535
- /**
536
- * The path to skip. Can be a string or a regex.
537
- */
538
- path?: string;
539
- /**
540
- * HTTP method to skip
541
- */
542
- method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
543
- [k: string]: unknown;
544
- }[];
545
- exporter?:
546
- | {
547
- type?: "console" | "otlp" | "zipkin" | "memory" | "file";
548
- /**
549
- * Options for the exporter. These are passed directly to the exporter.
550
- */
551
- options?: {
552
- /**
553
- * The URL to send the traces to. Not used for console or memory exporters.
554
- */
555
- url?: string;
556
- /**
557
- * Headers to send to the exporter. Not used for console or memory exporters.
558
- */
559
- headers?: {
560
- [k: string]: unknown;
561
- };
562
- /**
563
- * The path to write the traces to. Only for file exporter.
564
- */
565
- path?: string;
566
- /**
567
- * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http.
568
- */
569
- protocol?: "http" | "grpc";
570
- /**
571
- * Alias for protocol. Only for the otlp exporter. Defaults to http.
572
- */
573
- transport?: "http" | "grpc";
574
- [k: string]: unknown;
575
- };
576
- additionalProperties?: never;
577
- [k: string]: unknown;
578
- }[]
579
- | {
580
- type?: "console" | "otlp" | "zipkin" | "memory" | "file";
581
- /**
582
- * Options for the exporter. These are passed directly to the exporter.
583
- */
584
- options?: {
585
- /**
586
- * The URL to send the traces to. Not used for console or memory exporters.
587
- */
588
- url?: string;
589
- /**
590
- * Headers to send to the exporter. Not used for console or memory exporters.
591
- */
592
- headers?: {
593
- [k: string]: unknown;
594
- };
595
- /**
596
- * The path to write the traces to. Only for file exporter.
597
- */
598
- path?: string;
599
- /**
600
- * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http.
601
- */
602
- protocol?: "http" | "grpc";
603
- /**
604
- * Alias for protocol. Only for the otlp exporter. Defaults to http.
605
- */
606
- transport?: "http" | "grpc";
607
- [k: string]: unknown;
608
- };
609
- additionalProperties?: never;
610
- [k: string]: unknown;
611
- };
612
- /**
613
- * Enable the OpenTelemetry diagnostic logger. Diagnostic messages are forwarded to the Platformatic global logger using the current logger level.
614
- */
615
- diagLogger?: boolean | string;
616
- };
45
+ metrics?: boolean | MetricsOptions;
46
+ tracing?: TelemetryOptions;
617
47
  verticalScaler?: {
618
48
  enabled?: boolean;
619
49
  maxTotalWorkers?: number;
@@ -692,17 +122,585 @@ export type PlatformaticRuntimeConfig = {
692
122
  [k: string]: string | [string, ...string[]];
693
123
  };
694
124
  };
695
- compileCache?:
125
+ compileCache?: boolean | CompileCacheOptions;
126
+ module?: string;
127
+ };
128
+ export type ApplicationEntry = {
129
+ [k: string]: unknown;
130
+ };
131
+ export type ApplicationEntry1 = {
132
+ [k: string]: unknown;
133
+ };
134
+ export type ApplicationEntry2 = {
135
+ [k: string]: unknown;
136
+ };
137
+
138
+ export interface ExtensionEntry {
139
+ path: string;
140
+ options?: {
141
+ [k: string]: unknown;
142
+ };
143
+ build?: boolean;
144
+ }
145
+ export interface ExtensionEntry1 {
146
+ path: string;
147
+ options?: {
148
+ [k: string]: unknown;
149
+ };
150
+ build?: boolean;
151
+ }
152
+ export interface ApplicationEntryOverrides {
153
+ id: string;
154
+ enabled?:
696
155
  | boolean
156
+ | string
697
157
  | {
698
- /**
699
- * Enable Node.js module compile cache for faster startup
700
- */
701
- enabled?: boolean;
702
- /**
703
- * Directory to store compile cache. Defaults to .plt/compile-cache in app root
704
- */
705
- directory?: string;
158
+ [k: string]: boolean;
706
159
  };
707
- module?: string;
708
- };
160
+ config?:
161
+ | string
162
+ | {
163
+ [k: string]: unknown;
164
+ };
165
+ reuseTcpPorts?: boolean;
166
+ workers?:
167
+ | number
168
+ | string
169
+ | {
170
+ static?: number;
171
+ minimum?: number;
172
+ maximum?: number;
173
+ scaleUpELU?: number;
174
+ scaleDownELU?: number;
175
+ [k: string]: unknown;
176
+ };
177
+ health?: {
178
+ enabled?: boolean | string;
179
+ interval?: number | string;
180
+ gracePeriod?: number | string;
181
+ maxUnhealthyChecks?: number | string;
182
+ maxELU?: number | string;
183
+ maxEventLoopDelay?: number | string;
184
+ maxEventLoopDelayP99?: number | string;
185
+ maxHeapUsed?: number | string;
186
+ maxHeapTotal?: number | string;
187
+ maxYoungGeneration?: number | string;
188
+ codeRangeSize?: number | string;
189
+ bufferPoolSize?: number | string;
190
+ defaultHighWaterMark?: number | string;
191
+ };
192
+ /**
193
+ * Overrides the runtime-level restartOnError for this application. Set to false or 0 to never restart the application when it crashes, a positive number to wait that amount of milliseconds between restarts, or true to use the default delay.
194
+ */
195
+ restartOnError?: boolean | number;
196
+ dependencies?: string[];
197
+ arguments?: string[];
198
+ env?: {
199
+ [k: string]: string;
200
+ };
201
+ envfile?: string;
202
+ sourceMaps?: boolean;
203
+ nodeModulesSourceMaps?: string[];
204
+ packageManager?: "npm" | "pnpm" | "yarn";
205
+ preload?: string | string[];
206
+ nodeOptions?: string;
207
+ execArgv?: string[];
208
+ permissions?: {
209
+ fs?: {
210
+ read?: string[];
211
+ write?: string[];
212
+ };
213
+ };
214
+ tracing?: {
215
+ /**
216
+ * An array of instrumentations loaded if tracing is enabled
217
+ */
218
+ instrumentations?: (
219
+ | string
220
+ | {
221
+ package: string;
222
+ exportName?: string;
223
+ options?: {
224
+ [k: string]: unknown;
225
+ };
226
+ [k: string]: unknown;
227
+ }
228
+ )[];
229
+ [k: string]: unknown;
230
+ };
231
+ compileCache?:
232
+ | boolean
233
+ | {
234
+ /**
235
+ * Enable Node.js module compile cache for faster startup
236
+ */
237
+ enabled?: boolean;
238
+ /**
239
+ * Directory to store compile cache. Defaults to .plt/compile-cache in app root
240
+ */
241
+ directory?: string;
242
+ };
243
+ management?:
244
+ | boolean
245
+ | {
246
+ enabled?: boolean;
247
+ operations?: string[];
248
+ };
249
+ }
250
+ export interface WorkersOptions {
251
+ static?: number;
252
+ dynamic?: boolean;
253
+ minimum?: number;
254
+ maximum?: number;
255
+ total?: number;
256
+ maxMemory?: number;
257
+ cooldown?: number;
258
+ gracePeriod?: number;
259
+ scaleUpELU?: number;
260
+ scaleDownELU?: number;
261
+ [k: string]: unknown;
262
+ }
263
+ export interface RuntimeLoggerOptions {
264
+ level?: (
265
+ | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
266
+ | {
267
+ [k: string]: unknown;
268
+ }
269
+ ) &
270
+ string;
271
+ transport?:
272
+ | {
273
+ target?: string;
274
+ options?: {
275
+ [k: string]: unknown;
276
+ };
277
+ }
278
+ | {
279
+ targets?: {
280
+ target?: string;
281
+ options?: {
282
+ [k: string]: unknown;
283
+ };
284
+ level?: string;
285
+ }[];
286
+ options?: {
287
+ [k: string]: unknown;
288
+ };
289
+ };
290
+ pipeline?: {
291
+ target?: string;
292
+ options?: {
293
+ [k: string]: unknown;
294
+ };
295
+ };
296
+ formatters?: {
297
+ path: string;
298
+ };
299
+ timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime";
300
+ redact?: {
301
+ paths: string[];
302
+ censor?: string;
303
+ };
304
+ base?: {
305
+ [k: string]: unknown;
306
+ } | null;
307
+ messageKey?: string;
308
+ customLevels?: {
309
+ [k: string]: unknown;
310
+ };
311
+ openTelemetryExporter?: {
312
+ protocol: "grpc" | "http";
313
+ url: string;
314
+ };
315
+ captureStdio?: boolean;
316
+ pino?: {
317
+ level?: string;
318
+ time?: string;
319
+ message?: string;
320
+ };
321
+ [k: string]: unknown;
322
+ }
323
+ export interface GracefulShutdownOptions {
324
+ runtime: number | string;
325
+ application: number | string;
326
+ /**
327
+ * Add Connection: close header to HTTP responses during graceful shutdown
328
+ */
329
+ closeConnections?: boolean;
330
+ }
331
+ export interface HealthOptions {
332
+ enabled?: boolean | string;
333
+ interval?: number | string;
334
+ gracePeriod?: number | string;
335
+ maxUnhealthyChecks?: number | string;
336
+ maxELU?: number | string;
337
+ maxEventLoopDelay?: number | string;
338
+ maxEventLoopDelayP99?: number | string;
339
+ maxHeapUsed?: number | string;
340
+ maxHeapTotal?: number | string;
341
+ maxYoungGeneration?: number | string;
342
+ codeRangeSize?: number | string;
343
+ bufferPoolSize?: number | string;
344
+ defaultHighWaterMark?: number | string;
345
+ }
346
+ export interface HealthProbesOptions {
347
+ enabled?: boolean | string;
348
+ hostname?: string;
349
+ port?: number | string;
350
+ readiness?:
351
+ | boolean
352
+ | {
353
+ endpoint?: string;
354
+ success?: {
355
+ statusCode?: number;
356
+ body?: string;
357
+ };
358
+ fail?: {
359
+ statusCode?: number;
360
+ body?: string;
361
+ };
362
+ };
363
+ liveness?:
364
+ | boolean
365
+ | {
366
+ endpoint?: string;
367
+ success?: {
368
+ statusCode?: number;
369
+ body?: string;
370
+ };
371
+ fail?: {
372
+ statusCode?: number;
373
+ body?: string;
374
+ };
375
+ };
376
+ }
377
+ export interface UndiciOptions {
378
+ agentOptions?: {
379
+ [k: string]: unknown;
380
+ };
381
+ interceptors?:
382
+ | {
383
+ module: string;
384
+ options: {
385
+ [k: string]: unknown;
386
+ };
387
+ [k: string]: unknown;
388
+ }[]
389
+ | {
390
+ Client?: {
391
+ module: string;
392
+ options: {
393
+ [k: string]: unknown;
394
+ };
395
+ [k: string]: unknown;
396
+ }[];
397
+ Pool?: {
398
+ module: string;
399
+ options: {
400
+ [k: string]: unknown;
401
+ };
402
+ [k: string]: unknown;
403
+ }[];
404
+ Agent?: {
405
+ module: string;
406
+ options: {
407
+ [k: string]: unknown;
408
+ };
409
+ [k: string]: unknown;
410
+ }[];
411
+ [k: string]: unknown;
412
+ };
413
+ [k: string]: unknown;
414
+ }
415
+ export interface HttpCacheOptions {
416
+ store?: string;
417
+ /**
418
+ * @minItems 1
419
+ */
420
+ methods?: [string, ...string[]];
421
+ cacheTagsHeader?: string;
422
+ maxSize?: number;
423
+ maxEntrySize?: number;
424
+ maxCount?: number;
425
+ /**
426
+ * Whitelist of origins to cache. Supports exact strings and regex patterns (e.g., "/https:\\/\\/.*\\.example\\.com/").
427
+ */
428
+ origins?: string[];
429
+ /**
430
+ * Default cache duration in seconds for responses without explicit expiration headers.
431
+ */
432
+ cacheByDefault?: number;
433
+ /**
434
+ * Cache type. "shared" caches may be shared between users, "private" caches are user-specific.
435
+ */
436
+ type?: "shared" | "private";
437
+ [k: string]: unknown;
438
+ }
439
+ export interface ManagementApiOptions {
440
+ logs?: {
441
+ maxSize?: number;
442
+ };
443
+ /**
444
+ * Custom path for the control socket. If not specified, uses the default platform-specific location.
445
+ */
446
+ socket?: string;
447
+ }
448
+ export interface MetricsOptions {
449
+ port?: number | string;
450
+ enabled?: boolean | string;
451
+ hostname?: string;
452
+ endpoint?: string;
453
+ https?: HttpsOptions;
454
+ auth?: {
455
+ username: string;
456
+ password: string;
457
+ };
458
+ labels?: {
459
+ [k: string]: string;
460
+ };
461
+ /**
462
+ * The label name to use for the application identifier in metrics (e.g., applicationId, serviceId)
463
+ */
464
+ applicationLabel?: string;
465
+ /**
466
+ * Enable outgoing HTTP client request duration metrics
467
+ */
468
+ httpClientMetrics?: boolean | string;
469
+ readiness?:
470
+ | boolean
471
+ | {
472
+ endpoint?: string;
473
+ success?: {
474
+ statusCode?: number;
475
+ body?: string;
476
+ };
477
+ fail?: {
478
+ statusCode?: number;
479
+ body?: string;
480
+ };
481
+ };
482
+ liveness?:
483
+ | boolean
484
+ | {
485
+ endpoint?: string;
486
+ success?: {
487
+ statusCode?: number;
488
+ body?: string;
489
+ };
490
+ fail?: {
491
+ statusCode?: number;
492
+ body?: string;
493
+ };
494
+ };
495
+ /**
496
+ * @deprecated
497
+ * Deprecated. Health probe timeout configuration is no longer used.
498
+ */
499
+ healthChecksTimeouts?: number | string;
500
+ plugins?: string[];
501
+ timeout?: number | string;
502
+ /**
503
+ * Configuration for exporting metrics to an OTLP endpoint
504
+ */
505
+ otlpExporter?: {
506
+ /**
507
+ * Enable or disable OTLP metrics export
508
+ */
509
+ enabled?: boolean | string;
510
+ /**
511
+ * OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)
512
+ */
513
+ endpoint: string;
514
+ /**
515
+ * Interval in milliseconds between metric pushes
516
+ */
517
+ interval?: number | string;
518
+ /**
519
+ * Additional HTTP headers for authentication
520
+ */
521
+ headers?: {
522
+ [k: string]: string;
523
+ };
524
+ /**
525
+ * Service name for OTLP resource attributes
526
+ */
527
+ serviceName?: string;
528
+ /**
529
+ * Service version for OTLP resource attributes
530
+ */
531
+ serviceVersion?: string;
532
+ };
533
+ /**
534
+ * Configuration for forwarding user OpenTelemetry metrics to an OTLP endpoint
535
+ */
536
+ opentelemetry?: {
537
+ /**
538
+ * Enable or disable OpenTelemetry metrics forwarding
539
+ */
540
+ enabled?: boolean | string;
541
+ /**
542
+ * OTLP metrics endpoint URL (e.g., http://collector:4318/v1/metrics)
543
+ */
544
+ endpoint: string;
545
+ /**
546
+ * Interval in milliseconds between metric forwards
547
+ */
548
+ interval?: number | string;
549
+ /**
550
+ * Additional HTTP headers for authentication
551
+ */
552
+ headers?: {
553
+ [k: string]: string;
554
+ };
555
+ };
556
+ /**
557
+ * Custom labels to add to HTTP metrics (http_request_all_duration_seconds). Each label extracts its value from an HTTP request header.
558
+ */
559
+ httpCustomLabels?: {
560
+ /**
561
+ * The label name to use in metrics
562
+ */
563
+ name: string;
564
+ /**
565
+ * The HTTP request header to extract the value from
566
+ */
567
+ header: string;
568
+ /**
569
+ * Default value when header is missing (defaults to "unknown")
570
+ */
571
+ default?: string;
572
+ }[];
573
+ }
574
+ export interface HttpsOptions {
575
+ allowHTTP1?: boolean;
576
+ key:
577
+ | string
578
+ | {
579
+ path?: string;
580
+ }
581
+ | (
582
+ | string
583
+ | {
584
+ path?: string;
585
+ }
586
+ )[];
587
+ cert:
588
+ | string
589
+ | {
590
+ path?: string;
591
+ }
592
+ | (
593
+ | string
594
+ | {
595
+ path?: string;
596
+ }
597
+ )[];
598
+ requestCert?: boolean;
599
+ rejectUnauthorized?: boolean;
600
+ }
601
+ export interface TelemetryOptions {
602
+ enabled?: boolean | string;
603
+ /**
604
+ * The name of the application. Defaults to the folder name if not specified.
605
+ */
606
+ applicationName: string;
607
+ /**
608
+ * The version of the application (optional)
609
+ */
610
+ version?: string;
611
+ /**
612
+ * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
613
+ */
614
+ skip?: {
615
+ /**
616
+ * The path to skip. Can be a string or a regex.
617
+ */
618
+ path?: string;
619
+ /**
620
+ * HTTP method to skip
621
+ */
622
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
623
+ [k: string]: unknown;
624
+ }[];
625
+ exporter?:
626
+ | {
627
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
628
+ /**
629
+ * Options for the exporter. These are passed directly to the exporter.
630
+ */
631
+ options?: {
632
+ /**
633
+ * The URL to send the traces to. Not used for console or memory exporters.
634
+ */
635
+ url?: string;
636
+ /**
637
+ * Headers to send to the exporter. Not used for console or memory exporters.
638
+ */
639
+ headers?: {
640
+ [k: string]: unknown;
641
+ };
642
+ /**
643
+ * The path to write the traces to. Only for file exporter.
644
+ */
645
+ path?: string;
646
+ /**
647
+ * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http.
648
+ */
649
+ protocol?: "http" | "grpc";
650
+ /**
651
+ * Alias for protocol. Only for the otlp exporter. Defaults to http.
652
+ */
653
+ transport?: "http" | "grpc";
654
+ [k: string]: unknown;
655
+ };
656
+ additionalProperties?: never;
657
+ [k: string]: unknown;
658
+ }[]
659
+ | {
660
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
661
+ /**
662
+ * Options for the exporter. These are passed directly to the exporter.
663
+ */
664
+ options?: {
665
+ /**
666
+ * The URL to send the traces to. Not used for console or memory exporters.
667
+ */
668
+ url?: string;
669
+ /**
670
+ * Headers to send to the exporter. Not used for console or memory exporters.
671
+ */
672
+ headers?: {
673
+ [k: string]: unknown;
674
+ };
675
+ /**
676
+ * The path to write the traces to. Only for file exporter.
677
+ */
678
+ path?: string;
679
+ /**
680
+ * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http.
681
+ */
682
+ protocol?: "http" | "grpc";
683
+ /**
684
+ * Alias for protocol. Only for the otlp exporter. Defaults to http.
685
+ */
686
+ transport?: "http" | "grpc";
687
+ [k: string]: unknown;
688
+ };
689
+ additionalProperties?: never;
690
+ [k: string]: unknown;
691
+ };
692
+ /**
693
+ * Enable the OpenTelemetry diagnostic logger. Diagnostic messages are forwarded to the Platformatic global logger using the current logger level.
694
+ */
695
+ diagLogger?: boolean | string;
696
+ }
697
+ export interface CompileCacheOptions {
698
+ /**
699
+ * Enable Node.js module compile cache for faster startup
700
+ */
701
+ enabled?: boolean;
702
+ /**
703
+ * Directory to store compile cache. Defaults to .plt/compile-cache in app root
704
+ */
705
+ directory?: string;
706
+ }