@llmops/core 0.2.11-beta.2 → 0.2.11-beta.4

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,6 @@
1
+ import { NeonDialect } from "kysely-neon";
1
2
  import { ColumnType, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
2
- import * as zod0 from "zod";
3
+ import * as zod497 from "zod";
3
4
  import { z } from "zod";
4
5
 
5
6
  //#region src/db/schema.d.ts
@@ -857,29 +858,29 @@ declare const schemas: {
857
858
  * Validate data against table schema
858
859
  * Useful for runtime validation before inserting/updating
859
860
  */
860
- declare function validateTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseSuccess<{
861
+ declare function validateTableData<T extends TableName>(table: T, data: unknown): zod497.ZodSafeParseSuccess<{
861
862
  slug: string;
862
863
  id: string;
863
864
  createdAt: Date;
864
865
  updatedAt: Date;
865
866
  name?: string | undefined;
866
- }> | zod0.ZodSafeParseError<{
867
+ }> | zod497.ZodSafeParseError<{
867
868
  slug: string;
868
869
  id: string;
869
870
  createdAt: Date;
870
871
  updatedAt: Date;
871
872
  name?: string | undefined;
872
- }> | zod0.ZodSafeParseSuccess<{
873
+ }> | zod497.ZodSafeParseSuccess<{
873
874
  name: string;
874
875
  id: string;
875
876
  createdAt: Date;
876
877
  updatedAt: Date;
877
- }> | zod0.ZodSafeParseError<{
878
+ }> | zod497.ZodSafeParseError<{
878
879
  name: string;
879
880
  id: string;
880
881
  createdAt: Date;
881
882
  updatedAt: Date;
882
- }> | zod0.ZodSafeParseSuccess<{
883
+ }> | zod497.ZodSafeParseSuccess<{
883
884
  variantId: string;
884
885
  version: number;
885
886
  provider: string;
@@ -888,7 +889,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
888
889
  id: string;
889
890
  createdAt: Date;
890
891
  updatedAt: Date;
891
- }> | zod0.ZodSafeParseError<{
892
+ }> | zod497.ZodSafeParseError<{
892
893
  variantId: string;
893
894
  version: number;
894
895
  provider: string;
@@ -897,33 +898,33 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
897
898
  id: string;
898
899
  createdAt: Date;
899
900
  updatedAt: Date;
900
- }> | zod0.ZodSafeParseSuccess<{
901
+ }> | zod497.ZodSafeParseSuccess<{
901
902
  environmentId: string;
902
903
  keyName: string;
903
904
  keyValue: string;
904
905
  id: string;
905
906
  createdAt: Date;
906
907
  updatedAt: Date;
907
- }> | zod0.ZodSafeParseError<{
908
+ }> | zod497.ZodSafeParseError<{
908
909
  environmentId: string;
909
910
  keyName: string;
910
911
  keyValue: string;
911
912
  id: string;
912
913
  createdAt: Date;
913
914
  updatedAt: Date;
914
- }> | zod0.ZodSafeParseSuccess<{
915
+ }> | zod497.ZodSafeParseSuccess<{
915
916
  configId: string;
916
917
  variantId: string;
917
918
  id: string;
918
919
  createdAt: Date;
919
920
  updatedAt: Date;
920
- }> | zod0.ZodSafeParseError<{
921
+ }> | zod497.ZodSafeParseError<{
921
922
  configId: string;
922
923
  variantId: string;
923
924
  id: string;
924
925
  createdAt: Date;
925
926
  updatedAt: Date;
926
- }> | zod0.ZodSafeParseSuccess<{
927
+ }> | zod497.ZodSafeParseSuccess<{
927
928
  environmentId: string;
928
929
  configId: string;
929
930
  configVariantId: string;
@@ -935,7 +936,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
935
936
  createdAt: Date;
936
937
  updatedAt: Date;
937
938
  variantVersionId?: string | null | undefined;
938
- }> | zod0.ZodSafeParseError<{
939
+ }> | zod497.ZodSafeParseError<{
939
940
  environmentId: string;
940
941
  configId: string;
941
942
  configVariantId: string;
@@ -947,21 +948,21 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
947
948
  createdAt: Date;
948
949
  updatedAt: Date;
949
950
  variantVersionId?: string | null | undefined;
950
- }> | zod0.ZodSafeParseSuccess<{
951
+ }> | zod497.ZodSafeParseSuccess<{
951
952
  setupComplete: boolean;
952
953
  id: string;
953
954
  createdAt: Date;
954
955
  updatedAt: Date;
955
956
  name?: string | null | undefined;
956
957
  superAdminId?: string | null | undefined;
957
- }> | zod0.ZodSafeParseError<{
958
+ }> | zod497.ZodSafeParseError<{
958
959
  setupComplete: boolean;
959
960
  id: string;
960
961
  createdAt: Date;
961
962
  updatedAt: Date;
962
963
  name?: string | null | undefined;
963
964
  superAdminId?: string | null | undefined;
964
- }> | zod0.ZodSafeParseSuccess<{
965
+ }> | zod497.ZodSafeParseSuccess<{
965
966
  providerId: string;
966
967
  config: Record<string, unknown>;
967
968
  enabled: boolean;
@@ -969,7 +970,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
969
970
  createdAt: Date;
970
971
  updatedAt: Date;
971
972
  name?: string | null | undefined;
972
- }> | zod0.ZodSafeParseError<{
973
+ }> | zod497.ZodSafeParseError<{
973
974
  providerId: string;
974
975
  config: Record<string, unknown>;
975
976
  enabled: boolean;
@@ -977,7 +978,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
977
978
  createdAt: Date;
978
979
  updatedAt: Date;
979
980
  name?: string | null | undefined;
980
- }> | zod0.ZodSafeParseSuccess<{
981
+ }> | zod497.ZodSafeParseSuccess<{
981
982
  requestId: string;
982
983
  provider: string;
983
984
  model: string;
@@ -1001,7 +1002,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
1001
1002
  environmentId?: string | null | undefined;
1002
1003
  providerConfigId?: string | null | undefined;
1003
1004
  userId?: string | null | undefined;
1004
- }> | zod0.ZodSafeParseError<{
1005
+ }> | zod497.ZodSafeParseError<{
1005
1006
  requestId: string;
1006
1007
  provider: string;
1007
1008
  model: string;
@@ -1029,17 +1030,17 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
1029
1030
  /**
1030
1031
  * Validate partial data (for updates)
1031
1032
  */
1032
- declare function validatePartialTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseSuccess<{
1033
+ declare function validatePartialTableData<T extends TableName>(table: T, data: unknown): zod497.ZodSafeParseSuccess<{
1033
1034
  name?: string | undefined;
1034
1035
  id?: string | undefined;
1035
1036
  createdAt?: Date | undefined;
1036
1037
  updatedAt?: Date | undefined;
1037
- }> | zod0.ZodSafeParseError<{
1038
+ }> | zod497.ZodSafeParseError<{
1038
1039
  name?: string | undefined;
1039
1040
  id?: string | undefined;
1040
1041
  createdAt?: Date | undefined;
1041
1042
  updatedAt?: Date | undefined;
1042
- }> | zod0.ZodSafeParseSuccess<{
1043
+ }> | zod497.ZodSafeParseSuccess<{
1043
1044
  variantId?: string | undefined;
1044
1045
  version?: number | undefined;
1045
1046
  provider?: string | undefined;
@@ -1048,7 +1049,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1048
1049
  id?: string | undefined;
1049
1050
  createdAt?: Date | undefined;
1050
1051
  updatedAt?: Date | undefined;
1051
- }> | zod0.ZodSafeParseError<{
1052
+ }> | zod497.ZodSafeParseError<{
1052
1053
  variantId?: string | undefined;
1053
1054
  version?: number | undefined;
1054
1055
  provider?: string | undefined;
@@ -1057,33 +1058,33 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1057
1058
  id?: string | undefined;
1058
1059
  createdAt?: Date | undefined;
1059
1060
  updatedAt?: Date | undefined;
1060
- }> | zod0.ZodSafeParseSuccess<{
1061
+ }> | zod497.ZodSafeParseSuccess<{
1061
1062
  environmentId?: string | undefined;
1062
1063
  keyName?: string | undefined;
1063
1064
  keyValue?: string | undefined;
1064
1065
  id?: string | undefined;
1065
1066
  createdAt?: Date | undefined;
1066
1067
  updatedAt?: Date | undefined;
1067
- }> | zod0.ZodSafeParseError<{
1068
+ }> | zod497.ZodSafeParseError<{
1068
1069
  environmentId?: string | undefined;
1069
1070
  keyName?: string | undefined;
1070
1071
  keyValue?: string | undefined;
1071
1072
  id?: string | undefined;
1072
1073
  createdAt?: Date | undefined;
1073
1074
  updatedAt?: Date | undefined;
1074
- }> | zod0.ZodSafeParseSuccess<{
1075
+ }> | zod497.ZodSafeParseSuccess<{
1075
1076
  configId?: string | undefined;
1076
1077
  variantId?: string | undefined;
1077
1078
  id?: string | undefined;
1078
1079
  createdAt?: Date | undefined;
1079
1080
  updatedAt?: Date | undefined;
1080
- }> | zod0.ZodSafeParseError<{
1081
+ }> | zod497.ZodSafeParseError<{
1081
1082
  configId?: string | undefined;
1082
1083
  variantId?: string | undefined;
1083
1084
  id?: string | undefined;
1084
1085
  createdAt?: Date | undefined;
1085
1086
  updatedAt?: Date | undefined;
1086
- }> | zod0.ZodSafeParseSuccess<{
1087
+ }> | zod497.ZodSafeParseSuccess<{
1087
1088
  environmentId?: string | undefined;
1088
1089
  configId?: string | undefined;
1089
1090
  configVariantId?: string | undefined;
@@ -1095,7 +1096,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1095
1096
  id?: string | undefined;
1096
1097
  createdAt?: Date | undefined;
1097
1098
  updatedAt?: Date | undefined;
1098
- }> | zod0.ZodSafeParseError<{
1099
+ }> | zod497.ZodSafeParseError<{
1099
1100
  environmentId?: string | undefined;
1100
1101
  configId?: string | undefined;
1101
1102
  configVariantId?: string | undefined;
@@ -1107,21 +1108,21 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1107
1108
  id?: string | undefined;
1108
1109
  createdAt?: Date | undefined;
1109
1110
  updatedAt?: Date | undefined;
1110
- }> | zod0.ZodSafeParseSuccess<{
1111
+ }> | zod497.ZodSafeParseSuccess<{
1111
1112
  name?: string | null | undefined;
1112
1113
  setupComplete?: boolean | undefined;
1113
1114
  superAdminId?: string | null | undefined;
1114
1115
  id?: string | undefined;
1115
1116
  createdAt?: Date | undefined;
1116
1117
  updatedAt?: Date | undefined;
1117
- }> | zod0.ZodSafeParseError<{
1118
+ }> | zod497.ZodSafeParseError<{
1118
1119
  name?: string | null | undefined;
1119
1120
  setupComplete?: boolean | undefined;
1120
1121
  superAdminId?: string | null | undefined;
1121
1122
  id?: string | undefined;
1122
1123
  createdAt?: Date | undefined;
1123
1124
  updatedAt?: Date | undefined;
1124
- }> | zod0.ZodSafeParseSuccess<{
1125
+ }> | zod497.ZodSafeParseSuccess<{
1125
1126
  providerId?: string | undefined;
1126
1127
  name?: string | null | undefined;
1127
1128
  config?: Record<string, unknown> | undefined;
@@ -1129,7 +1130,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1129
1130
  id?: string | undefined;
1130
1131
  createdAt?: Date | undefined;
1131
1132
  updatedAt?: Date | undefined;
1132
- }> | zod0.ZodSafeParseError<{
1133
+ }> | zod497.ZodSafeParseError<{
1133
1134
  providerId?: string | undefined;
1134
1135
  name?: string | null | undefined;
1135
1136
  config?: Record<string, unknown> | undefined;
@@ -1137,7 +1138,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1137
1138
  id?: string | undefined;
1138
1139
  createdAt?: Date | undefined;
1139
1140
  updatedAt?: Date | undefined;
1140
- }> | zod0.ZodSafeParseSuccess<{
1141
+ }> | zod497.ZodSafeParseSuccess<{
1141
1142
  requestId?: string | undefined;
1142
1143
  configId?: string | null | undefined;
1143
1144
  variantId?: string | null | undefined;
@@ -1161,7 +1162,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1161
1162
  id?: string | undefined;
1162
1163
  createdAt?: Date | undefined;
1163
1164
  updatedAt?: Date | undefined;
1164
- }> | zod0.ZodSafeParseError<{
1165
+ }> | zod497.ZodSafeParseError<{
1165
1166
  requestId?: string | undefined;
1166
1167
  configId?: string | null | undefined;
1167
1168
  variantId?: string | null | undefined;
@@ -1405,7 +1406,7 @@ declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType$1,
1405
1406
  /**
1406
1407
  * Supported database types
1407
1408
  */
1408
- type DatabaseType = 'postgres' | 'mysql' | 'sqlite' | 'mssql';
1409
+ type DatabaseType = 'postgres' | 'mysql' | 'sqlite' | 'mssql' | 'neon';
1409
1410
  /**
1410
1411
  * Options for creating a database connection
1411
1412
  */
@@ -1431,6 +1432,9 @@ type DatabaseConnection = {
1431
1432
  } | {
1432
1433
  type: 'mssql';
1433
1434
  dialect: MssqlDialect;
1435
+ } | {
1436
+ type: 'neon';
1437
+ dialect: NeonDialect;
1434
1438
  } | {
1435
1439
  type: DatabaseType;
1436
1440
  kysely: Kysely<Database>;
@@ -1451,4 +1455,4 @@ declare function detectDatabaseType(db: unknown): DatabaseType | null;
1451
1455
  */
1452
1456
  declare function createDatabaseFromConnection(rawConnection: any, options?: DatabaseOptions): Promise<Kysely<Database> | null>;
1453
1457
  //#endregion
1454
- export { SCHEMA_METADATA as A, WorkspaceSettings as B, EnvironmentSecretsTable as C, LLMRequestsTable as D, LLMRequest as E, Updateable as F, environmentsSchema as G, configVariantsSchema as H, Variant as I, schemas as J, llmRequestsSchema as K, VariantVersion as L, TableName as M, TargetingRule as N, ProviderConfig as O, TargetingRulesTable as P, workspaceSettingsSchema as Q, VariantVersionsTable as R, EnvironmentSecret as S, Insertable as T, configsSchema as U, WorkspaceSettingsTable as V, environmentSecretsSchema as W, variantVersionsSchema as X, targetingRulesSchema as Y, variantsSchema as Z, 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, Selectable as j, ProviderConfigsTable as k, getMigrations as l, validatePartialTableData as m, DatabaseOptions as n, detectDatabaseType as o, parseTableData as p, providerConfigsSchema 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, VariantsTable as z };
1458
+ export { NeonDialect as $, SCHEMA_METADATA as A, WorkspaceSettings as B, EnvironmentSecretsTable as C, LLMRequestsTable as D, LLMRequest as E, Updateable as F, environmentsSchema as G, configVariantsSchema as H, Variant as I, schemas as J, llmRequestsSchema as K, VariantVersion as L, TableName as M, TargetingRule as N, ProviderConfig as O, TargetingRulesTable as P, workspaceSettingsSchema as Q, VariantVersionsTable as R, EnvironmentSecret as S, Insertable as T, configsSchema as U, WorkspaceSettingsTable as V, environmentSecretsSchema as W, variantVersionsSchema as X, targetingRulesSchema as Y, variantsSchema as Z, 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, Selectable as j, ProviderConfigsTable as k, getMigrations as l, validatePartialTableData as m, DatabaseOptions as n, detectDatabaseType as o, parseTableData as p, providerConfigsSchema 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, VariantsTable as z };
package/dist/index.cjs CHANGED
@@ -1,4 +1,6 @@
1
- const require_db = require('./db-CqDD6Ydv.cjs');
1
+ "use node";
2
+ const require_db = require('./db-BIiDmOuQ.cjs');
3
+ require('./neon-dialect-js5JsNqM.cjs');
2
4
  let __llmops_gateway = require("@llmops/gateway");
3
5
  __llmops_gateway = require_db.__toESM(__llmops_gateway);
4
6
  let kysely = require("kysely");
@@ -8,6 +10,7 @@ let node_path = require("node:path");
8
10
  node_path = require_db.__toESM(node_path);
9
11
  let __better_auth_utils_random = require("@better-auth/utils/random");
10
12
  let node_crypto = require("node:crypto");
13
+ let kysely_neon = require("kysely-neon");
11
14
 
12
15
  //#region src/providers/supported-providers.ts
13
16
  /**
@@ -839,7 +842,10 @@ var CacheService = class {
839
842
  }
840
843
  createBackend(config) {
841
844
  switch (config.backend) {
842
- case "memory": return new MemoryCacheBackend(config.maxSize, config.cleanupInterval);
845
+ case "memory": return new MemoryCacheBackend({
846
+ maxSize: config.maxSize,
847
+ cleanupIntervalMs: config.cleanupInterval
848
+ });
843
849
  case "file": return new FileCacheBackend(config.dataDir, config.fileName, config.saveInterval, config.cleanupInterval);
844
850
  default: throw new Error(`Unsupported cache backend: ${config.backend}`);
845
851
  }
@@ -2585,6 +2591,12 @@ exports.FileCacheBackend = FileCacheBackend;
2585
2591
  exports.MS = MS;
2586
2592
  exports.MemoryCacheBackend = MemoryCacheBackend;
2587
2593
  exports.ModelsDevPricingProvider = ModelsDevPricingProvider;
2594
+ Object.defineProperty(exports, 'NeonDialect', {
2595
+ enumerable: true,
2596
+ get: function () {
2597
+ return kysely_neon.NeonDialect;
2598
+ }
2599
+ });
2588
2600
  exports.SCHEMA_METADATA = require_db.SCHEMA_METADATA;
2589
2601
  exports.SupportedProviders = SupportedProviders;
2590
2602
  exports.calculateCost = calculateCost;