@platformatic/composer 2.65.1 → 2.66.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
@@ -72,6 +72,13 @@ export interface PlatformaticComposer {
72
72
  paths: string[];
73
73
  censor?: string;
74
74
  };
75
+ base?: {
76
+ [k: string]: unknown;
77
+ } | null;
78
+ messageKey?: string;
79
+ customLevels?: {
80
+ [k: string]: unknown;
81
+ };
75
82
  [k: string]: unknown;
76
83
  };
77
84
  loggerInstance?: {
@@ -399,7 +406,394 @@ export interface PlatformaticComposer {
399
406
  fullRequest?: boolean;
400
407
  validateResponse?: boolean;
401
408
  }[];
402
- telemetry?: OpenTelemetry;
409
+ runtime?: {
410
+ preload?: string | string[];
411
+ basePath?: string;
412
+ workers?: number | string;
413
+ logger?: {
414
+ level: (
415
+ | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
416
+ | {
417
+ [k: string]: unknown;
418
+ }
419
+ ) &
420
+ string;
421
+ transport?:
422
+ | {
423
+ target?: string;
424
+ options?: {
425
+ [k: string]: unknown;
426
+ };
427
+ }
428
+ | {
429
+ targets?: {
430
+ target?: string;
431
+ options?: {
432
+ [k: string]: unknown;
433
+ };
434
+ level?: string;
435
+ }[];
436
+ options?: {
437
+ [k: string]: unknown;
438
+ };
439
+ };
440
+ pipeline?: {
441
+ target?: string;
442
+ options?: {
443
+ [k: string]: unknown;
444
+ };
445
+ };
446
+ formatters?: {
447
+ path: string;
448
+ };
449
+ timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime";
450
+ redact?: {
451
+ paths: string[];
452
+ censor?: string;
453
+ };
454
+ base?: {
455
+ [k: string]: unknown;
456
+ } | null;
457
+ messageKey?: string;
458
+ customLevels?: {
459
+ [k: string]: unknown;
460
+ };
461
+ [k: string]: unknown;
462
+ };
463
+ server?: {
464
+ hostname?: string;
465
+ port?: number | string;
466
+ http2?: boolean;
467
+ https?: {
468
+ allowHTTP1?: boolean;
469
+ key:
470
+ | string
471
+ | {
472
+ path?: string;
473
+ }
474
+ | (
475
+ | string
476
+ | {
477
+ path?: string;
478
+ }
479
+ )[];
480
+ cert:
481
+ | string
482
+ | {
483
+ path?: string;
484
+ }
485
+ | (
486
+ | string
487
+ | {
488
+ path?: string;
489
+ }
490
+ )[];
491
+ requestCert?: boolean;
492
+ rejectUnauthorized?: boolean;
493
+ };
494
+ };
495
+ startTimeout?: number;
496
+ restartOnError?: boolean | number;
497
+ gracefulShutdown?: {
498
+ runtime: number | string;
499
+ service: number | string;
500
+ };
501
+ health?: {
502
+ enabled?: boolean | string;
503
+ interval?: number | string;
504
+ gracePeriod?: number | string;
505
+ maxUnhealthyChecks?: number | string;
506
+ maxELU?: number | string;
507
+ maxHeapUsed?: number | string;
508
+ maxHeapTotal?: number | string;
509
+ maxYoungGeneration?: number;
510
+ };
511
+ undici?: {
512
+ agentOptions?: {
513
+ [k: string]: unknown;
514
+ };
515
+ interceptors?:
516
+ | {
517
+ module: string;
518
+ options: {
519
+ [k: string]: unknown;
520
+ };
521
+ [k: string]: unknown;
522
+ }[]
523
+ | {
524
+ Client?: {
525
+ module: string;
526
+ options: {
527
+ [k: string]: unknown;
528
+ };
529
+ [k: string]: unknown;
530
+ }[];
531
+ Pool?: {
532
+ module: string;
533
+ options: {
534
+ [k: string]: unknown;
535
+ };
536
+ [k: string]: unknown;
537
+ }[];
538
+ Agent?: {
539
+ module: string;
540
+ options: {
541
+ [k: string]: unknown;
542
+ };
543
+ [k: string]: unknown;
544
+ }[];
545
+ [k: string]: unknown;
546
+ };
547
+ [k: string]: unknown;
548
+ };
549
+ httpCache?:
550
+ | boolean
551
+ | {
552
+ store?: string;
553
+ /**
554
+ * @minItems 1
555
+ */
556
+ methods?: [string, ...string[]];
557
+ cacheTagsHeader?: string;
558
+ maxSize?: number;
559
+ maxEntrySize?: number;
560
+ maxCount?: number;
561
+ [k: string]: unknown;
562
+ };
563
+ watch?: boolean | string;
564
+ managementApi?:
565
+ | boolean
566
+ | string
567
+ | {
568
+ logs?: {
569
+ maxSize?: number;
570
+ };
571
+ };
572
+ metrics?:
573
+ | boolean
574
+ | {
575
+ port?: number | string;
576
+ enabled?: boolean | string;
577
+ hostname?: string;
578
+ endpoint?: string;
579
+ auth?: {
580
+ username: string;
581
+ password: string;
582
+ };
583
+ labels?: {
584
+ [k: string]: string;
585
+ };
586
+ readiness?:
587
+ | boolean
588
+ | {
589
+ endpoint?: string;
590
+ success?: {
591
+ statusCode?: number;
592
+ body?: string;
593
+ };
594
+ fail?: {
595
+ statusCode?: number;
596
+ body?: string;
597
+ };
598
+ };
599
+ liveness?:
600
+ | boolean
601
+ | {
602
+ endpoint?: string;
603
+ success?: {
604
+ statusCode?: number;
605
+ body?: string;
606
+ };
607
+ fail?: {
608
+ statusCode?: number;
609
+ body?: string;
610
+ };
611
+ };
612
+ additionalProperties?: never;
613
+ [k: string]: unknown;
614
+ };
615
+ telemetry?: {
616
+ enabled?: boolean | string;
617
+ /**
618
+ * The name of the service. Defaults to the folder name if not specified.
619
+ */
620
+ serviceName: string;
621
+ /**
622
+ * The version of the service (optional)
623
+ */
624
+ version?: string;
625
+ /**
626
+ * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
627
+ */
628
+ skip?: {
629
+ /**
630
+ * The path to skip. Can be a string or a regex.
631
+ */
632
+ path?: string;
633
+ /**
634
+ * HTTP method to skip
635
+ */
636
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
637
+ [k: string]: unknown;
638
+ }[];
639
+ exporter?:
640
+ | {
641
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
642
+ /**
643
+ * Options for the exporter. These are passed directly to the exporter.
644
+ */
645
+ options?: {
646
+ /**
647
+ * The URL to send the traces to. Not used for console or memory exporters.
648
+ */
649
+ url?: string;
650
+ /**
651
+ * Headers to send to the exporter. Not used for console or memory exporters.
652
+ */
653
+ headers?: {
654
+ [k: string]: unknown;
655
+ };
656
+ /**
657
+ * The path to write the traces to. Only for file exporter.
658
+ */
659
+ path?: string;
660
+ [k: string]: unknown;
661
+ };
662
+ additionalProperties?: never;
663
+ [k: string]: unknown;
664
+ }[]
665
+ | {
666
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
667
+ /**
668
+ * Options for the exporter. These are passed directly to the exporter.
669
+ */
670
+ options?: {
671
+ /**
672
+ * The URL to send the traces to. Not used for console or memory exporters.
673
+ */
674
+ url?: string;
675
+ /**
676
+ * Headers to send to the exporter. Not used for console or memory exporters.
677
+ */
678
+ headers?: {
679
+ [k: string]: unknown;
680
+ };
681
+ /**
682
+ * The path to write the traces to. Only for file exporter.
683
+ */
684
+ path?: string;
685
+ [k: string]: unknown;
686
+ };
687
+ additionalProperties?: never;
688
+ [k: string]: unknown;
689
+ };
690
+ };
691
+ inspectorOptions?: {
692
+ host?: string;
693
+ port?: number;
694
+ breakFirstLine?: boolean;
695
+ watchDisabled?: boolean;
696
+ [k: string]: unknown;
697
+ };
698
+ serviceTimeout?: number | string;
699
+ env?: {
700
+ [k: string]: string;
701
+ };
702
+ sourceMaps?: boolean;
703
+ scheduler?: {
704
+ enabled?: boolean | string;
705
+ name: string;
706
+ cron: string;
707
+ callbackUrl: string;
708
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
709
+ headers?: {
710
+ [k: string]: string;
711
+ };
712
+ body?:
713
+ | string
714
+ | {
715
+ [k: string]: unknown;
716
+ };
717
+ maxRetries?: number;
718
+ [k: string]: unknown;
719
+ }[];
720
+ };
721
+ telemetry?: {
722
+ enabled?: boolean | string;
723
+ /**
724
+ * The name of the service. Defaults to the folder name if not specified.
725
+ */
726
+ serviceName: string;
727
+ /**
728
+ * The version of the service (optional)
729
+ */
730
+ version?: string;
731
+ /**
732
+ * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
733
+ */
734
+ skip?: {
735
+ /**
736
+ * The path to skip. Can be a string or a regex.
737
+ */
738
+ path?: string;
739
+ /**
740
+ * HTTP method to skip
741
+ */
742
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
743
+ [k: string]: unknown;
744
+ }[];
745
+ exporter?:
746
+ | {
747
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
748
+ /**
749
+ * Options for the exporter. These are passed directly to the exporter.
750
+ */
751
+ options?: {
752
+ /**
753
+ * The URL to send the traces to. Not used for console or memory exporters.
754
+ */
755
+ url?: string;
756
+ /**
757
+ * Headers to send to the exporter. Not used for console or memory exporters.
758
+ */
759
+ headers?: {
760
+ [k: string]: unknown;
761
+ };
762
+ /**
763
+ * The path to write the traces to. Only for file exporter.
764
+ */
765
+ path?: string;
766
+ [k: string]: unknown;
767
+ };
768
+ additionalProperties?: never;
769
+ [k: string]: unknown;
770
+ }[]
771
+ | {
772
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
773
+ /**
774
+ * Options for the exporter. These are passed directly to the exporter.
775
+ */
776
+ options?: {
777
+ /**
778
+ * The URL to send the traces to. Not used for console or memory exporters.
779
+ */
780
+ url?: string;
781
+ /**
782
+ * Headers to send to the exporter. Not used for console or memory exporters.
783
+ */
784
+ headers?: {
785
+ [k: string]: unknown;
786
+ };
787
+ /**
788
+ * The path to write the traces to. Only for file exporter.
789
+ */
790
+ path?: string;
791
+ [k: string]: unknown;
792
+ };
793
+ additionalProperties?: never;
794
+ [k: string]: unknown;
795
+ };
796
+ };
403
797
  watch?:
404
798
  | {
405
799
  enabled?: boolean | string;
@@ -628,79 +1022,3 @@ export interface Tag {
628
1022
  */
629
1023
  [k: string]: unknown;
630
1024
  }
631
- export interface OpenTelemetry {
632
- enabled?: boolean | string;
633
- /**
634
- * The name of the service. Defaults to the folder name if not specified.
635
- */
636
- serviceName: string;
637
- /**
638
- * The version of the service (optional)
639
- */
640
- version?: string;
641
- /**
642
- * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
643
- */
644
- skip?: {
645
- /**
646
- * The path to skip. Can be a string or a regex.
647
- */
648
- path?: string;
649
- /**
650
- * HTTP method to skip
651
- */
652
- method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
653
- [k: string]: unknown;
654
- }[];
655
- exporter?:
656
- | {
657
- type?: "console" | "otlp" | "zipkin" | "memory" | "file";
658
- /**
659
- * Options for the exporter. These are passed directly to the exporter.
660
- */
661
- options?: {
662
- /**
663
- * The URL to send the traces to. Not used for console or memory exporters.
664
- */
665
- url?: string;
666
- /**
667
- * Headers to send to the exporter. Not used for console or memory exporters.
668
- */
669
- headers?: {
670
- [k: string]: unknown;
671
- };
672
- /**
673
- * The path to write the traces to. Only for file exporter.
674
- */
675
- path?: string;
676
- [k: string]: unknown;
677
- };
678
- additionalProperties?: never;
679
- [k: string]: unknown;
680
- }[]
681
- | {
682
- type?: "console" | "otlp" | "zipkin" | "memory" | "file";
683
- /**
684
- * Options for the exporter. These are passed directly to the exporter.
685
- */
686
- options?: {
687
- /**
688
- * The URL to send the traces to. Not used for console or memory exporters.
689
- */
690
- url?: string;
691
- /**
692
- * Headers to send to the exporter. Not used for console or memory exporters.
693
- */
694
- headers?: {
695
- [k: string]: unknown;
696
- };
697
- /**
698
- * The path to write the traces to. Only for file exporter.
699
- */
700
- path?: string;
701
- [k: string]: unknown;
702
- };
703
- additionalProperties?: never;
704
- [k: string]: unknown;
705
- };
706
- }
package/lib/schema.js CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  const { metrics, server, plugins, watch, clients, openApiBase, openApiDefs, graphqlBase } =
5
5
  require('@platformatic/service').schemas
6
+ const { schemaComponents } = require('@platformatic/utils')
6
7
  const telemetry = require('@platformatic/telemetry').schema
7
8
  const pkg = require('../package.json')
8
9
 
@@ -142,8 +143,8 @@ const composer = {
142
143
  reconnectDecay: { type: 'number' },
143
144
  connectionTimeout: { type: 'number' },
144
145
  reconnectOnClose: { type: 'boolean' },
145
- logs: { type: 'boolean' },
146
- },
146
+ logs: { type: 'boolean' }
147
+ }
147
148
  },
