@llmops/core 0.6.10-beta.2 → 1.0.0-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-C06VxkTn.cjs → bun-sqlite-dialect-C3HVUfYl.cjs} +1 -1
- package/dist/db/index.cjs +2 -2
- package/dist/db/index.d.cts +1 -1
- package/dist/db/index.d.mts +1 -1
- package/dist/db/index.mjs +1 -1
- package/dist/{db-CdAtHHw5.mjs → db-CjwRQB4N.mjs} +4 -290
- package/dist/{db-D8otWwZL.cjs → db-D3WDjcvd.cjs} +5 -299
- package/dist/{index-D3onb7gK.d.mts → index-BmGf4wCW.d.cts} +278 -832
- package/dist/{index-CyVFWq76.d.cts → index-BoDvuqku.d.mts} +278 -832
- package/dist/index.cjs +52 -1171
- package/dist/index.d.cts +38 -1082
- package/dist/index.d.mts +38 -1082
- package/dist/index.mjs +52 -1162
- package/dist/{neon-dialect-DIuEesTA.cjs → neon-dialect-BSJpZ9YH.cjs} +1 -1
- package/dist/{neon-dialect-ccr-mLKR.cjs → neon-dialect-DMClTHvw.cjs} +1 -1
- package/dist/{node-sqlite-dialect-AU81Qz0n.cjs → node-sqlite-dialect-BZGXfDHS.cjs} +1 -1
- package/package.json +2 -4
|
@@ -13184,237 +13184,6 @@ const spanEventsSchema = object({
|
|
|
13184
13184
|
* Derived from Zod schemas
|
|
13185
13185
|
*/
|
|
13186
13186
|
const SCHEMA_METADATA = { tables: {
|
|
13187
|
-
configs: {
|
|
13188
|
-
order: 1,
|
|
13189
|
-
schema: configsSchema,
|
|
13190
|
-
fields: {
|
|
13191
|
-
id: {
|
|
13192
|
-
type: "uuid",
|
|
13193
|
-
primaryKey: true
|
|
13194
|
-
},
|
|
13195
|
-
slug: {
|
|
13196
|
-
type: "text",
|
|
13197
|
-
unique: true
|
|
13198
|
-
},
|
|
13199
|
-
name: {
|
|
13200
|
-
type: "text",
|
|
13201
|
-
nullable: true
|
|
13202
|
-
},
|
|
13203
|
-
createdAt: {
|
|
13204
|
-
type: "timestamp",
|
|
13205
|
-
default: "now()"
|
|
13206
|
-
},
|
|
13207
|
-
updatedAt: {
|
|
13208
|
-
type: "timestamp",
|
|
13209
|
-
default: "now()",
|
|
13210
|
-
onUpdate: "now()"
|
|
13211
|
-
}
|
|
13212
|
-
}
|
|
13213
|
-
},
|
|
13214
|
-
variants: {
|
|
13215
|
-
order: 2,
|
|
13216
|
-
schema: variantsSchema,
|
|
13217
|
-
fields: {
|
|
13218
|
-
id: {
|
|
13219
|
-
type: "uuid",
|
|
13220
|
-
primaryKey: true
|
|
13221
|
-
},
|
|
13222
|
-
name: { type: "text" },
|
|
13223
|
-
createdAt: {
|
|
13224
|
-
type: "timestamp",
|
|
13225
|
-
default: "now()"
|
|
13226
|
-
},
|
|
13227
|
-
updatedAt: {
|
|
13228
|
-
type: "timestamp",
|
|
13229
|
-
default: "now()",
|
|
13230
|
-
onUpdate: "now()"
|
|
13231
|
-
}
|
|
13232
|
-
}
|
|
13233
|
-
},
|
|
13234
|
-
variant_versions: {
|
|
13235
|
-
order: 3,
|
|
13236
|
-
schema: variantVersionsSchema,
|
|
13237
|
-
fields: {
|
|
13238
|
-
id: {
|
|
13239
|
-
type: "uuid",
|
|
13240
|
-
primaryKey: true
|
|
13241
|
-
},
|
|
13242
|
-
variantId: {
|
|
13243
|
-
type: "uuid",
|
|
13244
|
-
references: {
|
|
13245
|
-
table: "variants",
|
|
13246
|
-
column: "id"
|
|
13247
|
-
}
|
|
13248
|
-
},
|
|
13249
|
-
version: { type: "integer" },
|
|
13250
|
-
provider: { type: "text" },
|
|
13251
|
-
modelName: { type: "text" },
|
|
13252
|
-
jsonData: { type: "jsonb" },
|
|
13253
|
-
createdAt: {
|
|
13254
|
-
type: "timestamp",
|
|
13255
|
-
default: "now()"
|
|
13256
|
-
},
|
|
13257
|
-
updatedAt: {
|
|
13258
|
-
type: "timestamp",
|
|
13259
|
-
default: "now()",
|
|
13260
|
-
onUpdate: "now()"
|
|
13261
|
-
}
|
|
13262
|
-
},
|
|
13263
|
-
uniqueConstraints: [{ columns: ["variantId", "version"] }]
|
|
13264
|
-
},
|
|
13265
|
-
environments: {
|
|
13266
|
-
order: 4,
|
|
13267
|
-
schema: environmentsSchema,
|
|
13268
|
-
fields: {
|
|
13269
|
-
id: {
|
|
13270
|
-
type: "uuid",
|
|
13271
|
-
primaryKey: true
|
|
13272
|
-
},
|
|
13273
|
-
name: { type: "text" },
|
|
13274
|
-
slug: {
|
|
13275
|
-
type: "text",
|
|
13276
|
-
unique: true
|
|
13277
|
-
},
|
|
13278
|
-
isProd: {
|
|
13279
|
-
type: "boolean",
|
|
13280
|
-
default: false
|
|
13281
|
-
},
|
|
13282
|
-
createdAt: {
|
|
13283
|
-
type: "timestamp",
|
|
13284
|
-
default: "now()"
|
|
13285
|
-
},
|
|
13286
|
-
updatedAt: {
|
|
13287
|
-
type: "timestamp",
|
|
13288
|
-
default: "now()",
|
|
13289
|
-
onUpdate: "now()"
|
|
13290
|
-
}
|
|
13291
|
-
}
|
|
13292
|
-
},
|
|
13293
|
-
environment_secrets: {
|
|
13294
|
-
order: 5,
|
|
13295
|
-
schema: environmentSecretsSchema,
|
|
13296
|
-
fields: {
|
|
13297
|
-
id: {
|
|
13298
|
-
type: "uuid",
|
|
13299
|
-
primaryKey: true
|
|
13300
|
-
},
|
|
13301
|
-
environmentId: {
|
|
13302
|
-
type: "uuid",
|
|
13303
|
-
references: {
|
|
13304
|
-
table: "environments",
|
|
13305
|
-
column: "id"
|
|
13306
|
-
}
|
|
13307
|
-
},
|
|
13308
|
-
keyName: { type: "text" },
|
|
13309
|
-
keyValue: { type: "text" },
|
|
13310
|
-
createdAt: {
|
|
13311
|
-
type: "timestamp",
|
|
13312
|
-
default: "now()"
|
|
13313
|
-
},
|
|
13314
|
-
updatedAt: {
|
|
13315
|
-
type: "timestamp",
|
|
13316
|
-
default: "now()",
|
|
13317
|
-
onUpdate: "now()"
|
|
13318
|
-
}
|
|
13319
|
-
}
|
|
13320
|
-
},
|
|
13321
|
-
config_variants: {
|
|
13322
|
-
order: 6,
|
|
13323
|
-
schema: configVariantsSchema,
|
|
13324
|
-
fields: {
|
|
13325
|
-
id: {
|
|
13326
|
-
type: "uuid",
|
|
13327
|
-
primaryKey: true
|
|
13328
|
-
},
|
|
13329
|
-
configId: {
|
|
13330
|
-
type: "uuid",
|
|
13331
|
-
references: {
|
|
13332
|
-
table: "configs",
|
|
13333
|
-
column: "id"
|
|
13334
|
-
}
|
|
13335
|
-
},
|
|
13336
|
-
variantId: {
|
|
13337
|
-
type: "uuid",
|
|
13338
|
-
references: {
|
|
13339
|
-
table: "variants",
|
|
13340
|
-
column: "id"
|
|
13341
|
-
}
|
|
13342
|
-
},
|
|
13343
|
-
createdAt: {
|
|
13344
|
-
type: "timestamp",
|
|
13345
|
-
default: "now()"
|
|
13346
|
-
},
|
|
13347
|
-
updatedAt: {
|
|
13348
|
-
type: "timestamp",
|
|
13349
|
-
default: "now()",
|
|
13350
|
-
onUpdate: "now()"
|
|
13351
|
-
}
|
|
13352
|
-
}
|
|
13353
|
-
},
|
|
13354
|
-
targeting_rules: {
|
|
13355
|
-
order: 7,
|
|
13356
|
-
schema: targetingRulesSchema,
|
|
13357
|
-
fields: {
|
|
13358
|
-
id: {
|
|
13359
|
-
type: "uuid",
|
|
13360
|
-
primaryKey: true
|
|
13361
|
-
},
|
|
13362
|
-
environmentId: {
|
|
13363
|
-
type: "uuid",
|
|
13364
|
-
references: {
|
|
13365
|
-
table: "environments",
|
|
13366
|
-
column: "id"
|
|
13367
|
-
}
|
|
13368
|
-
},
|
|
13369
|
-
configId: {
|
|
13370
|
-
type: "uuid",
|
|
13371
|
-
references: {
|
|
13372
|
-
table: "configs",
|
|
13373
|
-
column: "id"
|
|
13374
|
-
}
|
|
13375
|
-
},
|
|
13376
|
-
configVariantId: {
|
|
13377
|
-
type: "uuid",
|
|
13378
|
-
references: {
|
|
13379
|
-
table: "config_variants",
|
|
13380
|
-
column: "id"
|
|
13381
|
-
}
|
|
13382
|
-
},
|
|
13383
|
-
variantVersionId: {
|
|
13384
|
-
type: "uuid",
|
|
13385
|
-
nullable: true,
|
|
13386
|
-
references: {
|
|
13387
|
-
table: "variant_versions",
|
|
13388
|
-
column: "id"
|
|
13389
|
-
}
|
|
13390
|
-
},
|
|
13391
|
-
weight: {
|
|
13392
|
-
type: "integer",
|
|
13393
|
-
default: 1e4
|
|
13394
|
-
},
|
|
13395
|
-
priority: {
|
|
13396
|
-
type: "integer",
|
|
13397
|
-
default: 0
|
|
13398
|
-
},
|
|
13399
|
-
enabled: {
|
|
13400
|
-
type: "boolean",
|
|
13401
|
-
default: true
|
|
13402
|
-
},
|
|
13403
|
-
conditions: {
|
|
13404
|
-
type: "jsonb",
|
|
13405
|
-
default: "{}"
|
|
13406
|
-
},
|
|
13407
|
-
createdAt: {
|
|
13408
|
-
type: "timestamp",
|
|
13409
|
-
default: "now()"
|
|
13410
|
-
},
|
|
13411
|
-
updatedAt: {
|
|
13412
|
-
type: "timestamp",
|
|
13413
|
-
default: "now()",
|
|
13414
|
-
onUpdate: "now()"
|
|
13415
|
-
}
|
|
13416
|
-
}
|
|
13417
|
-
},
|
|
13418
13187
|
workspace_settings: {
|
|
13419
13188
|
order: 8,
|
|
13420
13189
|
schema: workspaceSettingsSchema,
|
|
@@ -14266,27 +14035,6 @@ function parsePartialTableData(table, data) {
|
|
|
14266
14035
|
//#region src/utils/logger.ts
|
|
14267
14036
|
const logger = (0, pino.default)({ level: process.env.LOG_LEVEL || "info" });
|
|
14268
14037
|
|
|
14269
|
-
//#endregion
|
|
14270
|
-
//#region src/auth/get-auth-client-options.ts
|
|
14271
|
-
/**
|
|
14272
|
-
* Get Better Auth client options
|
|
14273
|
-
*
|
|
14274
|
-
* @param options - Auth client options including database config and hooks
|
|
14275
|
-
*/
|
|
14276
|
-
const getAuthClientOptions = (options) => {
|
|
14277
|
-
const { database, onUserCreated, baseURL, trustedOrigins } = options;
|
|
14278
|
-
return {
|
|
14279
|
-
database,
|
|
14280
|
-
baseURL,
|
|
14281
|
-
trustedOrigins,
|
|
14282
|
-
emailAndPassword: { enabled: true },
|
|
14283
|
-
advanced: { cookiePrefix: "llmops" },
|
|
14284
|
-
databaseHooks: onUserCreated ? { user: { create: { after: async (user) => {
|
|
14285
|
-
await onUserCreated(user.id);
|
|
14286
|
-
} } } } : void 0
|
|
14287
|
-
};
|
|
14288
|
-
};
|
|
14289
|
-
|
|
14290
14038
|
//#endregion
|
|
14291
14039
|
//#region src/db/migrations.ts
|
|
14292
14040
|
const postgresMap = {
|
|
@@ -14539,23 +14287,7 @@ async function getMigrations(db, dbType, options) {
|
|
|
14539
14287
|
migrations.push(builder);
|
|
14540
14288
|
}
|
|
14541
14289
|
}
|
|
14542
|
-
|
|
14543
|
-
await kysely.sql`SET search_path TO "${options?.schema ?? "llmops"}"`.execute(db);
|
|
14544
|
-
} catch (error$47) {
|
|
14545
|
-
logger.warn({ error: error$47 }, "Failed to set search_path for Better Auth migrations");
|
|
14546
|
-
}
|
|
14547
|
-
let getAuthMigrations;
|
|
14548
|
-
try {
|
|
14549
|
-
const dbModule = await import("better-auth/db");
|
|
14550
|
-
if (typeof dbModule.getMigrations === "function") getAuthMigrations = dbModule.getMigrations;
|
|
14551
|
-
if (!getAuthMigrations) {
|
|
14552
|
-
const migrationModule = await import("better-auth/db/migration");
|
|
14553
|
-
if (typeof migrationModule.getMigrations === "function") getAuthMigrations = migrationModule.getMigrations;
|
|
14554
|
-
}
|
|
14555
|
-
} catch (error$47) {
|
|
14556
|
-
logger.warn({ error: error$47 }, "Failed to import better-auth migrations; skipping auth migrations");
|
|
14557
|
-
}
|
|
14558
|
-
if (!getAuthMigrations) return {
|
|
14290
|
+
return {
|
|
14559
14291
|
toBeCreated,
|
|
14560
14292
|
toBeAdded,
|
|
14561
14293
|
runMigrations: async () => {
|
|
@@ -14567,26 +14299,6 @@ async function getMigrations(db, dbType, options) {
|
|
|
14567
14299
|
migrations,
|
|
14568
14300
|
needsMigration: toBeCreated.length > 0 || toBeAdded.length > 0
|
|
14569
14301
|
};
|
|
14570
|
-
const authOptions = getAuthClientOptions({ database: {
|
|
14571
|
-
db,
|
|
14572
|
-
type: dbType === "neon" ? "postgres" : dbType
|
|
14573
|
-
} });
|
|
14574
|
-
const { toBeAdded: authChangesToBeAdded, toBeCreated: authChangesToBeCreated, runMigrations: runAuthMigrations } = await getAuthMigrations(authOptions);
|
|
14575
|
-
async function runMigrations() {
|
|
14576
|
-
for (const migration of migrations) await migration.execute();
|
|
14577
|
-
await runAuthMigrations();
|
|
14578
|
-
}
|
|
14579
|
-
async function compileMigrations() {
|
|
14580
|
-
return migrations.map((m) => m.compile().sql).join(";\n\n") + ";";
|
|
14581
|
-
}
|
|
14582
|
-
return {
|
|
14583
|
-
toBeCreated: [...toBeCreated, ...authChangesToBeCreated],
|
|
14584
|
-
toBeAdded: [...toBeAdded, ...authChangesToBeAdded],
|
|
14585
|
-
runMigrations,
|
|
14586
|
-
compileMigrations,
|
|
14587
|
-
migrations,
|
|
14588
|
-
needsMigration: toBeCreated.length > 0 || toBeAdded.length > 0 || authChangesToBeCreated.length > 0 || authChangesToBeAdded.length > 0
|
|
14589
|
-
};
|
|
14590
14302
|
}
|
|
14591
14303
|
/**
|
|
14592
14304
|
* Fix legacy constraints that may exist from previous schema versions
|
|
@@ -14718,12 +14430,12 @@ async function createDatabaseFromConnection(rawConnection, options) {
|
|
|
14718
14430
|
case "sqlite":
|
|
14719
14431
|
if ("aggregate" in rawConnection && !("createSession" in rawConnection)) dialect = new kysely.SqliteDialect({ database: rawConnection });
|
|
14720
14432
|
else if ("fileControl" in rawConnection) {
|
|
14721
|
-
const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-
|
|
14433
|
+
const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-C3HVUfYl.cjs"));
|
|
14722
14434
|
dialect = new BunSqliteDialect({ database: rawConnection });
|
|
14723
14435
|
} else if ("createSession" in rawConnection && typeof window === "undefined") try {
|
|
14724
14436
|
const { DatabaseSync } = await import("node:sqlite");
|
|
14725
14437
|
if (rawConnection instanceof DatabaseSync) {
|
|
14726
|
-
const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-
|
|
14438
|
+
const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-BZGXfDHS.cjs"));
|
|
14727
14439
|
dialect = new NodeSqliteDialect({ database: rawConnection });
|
|
14728
14440
|
}
|
|
14729
14441
|
} catch {}
|
|
@@ -14741,7 +14453,7 @@ async function createDatabaseFromConnection(rawConnection, options) {
|
|
|
14741
14453
|
break;
|
|
14742
14454
|
case "neon": {
|
|
14743
14455
|
if (typeof rawConnection === "function") {
|
|
14744
|
-
const { createNeonDialect: createNeonDialect$1 } = await Promise.resolve().then(() => require("./neon-dialect-
|
|
14456
|
+
const { createNeonDialect: createNeonDialect$1 } = await Promise.resolve().then(() => require("./neon-dialect-BSJpZ9YH.cjs"));
|
|
14745
14457
|
dialect = createNeonDialect$1(rawConnection);
|
|
14746
14458
|
break;
|
|
14747
14459
|
}
|
|
@@ -14749,7 +14461,7 @@ async function createDatabaseFromConnection(rawConnection, options) {
|
|
|
14749
14461
|
if (!connectionString) throw new Error("Neon connection string is required. Pass it directly as the database option or set one of: NEON_CONNECTION_STRING, NEON_PG_URL, DATABASE_URL, POSTGRES_URL");
|
|
14750
14462
|
const { neon } = await import("@neondatabase/serverless");
|
|
14751
14463
|
const sql$1 = neon(connectionString);
|
|
14752
|
-
const { createNeonDialect } = await Promise.resolve().then(() => require("./neon-dialect-
|
|
14464
|
+
const { createNeonDialect } = await Promise.resolve().then(() => require("./neon-dialect-BSJpZ9YH.cjs"));
|
|
14753
14465
|
dialect = createNeonDialect(sql$1);
|
|
14754
14466
|
break;
|
|
14755
14467
|
}
|
|
@@ -14863,12 +14575,6 @@ Object.defineProperty(exports, 'environmentsSchema', {
|
|
|
14863
14575
|
return environmentsSchema;
|
|
14864
14576
|
}
|
|
14865
14577
|
});
|
|
14866
|
-
Object.defineProperty(exports, 'getAuthClientOptions', {
|
|
14867
|
-
enumerable: true,
|
|
14868
|
-
get: function () {
|
|
14869
|
-
return getAuthClientOptions;
|
|
14870
|
-
}
|
|
14871
|
-
});
|
|
14872
14578
|
Object.defineProperty(exports, 'getMigrations', {
|
|
14873
14579
|
enumerable: true,
|
|
14874
14580
|
get: function () {
|