@platformatic/tanstack 4.0.0-new-config.2 → 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 PlatformaticTanStackConfig {
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 PlatformaticTanStackConfig {
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 PlatformaticTanStackConfig {
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
  vite?: {
@@ -803,3 +161,641 @@ export interface PlatformaticTanStackConfig {
803
161
  };
804
162
  };
805
163
  }
164
+ export interface AppLoggerOptions {
165
+ level?: (
166
+ | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
167
+ | {
168
+ [k: string]: unknown;
169
+ }
170
+ ) &
171
+ string;
172
+ transport?:
173
+ | {
174
+ target?: string;
175
+ options?: {
176
+ [k: string]: unknown;
177
+ };
178
+ }
179
+ | {
180
+ targets?: {
181
+ target?: string;
182
+ options?: {
183
+ [k: string]: unknown;
184
+ };
185
+ level?: string;
186
+ }[];
187
+ options?: {
188
+ [k: string]: unknown;
189
+ };
190
+ };
191
+ pipeline?: {
192
+ target?: string;
193
+ options?: {
194
+ [k: string]: unknown;
195
+ };
196
+ };
197
+ formatters?: {
198
+ path: string;
199
+ };
200
+ timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime";
201
+ redact?: {
202
+ paths: string[];
203
+ censor?: string;
204
+ };
205
+ base?: {
206
+ [k: string]: unknown;
207
+ } | null;
208
+ messageKey?: string;
209
+ customLevels?: {
210
+ [k: string]: unknown;
211
+ };
212
+ openTelemetryExporter?: {
213
+ protocol: "grpc" | "http";
214
+ url: string;
215
+ };
216
+ [k: string]: unknown;
217
+ }
218
+ export interface AppServerOptions {
219
+ hostname?: string;
220
+ port?: number | string;
221
+ /**
222
+ * 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.
223
+ */
224
+ portAssignment?: "shared" | "perWorkerIncrement";
225
+ /**
226
+ * The maximum length of the queue of pending connections
227
+ */
228
+ backlog?: number;
229
+ http2?: boolean;
230
+ https?: HttpsOptions;
231
+ }
232
+ export interface HttpsOptions {
233
+ allowHTTP1?: boolean;
234
+ key:
235
+ | string
236
+ | {
237
+ path?: string;
238
+ }
239
+ | (
240
+ | string
241
+ | {
242
+ path?: string;
243
+ }
244
+ )[];
245
+ cert:
246
+ | string
247
+ | {
248
+ path?: string;
249
+ }
250
+ | (
251
+ | string
252
+ | {
253
+ path?: string;
254
+ }
255
+ )[];
256
+ requestCert?: boolean;
257
+ rejectUnauthorized?: boolean;
258
+ }
259
+ export interface WatchOptions {
260
+ enabled?: boolean | string;
261
+ /**
262
+ * @minItems 1
263
+ */
264
+ allow?: [string, ...string[]];
265
+ ignore?: string[];
266
+ }
267
+ export interface BuildableApplicationOptions {
268
+ basePath?: string;
269
+ outputDirectory?: string;
270
+ include?: string[];
271
+ commands?: {
272
+ install?: string;
273
+ build?: string;
274
+ development?: string;
275
+ production?: string;
276
+ };
277
+ changeDirectoryBeforeExecution?: boolean;
278
+ preferLocalCommands?: boolean;
279
+ processSpawner?: string;
280
+ }
281
+ export interface ExtensionEntry {
282
+ path: string;
283
+ options?: {
284
+ [k: string]: unknown;
285
+ };
286
+ build?: boolean;
287
+ }
288
+ export interface ExtensionEntry1 {
289
+ path: string;
290
+ options?: {
291
+ [k: string]: unknown;
292
+ };
293
+ build?: boolean;
294
+ }
295
+ export interface WorkersOptions {
296
+ static?: number;
297
+ dynamic?: boolean;
298
+ minimum?: number;
299
+ maximum?: number;
300
+ total?: number;
301
+ maxMemory?: number;
302
+ cooldown?: number;
303
+ gracePeriod?: number;
304
+ scaleUpELU?: number;
305
+ scaleDownELU?: number;
306
+ [k: string]: unknown;
307
+ }
308
+ export interface AppLoggerOptions1 {
309
+ level?: (
310
+ | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
311
+ | {
312
+ [k: string]: unknown;
313
+ }
314
+ ) &
315
+ string;
316
+ transport?:
317
+ | {
318
+ target?: string;
319
+ options?: {
320
+ [k: string]: unknown;
321
+ };
322
+ }
323
+ | {
324
+ targets?: {
325
+ target?: string;
326
+ options?: {
327
+ [k: string]: unknown;
328
+ };
329
+ level?: string;
330
+ }[];
331
+ options?: {
332
+ [k: string]: unknown;
333
+ };
334
+ };
335
+ pipeline?: {
336
+ target?: string;
337
+ options?: {
338
+ [k: string]: unknown;
339
+ };
340
+ };
341
+ formatters?: {
342
+ path: string;
343
+ };
344
+ timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime";
345
+ redact?: {
346
+ paths: string[];
347
+ censor?: string;
348
+ };
349
+ base?: {
350
+ [k: string]: unknown;
351
+ } | null;
352
+ messageKey?: string;
353
+ customLevels?: {
354
+ [k: string]: unknown;
355
+ };
356
+ openTelemetryExporter?: {
357
+ protocol: "grpc" | "http";
358
+ url: string;
359
+ };
360
+ [k: string]: unknown;
361
+ }
362
+ export interface GracefulShutdownOptions {
363
+ runtime: number | string;
364
+ application: number | string;
365
+ /**
366
+ * Add Connection: close header to HTTP responses during graceful shutdown
367
+ */
368
+ closeConnections?: boolean;
369
+ }
370
+ export interface HealthOptions {
371
+ enabled?: boolean | string;
372
+ interval?: number | string;
373
+ gracePeriod?: number | string;
374
+ maxUnhealthyChecks?: number | string;
375
+ maxELU?: number | string;
376
+ maxEventLoopDelay?: number | string;
377
+ maxEventLoopDelayP99?: number | string;
378
+ maxHeapUsed?: number | string;
379
+ maxHeapTotal?: number | string;
380
+ maxYoungGeneration?: number | string;
381
+ codeRangeSize?: number | string;
382
+ bufferPoolSize?: number | string;
383
+ defaultHighWaterMark?: number | string;
384
+ }
385
+ export interface HealthProbesOptions {
386
+ enabled?: boolean | string;
387
+ hostname?: string;
388
+ port?: number | string;
389
+ readiness?:
390
+ | boolean
391
+ | {
392
+ endpoint?: string;
393
+ success?: {
394
+ statusCode?: number;
395
+ body?: string;
396
+ };
397
+ fail?: {
398
+ statusCode?: number;
399
+ body?: string;
400
+ };
401
+ };
402
+ liveness?:
403
+ | boolean
404
+ | {
405
+ endpoint?: string;
406
+ success?: {
407
+ statusCode?: number;
408
+ body?: string;
409
+ };
410
+ fail?: {
411
+ statusCode?: number;
412
+ body?: string;
413
+ };
414
+ };
415
+ }
416
+ export interface UndiciOptions {
417
+ agentOptions?: {
418
+ [k: string]: unknown;
419
+ };
420
+ interceptors?:
421
+ | {
422
+ module: string;
423
+ options: {
424
+ [k: string]: unknown;
425
+ };
426
+ [k: string]: unknown;
427
+ }[]
428
+ | {
429
+ Client?: {
430
+ module: string;
431
+ options: {
432
+ [k: string]: unknown;
433
+ };
434
+ [k: string]: unknown;
435
+ }[];
436
+ Pool?: {
437
+ module: string;
438
+ options: {
439
+ [k: string]: unknown;
440
+ };
441
+ [k: string]: unknown;
442
+ }[];
443
+ Agent?: {
444
+ module: string;
445
+ options: {
446
+ [k: string]: unknown;
447
+ };
448
+ [k: string]: unknown;
449
+ }[];
450
+ [k: string]: unknown;
451
+ };
452
+ [k: string]: unknown;
453
+ }
454
+ export interface HttpCacheOptions {
455
+ store?: string;
456
+ /**
457
+ * @minItems 1
458
+ */
459
+ methods?: [string, ...string[]];
460
+ cacheTagsHeader?: string;
461
+ maxSize?: number;
462
+ maxEntrySize?: number;
463
+ maxCount?: number;
464
+ /**
465
+ * Whitelist of origins to cache. Supports exact strings and regex patterns (e.g., "/https:\\/\\/.*\\.example\\.com/").
466
+ */
467
+ origins?: string[];
468
+ /**
469
+ * Default cache duration in seconds for responses without explicit expiration headers.
470
+ */
471
+ cacheByDefault?: number;
472
+ /**
473
+ * Cache type. "shared" caches may be shared between users, "private" caches are user-specific.
474
+ */
475
+ type?: "shared" | "private";
476
+ [k: string]: unknown;
477
+ }
478
+ export interface ManagementApiOptions {
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
+ }
487
+ export interface MetricsOptions {
488
+ port?: number | string;
489
+ enabled?: boolean | string;
490
+ hostname?: string;
491
+ endpoint?: string;
492
+ https?: HttpsOptions1;
493
+ auth?: {
494
+ username: string;
495
+ password: string;
496
+ };
497
+ labels?: {
498
+ [k: string]: string;
499
+ };
500
+ /**
501
+ * The label name to use for the application identifier in metrics (e.g., applicationId, serviceId)
502
+ */
503
+ applicationLabel?: string;
504
+ /**
505
+ * Enable outgoing HTTP client request duration metrics
506
+ */
507
+ httpClientMetrics?: boolean | string;
508
+ readiness?:
509
+ | boolean
510
+ | {
511
+ endpoint?: string;
512
+ success?: {
513
+ statusCode?: number;
514
+ body?: string;
515
+ };
516
+ fail?: {
517
+ statusCode?: number;
518
+ body?: string;
519
+ };
520
+ };
521
+ liveness?:
522
+ | boolean
523
+ | {
524
+ endpoint?: string;
525
+ success?: {
526
+ statusCode?: number;
527
+ body?: string;
528
+ };
529
+ fail?: {
530
+ statusCode?: number;
531
+ body?: string;
532
+ };
533
+ };
534
+ /**
535
+ * @deprecated
536
+ * Deprecated. Health probe timeout configuration is no longer used.
537
+ */
538
+ healthChecksTimeouts?: number | string;
539
+ plugins?: string[];
540
+ timeout?: number | string;
541
+ /**
542
+ * Configuration for exporting metrics to an OTLP endpoint
543
+ */
544
+ otlpExporter?: {
545
+ /**
546
+ * Enable or disable OTLP metrics export
547
+ */
548
+ enabled?: boolean | string;
549
+ /**
550
+ * OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)
551
+ */
552
+ endpoint: string;
553
+ /**
554
+ * Interval in milliseconds between metric pushes
555
+ */
556
+ interval?: number | string;
557
+ /**
558
+ * Additional HTTP headers for authentication
559
+ */
560
+ headers?: {
561
+ [k: string]: string;
562
+ };
563
+ /**
564
+ * Service name for OTLP resource attributes
565
+ */
566
+ serviceName?: string;
567
+ /**
568
+ * Service version for OTLP resource attributes
569
+ */
570
+ serviceVersion?: string;
571
+ };
572
+ /**
573
+ * Configuration for forwarding user OpenTelemetry metrics to an OTLP endpoint
574
+ */
575
+ opentelemetry?: {
576
+ /**
577
+ * Enable or disable OpenTelemetry metrics forwarding
578
+ */
579
+ enabled?: boolean | string;
580
+ /**
581
+ * OTLP metrics endpoint URL (e.g., http://collector:4318/v1/metrics)
582
+ */
583
+ endpoint: string;
584
+ /**
585
+ * Interval in milliseconds between metric forwards
586
+ */
587
+ interval?: number | string;
588
+ /**
589
+ * Additional HTTP headers for authentication
590
+ */
591
+ headers?: {
592
+ [k: string]: string;
593
+ };
594
+ };
595
+ /**
596
+ * Custom labels to add to HTTP metrics (http_request_all_duration_seconds). Each label extracts its value from an HTTP request header.
597
+ */
598
+ httpCustomLabels?: {
599
+ /**
600
+ * The label name to use in metrics
601
+ */
602
+ name: string;
603
+ /**
604
+ * The HTTP request header to extract the value from
605
+ */
606
+ header: string;
607
+ /**
608
+ * Default value when header is missing (defaults to "unknown")
609
+ */
610
+ default?: string;
611
+ }[];
612
+ }
613
+ export interface HttpsOptions1 {
614
+ allowHTTP1?: boolean;
615
+ key:
616
+ | string
617
+ | {
618
+ path?: string;
619
+ }
620
+ | (
621
+ | string
622
+ | {
623
+ path?: string;
624
+ }
625
+ )[];
626
+ cert:
627
+ | string
628
+ | {
629
+ path?: string;
630
+ }
631
+ | (
632
+ | string
633
+ | {
634
+ path?: string;
635
+ }
636
+ )[];
637
+ requestCert?: boolean;
638
+ rejectUnauthorized?: boolean;
639
+ }
640
+ export interface TelemetryOptions {
641
+ enabled?: boolean | string;
642
+ /**
643
+ * The name of the application. Defaults to the folder name if not specified.
644
+ */
645
+ applicationName: string;
646
+ /**
647
+ * The version of the application (optional)
648
+ */
649
+ version?: string;
650
+ /**
651
+ * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
652
+ */
653
+ skip?: {
654
+ /**
655
+ * The path to skip. Can be a string or a regex.
656
+ */
657
+ path?: string;
658
+ /**
659
+ * HTTP method to skip
660
+ */
661
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
662
+ [k: string]: unknown;
663
+ }[];
664
+ exporter?:
665
+ | {
666
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
667
+ /**
668
+ * Options for the exporter. These are passed directly to the exporter.
669
+ */
670
+ options?: {
671
+ /**
672
+ * The URL to send the traces to. Not used for console or memory exporters.
673
+ */
674
+ url?: string;
675
+ /**
676
+ * Headers to send to the exporter. Not used for console or memory exporters.
677
+ */
678
+ headers?: {
679
+ [k: string]: unknown;
680
+ };
681
+ /**
682
+ * The path to write the traces to. Only for file exporter.
683
+ */
684
+ path?: string;
685
+ /**
686
+ * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http.
687
+ */
688
+ protocol?: "http" | "grpc";
689
+ /**
690
+ * Alias for protocol. Only for the otlp exporter. Defaults to http.
691
+ */
692
+ transport?: "http" | "grpc";
693
+ [k: string]: unknown;
694
+ };
695
+ additionalProperties?: never;
696
+ [k: string]: unknown;
697
+ }[]
698
+ | {
699
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
700
+ /**
701
+ * Options for the exporter. These are passed directly to the exporter.
702
+ */
703
+ options?: {
704
+ /**
705
+ * The URL to send the traces to. Not used for console or memory exporters.
706
+ */
707
+ url?: string;
708
+ /**
709
+ * Headers to send to the exporter. Not used for console or memory exporters.
710
+ */
711
+ headers?: {
712
+ [k: string]: unknown;
713
+ };
714
+ /**
715
+ * The path to write the traces to. Only for file exporter.
716
+ */
717
+ path?: string;
718
+ /**
719
+ * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http.
720
+ */
721
+ protocol?: "http" | "grpc";
722
+ /**
723
+ * Alias for protocol. Only for the otlp exporter. Defaults to http.
724
+ */
725
+ transport?: "http" | "grpc";
726
+ [k: string]: unknown;
727
+ };
728
+ additionalProperties?: never;
729
+ [k: string]: unknown;
730
+ };
731
+ /**
732
+ * Enable the OpenTelemetry diagnostic logger. Diagnostic messages are forwarded to the Platformatic global logger using the current logger level.
733
+ */
734
+ diagLogger?: boolean | string;
735
+ }
736
+ export interface CompileCacheOptions {
737
+ /**
738
+ * Enable Node.js module compile cache for faster startup
739
+ */
740
+ enabled?: boolean;
741
+ /**
742
+ * Directory to store compile cache. Defaults to .plt/compile-cache in app root
743
+ */
744
+ directory?: string;
745
+ }
746
+ export interface ApplicationWorkersOptions {
747
+ static?: number;
748
+ minimum?: number;
749
+ maximum?: number;
750
+ scaleUpELU?: number;
751
+ scaleDownELU?: number;
752
+ [k: string]: unknown;
753
+ }
754
+ export interface ApplicationHealthOptions {
755
+ enabled?: boolean | string;
756
+ interval?: number | string;
757
+ gracePeriod?: number | string;
758
+ maxUnhealthyChecks?: number | string;
759
+ maxELU?: number | string;
760
+ maxEventLoopDelay?: number | string;
761
+ maxEventLoopDelayP99?: number | string;
762
+ maxHeapUsed?: number | string;
763
+ maxHeapTotal?: number | string;
764
+ maxYoungGeneration?: number | string;
765
+ codeRangeSize?: number | string;
766
+ bufferPoolSize?: number | string;
767
+ defaultHighWaterMark?: number | string;
768
+ }
769
+ export interface PermissionsOptions {
770
+ fs?: {
771
+ read?: string[];
772
+ write?: string[];
773
+ };
774
+ }
775
+ export interface ApplicationTelemetryOverrides {
776
+ /**
777
+ * An array of instrumentations loaded if tracing is enabled
778
+ */
779
+ instrumentations?: (
780
+ | string
781
+ | {
782
+ package: string;
783
+ exportName?: string;
784
+ options?: {
785
+ [k: string]: unknown;
786
+ };
787
+ [k: string]: unknown;
788
+ }
789
+ )[];
790
+ [k: string]: unknown;
791
+ }
792
+ export interface CompileCacheOptions1 {
793
+ /**
794
+ * Enable Node.js module compile cache for faster startup
795
+ */
796
+ enabled?: boolean;
797
+ /**
798
+ * Directory to store compile cache. Defaults to .plt/compile-cache in app root
799
+ */
800
+ directory?: string;
801
+ }