@llmops/core 0.1.5-beta.1 → 0.1.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/dist/{bun-sqlite-dialect-zL8xmYst.cjs → bun-sqlite-dialect-Bp2qbl5F.cjs} +1 -1
- package/dist/db/index.cjs +2 -1
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +2 -2
- package/dist/{db-CGY-vZ3u.mjs → db-DSzwrW4p.mjs} +108 -2
- package/dist/{db-C9-M-kdS.cjs → db-eEfIe5dO.cjs} +115 -3
- package/dist/{index-DTHo2J3v.d.cts → index-BO7DYWFs.d.cts} +338 -22
- package/dist/{index-D3ncxgf2.d.mts → index-mUSLoeGU.d.mts} +338 -22
- package/dist/index.cjs +500 -2
- package/dist/index.d.cts +600 -3
- package/dist/index.d.mts +600 -3
- package/dist/index.mjs +493 -3
- package/dist/{node-sqlite-dialect-CQlHW438.cjs → node-sqlite-dialect-b2V910TJ.cjs} +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColumnType, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
2
|
-
import * as
|
|
2
|
+
import * as zod353 from "zod";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/db/schema.d.ts
|
|
@@ -68,6 +68,29 @@ declare const workspaceSettingsSchema: z.ZodObject<{
|
|
|
68
68
|
createdAt: z.ZodDate;
|
|
69
69
|
updatedAt: z.ZodDate;
|
|
70
70
|
}, z.core.$strip>;
|
|
71
|
+
declare const llmRequestsSchema: z.ZodObject<{
|
|
72
|
+
requestId: z.ZodString;
|
|
73
|
+
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
provider: z.ZodString;
|
|
76
|
+
model: z.ZodString;
|
|
77
|
+
promptTokens: z.ZodDefault<z.ZodNumber>;
|
|
78
|
+
completionTokens: z.ZodDefault<z.ZodNumber>;
|
|
79
|
+
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
80
|
+
cachedTokens: z.ZodDefault<z.ZodNumber>;
|
|
81
|
+
cost: z.ZodDefault<z.ZodNumber>;
|
|
82
|
+
inputCost: z.ZodDefault<z.ZodNumber>;
|
|
83
|
+
outputCost: z.ZodDefault<z.ZodNumber>;
|
|
84
|
+
endpoint: z.ZodString;
|
|
85
|
+
statusCode: z.ZodNumber;
|
|
86
|
+
latencyMs: z.ZodDefault<z.ZodNumber>;
|
|
87
|
+
isStreaming: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
+
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
|
+
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
90
|
+
id: z.ZodString;
|
|
91
|
+
createdAt: z.ZodDate;
|
|
92
|
+
updatedAt: z.ZodDate;
|
|
93
|
+
}, z.core.$strip>;
|
|
71
94
|
/**
|
|
72
95
|
* Zod inferred types (for runtime validation)
|
|
73
96
|
*/
|
|
@@ -79,6 +102,7 @@ type EnvironmentSecret = z.infer<typeof environmentSecretsSchema>;
|
|
|
79
102
|
type ConfigVariant = z.infer<typeof configVariantsSchema>;
|
|
80
103
|
type TargetingRule = z.infer<typeof targetingRulesSchema>;
|
|
81
104
|
type WorkspaceSettings = z.infer<typeof workspaceSettingsSchema>;
|
|
105
|
+
type LLMRequest = z.infer<typeof llmRequestsSchema>;
|
|
82
106
|
/**
|
|
83
107
|
* Kysely Table Interfaces
|
|
84
108
|
* Derived from Zod schemas with proper column types
|
|
@@ -129,6 +153,26 @@ interface TargetingRulesTable extends BaseTable {
|
|
|
129
153
|
interface WorkspaceSettingsTable extends BaseTable {
|
|
130
154
|
name: string | null;
|
|
131
155
|
}
|
|
156
|
+
interface LLMRequestsTable extends BaseTable {
|
|
157
|
+
requestId: string;
|
|
158
|
+
configId: string | null;
|
|
159
|
+
variantId: string | null;
|
|
160
|
+
provider: string;
|
|
161
|
+
model: string;
|
|
162
|
+
promptTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
163
|
+
completionTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
164
|
+
totalTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
165
|
+
cachedTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
166
|
+
cost: ColumnType<number, number | undefined, number | undefined>;
|
|
167
|
+
inputCost: ColumnType<number, number | undefined, number | undefined>;
|
|
168
|
+
outputCost: ColumnType<number, number | undefined, number | undefined>;
|
|
169
|
+
endpoint: string;
|
|
170
|
+
statusCode: number;
|
|
171
|
+
latencyMs: ColumnType<number, number | undefined, number | undefined>;
|
|
172
|
+
isStreaming: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
173
|
+
userId: string | null;
|
|
174
|
+
tags: ColumnType<Record<string, string>, string, string>;
|
|
175
|
+
}
|
|
132
176
|
/**
|
|
133
177
|
* Main Kysely Database interface
|
|
134
178
|
*/
|
|
@@ -141,6 +185,7 @@ interface Database {
|
|
|
141
185
|
config_variants: ConfigVariantsTable;
|
|
142
186
|
targeting_rules: TargetingRulesTable;
|
|
143
187
|
workspace_settings: WorkspaceSettingsTable;
|
|
188
|
+
llm_requests: LLMRequestsTable;
|
|
144
189
|
}
|
|
145
190
|
/**
|
|
146
191
|
* Table names as a union type
|
|
@@ -487,6 +532,122 @@ declare const SCHEMA_METADATA: {
|
|
|
487
532
|
};
|
|
488
533
|
};
|
|
489
534
|
};
|
|
535
|
+
readonly llm_requests: {
|
|
536
|
+
readonly order: 9;
|
|
537
|
+
readonly schema: z.ZodObject<{
|
|
538
|
+
requestId: z.ZodString;
|
|
539
|
+
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
540
|
+
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
541
|
+
provider: z.ZodString;
|
|
542
|
+
model: z.ZodString;
|
|
543
|
+
promptTokens: z.ZodDefault<z.ZodNumber>;
|
|
544
|
+
completionTokens: z.ZodDefault<z.ZodNumber>;
|
|
545
|
+
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
546
|
+
cachedTokens: z.ZodDefault<z.ZodNumber>;
|
|
547
|
+
cost: z.ZodDefault<z.ZodNumber>;
|
|
548
|
+
inputCost: z.ZodDefault<z.ZodNumber>;
|
|
549
|
+
outputCost: z.ZodDefault<z.ZodNumber>;
|
|
550
|
+
endpoint: z.ZodString;
|
|
551
|
+
statusCode: z.ZodNumber;
|
|
552
|
+
latencyMs: z.ZodDefault<z.ZodNumber>;
|
|
553
|
+
isStreaming: z.ZodDefault<z.ZodBoolean>;
|
|
554
|
+
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
555
|
+
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
556
|
+
id: z.ZodString;
|
|
557
|
+
createdAt: z.ZodDate;
|
|
558
|
+
updatedAt: z.ZodDate;
|
|
559
|
+
}, z.core.$strip>;
|
|
560
|
+
readonly fields: {
|
|
561
|
+
readonly id: {
|
|
562
|
+
readonly type: "uuid";
|
|
563
|
+
readonly primaryKey: true;
|
|
564
|
+
};
|
|
565
|
+
readonly requestId: {
|
|
566
|
+
readonly type: "uuid";
|
|
567
|
+
};
|
|
568
|
+
readonly configId: {
|
|
569
|
+
readonly type: "uuid";
|
|
570
|
+
readonly nullable: true;
|
|
571
|
+
readonly references: {
|
|
572
|
+
readonly table: "configs";
|
|
573
|
+
readonly column: "id";
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
readonly variantId: {
|
|
577
|
+
readonly type: "uuid";
|
|
578
|
+
readonly nullable: true;
|
|
579
|
+
readonly references: {
|
|
580
|
+
readonly table: "variants";
|
|
581
|
+
readonly column: "id";
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
readonly provider: {
|
|
585
|
+
readonly type: "text";
|
|
586
|
+
};
|
|
587
|
+
readonly model: {
|
|
588
|
+
readonly type: "text";
|
|
589
|
+
};
|
|
590
|
+
readonly promptTokens: {
|
|
591
|
+
readonly type: "integer";
|
|
592
|
+
readonly default: 0;
|
|
593
|
+
};
|
|
594
|
+
readonly completionTokens: {
|
|
595
|
+
readonly type: "integer";
|
|
596
|
+
readonly default: 0;
|
|
597
|
+
};
|
|
598
|
+
readonly totalTokens: {
|
|
599
|
+
readonly type: "integer";
|
|
600
|
+
readonly default: 0;
|
|
601
|
+
};
|
|
602
|
+
readonly cachedTokens: {
|
|
603
|
+
readonly type: "integer";
|
|
604
|
+
readonly default: 0;
|
|
605
|
+
};
|
|
606
|
+
readonly cost: {
|
|
607
|
+
readonly type: "integer";
|
|
608
|
+
readonly default: 0;
|
|
609
|
+
};
|
|
610
|
+
readonly inputCost: {
|
|
611
|
+
readonly type: "integer";
|
|
612
|
+
readonly default: 0;
|
|
613
|
+
};
|
|
614
|
+
readonly outputCost: {
|
|
615
|
+
readonly type: "integer";
|
|
616
|
+
readonly default: 0;
|
|
617
|
+
};
|
|
618
|
+
readonly endpoint: {
|
|
619
|
+
readonly type: "text";
|
|
620
|
+
};
|
|
621
|
+
readonly statusCode: {
|
|
622
|
+
readonly type: "integer";
|
|
623
|
+
};
|
|
624
|
+
readonly latencyMs: {
|
|
625
|
+
readonly type: "integer";
|
|
626
|
+
readonly default: 0;
|
|
627
|
+
};
|
|
628
|
+
readonly isStreaming: {
|
|
629
|
+
readonly type: "boolean";
|
|
630
|
+
readonly default: false;
|
|
631
|
+
};
|
|
632
|
+
readonly userId: {
|
|
633
|
+
readonly type: "text";
|
|
634
|
+
readonly nullable: true;
|
|
635
|
+
};
|
|
636
|
+
readonly tags: {
|
|
637
|
+
readonly type: "jsonb";
|
|
638
|
+
readonly default: "{}";
|
|
639
|
+
};
|
|
640
|
+
readonly createdAt: {
|
|
641
|
+
readonly type: "timestamp";
|
|
642
|
+
readonly default: "now()";
|
|
643
|
+
};
|
|
644
|
+
readonly updatedAt: {
|
|
645
|
+
readonly type: "timestamp";
|
|
646
|
+
readonly default: "now()";
|
|
647
|
+
readonly onUpdate: "now()";
|
|
648
|
+
};
|
|
649
|
+
};
|
|
650
|
+
};
|
|
490
651
|
};
|
|
491
652
|
};
|
|
492
653
|
/**
|
|
@@ -558,6 +719,29 @@ declare const schemas: {
|
|
|
558
719
|
createdAt: z.ZodDate;
|
|
559
720
|
updatedAt: z.ZodDate;
|
|
560
721
|
}, z.core.$strip>;
|
|
722
|
+
readonly llm_requests: z.ZodObject<{
|
|
723
|
+
requestId: z.ZodString;
|
|
724
|
+
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
725
|
+
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
726
|
+
provider: z.ZodString;
|
|
727
|
+
model: z.ZodString;
|
|
728
|
+
promptTokens: z.ZodDefault<z.ZodNumber>;
|
|
729
|
+
completionTokens: z.ZodDefault<z.ZodNumber>;
|
|
730
|
+
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
731
|
+
cachedTokens: z.ZodDefault<z.ZodNumber>;
|
|
732
|
+
cost: z.ZodDefault<z.ZodNumber>;
|
|
733
|
+
inputCost: z.ZodDefault<z.ZodNumber>;
|
|
734
|
+
outputCost: z.ZodDefault<z.ZodNumber>;
|
|
735
|
+
endpoint: z.ZodString;
|
|
736
|
+
statusCode: z.ZodNumber;
|
|
737
|
+
latencyMs: z.ZodDefault<z.ZodNumber>;
|
|
738
|
+
isStreaming: z.ZodDefault<z.ZodBoolean>;
|
|
739
|
+
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
740
|
+
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
741
|
+
id: z.ZodString;
|
|
742
|
+
createdAt: z.ZodDate;
|
|
743
|
+
updatedAt: z.ZodDate;
|
|
744
|
+
}, z.core.$strip>;
|
|
561
745
|
};
|
|
562
746
|
//#endregion
|
|
563
747
|
//#region src/db/validation.d.ts
|
|
@@ -565,7 +749,7 @@ declare const schemas: {
|
|
|
565
749
|
* Validate data against table schema
|
|
566
750
|
* Useful for runtime validation before inserting/updating
|
|
567
751
|
*/
|
|
568
|
-
declare function validateTableData<T extends TableName>(table: T, data: unknown):
|
|
752
|
+
declare function validateTableData<T extends TableName>(table: T, data: unknown): zod353.ZodSafeParseSuccess<{
|
|
569
753
|
variantId: string;
|
|
570
754
|
version: number;
|
|
571
755
|
provider: string;
|
|
@@ -574,7 +758,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
574
758
|
id: string;
|
|
575
759
|
createdAt: Date;
|
|
576
760
|
updatedAt: Date;
|
|
577
|
-
}> |
|
|
761
|
+
}> | zod353.ZodSafeParseError<{
|
|
578
762
|
variantId: string;
|
|
579
763
|
version: number;
|
|
580
764
|
provider: string;
|
|
@@ -583,33 +767,33 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
583
767
|
id: string;
|
|
584
768
|
createdAt: Date;
|
|
585
769
|
updatedAt: Date;
|
|
586
|
-
}> |
|
|
770
|
+
}> | zod353.ZodSafeParseSuccess<{
|
|
587
771
|
environmentId: string;
|
|
588
772
|
keyName: string;
|
|
589
773
|
keyValue: string;
|
|
590
774
|
id: string;
|
|
591
775
|
createdAt: Date;
|
|
592
776
|
updatedAt: Date;
|
|
593
|
-
}> |
|
|
777
|
+
}> | zod353.ZodSafeParseError<{
|
|
594
778
|
environmentId: string;
|
|
595
779
|
keyName: string;
|
|
596
780
|
keyValue: string;
|
|
597
781
|
id: string;
|
|
598
782
|
createdAt: Date;
|
|
599
783
|
updatedAt: Date;
|
|
600
|
-
}> |
|
|
784
|
+
}> | zod353.ZodSafeParseSuccess<{
|
|
601
785
|
configId: string;
|
|
602
786
|
variantId: string;
|
|
603
787
|
id: string;
|
|
604
788
|
createdAt: Date;
|
|
605
789
|
updatedAt: Date;
|
|
606
|
-
}> |
|
|
790
|
+
}> | zod353.ZodSafeParseError<{
|
|
607
791
|
configId: string;
|
|
608
792
|
variantId: string;
|
|
609
793
|
id: string;
|
|
610
794
|
createdAt: Date;
|
|
611
795
|
updatedAt: Date;
|
|
612
|
-
}> |
|
|
796
|
+
}> | zod353.ZodSafeParseSuccess<{
|
|
613
797
|
environmentId: string;
|
|
614
798
|
configId: string;
|
|
615
799
|
configVariantId: string;
|
|
@@ -621,7 +805,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
621
805
|
createdAt: Date;
|
|
622
806
|
updatedAt: Date;
|
|
623
807
|
variantVersionId?: string | null | undefined;
|
|
624
|
-
}> |
|
|
808
|
+
}> | zod353.ZodSafeParseError<{
|
|
625
809
|
environmentId: string;
|
|
626
810
|
configId: string;
|
|
627
811
|
configVariantId: string;
|
|
@@ -633,21 +817,65 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
633
817
|
createdAt: Date;
|
|
634
818
|
updatedAt: Date;
|
|
635
819
|
variantVersionId?: string | null | undefined;
|
|
636
|
-
}> |
|
|
820
|
+
}> | zod353.ZodSafeParseSuccess<{
|
|
637
821
|
id: string;
|
|
638
822
|
createdAt: Date;
|
|
639
823
|
updatedAt: Date;
|
|
640
824
|
name?: string | null | undefined;
|
|
641
|
-
}> |
|
|
825
|
+
}> | zod353.ZodSafeParseError<{
|
|
642
826
|
id: string;
|
|
643
827
|
createdAt: Date;
|
|
644
828
|
updatedAt: Date;
|
|
645
829
|
name?: string | null | undefined;
|
|
830
|
+
}> | zod353.ZodSafeParseSuccess<{
|
|
831
|
+
requestId: string;
|
|
832
|
+
provider: string;
|
|
833
|
+
model: string;
|
|
834
|
+
promptTokens: number;
|
|
835
|
+
completionTokens: number;
|
|
836
|
+
totalTokens: number;
|
|
837
|
+
cachedTokens: number;
|
|
838
|
+
cost: number;
|
|
839
|
+
inputCost: number;
|
|
840
|
+
outputCost: number;
|
|
841
|
+
endpoint: string;
|
|
842
|
+
statusCode: number;
|
|
843
|
+
latencyMs: number;
|
|
844
|
+
isStreaming: boolean;
|
|
845
|
+
tags: Record<string, string>;
|
|
846
|
+
id: string;
|
|
847
|
+
createdAt: Date;
|
|
848
|
+
updatedAt: Date;
|
|
849
|
+
configId?: string | null | undefined;
|
|
850
|
+
variantId?: string | null | undefined;
|
|
851
|
+
userId?: string | null | undefined;
|
|
852
|
+
}> | zod353.ZodSafeParseError<{
|
|
853
|
+
requestId: string;
|
|
854
|
+
provider: string;
|
|
855
|
+
model: string;
|
|
856
|
+
promptTokens: number;
|
|
857
|
+
completionTokens: number;
|
|
858
|
+
totalTokens: number;
|
|
859
|
+
cachedTokens: number;
|
|
860
|
+
cost: number;
|
|
861
|
+
inputCost: number;
|
|
862
|
+
outputCost: number;
|
|
863
|
+
endpoint: string;
|
|
864
|
+
statusCode: number;
|
|
865
|
+
latencyMs: number;
|
|
866
|
+
isStreaming: boolean;
|
|
867
|
+
tags: Record<string, string>;
|
|
868
|
+
id: string;
|
|
869
|
+
createdAt: Date;
|
|
870
|
+
updatedAt: Date;
|
|
871
|
+
configId?: string | null | undefined;
|
|
872
|
+
variantId?: string | null | undefined;
|
|
873
|
+
userId?: string | null | undefined;
|
|
646
874
|
}>;
|
|
647
875
|
/**
|
|
648
876
|
* Validate partial data (for updates)
|
|
649
877
|
*/
|
|
650
|
-
declare function validatePartialTableData<T extends TableName>(table: T, data: unknown):
|
|
878
|
+
declare function validatePartialTableData<T extends TableName>(table: T, data: unknown): zod353.ZodSafeParseSuccess<{
|
|
651
879
|
variantId?: string | undefined;
|
|
652
880
|
version?: number | undefined;
|
|
653
881
|
provider?: string | undefined;
|
|
@@ -656,7 +884,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
656
884
|
id?: string | undefined;
|
|
657
885
|
createdAt?: Date | undefined;
|
|
658
886
|
updatedAt?: Date | undefined;
|
|
659
|
-
}> |
|
|
887
|
+
}> | zod353.ZodSafeParseError<{
|
|
660
888
|
variantId?: string | undefined;
|
|
661
889
|
version?: number | undefined;
|
|
662
890
|
provider?: string | undefined;
|
|
@@ -665,33 +893,33 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
665
893
|
id?: string | undefined;
|
|
666
894
|
createdAt?: Date | undefined;
|
|
667
895
|
updatedAt?: Date | undefined;
|
|
668
|
-
}> |
|
|
896
|
+
}> | zod353.ZodSafeParseSuccess<{
|
|
669
897
|
environmentId?: string | undefined;
|
|
670
898
|
keyName?: string | undefined;
|
|
671
899
|
keyValue?: string | undefined;
|
|
672
900
|
id?: string | undefined;
|
|
673
901
|
createdAt?: Date | undefined;
|
|
674
902
|
updatedAt?: Date | undefined;
|
|
675
|
-
}> |
|
|
903
|
+
}> | zod353.ZodSafeParseError<{
|
|
676
904
|
environmentId?: string | undefined;
|
|
677
905
|
keyName?: string | undefined;
|
|
678
906
|
keyValue?: string | undefined;
|
|
679
907
|
id?: string | undefined;
|
|
680
908
|
createdAt?: Date | undefined;
|
|
681
909
|
updatedAt?: Date | undefined;
|
|
682
|
-
}> |
|
|
910
|
+
}> | zod353.ZodSafeParseSuccess<{
|
|
683
911
|
configId?: string | undefined;
|
|
684
912
|
variantId?: string | undefined;
|
|
685
913
|
id?: string | undefined;
|
|
686
914
|
createdAt?: Date | undefined;
|
|
687
915
|
updatedAt?: Date | undefined;
|
|
688
|
-
}> |
|
|
916
|
+
}> | zod353.ZodSafeParseError<{
|
|
689
917
|
configId?: string | undefined;
|
|
690
918
|
variantId?: string | undefined;
|
|
691
919
|
id?: string | undefined;
|
|
692
920
|
createdAt?: Date | undefined;
|
|
693
921
|
updatedAt?: Date | undefined;
|
|
694
|
-
}> |
|
|
922
|
+
}> | zod353.ZodSafeParseSuccess<{
|
|
695
923
|
environmentId?: string | undefined;
|
|
696
924
|
configId?: string | undefined;
|
|
697
925
|
configVariantId?: string | undefined;
|
|
@@ -703,7 +931,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
703
931
|
id?: string | undefined;
|
|
704
932
|
createdAt?: Date | undefined;
|
|
705
933
|
updatedAt?: Date | undefined;
|
|
706
|
-
}> |
|
|
934
|
+
}> | zod353.ZodSafeParseError<{
|
|
707
935
|
environmentId?: string | undefined;
|
|
708
936
|
configId?: string | undefined;
|
|
709
937
|
configVariantId?: string | undefined;
|
|
@@ -715,16 +943,60 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
715
943
|
id?: string | undefined;
|
|
716
944
|
createdAt?: Date | undefined;
|
|
717
945
|
updatedAt?: Date | undefined;
|
|
718
|
-
}> |
|
|
946
|
+
}> | zod353.ZodSafeParseSuccess<{
|
|
719
947
|
name?: string | null | undefined;
|
|
720
948
|
id?: string | undefined;
|
|
721
949
|
createdAt?: Date | undefined;
|
|
722
950
|
updatedAt?: Date | undefined;
|
|
723
|
-
}> |
|
|
951
|
+
}> | zod353.ZodSafeParseError<{
|
|
724
952
|
name?: string | null | undefined;
|
|
725
953
|
id?: string | undefined;
|
|
726
954
|
createdAt?: Date | undefined;
|
|
727
955
|
updatedAt?: Date | undefined;
|
|
956
|
+
}> | zod353.ZodSafeParseSuccess<{
|
|
957
|
+
requestId?: string | undefined;
|
|
958
|
+
configId?: string | null | undefined;
|
|
959
|
+
variantId?: string | null | undefined;
|
|
960
|
+
provider?: string | undefined;
|
|
961
|
+
model?: string | undefined;
|
|
962
|
+
promptTokens?: number | undefined;
|
|
963
|
+
completionTokens?: number | undefined;
|
|
964
|
+
totalTokens?: number | undefined;
|
|
965
|
+
cachedTokens?: number | undefined;
|
|
966
|
+
cost?: number | undefined;
|
|
967
|
+
inputCost?: number | undefined;
|
|
968
|
+
outputCost?: number | undefined;
|
|
969
|
+
endpoint?: string | undefined;
|
|
970
|
+
statusCode?: number | undefined;
|
|
971
|
+
latencyMs?: number | undefined;
|
|
972
|
+
isStreaming?: boolean | undefined;
|
|
973
|
+
userId?: string | null | undefined;
|
|
974
|
+
tags?: Record<string, string> | undefined;
|
|
975
|
+
id?: string | undefined;
|
|
976
|
+
createdAt?: Date | undefined;
|
|
977
|
+
updatedAt?: Date | undefined;
|
|
978
|
+
}> | zod353.ZodSafeParseError<{
|
|
979
|
+
requestId?: string | undefined;
|
|
980
|
+
configId?: string | null | undefined;
|
|
981
|
+
variantId?: string | null | undefined;
|
|
982
|
+
provider?: string | undefined;
|
|
983
|
+
model?: string | undefined;
|
|
984
|
+
promptTokens?: number | undefined;
|
|
985
|
+
completionTokens?: number | undefined;
|
|
986
|
+
totalTokens?: number | undefined;
|
|
987
|
+
cachedTokens?: number | undefined;
|
|
988
|
+
cost?: number | undefined;
|
|
989
|
+
inputCost?: number | undefined;
|
|
990
|
+
outputCost?: number | undefined;
|
|
991
|
+
endpoint?: string | undefined;
|
|
992
|
+
statusCode?: number | undefined;
|
|
993
|
+
latencyMs?: number | undefined;
|
|
994
|
+
isStreaming?: boolean | undefined;
|
|
995
|
+
userId?: string | null | undefined;
|
|
996
|
+
tags?: Record<string, string> | undefined;
|
|
997
|
+
id?: string | undefined;
|
|
998
|
+
createdAt?: Date | undefined;
|
|
999
|
+
updatedAt?: Date | undefined;
|
|
728
1000
|
}>;
|
|
729
1001
|
/**
|
|
730
1002
|
* Parse and validate data, throws on error
|
|
@@ -768,6 +1040,28 @@ declare function parseTableData<T extends TableName>(table: T, data: unknown): {
|
|
|
768
1040
|
createdAt: Date;
|
|
769
1041
|
updatedAt: Date;
|
|
770
1042
|
name?: string | null | undefined;
|
|
1043
|
+
} | {
|
|
1044
|
+
requestId: string;
|
|
1045
|
+
provider: string;
|
|
1046
|
+
model: string;
|
|
1047
|
+
promptTokens: number;
|
|
1048
|
+
completionTokens: number;
|
|
1049
|
+
totalTokens: number;
|
|
1050
|
+
cachedTokens: number;
|
|
1051
|
+
cost: number;
|
|
1052
|
+
inputCost: number;
|
|
1053
|
+
outputCost: number;
|
|
1054
|
+
endpoint: string;
|
|
1055
|
+
statusCode: number;
|
|
1056
|
+
latencyMs: number;
|
|
1057
|
+
isStreaming: boolean;
|
|
1058
|
+
tags: Record<string, string>;
|
|
1059
|
+
id: string;
|
|
1060
|
+
createdAt: Date;
|
|
1061
|
+
updatedAt: Date;
|
|
1062
|
+
configId?: string | null | undefined;
|
|
1063
|
+
variantId?: string | null | undefined;
|
|
1064
|
+
userId?: string | null | undefined;
|
|
771
1065
|
};
|
|
772
1066
|
/**
|
|
773
1067
|
* Parse partial data, throws on error
|
|
@@ -811,6 +1105,28 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
811
1105
|
id?: string | undefined;
|
|
812
1106
|
createdAt?: Date | undefined;
|
|
813
1107
|
updatedAt?: Date | undefined;
|
|
1108
|
+
} | {
|
|
1109
|
+
requestId?: string | undefined;
|
|
1110
|
+
configId?: string | null | undefined;
|
|
1111
|
+
variantId?: string | null | undefined;
|
|
1112
|
+
provider?: string | undefined;
|
|
1113
|
+
model?: string | undefined;
|
|
1114
|
+
promptTokens?: number | undefined;
|
|
1115
|
+
completionTokens?: number | undefined;
|
|
1116
|
+
totalTokens?: number | undefined;
|
|
1117
|
+
cachedTokens?: number | undefined;
|
|
1118
|
+
cost?: number | undefined;
|
|
1119
|
+
inputCost?: number | undefined;
|
|
1120
|
+
outputCost?: number | undefined;
|
|
1121
|
+
endpoint?: string | undefined;
|
|
1122
|
+
statusCode?: number | undefined;
|
|
1123
|
+
latencyMs?: number | undefined;
|
|
1124
|
+
isStreaming?: boolean | undefined;
|
|
1125
|
+
userId?: string | null | undefined;
|
|
1126
|
+
tags?: Record<string, string> | undefined;
|
|
1127
|
+
id?: string | undefined;
|
|
1128
|
+
createdAt?: Date | undefined;
|
|
1129
|
+
updatedAt?: Date | undefined;
|
|
814
1130
|
};
|
|
815
1131
|
//#endregion
|
|
816
1132
|
//#region src/db/migrations.d.ts
|
|
@@ -907,4 +1223,4 @@ declare function detectDatabaseType(db: unknown): DatabaseType | null;
|
|
|
907
1223
|
*/
|
|
908
1224
|
declare function createDatabaseFromConnection(rawConnection: any, options?: DatabaseOptions): Promise<Kysely<Database> | null>;
|
|
909
1225
|
//#endregion
|
|
910
|
-
export {
|
|
1226
|
+
export { TableName as A, configVariantsSchema as B, EnvironmentSecretsTable as C, LLMRequestsTable as D, LLMRequest as E, VariantVersion as F, schemas as G, environmentSecretsSchema as H, VariantVersionsTable as I, variantsSchema as J, targetingRulesSchema as K, VariantsTable as L, TargetingRulesTable as M, Updateable as N, SCHEMA_METADATA as O, Variant as P, WorkspaceSettings as R, EnvironmentSecret as S, Insertable as T, environmentsSchema as U, configsSchema as V, llmRequestsSchema as W, workspaceSettingsSchema as Y, ConfigVariant as _, createDatabaseFromConnection as a, Database as b, MigrationResult as c, runAutoMigrations as d, parsePartialTableData as f, Config as g, validateTableData as h, createDatabase as i, TargetingRule as j, Selectable as k, getMigrations as l, validatePartialTableData as m, DatabaseOptions as n, detectDatabaseType as o, parseTableData as p, variantVersionsSchema as q, DatabaseType as r, MigrationOptions as s, DatabaseConnection as t, matchType as u, ConfigVariantsTable as v, EnvironmentsTable as w, Environment as x, ConfigsTable as y, WorkspaceSettingsTable as z };
|