@platformatic/next 4.0.0-new-config.2 → 4.0.0-new-config.6

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