148
149
  hooks: {
149
150
  type: 'object',
@@ -156,12 +157,12 @@ const composer = {
156
157
  },
157
158
  required: [],
158
159
  additionalProperties: false
159
- },
160
+ }
160
161
  },
161
162
  required: [],
162
163
  additionalProperties: false
163
164
  }
164
- ],
165
+ ]
165
166
  }
166
167
  },
167
168
  required: ['id'],
@@ -209,6 +210,7 @@ const platformaticComposerSchema = {
209
210
  types,
210
211
  plugins,
211
212
  clients,
213
+ runtime: schemaComponents.wrappedRuntime,
212
214
  telemetry,
213
215
  watch: {
214
216
  anyOf: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/composer",
3
- "version": "2.65.1",
3
+ "version": "2.66.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -32,9 +32,9 @@
32
32
  "typescript": "^5.5.4",
33
33
  "why-is-node-running": "2",
34
34
  "ws": "^8.16.0",
35
- "@platformatic/client": "2.65.1",
36
- "@platformatic/db": "2.65.1",
37
- "@platformatic/config": "2.65.1"
35
+ "@platformatic/client": "2.66.1",
36
+ "@platformatic/config": "2.66.1",
37
+ "@platformatic/db": "2.66.1"
38
38
  },
39
39
  "dependencies": {
40
40
  "@fastify/error": "^4.0.0",
@@ -45,7 +45,7 @@
45
45
  "@fastify/view": "^10.0.1",
46
46
  "@platformatic/fastify-openapi-glue": "^5.1.0",
47
47
  "@platformatic/graphql-composer": "^0.10.0",
48
- "@scalar/fastify-api-reference": "1.28.34",
48
+ "@scalar/fastify-api-reference": "1.29.3",
49
49
  "ajv": "^8.12.0",
50
50
  "commist": "^3.2.0",
51
51
  "console-table-printer": "^2.12.0",
@@ -68,12 +68,12 @@
68
68
  "rfdc": "^1.3.1",
69
69
  "semgrator": "^0.3.0",
70
70
  "undici": "^7.0.0",
71
- "@platformatic/config": "2.65.1",
72
- "@platformatic/generators": "2.65.1",
73
- "@platformatic/scalar-theme": "2.65.1",
74
- "@platformatic/service": "2.65.1",
75
- "@platformatic/telemetry": "2.65.1",
76
- "@platformatic/utils": "^2.65.1"
71
+ "@platformatic/config": "2.66.1",
72
+ "@platformatic/scalar-theme": "2.66.1",
73
+ "@platformatic/service": "2.66.1",
74
+ "@platformatic/telemetry": "2.66.1",
75
+ "@platformatic/utils": "^2.66.1",
76
+ "@platformatic/generators": "2.66.1"
77
77
  },
78
78
  "scripts": {
79
79
  "test": "pnpm run lint && borp -T --timeout=300000 -c 1 && tsd",