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