@platformatic/tanstack 3.71.1-alpha.0 → 4.0.0-alpha.1

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