@platformatic/db 2.65.1 → 2.66.0

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
@@ -89,6 +89,13 @@ export interface PlatformaticDB {
89
89
  paths: string[];
90
90
  censor?: string;
91
91
  };
92
+ base?: {
93
+ [k: string]: unknown;
94
+ } | null;
95
+ messageKey?: string;
96
+ customLevels?: {
97
+ [k: string]: unknown;
98
+ };
92
99
  [k: string]: unknown;
93
100
  };
94
101
  loggerInstance?: {
@@ -411,7 +418,82 @@ export interface PlatformaticDB {
411
418
  plugins?: {
412
419
  [k: string]: unknown;
413
420
  };
414
- telemetry?: OpenTelemetry;
421
+ telemetry?: {
422
+ enabled?: boolean | string;
423
+ /**
424
+ * The name of the service. Defaults to the folder name if not specified.
425
+ */
426
+ serviceName: string;
427
+ /**
428
+ * The version of the service (optional)
429
+ */
430
+ version?: string;
431
+ /**
432
+ * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
433
+ */
434
+ skip?: {
435
+ /**
436
+ * The path to skip. Can be a string or a regex.
437
+ */
438
+ path?: string;
439
+ /**
440
+ * HTTP method to skip
441
+ */
442
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
443
+ [k: string]: unknown;
444
+ }[];
445
+ exporter?:
446
+ | {
447
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
448
+ /**
449
+ * Options for the exporter. These are passed directly to the exporter.
450
+ */
451
+ options?: {
452
+ /**
453
+ * The URL to send the traces to. Not used for console or memory exporters.
454
+ */
455
+ url?: string;
456
+ /**
457
+ * Headers to send to the exporter. Not used for console or memory exporters.
458
+ */
459
+ headers?: {
460
+ [k: string]: unknown;
461
+ };
462
+ /**
463
+ * The path to write the traces to. Only for file exporter.
464
+ */
465
+ path?: string;
466
+ [k: string]: unknown;
467
+ };
468
+ additionalProperties?: never;
469
+ [k: string]: unknown;
470
+ }[]
471
+ | {
472
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
473
+ /**
474
+ * Options for the exporter. These are passed directly to the exporter.
475
+ */
476
+ options?: {
477
+ /**
478
+ * The URL to send the traces to. Not used for console or memory exporters.
479
+ */
480
+ url?: string;
481
+ /**
482
+ * Headers to send to the exporter. Not used for console or memory exporters.
483
+ */
484
+ headers?: {
485
+ [k: string]: unknown;
486
+ };
487
+ /**
488
+ * The path to write the traces to. Only for file exporter.
489
+ */
490
+ path?: string;
491
+ [k: string]: unknown;
492
+ };
493
+ additionalProperties?: never;
494
+ [k: string]: unknown;
495
+ };
496
+ };
415
497
  clients?: {
416
498
  serviceId?: string;
417
499
  name?: string;
@@ -423,6 +505,318 @@ export interface PlatformaticDB {
423
505
  fullRequest?: boolean;
424
506
  validateResponse?: boolean;
425
507
  }[];
508
+ runtime?: {
509
+ preload?: string | string[];
510
+ basePath?: string;
511
+ workers?: number | string;
512
+ logger?: {
513
+ level: (
514
+ | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
515
+ | {
516
+ [k: string]: unknown;
517
+ }
518
+ ) &
519
+ string;
520
+ transport?:
521
+ | {
522
+ target?: string;
523
+ options?: {
524
+ [k: string]: unknown;
525
+ };
526
+ }
527
+ | {
528
+ targets?: {
529
+ target?: string;
530
+ options?: {
531
+ [k: string]: unknown;
532
+ };
533
+ level?: string;
534
+ }[];
535
+ options?: {
536
+ [k: string]: unknown;
537
+ };
538
+ };
539
+ pipeline?: {
540
+ target?: string;
541
+ options?: {
542
+ [k: string]: unknown;
543
+ };
544
+ };
545
+ formatters?: {
546
+ path: string;
547
+ };
548
+ timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime";
549
+ redact?: {
550
+ paths: string[];
551
+ censor?: string;
552
+ };
553
+ base?: {
554
+ [k: string]: unknown;
555
+ } | null;
556
+ messageKey?: string;
557
+ customLevels?: {
558
+ [k: string]: unknown;
559
+ };
560
+ [k: string]: unknown;
561
+ };
562
+ server?: {
563
+ hostname?: string;
564
+ port?: number | string;
565
+ http2?: boolean;
566
+ https?: {
567
+ allowHTTP1?: boolean;
568
+ key:
569
+ | string
570
+ | {
571
+ path?: string;
572
+ }
573
+ | (
574
+ | string
575
+ | {
576
+ path?: string;
577
+ }
578
+ )[];
579
+ cert:
580
+ | string
581
+ | {
582
+ path?: string;
583
+ }
584
+ | (
585
+ | string
586
+ | {
587
+ path?: string;
588
+ }
589
+ )[];
590
+ requestCert?: boolean;
591
+ rejectUnauthorized?: boolean;
592
+ };
593
+ };
594
+ startTimeout?: number;
595
+ restartOnError?: boolean | number;
596
+ gracefulShutdown?: {
597
+ runtime: number | string;
598
+ service: number | string;
599
+ };
600
+ health?: {
601
+ enabled?: boolean | string;
602
+ interval?: number | string;
603
+ gracePeriod?: number | string;
604
+ maxUnhealthyChecks?: number | string;
605
+ maxELU?: number | string;
606
+ maxHeapUsed?: number | string;
607
+ maxHeapTotal?: number | string;
608
+ maxYoungGeneration?: number;
609
+ };
610
+ undici?: {
611
+ agentOptions?: {
612
+ [k: string]: unknown;
613
+ };
614
+ interceptors?:
615
+ | {
616
+ module: string;
617
+ options: {
618
+ [k: string]: unknown;
619
+ };
620
+ [k: string]: unknown;
621
+ }[]
622
+ | {
623
+ Client?: {
624
+ module: string;
625
+ options: {
626
+ [k: string]: unknown;
627
+ };
628
+ [k: string]: unknown;
629
+ }[];
630
+ Pool?: {
631
+ module: string;
632
+ options: {
633
+ [k: string]: unknown;
634
+ };
635
+ [k: string]: unknown;
636
+ }[];
637
+ Agent?: {
638
+ module: string;
639
+ options: {
640
+ [k: string]: unknown;
641
+ };
642
+ [k: string]: unknown;
643
+ }[];
644
+ [k: string]: unknown;
645
+ };
646
+ [k: string]: unknown;
647
+ };
648
+ httpCache?:
649
+ | boolean
650
+ | {
651
+ store?: string;
652
+ /**
653
+ * @minItems 1
654
+ */
655
+ methods?: [string, ...string[]];
656
+ cacheTagsHeader?: string;
657
+ maxSize?: number;
658
+ maxEntrySize?: number;
659
+ maxCount?: number;
660
+ [k: string]: unknown;
661
+ };
662
+ watch?: boolean | string;
663
+ managementApi?:
664
+ | boolean
665
+ | string
666
+ | {
667
+ logs?: {
668
+ maxSize?: number;
669
+ };
670
+ };
671
+ metrics?:
672
+ | boolean
673
+ | {
674
+ port?: number | string;
675
+ enabled?: boolean | string;
676
+ hostname?: string;
677
+ endpoint?: string;
678
+ auth?: {
679
+ username: string;
680
+ password: string;
681
+ };
682
+ labels?: {
683
+ [k: string]: string;
684
+ };
685
+ readiness?:
686
+ | boolean
687
+ | {
688
+ endpoint?: string;
689
+ success?: {
690
+ statusCode?: number;
691
+ body?: string;
692
+ };
693
+ fail?: {
694
+ statusCode?: number;
695
+ body?: string;
696
+ };
697
+ };
698
+ liveness?:
699
+ | boolean
700
+ | {
701
+ endpoint?: string;
702
+ success?: {
703
+ statusCode?: number;
704
+ body?: string;
705
+ };
706
+ fail?: {
707
+ statusCode?: number;
708
+ body?: string;
709
+ };
710
+ };
711
+ additionalProperties?: never;
712
+ [k: string]: unknown;
713
+ };
714
+ telemetry?: {
715
+ enabled?: boolean | string;
716
+ /**
717
+ * The name of the service. Defaults to the folder name if not specified.
718
+ */
719
+ serviceName: string;
720
+ /**
721
+ * The version of the service (optional)
722
+ */
723
+ version?: string;
724
+ /**
725
+ * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
726
+ */
727
+ skip?: {
728
+ /**
729
+ * The path to skip. Can be a string or a regex.
730
+ */
731
+ path?: string;
732
+ /**
733
+ * HTTP method to skip
734
+ */
735
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
736
+ [k: string]: unknown;
737
+ }[];
738
+ exporter?:
739
+ | {
740
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
741
+ /**
742
+ * Options for the exporter. These are passed directly to the exporter.
743
+ */
744
+ options?: {
745
+ /**
746
+ * The URL to send the traces to. Not used for console or memory exporters.
747
+ */
748
+ url?: string;
749
+ /**
750
+ * Headers to send to the exporter. Not used for console or memory exporters.
751
+ */
752
+ headers?: {
753
+ [k: string]: unknown;
754
+ };
755
+ /**
756
+ * The path to write the traces to. Only for file exporter.
757
+ */
758
+ path?: string;
759
+ [k: string]: unknown;
760
+ };
761
+ additionalProperties?: never;
762
+ [k: string]: unknown;
763
+ }[]
764
+ | {
765
+ type?: "console" | "otlp" | "zipkin" | "memory" | "file";
766
+ /**
767
+ * Options for the exporter. These are passed directly to the exporter.
768
+ */
769
+ options?: {
770
+ /**
771
+ * The URL to send the traces to. Not used for console or memory exporters.
772
+ */
773
+ url?: string;
774
+ /**
775
+ * Headers to send to the exporter. Not used for console or memory exporters.
776
+ */
777
+ headers?: {
778
+ [k: string]: unknown;
779
+ };
780
+ /**
781
+ * The path to write the traces to. Only for file exporter.
782
+ */
783
+ path?: string;
784
+ [k: string]: unknown;
785
+ };
786
+ additionalProperties?: never;
787
+ [k: string]: unknown;
788
+ };
789
+ };
790
+ inspectorOptions?: {
791
+ host?: string;
792
+ port?: number;
793
+ breakFirstLine?: boolean;
794
+ watchDisabled?: boolean;
795
+ [k: string]: unknown;
796
+ };
797
+ serviceTimeout?: number | string;
798
+ env?: {
799
+ [k: string]: string;
800
+ };
801
+ sourceMaps?: boolean;
802
+ scheduler?: {
803
+ enabled?: boolean | string;
804
+ name: string;
805
+ cron: string;
806
+ callbackUrl: string;
807
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
808
+ headers?: {
809
+ [k: string]: string;
810
+ };
811
+ body?:
812
+ | string
813
+ | {
814
+ [k: string]: unknown;
815
+ };
816
+ maxRetries?: number;
817
+ [k: string]: unknown;
818
+ }[];
819
+ };
426
820
  watch?:
427
821
  | {
428
822
  enabled?: boolean | string;
@@ -651,79 +1045,3 @@ export interface Tag {
651
1045
  */
652
1046
  [k: string]: unknown;
653
1047
  }
654
- export interface OpenTelemetry {
655
- enabled?: boolean | string;
656
- /**
657
- * The name of the service. Defaults to the folder name if not specified.
658
- */
659
- serviceName: string;
660
- /**
661
- * The version of the service (optional)
662
- */
663
- version?: string;
664
- /**
665
- * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
666
- */
667
- skip?: {
668
- /**
669
- * The path to skip. Can be a string or a regex.
670
- */
671
- path?: string;
672
- /**
673
- * HTTP method to skip
674
- */
675
- method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
676
- [k: string]: unknown;
677
- }[];
678
- exporter?:
679
- | {
680
- type?: "console" | "otlp" | "zipkin" | "memory" | "file";
681
- /**
682
- * Options for the exporter. These are passed directly to the exporter.
683
- */
684
- options?: {
685
- /**
686
- * The URL to send the traces to. Not used for console or memory exporters.
687
- */
688
- url?: string;
689
- /**
690
- * Headers to send to the exporter. Not used for console or memory exporters.
691
- */
692
- headers?: {
693
- [k: string]: unknown;
694
- };
695
- /**
696
- * The path to write the traces to. Only for file exporter.
697
- */
698
- path?: string;
699
- [k: string]: unknown;
700
- };
701
- additionalProperties?: never;
702
- [k: string]: unknown;
703
- }[]
704
- | {
705
- type?: "console" | "otlp" | "zipkin" | "memory" | "file";
706
- /**
707
- * Options for the exporter. These are passed directly to the exporter.
708
- */
709
- options?: {
710
- /**
711
- * The URL to send the traces to. Not used for console or memory exporters.
712
- */
713
- url?: string;
714
- /**
715
- * Headers to send to the exporter. Not used for console or memory exporters.
716
- */
717
- headers?: {
718
- [k: string]: unknown;
719
- };
720
- /**
721
- * The path to write the traces to. Only for file exporter.
722
- */
723
- path?: string;
724
- [k: string]: unknown;
725
- };
726
- additionalProperties?: never;
727
- [k: string]: unknown;
728
- };
729
- }
package/lib/schema.js CHANGED
@@ -2,6 +2,7 @@
2
2
  'use strict'
3
3
 
4
4
  const { metrics, server, plugins, watch, openApiDefs, openApiBase, clients } = require('@platformatic/service').schemas
5
+ const { schemaComponents } = require('@platformatic/utils')
5
6
  const telemetry = require('@platformatic/telemetry').schema
6
7
  const pkg = require('../package.json')
7
8
 
@@ -459,6 +460,7 @@ const platformaticDBschema = {
459
460
  plugins,
460
461
  telemetry,
461
462
  clients,
463
+ runtime: schemaComponents.wrappedRuntime,
462
464
  watch: {
463
465
  anyOf: [
464
466
  watch,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/db",
3
- "version": "2.65.1",
3
+ "version": "2.66.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -73,19 +73,19 @@
73
73
  "rfdc": "^1.3.1",
74
74
  "rimraf": "^4.4.1",
75
75
  "semgrator": "^0.3.0",
76
- "@platformatic/config": "2.65.1",
77
- "@platformatic/db-authorization": "2.65.1",
78
- "@platformatic/generators": "2.65.1",
79
- "@platformatic/sql-events": "2.65.1",
80
- "@platformatic/db-core": "2.65.1",
81
- "@platformatic/sql-graphql": "2.65.1",
82
- "@platformatic/service": "2.65.1",
83
- "@platformatic/sql-json-schema-mapper": "2.65.1",
84
- "@platformatic/sql-openapi": "2.65.1",
85
- "@platformatic/sql-mapper": "2.65.1",
86
- "@platformatic/telemetry": "2.65.1",
87
- "@platformatic/ts-compiler": "2.65.1",
88
- "@platformatic/utils": "2.65.1"
76
+ "@platformatic/config": "2.66.0",
77
+ "@platformatic/db-authorization": "2.66.0",
78
+ "@platformatic/db-core": "2.66.0",
79
+ "@platformatic/generators": "2.66.0",
80
+ "@platformatic/service": "2.66.0",
81
+ "@platformatic/sql-graphql": "2.66.0",
82
+ "@platformatic/sql-events": "2.66.0",
83
+ "@platformatic/sql-json-schema-mapper": "2.66.0",
84
+ "@platformatic/sql-openapi": "2.66.0",
85
+ "@platformatic/sql-mapper": "2.66.0",
86
+ "@platformatic/telemetry": "2.66.0",
87
+ "@platformatic/ts-compiler": "2.66.0",
88
+ "@platformatic/utils": "2.66.0"
89
89
  },
90
90
  "scripts": {
91
91
  "test": "pnpm run lint && borp -T --concurrency=1 --timeout=300000 && tsd ",