@platformatic/nitro 0.0.1 → 3.62.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 ADDED
@@ -0,0 +1,829 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ export interface PlatformaticNitroConfig {
9
+ $schema?: string;
10
+ 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 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).
70
+ */
71
+ portAssignment?: "shared" | "perWorkerIncrement";
72
+ /**
73
+ * The maximum length of the queue of pending connections
74
+ */
75
+ backlog?: number;
76
+ https?: {
77
+ allowHTTP1?: boolean;
78
+ key:
79
+ | string
80
+ | {
81
+ path?: string;
82
+ }
83
+ | (
84
+ | string
85
+ | {
86
+ path?: string;
87
+ }
88
+ )[];
89
+ cert:
90
+ | string
91
+ | {
92
+ path?: string;
93
+ }
94
+ | (
95
+ | string
96
+ | {
97
+ path?: string;
98
+ }
99
+ )[];
100
+ requestCert?: boolean;
101
+ rejectUnauthorized?: boolean;
102
+ };
103
+ };
104
+ watch?:
105
+ | {
106
+ enabled?: boolean | string;
107
+ /**
108
+ * @minItems 1
109
+ */
110
+ allow?: [string, ...string[]];
111
+ ignore?: string[];
112
+ }
113
+ | boolean
114
+ | string;
115
+ application?: {
116
+ basePath?: string;
117
+ outputDirectory?: string;
118
+ include?: string[];
119
+ commands?: {
120
+ install?: string;
121
+ build?: string;
122
+ development?: string;
123
+ production?: string;
124
+ };
125
+ entrypointPort?: number;
126
+ changeDirectoryBeforeExecution?: boolean;
127
+ preferLocalCommands?: boolean;
128
+ processSpawner?: string;
129
+ };
130
+ runtime?: {
131
+ preload?: string | string[];
132
+ extensions?:
133
+ | string
134
+ | {
135
+ path: string;
136
+ options?: {
137
+ [k: string]: unknown;
138
+ };
139
+ }
140
+ | (
141
+ | string
142
+ | {
143
+ path: string;
144
+ options?: {
145
+ [k: string]: unknown;
146
+ };
147
+ }
148
+ )[];
149
+ basePath?: string;
150
+ services?: {
151
+ [k: string]: unknown;
152
+ }[];
153
+ workers?:
154
+ | number
155
+ | string
156
+ | {
157
+ static?: number;
158
+ dynamic?: boolean;
159
+ minimum?: number;
160
+ maximum?: number;
161
+ total?: number;
162
+ maxMemory?: number;
163
+ cooldown?: number;
164
+ gracePeriod?: number;
165
+ scaleUpELU?: number;
166
+ scaleDownELU?: number;
167
+ [k: string]: unknown;
168
+ };
169
+ workersRestartDelay?: number | string;
170
+ logger?: {
171
+ level?: (
172
+ | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
173
+ | {
174
+ [k: string]: unknown;
175
+ }
176
+ ) &
177
+ string;
178
+ transport?:
179
+ | {
180
+ target?: string;
181
+ options?: {
182
+ [k: string]: unknown;
183
+ };
184
+ }
185
+ | {
186
+ targets?: {
187
+ target?: string;
188
+ options?: {
189
+ [k: string]: unknown;
190
+ };
191
+ level?: string;
192
+ }[];
193
+ options?: {
194
+ [k: string]: unknown;
195
+ };
196
+ };
197
+ pipeline?: {
198
+ target?: string;
199
+ options?: {
200
+ [k: string]: unknown;
201
+ };
202
+ };
203
+ formatters?: {
204
+ path: string;
205
+ };
206
+ timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime";
207
+ redact?: {
208
+ paths: string[];
209
+ censor?: string;
210
+ };
211
+ base?: {
212
+ [k: string]: unknown;
213
+ } | null;
214
+ messageKey?: string;
215
+ customLevels?: {
216
+ [k: string]: unknown;
217
+ };
218
+ openTelemetryExporter?: {
219
+ protocol: "grpc" | "http";
220
+ url: string;
221
+ };
222
+ [k: string]: unknown;
223
+ };
224
+ server?: {
225
+ hostname?: string;
226
+ port?: number | string;
227
+ /**
228
+ * 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).
229
+ */
230
+ portAssignment?: "shared" | "perWorkerIncrement";
231
+ /**
232
+ * The maximum length of the queue of pending connections
233
+ */
234
+ backlog?: number;
235
+ http2?: boolean;
236
+ https?: {
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
+ };
264
+ reuseTcpPorts?: boolean;
265
+ startTimeout?: number;
266
+ restartOnError?: boolean | number;
267
+ exitOnUnhandledErrors?: boolean | number;
268
+ gracefulShutdown?: {
269
+ runtime: number | string;
270
+ application: number | string;
271
+ /**
272
+ * Add Connection: close header to HTTP responses during graceful shutdown
273
+ */
274
+ closeConnections?: boolean;
275
+ };
276
+ health?: {
277
+ enabled?: boolean | string;
278
+ interval?: number | string;
279
+ gracePeriod?: number | string;
280
+ maxUnhealthyChecks?: number | string;
281
+ maxELU?: number | string;
282
+ maxEventLoopDelay?: number | string;
283
+ maxEventLoopDelayP99?: number | string;
284
+ maxHeapUsed?: number | string;
285
+ maxHeapTotal?: number | string;
286
+ maxYoungGeneration?: number | string;
287
+ codeRangeSize?: number | string;
288
+ bufferPoolSize?: number | string;
289
+ defaultHighWaterMark?: number | string;
290
+ };
291
+ healthProbes?:
292
+ | boolean
293
+ | string
294
+ | {
295
+ enabled?: boolean | string;
296
+ hostname?: string;
297
+ port?: number | string;
298
+ readiness?:
299
+ | boolean
300
+ | {
301
+ endpoint?: string;
302
+ success?: {
303
+ statusCode?: number;
304
+ body?: string;
305
+ };
306
+ fail?: {
307
+ statusCode?: number;
308
+ body?: string;
309
+ };
310
+ };
311
+ liveness?:
312
+ | boolean
313
+ | {
314
+ endpoint?: string;
315
+ success?: {
316
+ statusCode?: number;
317
+ body?: string;
318
+ };
319
+ fail?: {
320
+ statusCode?: number;
321
+ body?: string;
322
+ };
323
+ };
324
+ };
325
+ undici?: {
326
+ agentOptions?: {
327
+ [k: string]: unknown;
328
+ };
329
+ interceptors?:
330
+ | {
331
+ module: string;
332
+ options: {
333
+ [k: string]: unknown;
334
+ };
335
+ [k: string]: unknown;
336
+ }[]
337
+ | {
338
+ Client?: {
339
+ module: string;
340
+ options: {
341
+ [k: string]: unknown;
342
+ };
343
+ [k: string]: unknown;
344
+ }[];
345
+ Pool?: {
346
+ module: string;
347
+ options: {
348
+ [k: string]: unknown;
349
+ };
350
+ [k: string]: unknown;
351
+ }[];
352
+ Agent?: {
353
+ module: string;
354
+ options: {
355
+ [k: string]: unknown;
356
+ };
357
+ [k: string]: unknown;
358
+ }[];
359
+ [k: string]: unknown;
360
+ };
361
+ [k: string]: unknown;
362
+ };
363
+ httpCache?:
364
+ | boolean
365
+ | {
366
+ store?: string;
367
+ /**
368
+ * @minItems 1
369
+ */
370
+ methods?: [string, ...string[]];
371
+ cacheTagsHeader?: string;
372
+ maxSize?: number;
373
+ maxEntrySize?: number;
374
+ maxCount?: number;
375
+ /**
376
+ * Whitelist of origins to cache. Supports exact strings and regex patterns (e.g., "/https:\\/\\/.*\\.example\\.com/").
377
+ */
378
+ origins?: string[];
379
+ /**
380
+ * Default cache duration in seconds for responses without explicit expiration headers.
381
+ */
382
+ cacheByDefault?: number;
383
+ /**
384
+ * Cache type. "shared" caches may be shared between users, "private" caches are user-specific.
385
+ */
386
+ type?: "shared" | "private";
387
+ [k: string]: unknown;
388
+ };
389
+ watch?: boolean | string;
390
+ managementApi?:
391
+ | boolean
392
+ | string
393
+ | {
394
+ logs?: {
395
+ maxSize?: number;
396
+ };
397
+ /**
398
+ * Custom path for the control socket. If not specified, uses the default platform-specific location.
399
+ */
400
+ socket?: string;
401
+ };
402
+ management?:
403
+ | boolean
404
+ | {
405
+ enabled?: boolean;
406
+ operations?: string[];
407
+ };
408
+ metrics?:
409
+ | boolean
410
+ | {
411
+ port?: number | string;
412
+ enabled?: boolean | string;
413
+ hostname?: string;
414
+ endpoint?: string;
415
+ https?: {
416
+ allowHTTP1?: boolean;
417
+ key:
418
+ | string
419
+ | {
420
+ path?: string;
421
+ }
422
+ | (
423
+ | string
424
+ | {
425
+ path?: string;
426
+ }
427
+ )[];
428
+ cert:
429
+ | string
430
+ | {
431
+ path?: string;
432
+ }
433
+ | (
434
+ | string
435
+ | {
436
+ path?: string;
437
+ }
438
+ )[];
439
+ requestCert?: boolean;
440
+ rejectUnauthorized?: boolean;
441
+ };
442
+ auth?: {
443
+ username: string;
444
+ password: string;
445
+ };
446
+ labels?: {
447
+ [k: string]: string;
448
+ };
449
+ /**
450
+ * The label name to use for the application identifier in metrics (e.g., applicationId, serviceId)
451
+ */
452
+ applicationLabel?: string;
453
+ /**
454
+ * Enable outgoing HTTP client request duration metrics
455
+ */
456
+ httpClientMetrics?: boolean | string;
457
+ readiness?:
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
+ liveness?:
471
+ | boolean
472
+ | {
473
+ endpoint?: string;
474
+ success?: {
475
+ statusCode?: number;
476
+ body?: string;
477
+ };
478
+ fail?: {
479
+ statusCode?: number;
480
+ body?: string;
481
+ };
482
+ };
483
+ /**
484
+ * @deprecated
485
+ * Deprecated. Health probe timeout configuration is no longer used.
486
+ */
487
+ healthChecksTimeouts?: number | string;
488
+ plugins?: string[];
489
+ timeout?: number | string;
490
+ /**
491
+ * Configuration for exporting metrics to an OTLP endpoint
492
+ */
493
+ otlpExporter?: {
494
+ /**
495
+ * Enable or disable OTLP metrics export
496
+ */
497
+ enabled?: boolean | string;
498
+ /**
499
+ * OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)
500
+ */
501
+ endpoint: string;
502
+ /**
503
+ * Interval in milliseconds between metric pushes
504
+ */
505
+ interval?: number | string;
506
+ /**
507
+ * Additional HTTP headers for authentication
508
+ */
509
+ headers?: {
510
+ [k: string]: string;
511
+ };
512
+ /**
513
+ * Service name for OTLP resource attributes
514
+ */
515
+ serviceName?: string;
516
+ /**
517
+ * Service version for OTLP resource attributes
518
+ */
519
+ serviceVersion?: string;
520
+ };
521
+ /**
522
+ * Configuration for forwarding user OpenTelemetry metrics to an OTLP endpoint
523
+ */
524
+ opentelemetry?: {
525
+ /**
526
+ * Enable or disable OpenTelemetry metrics forwarding
527
+ */
528
+ enabled?: boolean | string;
529
+ /**
530
+ * OTLP metrics endpoint URL (e.g., http://collector:4318/v1/metrics)
531
+ */
532
+ endpoint: string;
533
+ /**
534
+ * Interval in milliseconds between metric forwards
535
+ */
536
+ interval?: number | string;
537
+ /**
538
+ * Additional HTTP headers for authentication
539
+ */
540
+ headers?: {
541
+ [k: string]: string;
542
+ };
543
+ };
544
+ /**
545
+ * Custom labels to add to HTTP metrics (http_request_all_duration_seconds). Each label extracts its value from an HTTP request header.
546
+ */
547
+ httpCustomLabels?: {
548
+ /**
549
+ * The label name to use in metrics
550
+ */
551
+ name: string;
552
+ /**
553
+ * The HTTP request header to extract the value from
554
+ */
555
+ header: string;
556
+ /**
557
+ * Default value when header is missing (defaults to "unknown")
558
+ */
559
+ default?: string;
560
+ }[];
561
+ };
562
+ telemetry?: {
563
+ enabled?: boolean | string;
564
+ /**
565
+ * The name of the application. Defaults to the folder name if not specified.
566
+ */
567
+ applicationName: string;
568
+ /**
569
+ * The version of the application (optional)
570
+ */
571
+ version?: string;
572
+ /**
573
+ * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
574
+ */
575
+ skip?: {
576
+ /**
577
+ * The path to skip. Can be a string or a regex.
578
+ */
579
+ path?: string;
580
+ /**
581
+ * HTTP method to skip
582
+ */
583
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
584
+ [k: string]: unknown;
585
+ }[];
586
+ exporter?:
587
+ | {
588
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
589
+ /**
590
+ * Options for the exporter. These are passed directly to the exporter.
591
+ */
592
+ options?: {
593
+ /**
594
+ * The URL to send the traces to. Not used for console or memory exporters.
595
+ */
596
+ url?: string;
597
+ /**
598
+ * Headers to send to the exporter. Not used for console or memory exporters.
599
+ */
600
+ headers?: {
601
+ [k: string]: unknown;
602
+ };
603
+ /**
604
+ * The path to write the traces to. Only for file exporter.
605
+ */
606
+ path?: string;
607
+ /**
608
+ * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http.
609
+ */
610
+ protocol?: "http" | "grpc";
611
+ /**
612
+ * Alias for protocol. Only for the otlp exporter. Defaults to http.
613
+ */
614
+ transport?: "http" | "grpc";
615
+ [k: string]: unknown;
616
+ };
617
+ additionalProperties?: never;
618
+ [k: string]: unknown;
619
+ }[]
620
+ | {
621
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
622
+ /**
623
+ * Options for the exporter. These are passed directly to the exporter.
624
+ */
625
+ options?: {
626
+ /**
627
+ * The URL to send the traces to. Not used for console or memory exporters.
628
+ */
629
+ url?: string;
630
+ /**
631
+ * Headers to send to the exporter. Not used for console or memory exporters.
632
+ */
633
+ headers?: {
634
+ [k: string]: unknown;
635
+ };
636
+ /**
637
+ * The path to write the traces to. Only for file exporter.
638
+ */
639
+ path?: string;
640
+ /**
641
+ * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http.
642
+ */
643
+ protocol?: "http" | "grpc";
644
+ /**
645
+ * Alias for protocol. Only for the otlp exporter. Defaults to http.
646
+ */
647
+ transport?: "http" | "grpc";
648
+ [k: string]: unknown;
649
+ };
650
+ additionalProperties?: never;
651
+ [k: string]: unknown;
652
+ };
653
+ /**
654
+ * Enable the OpenTelemetry diagnostic logger. Diagnostic messages are forwarded to the Platformatic global logger using the current logger level.
655
+ */
656
+ diagLogger?: boolean | string;
657
+ };
658
+ verticalScaler?: {
659
+ enabled?: boolean;
660
+ maxTotalWorkers?: number;
661
+ maxTotalMemory?: number;
662
+ minWorkers?: number;
663
+ maxWorkers?: number;
664
+ cooldownSec?: number;
665
+ gracePeriod?: number;
666
+ scaleUpELU?: number;
667
+ scaleDownELU?: number;
668
+ /**
669
+ * @deprecated
670
+ */
671
+ timeWindowSec?: number;
672
+ /**
673
+ * @deprecated
674
+ */
675
+ scaleDownTimeWindowSec?: number;
676
+ /**
677
+ * @deprecated
678
+ */
679
+ scaleIntervalSec?: number;
680
+ };
681
+ inspectorOptions?: {
682
+ host?: string;
683
+ port?: number;
684
+ breakFirstLine?: boolean;
685
+ watchDisabled?: boolean;
686
+ [k: string]: unknown;
687
+ };
688
+ applicationTimeout?: number | string;
689
+ startupConcurrency?: number | string;
690
+ messagingTimeout?: number | string;
691
+ env?: {
692
+ [k: string]: string;
693
+ };
694
+ envfile?: string;
695
+ /**
696
+ * When set to true, the configuration loading fails if a {PLT_*} placeholder references an environment variable which is not set. When set to "warn", a warning listing the missing variables is logged but the placeholders are still replaced with an empty string. Defaults to false.
697
+ */
698
+ strictEnv?: boolean | string;
699
+ sourceMaps?: boolean;
700
+ nodeModulesSourceMaps?: string[];
701
+ scheduler?: {
702
+ enabled?: boolean | string;
703
+ name: string;
704
+ cron: string;
705
+ callbackUrl: string;
706
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
707
+ headers?: {
708
+ [k: string]: string;
709
+ };
710
+ body?:
711
+ | string
712
+ | {
713
+ [k: string]: unknown;
714
+ };
715
+ maxRetries?: number;
716
+ [k: string]: unknown;
717
+ }[];
718
+ policies?: {
719
+ deny: {
720
+ /**
721
+ * This interface was referenced by `undefined`'s JSON-Schema definition
722
+ * via the `patternProperty` "^.*$".
723
+ */
724
+ [k: string]: string | [string, ...string[]];
725
+ };
726
+ };
727
+ compileCache?:
728
+ | boolean
729
+ | {
730
+ /**
731
+ * Enable Node.js module compile cache for faster startup
732
+ */
733
+ enabled?: boolean;
734
+ /**
735
+ * Directory to store compile cache. Defaults to .plt/compile-cache in app root
736
+ */
737
+ directory?: string;
738
+ };
739
+ application?: {
740
+ reuseTcpPorts?: boolean;
741
+ workers?:
742
+ | number
743
+ | string
744
+ | {
745
+ static?: number;
746
+ minimum?: number;
747
+ maximum?: number;
748
+ scaleUpELU?: number;
749
+ scaleDownELU?: number;
750
+ [k: string]: unknown;
751
+ };
752
+ health?: {
753
+ enabled?: boolean | string;
754
+ interval?: number | string;
755
+ gracePeriod?: number | string;
756
+ maxUnhealthyChecks?: number | string;
757
+ maxELU?: number | string;
758
+ maxEventLoopDelay?: number | string;
759
+ maxEventLoopDelayP99?: number | string;
760
+ maxHeapUsed?: number | string;
761
+ maxHeapTotal?: number | string;
762
+ maxYoungGeneration?: number | string;
763
+ codeRangeSize?: number | string;
764
+ bufferPoolSize?: number | string;
765
+ defaultHighWaterMark?: number | string;
766
+ };
767
+ /**
768
+ * 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.
769
+ */
770
+ restartOnError?: boolean | number;
771
+ arguments?: string[];
772
+ env?: {
773
+ [k: string]: string;
774
+ };
775
+ envfile?: string;
776
+ sourceMaps?: boolean;
777
+ nodeModulesSourceMaps?: string[];
778
+ packageManager?: "npm" | "pnpm" | "yarn";
779
+ preload?: string | string[];
780
+ nodeOptions?: string;
781
+ execArgv?: string[];
782
+ permissions?: {
783
+ fs?: {
784
+ read?: string[];
785
+ write?: string[];
786
+ };
787
+ };
788
+ telemetry?: {
789
+ /**
790
+ * An array of instrumentations loaded if telemetry is enabled
791
+ */
792
+ instrumentations?: (
793
+ | string
794
+ | {
795
+ package: string;
796
+ exportName?: string;
797
+ options?: {
798
+ [k: string]: unknown;
799
+ };
800
+ [k: string]: unknown;
801
+ }
802
+ )[];
803
+ [k: string]: unknown;
804
+ };
805
+ compileCache?:
806
+ | boolean
807
+ | {
808
+ /**
809
+ * Enable Node.js module compile cache for faster startup
810
+ */
811
+ enabled?: boolean;
812
+ /**
813
+ * Directory to store compile cache. Defaults to .plt/compile-cache in app root
814
+ */
815
+ directory?: string;
816
+ };
817
+ };
818
+ };
819
+ vite?: {
820
+ configFile?: string | boolean;
821
+ devServer?: {
822
+ strict?: boolean;
823
+ };
824
+ };
825
+ nitro?: {
826
+ outputDirectory?: string;
827
+ entrypoint?: string;
828
+ };
829
+ }