@llmops/core 0.2.11-beta.4 → 0.2.12-beta.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/dist/{bun-sqlite-dialect-DLqPd3F0.cjs → bun-sqlite-dialect-Bxz4B97L.cjs} +1 -2
- package/dist/{bun-sqlite-dialect-BiyQ5XmW.mjs → bun-sqlite-dialect-CHpTFgAo.mjs} +0 -1
- package/dist/db/index.cjs +4 -10
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +3 -4
- package/dist/{db-BIiDmOuQ.cjs → db-BOe6mM51.cjs} +94 -63
- package/dist/{db-CEHt_ysR.mjs → db-DohlAqJU.mjs} +94 -63
- package/dist/{index-C66pTe1n.d.cts → index-BO5Rse5J.d.mts} +60 -43
- package/dist/{index-BX96l072.d.mts → index-DwZhaRvQ.d.cts} +25 -8
- package/dist/index.cjs +5 -14
- package/dist/index.d.cts +226 -226
- package/dist/index.d.mts +493 -493
- package/dist/index.mjs +4 -8
- package/dist/neon-dialect-BQey5lUw.cjs +42 -0
- package/dist/neon-dialect-C0GZuGot.cjs +3 -0
- package/dist/neon-dialect-DySGBYUi.mjs +30 -0
- package/dist/neon-dialect-Hmo08nUq.mjs +3 -0
- package/dist/{node-sqlite-dialect-B3Mejscr.mjs → node-sqlite-dialect-B5oKhOm1.mjs} +0 -1
- package/dist/{node-sqlite-dialect-HRKgk8Ae.cjs → node-sqlite-dialect-N8j5UsT-.cjs} +1 -2
- package/package.json +7 -4
- package/dist/neon-dialect-C8y4ymaE.mjs +0 -4
- package/dist/neon-dialect-CTFuNy48.mjs +0 -4
- package/dist/neon-dialect-eEOfdvtN.cjs +0 -11
- package/dist/neon-dialect-js5JsNqM.cjs +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
1
|
+
import { ColumnType, Dialect, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
2
|
+
import { NeonQueryFunction } from "@neondatabase/serverless";
|
|
3
|
+
import * as zod0 from "zod";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/db/schema.d.ts
|
|
@@ -858,29 +858,29 @@ declare const schemas: {
|
|
|
858
858
|
* Validate data against table schema
|
|
859
859
|
* Useful for runtime validation before inserting/updating
|
|
860
860
|
*/
|
|
861
|
-
declare function validateTableData<T extends TableName>(table: T, data: unknown):
|
|
861
|
+
declare function validateTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseSuccess<{
|
|
862
862
|
slug: string;
|
|
863
863
|
id: string;
|
|
864
864
|
createdAt: Date;
|
|
865
865
|
updatedAt: Date;
|
|
866
866
|
name?: string | undefined;
|
|
867
|
-
}> |
|
|
867
|
+
}> | zod0.ZodSafeParseError<{
|
|
868
868
|
slug: string;
|
|
869
869
|
id: string;
|
|
870
870
|
createdAt: Date;
|
|
871
871
|
updatedAt: Date;
|
|
872
872
|
name?: string | undefined;
|
|
873
|
-
}> |
|
|
873
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
874
874
|
name: string;
|
|
875
875
|
id: string;
|
|
876
876
|
createdAt: Date;
|
|
877
877
|
updatedAt: Date;
|
|
878
|
-
}> |
|
|
878
|
+
}> | zod0.ZodSafeParseError<{
|
|
879
879
|
name: string;
|
|
880
880
|
id: string;
|
|
881
881
|
createdAt: Date;
|
|
882
882
|
updatedAt: Date;
|
|
883
|
-
}> |
|
|
883
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
884
884
|
variantId: string;
|
|
885
885
|
version: number;
|
|
886
886
|
provider: string;
|
|
@@ -889,7 +889,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
889
889
|
id: string;
|
|
890
890
|
createdAt: Date;
|
|
891
891
|
updatedAt: Date;
|
|
892
|
-
}> |
|
|
892
|
+
}> | zod0.ZodSafeParseError<{
|
|
893
893
|
variantId: string;
|
|
894
894
|
version: number;
|
|
895
895
|
provider: string;
|
|
@@ -898,33 +898,33 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
898
898
|
id: string;
|
|
899
899
|
createdAt: Date;
|
|
900
900
|
updatedAt: Date;
|
|
901
|
-
}> |
|
|
901
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
902
902
|
environmentId: string;
|
|
903
903
|
keyName: string;
|
|
904
904
|
keyValue: string;
|
|
905
905
|
id: string;
|
|
906
906
|
createdAt: Date;
|
|
907
907
|
updatedAt: Date;
|
|
908
|
-
}> |
|
|
908
|
+
}> | zod0.ZodSafeParseError<{
|
|
909
909
|
environmentId: string;
|
|
910
910
|
keyName: string;
|
|
911
911
|
keyValue: string;
|
|
912
912
|
id: string;
|
|
913
913
|
createdAt: Date;
|
|
914
914
|
updatedAt: Date;
|
|
915
|
-
}> |
|
|
915
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
916
916
|
configId: string;
|
|
917
917
|
variantId: string;
|
|
918
918
|
id: string;
|
|
919
919
|
createdAt: Date;
|
|
920
920
|
updatedAt: Date;
|
|
921
|
-
}> |
|
|
921
|
+
}> | zod0.ZodSafeParseError<{
|
|
922
922
|
configId: string;
|
|
923
923
|
variantId: string;
|
|
924
924
|
id: string;
|
|
925
925
|
createdAt: Date;
|
|
926
926
|
updatedAt: Date;
|
|
927
|
-
}> |
|
|
927
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
928
928
|
environmentId: string;
|
|
929
929
|
configId: string;
|
|
930
930
|
configVariantId: string;
|
|
@@ -936,7 +936,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
936
936
|
createdAt: Date;
|
|
937
937
|
updatedAt: Date;
|
|
938
938
|
variantVersionId?: string | null | undefined;
|
|
939
|
-
}> |
|
|
939
|
+
}> | zod0.ZodSafeParseError<{
|
|
940
940
|
environmentId: string;
|
|
941
941
|
configId: string;
|
|
942
942
|
configVariantId: string;
|
|
@@ -948,21 +948,21 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
948
948
|
createdAt: Date;
|
|
949
949
|
updatedAt: Date;
|
|
950
950
|
variantVersionId?: string | null | undefined;
|
|
951
|
-
}> |
|
|
951
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
952
952
|
setupComplete: boolean;
|
|
953
953
|
id: string;
|
|
954
954
|
createdAt: Date;
|
|
955
955
|
updatedAt: Date;
|
|
956
956
|
name?: string | null | undefined;
|
|
957
957
|
superAdminId?: string | null | undefined;
|
|
958
|
-
}> |
|
|
958
|
+
}> | zod0.ZodSafeParseError<{
|
|
959
959
|
setupComplete: boolean;
|
|
960
960
|
id: string;
|
|
961
961
|
createdAt: Date;
|
|
962
962
|
updatedAt: Date;
|
|
963
963
|
name?: string | null | undefined;
|
|
964
964
|
superAdminId?: string | null | undefined;
|
|
965
|
-
}> |
|
|
965
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
966
966
|
providerId: string;
|
|
967
967
|
config: Record<string, unknown>;
|
|
968
968
|
enabled: boolean;
|
|
@@ -970,7 +970,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
970
970
|
createdAt: Date;
|
|
971
971
|
updatedAt: Date;
|
|
972
972
|
name?: string | null | undefined;
|
|
973
|
-
}> |
|
|
973
|
+
}> | zod0.ZodSafeParseError<{
|
|
974
974
|
providerId: string;
|
|
975
975
|
config: Record<string, unknown>;
|
|
976
976
|
enabled: boolean;
|
|
@@ -978,7 +978,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
978
978
|
createdAt: Date;
|
|
979
979
|
updatedAt: Date;
|
|
980
980
|
name?: string | null | undefined;
|
|
981
|
-
}> |
|
|
981
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
982
982
|
requestId: string;
|
|
983
983
|
provider: string;
|
|
984
984
|
model: string;
|
|
@@ -1002,7 +1002,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
1002
1002
|
environmentId?: string | null | undefined;
|
|
1003
1003
|
providerConfigId?: string | null | undefined;
|
|
1004
1004
|
userId?: string | null | undefined;
|
|
1005
|
-
}> |
|
|
1005
|
+
}> | zod0.ZodSafeParseError<{
|
|
1006
1006
|
requestId: string;
|
|
1007
1007
|
provider: string;
|
|
1008
1008
|
model: string;
|
|
@@ -1030,17 +1030,17 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
1030
1030
|
/**
|
|
1031
1031
|
* Validate partial data (for updates)
|
|
1032
1032
|
*/
|
|
1033
|
-
declare function validatePartialTableData<T extends TableName>(table: T, data: unknown):
|
|
1033
|
+
declare function validatePartialTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseSuccess<{
|
|
1034
1034
|
name?: string | undefined;
|
|
1035
1035
|
id?: string | undefined;
|
|
1036
1036
|
createdAt?: Date | undefined;
|
|
1037
1037
|
updatedAt?: Date | undefined;
|
|
1038
|
-
}> |
|
|
1038
|
+
}> | zod0.ZodSafeParseError<{
|
|
1039
1039
|
name?: string | undefined;
|
|
1040
1040
|
id?: string | undefined;
|
|
1041
1041
|
createdAt?: Date | undefined;
|
|
1042
1042
|
updatedAt?: Date | undefined;
|
|
1043
|
-
}> |
|
|
1043
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
1044
1044
|
variantId?: string | undefined;
|
|
1045
1045
|
version?: number | undefined;
|
|
1046
1046
|
provider?: string | undefined;
|
|
@@ -1049,7 +1049,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1049
1049
|
id?: string | undefined;
|
|
1050
1050
|
createdAt?: Date | undefined;
|
|
1051
1051
|
updatedAt?: Date | undefined;
|
|
1052
|
-
}> |
|
|
1052
|
+
}> | zod0.ZodSafeParseError<{
|
|
1053
1053
|
variantId?: string | undefined;
|
|
1054
1054
|
version?: number | undefined;
|
|
1055
1055
|
provider?: string | undefined;
|
|
@@ -1058,33 +1058,33 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1058
1058
|
id?: string | undefined;
|
|
1059
1059
|
createdAt?: Date | undefined;
|
|
1060
1060
|
updatedAt?: Date | undefined;
|
|
1061
|
-
}> |
|
|
1061
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
1062
1062
|
environmentId?: string | undefined;
|
|
1063
1063
|
keyName?: string | undefined;
|
|
1064
1064
|
keyValue?: string | undefined;
|
|
1065
1065
|
id?: string | undefined;
|
|
1066
1066
|
createdAt?: Date | undefined;
|
|
1067
1067
|
updatedAt?: Date | undefined;
|
|
1068
|
-
}> |
|
|
1068
|
+
}> | zod0.ZodSafeParseError<{
|
|
1069
1069
|
environmentId?: string | undefined;
|
|
1070
1070
|
keyName?: string | undefined;
|
|
1071
1071
|
keyValue?: string | undefined;
|
|
1072
1072
|
id?: string | undefined;
|
|
1073
1073
|
createdAt?: Date | undefined;
|
|
1074
1074
|
updatedAt?: Date | undefined;
|
|
1075
|
-
}> |
|
|
1075
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
1076
1076
|
configId?: string | undefined;
|
|
1077
1077
|
variantId?: string | undefined;
|
|
1078
1078
|
id?: string | undefined;
|
|
1079
1079
|
createdAt?: Date | undefined;
|
|
1080
1080
|
updatedAt?: Date | undefined;
|
|
1081
|
-
}> |
|
|
1081
|
+
}> | zod0.ZodSafeParseError<{
|
|
1082
1082
|
configId?: string | undefined;
|
|
1083
1083
|
variantId?: string | undefined;
|
|
1084
1084
|
id?: string | undefined;
|
|
1085
1085
|
createdAt?: Date | undefined;
|
|
1086
1086
|
updatedAt?: Date | undefined;
|
|
1087
|
-
}> |
|
|
1087
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
1088
1088
|
environmentId?: string | undefined;
|
|
1089
1089
|
configId?: string | undefined;
|
|
1090
1090
|
configVariantId?: string | undefined;
|
|
@@ -1096,7 +1096,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1096
1096
|
id?: string | undefined;
|
|
1097
1097
|
createdAt?: Date | undefined;
|
|
1098
1098
|
updatedAt?: Date | undefined;
|
|
1099
|
-
}> |
|
|
1099
|
+
}> | zod0.ZodSafeParseError<{
|
|
1100
1100
|
environmentId?: string | undefined;
|
|
1101
1101
|
configId?: string | undefined;
|
|
1102
1102
|
configVariantId?: string | undefined;
|
|
@@ -1108,21 +1108,21 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1108
1108
|
id?: string | undefined;
|
|
1109
1109
|
createdAt?: Date | undefined;
|
|
1110
1110
|
updatedAt?: Date | undefined;
|
|
1111
|
-
}> |
|
|
1111
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
1112
1112
|
name?: string | null | undefined;
|
|
1113
1113
|
setupComplete?: boolean | undefined;
|
|
1114
1114
|
superAdminId?: string | null | undefined;
|
|
1115
1115
|
id?: string | undefined;
|
|
1116
1116
|
createdAt?: Date | undefined;
|
|
1117
1117
|
updatedAt?: Date | undefined;
|
|
1118
|
-
}> |
|
|
1118
|
+
}> | zod0.ZodSafeParseError<{
|
|
1119
1119
|
name?: string | null | undefined;
|
|
1120
1120
|
setupComplete?: boolean | undefined;
|
|
1121
1121
|
superAdminId?: string | null | undefined;
|
|
1122
1122
|
id?: string | undefined;
|
|
1123
1123
|
createdAt?: Date | undefined;
|
|
1124
1124
|
updatedAt?: Date | undefined;
|
|
1125
|
-
}> |
|
|
1125
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
1126
1126
|
providerId?: string | undefined;
|
|
1127
1127
|
name?: string | null | undefined;
|
|
1128
1128
|
config?: Record<string, unknown> | undefined;
|
|
@@ -1130,7 +1130,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1130
1130
|
id?: string | undefined;
|
|
1131
1131
|
createdAt?: Date | undefined;
|
|
1132
1132
|
updatedAt?: Date | undefined;
|
|
1133
|
-
}> |
|
|
1133
|
+
}> | zod0.ZodSafeParseError<{
|
|
1134
1134
|
providerId?: string | undefined;
|
|
1135
1135
|
name?: string | null | undefined;
|
|
1136
1136
|
config?: Record<string, unknown> | undefined;
|
|
@@ -1138,7 +1138,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1138
1138
|
id?: string | undefined;
|
|
1139
1139
|
createdAt?: Date | undefined;
|
|
1140
1140
|
updatedAt?: Date | undefined;
|
|
1141
|
-
}> |
|
|
1141
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
1142
1142
|
requestId?: string | undefined;
|
|
1143
1143
|
configId?: string | null | undefined;
|
|
1144
1144
|
variantId?: string | null | undefined;
|
|
@@ -1162,7 +1162,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1162
1162
|
id?: string | undefined;
|
|
1163
1163
|
createdAt?: Date | undefined;
|
|
1164
1164
|
updatedAt?: Date | undefined;
|
|
1165
|
-
}> |
|
|
1165
|
+
}> | zod0.ZodSafeParseError<{
|
|
1166
1166
|
requestId?: string | undefined;
|
|
1167
1167
|
configId?: string | null | undefined;
|
|
1168
1168
|
variantId?: string | null | undefined;
|
|
@@ -1359,7 +1359,6 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
1359
1359
|
};
|
|
1360
1360
|
//#endregion
|
|
1361
1361
|
//#region src/db/migrations.d.ts
|
|
1362
|
-
type DatabaseType$1 = 'postgres' | 'mysql' | 'sqlite' | 'mssql';
|
|
1363
1362
|
/**
|
|
1364
1363
|
* Options for migration operations
|
|
1365
1364
|
*/
|
|
@@ -1371,7 +1370,7 @@ interface MigrationOptions {
|
|
|
1371
1370
|
schema?: string;
|
|
1372
1371
|
rawConnection?: unknown;
|
|
1373
1372
|
}
|
|
1374
|
-
declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType
|
|
1373
|
+
declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType): boolean;
|
|
1375
1374
|
interface MigrationResult {
|
|
1376
1375
|
toBeCreated: Array<{
|
|
1377
1376
|
table: string;
|
|
@@ -1388,7 +1387,7 @@ interface MigrationResult {
|
|
|
1388
1387
|
migrations: any[];
|
|
1389
1388
|
needsMigration: boolean;
|
|
1390
1389
|
}
|
|
1391
|
-
declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType
|
|
1390
|
+
declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<MigrationResult>;
|
|
1392
1391
|
/**
|
|
1393
1392
|
* Run migrations if needed
|
|
1394
1393
|
* @param db - Kysely database instance
|
|
@@ -1396,12 +1395,30 @@ declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType$1, opt
|
|
|
1396
1395
|
* @param options - Migration options (schema, etc.)
|
|
1397
1396
|
* @returns true if migrations were run, false otherwise
|
|
1398
1397
|
*/
|
|
1399
|
-
declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType
|
|
1398
|
+
declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<{
|
|
1400
1399
|
ran: boolean;
|
|
1401
1400
|
tables: string[];
|
|
1402
1401
|
fields: string[];
|
|
1403
1402
|
}>;
|
|
1404
1403
|
//#endregion
|
|
1404
|
+
//#region src/db/neon-dialect.d.ts
|
|
1405
|
+
/**
|
|
1406
|
+
* Create a Neon serverless dialect for Kysely
|
|
1407
|
+
*
|
|
1408
|
+
* @param neonInstance - Neon database query function
|
|
1409
|
+
* @returns Kysely dialect configured for Neon serverless
|
|
1410
|
+
*/
|
|
1411
|
+
declare function createNeonDialect(neonInstance: NeonQueryFunction<false, false>): any;
|
|
1412
|
+
/**
|
|
1413
|
+
* Execute a query with search_path set for Neon serverless
|
|
1414
|
+
*
|
|
1415
|
+
* @param neonInstance - Neon database query function
|
|
1416
|
+
* @param query - SQL query to execute
|
|
1417
|
+
* @param schema - Schema to set (optional)
|
|
1418
|
+
* @returns Query result
|
|
1419
|
+
*/
|
|
1420
|
+
declare function executeWithSchema(neonInstance: NeonQueryFunction<false, false>, query: string, schema?: string): Promise<any>;
|
|
1421
|
+
//#endregion
|
|
1405
1422
|
//#region src/db/index.d.ts
|
|
1406
1423
|
/**
|
|
1407
1424
|
* Supported database types
|
|
@@ -1434,7 +1451,7 @@ type DatabaseConnection = {
|
|
|
1434
1451
|
dialect: MssqlDialect;
|
|
1435
1452
|
} | {
|
|
1436
1453
|
type: 'neon';
|
|
1437
|
-
dialect:
|
|
1454
|
+
dialect: Dialect;
|
|
1438
1455
|
} | {
|
|
1439
1456
|
type: DatabaseType;
|
|
1440
1457
|
kysely: Kysely<Database>;
|
|
@@ -1455,4 +1472,4 @@ declare function detectDatabaseType(db: unknown): DatabaseType | null;
|
|
|
1455
1472
|
*/
|
|
1456
1473
|
declare function createDatabaseFromConnection(rawConnection: any, options?: DatabaseOptions): Promise<Kysely<Database> | null>;
|
|
1457
1474
|
//#endregion
|
|
1458
|
-
export {
|
|
1475
|
+
export { variantsSchema as $, ProviderConfig as A, VariantVersionsTable as B, Environment as C, Insertable as D, EnvironmentsTable as E, TargetingRule as F, configsSchema as G, WorkspaceSettings as H, TargetingRulesTable as I, llmRequestsSchema as J, environmentSecretsSchema as K, Updateable as L, SCHEMA_METADATA as M, Selectable as N, LLMRequest as O, TableName as P, variantVersionsSchema as Q, Variant as R, Database as S, EnvironmentSecretsTable as T, WorkspaceSettingsTable as U, VariantsTable as V, configVariantsSchema as W, schemas as X, providerConfigsSchema as Y, targetingRulesSchema as Z, validateTableData as _, createDatabaseFromConnection as a, ConfigVariantsTable as b, executeWithSchema as c, getMigrations as d, workspaceSettingsSchema as et, matchType as f, validatePartialTableData as g, parseTableData as h, createDatabase as i, ProviderConfigsTable as j, LLMRequestsTable as k, MigrationOptions as l, parsePartialTableData as m, DatabaseOptions as n, detectDatabaseType as o, runAutoMigrations as p, environmentsSchema as q, DatabaseType as r, createNeonDialect as s, DatabaseConnection as t, MigrationResult as u, Config as v, EnvironmentSecret as w, ConfigsTable as x, ConfigVariant as y, VariantVersion as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ColumnType, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
2
|
-
import { NeonDialect } from "kysely-neon";
|
|
1
|
+
import { ColumnType, Dialect, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
3
2
|
import * as zod497 from "zod";
|
|
4
3
|
import { z } from "zod";
|
|
4
|
+
import { NeonQueryFunction } from "@neondatabase/serverless";
|
|
5
5
|
|
|
6
6
|
//#region src/db/schema.d.ts
|
|
7
7
|
declare const configsSchema: z.ZodObject<{
|
|
@@ -1359,7 +1359,6 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
1359
1359
|
};
|
|
1360
1360
|
//#endregion
|
|
1361
1361
|
//#region src/db/migrations.d.ts
|
|
1362
|
-
type DatabaseType$1 = 'postgres' | 'mysql' | 'sqlite' | 'mssql';
|
|
1363
1362
|
/**
|
|
1364
1363
|
* Options for migration operations
|
|
1365
1364
|
*/
|
|
@@ -1371,7 +1370,7 @@ interface MigrationOptions {
|
|
|
1371
1370
|
schema?: string;
|
|
1372
1371
|
rawConnection?: unknown;
|
|
1373
1372
|
}
|
|
1374
|
-
declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType
|
|
1373
|
+
declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType): boolean;
|
|
1375
1374
|
interface MigrationResult {
|
|
1376
1375
|
toBeCreated: Array<{
|
|
1377
1376
|
table: string;
|
|
@@ -1388,7 +1387,7 @@ interface MigrationResult {
|
|
|
1388
1387
|
migrations: any[];
|
|
1389
1388
|
needsMigration: boolean;
|
|
1390
1389
|
}
|
|
1391
|
-
declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType
|
|
1390
|
+
declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<MigrationResult>;
|
|
1392
1391
|
/**
|
|
1393
1392
|
* Run migrations if needed
|
|
1394
1393
|
* @param db - Kysely database instance
|
|
@@ -1396,12 +1395,30 @@ declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType$1, opt
|
|
|
1396
1395
|
* @param options - Migration options (schema, etc.)
|
|
1397
1396
|
* @returns true if migrations were run, false otherwise
|
|
1398
1397
|
*/
|
|
1399
|
-
declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType
|
|
1398
|
+
declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<{
|
|
1400
1399
|
ran: boolean;
|
|
1401
1400
|
tables: string[];
|
|
1402
1401
|
fields: string[];
|
|
1403
1402
|
}>;
|
|
1404
1403
|
//#endregion
|
|
1404
|
+
//#region src/db/neon-dialect.d.ts
|
|
1405
|
+
/**
|
|
1406
|
+
* Create a Neon serverless dialect for Kysely
|
|
1407
|
+
*
|
|
1408
|
+
* @param neonInstance - Neon database query function
|
|
1409
|
+
* @returns Kysely dialect configured for Neon serverless
|
|
1410
|
+
*/
|
|
1411
|
+
declare function createNeonDialect(neonInstance: NeonQueryFunction<false, false>): any;
|
|
1412
|
+
/**
|
|
1413
|
+
* Execute a query with search_path set for Neon serverless
|
|
1414
|
+
*
|
|
1415
|
+
* @param neonInstance - Neon database query function
|
|
1416
|
+
* @param query - SQL query to execute
|
|
1417
|
+
* @param schema - Schema to set (optional)
|
|
1418
|
+
* @returns Query result
|
|
1419
|
+
*/
|
|
1420
|
+
declare function executeWithSchema(neonInstance: NeonQueryFunction<false, false>, query: string, schema?: string): Promise<any>;
|
|
1421
|
+
//#endregion
|
|
1405
1422
|
//#region src/db/index.d.ts
|
|
1406
1423
|
/**
|
|
1407
1424
|
* Supported database types
|
|
@@ -1434,7 +1451,7 @@ type DatabaseConnection = {
|
|
|
1434
1451
|
dialect: MssqlDialect;
|
|
1435
1452
|
} | {
|
|
1436
1453
|
type: 'neon';
|
|
1437
|
-
dialect:
|
|
1454
|
+
dialect: Dialect;
|
|
1438
1455
|
} | {
|
|
1439
1456
|
type: DatabaseType;
|
|
1440
1457
|
kysely: Kysely<Database>;
|
|
@@ -1455,4 +1472,4 @@ declare function detectDatabaseType(db: unknown): DatabaseType | null;
|
|
|
1455
1472
|
*/
|
|
1456
1473
|
declare function createDatabaseFromConnection(rawConnection: any, options?: DatabaseOptions): Promise<Kysely<Database> | null>;
|
|
1457
1474
|
//#endregion
|
|
1458
|
-
export {
|
|
1475
|
+
export { variantsSchema as $, ProviderConfig as A, VariantVersionsTable as B, Environment as C, Insertable as D, EnvironmentsTable as E, TargetingRule as F, configsSchema as G, WorkspaceSettings as H, TargetingRulesTable as I, llmRequestsSchema as J, environmentSecretsSchema as K, Updateable as L, SCHEMA_METADATA as M, Selectable as N, LLMRequest as O, TableName as P, variantVersionsSchema as Q, Variant as R, Database as S, EnvironmentSecretsTable as T, WorkspaceSettingsTable as U, VariantsTable as V, configVariantsSchema as W, schemas as X, providerConfigsSchema as Y, targetingRulesSchema as Z, validateTableData as _, createDatabaseFromConnection as a, ConfigVariantsTable as b, executeWithSchema as c, getMigrations as d, workspaceSettingsSchema as et, matchType as f, validatePartialTableData as g, parseTableData as h, createDatabase as i, ProviderConfigsTable as j, LLMRequestsTable as k, MigrationOptions as l, parsePartialTableData as m, DatabaseOptions as n, detectDatabaseType as o, runAutoMigrations as p, environmentsSchema as q, DatabaseType as r, createNeonDialect as s, DatabaseConnection as t, MigrationResult as u, Config as v, EnvironmentSecret as w, ConfigsTable as x, ConfigVariant as y, VariantVersion as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
require('./neon-dialect-js5JsNqM.cjs');
|
|
1
|
+
const require_db = require('./db-BOe6mM51.cjs');
|
|
2
|
+
const require_neon_dialect = require('./neon-dialect-BQey5lUw.cjs');
|
|
4
3
|
let __llmops_gateway = require("@llmops/gateway");
|
|
5
4
|
__llmops_gateway = require_db.__toESM(__llmops_gateway);
|
|
6
5
|
let kysely = require("kysely");
|
|
@@ -10,7 +9,6 @@ let node_path = require("node:path");
|
|
|
10
9
|
node_path = require_db.__toESM(node_path);
|
|
11
10
|
let __better_auth_utils_random = require("@better-auth/utils/random");
|
|
12
11
|
let node_crypto = require("node:crypto");
|
|
13
|
-
let kysely_neon = require("kysely-neon");
|
|
14
12
|
|
|
15
13
|
//#region src/providers/supported-providers.ts
|
|
16
14
|
/**
|
|
@@ -842,10 +840,7 @@ var CacheService = class {
|
|
|
842
840
|
}
|
|
843
841
|
createBackend(config) {
|
|
844
842
|
switch (config.backend) {
|
|
845
|
-
case "memory": return new MemoryCacheBackend(
|
|
846
|
-
maxSize: config.maxSize,
|
|
847
|
-
cleanupIntervalMs: config.cleanupInterval
|
|
848
|
-
});
|
|
843
|
+
case "memory": return new MemoryCacheBackend(config.maxSize, config.cleanupInterval);
|
|
849
844
|
case "file": return new FileCacheBackend(config.dataDir, config.fileName, config.saveInterval, config.cleanupInterval);
|
|
850
845
|
default: throw new Error(`Unsupported cache backend: ${config.backend}`);
|
|
851
846
|
}
|
|
@@ -2591,12 +2586,6 @@ exports.FileCacheBackend = FileCacheBackend;
|
|
|
2591
2586
|
exports.MS = MS;
|
|
2592
2587
|
exports.MemoryCacheBackend = MemoryCacheBackend;
|
|
2593
2588
|
exports.ModelsDevPricingProvider = ModelsDevPricingProvider;
|
|
2594
|
-
Object.defineProperty(exports, 'NeonDialect', {
|
|
2595
|
-
enumerable: true,
|
|
2596
|
-
get: function () {
|
|
2597
|
-
return kysely_neon.NeonDialect;
|
|
2598
|
-
}
|
|
2599
|
-
});
|
|
2600
2589
|
exports.SCHEMA_METADATA = require_db.SCHEMA_METADATA;
|
|
2601
2590
|
exports.SupportedProviders = SupportedProviders;
|
|
2602
2591
|
exports.calculateCost = calculateCost;
|
|
@@ -2607,12 +2596,14 @@ exports.createDataLayer = createDataLayer;
|
|
|
2607
2596
|
exports.createDatabase = require_db.createDatabase;
|
|
2608
2597
|
exports.createDatabaseFromConnection = require_db.createDatabaseFromConnection;
|
|
2609
2598
|
exports.createLLMRequestsDataLayer = createLLMRequestsDataLayer;
|
|
2599
|
+
exports.createNeonDialect = require_neon_dialect.createNeonDialect;
|
|
2610
2600
|
exports.createProviderConfigsDataLayer = createProviderConfigsDataLayer;
|
|
2611
2601
|
exports.createWorkspaceSettingsDataLayer = createWorkspaceSettingsDataLayer;
|
|
2612
2602
|
exports.detectDatabaseType = require_db.detectDatabaseType;
|
|
2613
2603
|
exports.dollarsToMicroDollars = dollarsToMicroDollars;
|
|
2614
2604
|
exports.environmentSecretsSchema = require_db.environmentSecretsSchema;
|
|
2615
2605
|
exports.environmentsSchema = require_db.environmentsSchema;
|
|
2606
|
+
exports.executeWithSchema = require_neon_dialect.executeWithSchema;
|
|
2616
2607
|
exports.formatCost = formatCost;
|
|
2617
2608
|
Object.defineProperty(exports, 'gateway', {
|
|
2618
2609
|
enumerable: true,
|