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