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