@llmops/core 0.1.0-beta.8 → 0.1.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.
@@ -1,5 +1,5 @@
1
1
  import { ColumnType, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
2
- import * as zod302 from "zod";
2
+ import * as zod0 from "zod";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region src/db/schema.d.ts
@@ -520,29 +520,29 @@ declare const schemas: {
520
520
  * Validate data against table schema
521
521
  * Useful for runtime validation before inserting/updating
522
522
  */
523
- declare function validateTableData<T extends TableName>(table: T, data: unknown): zod302.ZodSafeParseSuccess<{
523
+ declare function validateTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseSuccess<{
524
524
  slug: string;
525
525
  id: string;
526
526
  createdAt: Date;
527
527
  updatedAt: Date;
528
528
  name?: string | undefined;
529
- }> | zod302.ZodSafeParseError<{
529
+ }> | zod0.ZodSafeParseError<{
530
530
  slug: string;
531
531
  id: string;
532
532
  createdAt: Date;
533
533
  updatedAt: Date;
534
534
  name?: string | undefined;
535
- }> | zod302.ZodSafeParseSuccess<{
535
+ }> | zod0.ZodSafeParseSuccess<{
536
536
  name: string;
537
537
  id: string;
538
538
  createdAt: Date;
539
539
  updatedAt: Date;
540
- }> | zod302.ZodSafeParseError<{
540
+ }> | zod0.ZodSafeParseError<{
541
541
  name: string;
542
542
  id: string;
543
543
  createdAt: Date;
544
544
  updatedAt: Date;
545
- }> | zod302.ZodSafeParseSuccess<{
545
+ }> | zod0.ZodSafeParseSuccess<{
546
546
  variantId: string;
547
547
  version: number;
548
548
  provider: string;
@@ -551,7 +551,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
551
551
  id: string;
552
552
  createdAt: Date;
553
553
  updatedAt: Date;
554
- }> | zod302.ZodSafeParseError<{
554
+ }> | zod0.ZodSafeParseError<{
555
555
  variantId: string;
556
556
  version: number;
557
557
  provider: string;
@@ -560,33 +560,33 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
560
560
  id: string;
561
561
  createdAt: Date;
562
562
  updatedAt: Date;
563
- }> | zod302.ZodSafeParseSuccess<{
563
+ }> | zod0.ZodSafeParseSuccess<{
564
564
  environmentId: string;
565
565
  keyName: string;
566
566
  keyValue: string;
567
567
  id: string;
568
568
  createdAt: Date;
569
569
  updatedAt: Date;
570
- }> | zod302.ZodSafeParseError<{
570
+ }> | zod0.ZodSafeParseError<{
571
571
  environmentId: string;
572
572
  keyName: string;
573
573
  keyValue: string;
574
574
  id: string;
575
575
  createdAt: Date;
576
576
  updatedAt: Date;
577
- }> | zod302.ZodSafeParseSuccess<{
577
+ }> | zod0.ZodSafeParseSuccess<{
578
578
  configId: string;
579
579
  variantId: string;
580
580
  id: string;
581
581
  createdAt: Date;
582
582
  updatedAt: Date;
583
- }> | zod302.ZodSafeParseError<{
583
+ }> | zod0.ZodSafeParseError<{
584
584
  configId: string;
585
585
  variantId: string;
586
586
  id: string;
587
587
  createdAt: Date;
588
588
  updatedAt: Date;
589
- }> | zod302.ZodSafeParseSuccess<{
589
+ }> | zod0.ZodSafeParseSuccess<{
590
590
  environmentId: string;
591
591
  configId: string;
592
592
  configVariantId: string;
@@ -598,7 +598,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
598
598
  createdAt: Date;
599
599
  updatedAt: Date;
600
600
  variantVersionId?: string | null | undefined;
601
- }> | zod302.ZodSafeParseError<{
601
+ }> | zod0.ZodSafeParseError<{
602
602
  environmentId: string;
603
603
  configId: string;
604
604
  configVariantId: string;
@@ -614,17 +614,17 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
614
614
  /**
615
615
  * Validate partial data (for updates)
616
616
  */
617
- declare function validatePartialTableData<T extends TableName>(table: T, data: unknown): zod302.ZodSafeParseSuccess<{
617
+ declare function validatePartialTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseSuccess<{
618
618
  name?: string | undefined;
619
619
  id?: string | undefined;
620
620
  createdAt?: Date | undefined;
621
621
  updatedAt?: Date | undefined;
622
- }> | zod302.ZodSafeParseError<{
622
+ }> | zod0.ZodSafeParseError<{
623
623
  name?: string | undefined;
624
624
  id?: string | undefined;
625
625
  createdAt?: Date | undefined;
626
626
  updatedAt?: Date | undefined;
627
- }> | zod302.ZodSafeParseSuccess<{
627
+ }> | zod0.ZodSafeParseSuccess<{
628
628
  variantId?: string | undefined;
629
629
  version?: number | undefined;
630
630
  provider?: string | undefined;
@@ -633,7 +633,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
633
633
  id?: string | undefined;
634
634
  createdAt?: Date | undefined;
635
635
  updatedAt?: Date | undefined;
636
- }> | zod302.ZodSafeParseError<{
636
+ }> | zod0.ZodSafeParseError<{
637
637
  variantId?: string | undefined;
638
638
  version?: number | undefined;
639
639
  provider?: string | undefined;
@@ -642,33 +642,33 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
642
642
  id?: string | undefined;
643
643
  createdAt?: Date | undefined;
644
644
  updatedAt?: Date | undefined;
645
- }> | zod302.ZodSafeParseSuccess<{
645
+ }> | zod0.ZodSafeParseSuccess<{
646
646
  environmentId?: string | undefined;
647
647
  keyName?: string | undefined;
648
648
  keyValue?: string | undefined;
649
649
  id?: string | undefined;
650
650
  createdAt?: Date | undefined;
651
651
  updatedAt?: Date | undefined;
652
- }> | zod302.ZodSafeParseError<{
652
+ }> | zod0.ZodSafeParseError<{
653
653
  environmentId?: string | undefined;
654
654
  keyName?: string | undefined;
655
655
  keyValue?: string | undefined;
656
656
  id?: string | undefined;
657
657
  createdAt?: Date | undefined;
658
658
  updatedAt?: Date | undefined;
659
- }> | zod302.ZodSafeParseSuccess<{
659
+ }> | zod0.ZodSafeParseSuccess<{
660
660
  configId?: string | undefined;
661
661
  variantId?: string | undefined;
662
662
  id?: string | undefined;
663
663
  createdAt?: Date | undefined;
664
664
  updatedAt?: Date | undefined;
665
- }> | zod302.ZodSafeParseError<{
665
+ }> | zod0.ZodSafeParseError<{
666
666
  configId?: string | undefined;
667
667
  variantId?: string | undefined;
668
668
  id?: string | undefined;
669
669
  createdAt?: Date | undefined;
670
670
  updatedAt?: Date | undefined;
671
- }> | zod302.ZodSafeParseSuccess<{
671
+ }> | zod0.ZodSafeParseSuccess<{
672
672
  environmentId?: string | undefined;
673
673
  configId?: string | undefined;
674
674
  configVariantId?: string | undefined;
@@ -680,7 +680,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
680
680
  id?: string | undefined;
681
681
  createdAt?: Date | undefined;
682
682
  updatedAt?: Date | undefined;
683
- }> | zod302.ZodSafeParseError<{
683
+ }> | zod0.ZodSafeParseError<{
684
684
  environmentId?: string | undefined;
685
685
  configId?: string | undefined;
686
686
  configVariantId?: string | undefined;
@@ -786,6 +786,39 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
786
786
  updatedAt?: Date | undefined;
787
787
  };
788
788
  //#endregion
789
+ //#region src/db/migrations.d.ts
790
+ type DatabaseType$1 = 'postgres' | 'mysql' | 'sqlite' | 'mssql';
791
+ declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType$1): boolean;
792
+ interface MigrationResult {
793
+ toBeCreated: Array<{
794
+ table: string;
795
+ fields: Record<string, any>;
796
+ order: number;
797
+ }>;
798
+ toBeAdded: Array<{
799
+ table: string;
800
+ fields: Record<string, any>;
801
+ order: number;
802
+ }>;
803
+ runMigrations: () => Promise<void>;
804
+ compileMigrations: () => Promise<string>;
805
+ migrations: any[];
806
+ needsMigration: boolean;
807
+ }
808
+ declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType$1): Promise<MigrationResult>;
809
+ /**
810
+ * Run migrations if needed based on autoMigrate config
811
+ * @param db - Kysely database instance
812
+ * @param dbType - Database type
813
+ * @param autoMigrate - Auto-migrate configuration
814
+ * @returns true if migrations were run, false otherwise
815
+ */
816
+ declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType$1, autoMigrate: boolean | 'development'): Promise<{
817
+ ran: boolean;
818
+ tables: string[];
819
+ fields: string[];
820
+ }>;
821
+ //#endregion
789
822
  //#region src/db/index.d.ts
790
823
  /**
791
824
  * Supported database types
@@ -823,4 +856,4 @@ declare function detectDatabaseType(db: unknown): DatabaseType | null;
823
856
  */
824
857
  declare function createDatabaseFromConnection(rawConnection: any): Promise<Kysely<Database> | null>;
825
858
  //#endregion
826
- export { configVariantsSchema as A, TargetingRule as C, VariantVersion as D, Variant as E, targetingRulesSchema as F, variantVersionsSchema as I, variantsSchema as L, environmentSecretsSchema as M, environmentsSchema as N, VariantVersionsTable as O, schemas as P, TableName as S, Updateable as T, EnvironmentSecretsTable as _, detectDatabaseType as a, SCHEMA_METADATA as b, validatePartialTableData as c, ConfigVariant as d, ConfigVariantsTable as f, EnvironmentSecret as g, Environment as h, createDatabaseFromConnection as i, configsSchema as j, VariantsTable as k, validateTableData as l, Database as m, DatabaseType as n, parsePartialTableData as o, ConfigsTable as p, createDatabase as r, parseTableData as s, DatabaseConnection as t, Config as u, EnvironmentsTable as v, TargetingRulesTable as w, Selectable as x, Insertable as y };
859
+ export { Variant as A, variantVersionsSchema as B, Insertable as C, TargetingRule as D, TableName as E, configsSchema as F, environmentSecretsSchema as I, environmentsSchema as L, VariantVersionsTable as M, VariantsTable as N, TargetingRulesTable as O, configVariantsSchema as P, schemas as R, EnvironmentsTable as S, Selectable as T, variantsSchema as V, ConfigsTable as _, detectDatabaseType as a, EnvironmentSecret as b, matchType as c, parseTableData as d, validatePartialTableData as f, ConfigVariantsTable as g, ConfigVariant as h, createDatabaseFromConnection as i, VariantVersion as j, Updateable as k, runAutoMigrations as l, Config as m, DatabaseType as n, MigrationResult as o, validateTableData as p, createDatabase as r, getMigrations as s, DatabaseConnection as t, parsePartialTableData as u, Database as v, SCHEMA_METADATA as w, EnvironmentSecretsTable as x, Environment as y, targetingRulesSchema as z };