@llmops/core 0.3.1 → 0.3.2-beta.2
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-BNaQHMpk.cjs → bun-sqlite-dialect-B5rfiYIH.cjs} +1 -1
- package/dist/db/index.cjs +4 -2
- 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-B-EsQtOz.mjs → db-Bkg85wso.mjs} +125 -3
- package/dist/{db-Du2xmkGS.cjs → db-CCKBHjuz.cjs} +139 -5
- package/dist/{index-COkIT6TH.d.mts → index-BMN3ZSTf.d.mts} +398 -2
- package/dist/{index-CunWjFE4.d.cts → index-BgqlEG16.d.cts} +433 -37
- package/dist/index.cjs +249 -5
- package/dist/index.d.cts +1026 -466
- package/dist/index.d.mts +1026 -466
- package/dist/index.mjs +245 -5
- package/dist/{neon-dialect-BR1nZmKX.cjs → neon-dialect-DmI-frVR.cjs} +1 -1
- package/dist/{neon-dialect-B-Q6mmbI.cjs → neon-dialect-q-8lApt2.cjs} +1 -1
- package/dist/{node-sqlite-dialect-DpdAEbyp.cjs → node-sqlite-dialect-uTc3IyPv.cjs} +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as environmentsSchema, A as GuardrailResults, B as TableName, C as Environment, D as GuardrailConfig, E as EnvironmentsTable, F as ProviderConfigsTable, G as VariantVersion, H as TargetingRulesTable, I as ProviderGuardrailOverride, J as WorkspaceSettings, K as VariantVersionsTable, L as ProviderGuardrailOverridesTable, M as LLMRequest, N as LLMRequestsTable, O as GuardrailConfigsTable, P as ProviderConfig, Q as environmentSecretsSchema, R as SCHEMA_METADATA, S as Database, T as EnvironmentSecretsTable, U as Updateable, V as TargetingRule, W as Variant, X as configVariantsSchema, Y as WorkspaceSettingsTable, Z as configsSchema, _ as validateTableData, a as createDatabaseFromConnection, at as targetingRulesSchema, b as ConfigVariantsTable, c as executeWithSchema, ct as workspaceSettingsSchema, d as getMigrations, et as guardrailConfigsSchema, f as matchType, g as validatePartialTableData, h as parseTableData, i as createDatabase, it as schemas, j as Insertable, k as GuardrailResult, l as MigrationOptions, m as parsePartialTableData, n as DatabaseOptions, nt as providerConfigsSchema, o as detectDatabaseType, ot as variantVersionsSchema, p as runAutoMigrations, q as VariantsTable, r as DatabaseType, rt as providerGuardrailOverridesSchema, s as createNeonDialect, st as variantsSchema, t as DatabaseConnection, tt as llmRequestsSchema, u as MigrationResult, v as Config, w as EnvironmentSecret, x as ConfigsTable, y as ConfigVariant, z as Selectable } from "./index-BMN3ZSTf.mjs";
|
|
2
2
|
import gateway from "@llmops/gateway";
|
|
3
|
+
import * as kysely0 from "kysely";
|
|
3
4
|
import { Kysely } from "kysely";
|
|
4
5
|
import pino from "pino";
|
|
5
6
|
import { RulesLogic } from "json-logic-js";
|
|
6
|
-
import * as
|
|
7
|
+
import * as zod37 from "zod";
|
|
7
8
|
import z$1, { z } from "zod";
|
|
8
9
|
import * as better_auth0 from "better-auth";
|
|
9
10
|
import { BetterAuthOptions } from "better-auth";
|
|
@@ -1149,12 +1150,15 @@ declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
|
1149
1150
|
* Insert a single LLM request log
|
|
1150
1151
|
*/
|
|
1151
1152
|
insertRequest: (request: LLMRequestInsert) => Promise<{
|
|
1153
|
+
id: string;
|
|
1154
|
+
createdAt: Date;
|
|
1155
|
+
updatedAt: Date;
|
|
1152
1156
|
variantId: string | null;
|
|
1153
1157
|
provider: string;
|
|
1154
1158
|
environmentId: string | null;
|
|
1155
1159
|
configId: string | null;
|
|
1156
|
-
requestId: string;
|
|
1157
1160
|
providerConfigId: string | null;
|
|
1161
|
+
requestId: string;
|
|
1158
1162
|
model: string;
|
|
1159
1163
|
promptTokens: number;
|
|
1160
1164
|
completionTokens: number;
|
|
@@ -1169,9 +1173,17 @@ declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
|
1169
1173
|
isStreaming: boolean;
|
|
1170
1174
|
userId: string | null;
|
|
1171
1175
|
tags: Record<string, string>;
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1176
|
+
guardrailResults: {
|
|
1177
|
+
results: {
|
|
1178
|
+
configId: string;
|
|
1179
|
+
functionId: string;
|
|
1180
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1181
|
+
verdict: boolean;
|
|
1182
|
+
latencyMs: number;
|
|
1183
|
+
}[];
|
|
1184
|
+
action: "allowed" | "blocked" | "logged";
|
|
1185
|
+
totalLatencyMs: number;
|
|
1186
|
+
} | null;
|
|
1175
1187
|
} | undefined>;
|
|
1176
1188
|
/**
|
|
1177
1189
|
* List LLM requests with filtering and pagination
|
|
@@ -1179,12 +1191,15 @@ declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
|
1179
1191
|
*/
|
|
1180
1192
|
listRequests: (params?: z$1.infer<typeof listRequestsSchema>) => Promise<{
|
|
1181
1193
|
data: {
|
|
1194
|
+
id: string;
|
|
1195
|
+
createdAt: Date;
|
|
1196
|
+
updatedAt: Date;
|
|
1182
1197
|
variantId: string | null;
|
|
1183
1198
|
provider: string;
|
|
1184
1199
|
environmentId: string | null;
|
|
1185
1200
|
configId: string | null;
|
|
1186
|
-
requestId: string;
|
|
1187
1201
|
providerConfigId: string | null;
|
|
1202
|
+
requestId: string;
|
|
1188
1203
|
model: string;
|
|
1189
1204
|
promptTokens: number;
|
|
1190
1205
|
completionTokens: number;
|
|
@@ -1199,9 +1214,17 @@ declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
|
1199
1214
|
isStreaming: boolean;
|
|
1200
1215
|
userId: string | null;
|
|
1201
1216
|
tags: Record<string, string>;
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1217
|
+
guardrailResults: {
|
|
1218
|
+
results: {
|
|
1219
|
+
configId: string;
|
|
1220
|
+
functionId: string;
|
|
1221
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1222
|
+
verdict: boolean;
|
|
1223
|
+
latencyMs: number;
|
|
1224
|
+
}[];
|
|
1225
|
+
action: "allowed" | "blocked" | "logged";
|
|
1226
|
+
totalLatencyMs: number;
|
|
1227
|
+
} | null;
|
|
1205
1228
|
}[];
|
|
1206
1229
|
total: number;
|
|
1207
1230
|
limit: number;
|
|
@@ -1211,12 +1234,15 @@ declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
|
1211
1234
|
* Get a single request by requestId
|
|
1212
1235
|
*/
|
|
1213
1236
|
getRequestByRequestId: (requestId: string) => Promise<{
|
|
1237
|
+
id: string;
|
|
1238
|
+
createdAt: Date;
|
|
1239
|
+
updatedAt: Date;
|
|
1214
1240
|
variantId: string | null;
|
|
1215
1241
|
provider: string;
|
|
1216
1242
|
environmentId: string | null;
|
|
1217
1243
|
configId: string | null;
|
|
1218
|
-
requestId: string;
|
|
1219
1244
|
providerConfigId: string | null;
|
|
1245
|
+
requestId: string;
|
|
1220
1246
|
model: string;
|
|
1221
1247
|
promptTokens: number;
|
|
1222
1248
|
completionTokens: number;
|
|
@@ -1231,9 +1257,17 @@ declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
|
1231
1257
|
isStreaming: boolean;
|
|
1232
1258
|
userId: string | null;
|
|
1233
1259
|
tags: Record<string, string>;
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1260
|
+
guardrailResults: {
|
|
1261
|
+
results: {
|
|
1262
|
+
configId: string;
|
|
1263
|
+
functionId: string;
|
|
1264
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1265
|
+
verdict: boolean;
|
|
1266
|
+
latencyMs: number;
|
|
1267
|
+
}[];
|
|
1268
|
+
action: "allowed" | "blocked" | "logged";
|
|
1269
|
+
totalLatencyMs: number;
|
|
1270
|
+
} | null;
|
|
1237
1271
|
} | undefined>;
|
|
1238
1272
|
/**
|
|
1239
1273
|
* Get total cost for a date range with optional filters
|
|
@@ -1338,22 +1372,22 @@ declare const createWorkspaceSettingsDataLayer: (db: Kysely<Database>) => {
|
|
|
1338
1372
|
*/
|
|
1339
1373
|
getWorkspaceSettings: () => Promise<{
|
|
1340
1374
|
name: string | null;
|
|
1341
|
-
setupComplete: boolean;
|
|
1342
|
-
superAdminId: string | null;
|
|
1343
1375
|
id: string;
|
|
1344
1376
|
createdAt: Date;
|
|
1345
1377
|
updatedAt: Date;
|
|
1378
|
+
setupComplete: boolean;
|
|
1379
|
+
superAdminId: string | null;
|
|
1346
1380
|
} | undefined>;
|
|
1347
1381
|
/**
|
|
1348
1382
|
* Update workspace settings
|
|
1349
1383
|
*/
|
|
1350
1384
|
updateWorkspaceSettings: (params: z$1.infer<typeof updateWorkspaceSettings>) => Promise<{
|
|
1351
1385
|
name: string | null;
|
|
1352
|
-
setupComplete: boolean;
|
|
1353
|
-
superAdminId: string | null;
|
|
1354
1386
|
id: string;
|
|
1355
1387
|
createdAt: Date;
|
|
1356
1388
|
updatedAt: Date;
|
|
1389
|
+
setupComplete: boolean;
|
|
1390
|
+
superAdminId: string | null;
|
|
1357
1391
|
} | undefined>;
|
|
1358
1392
|
/**
|
|
1359
1393
|
* Get the super admin user ID
|
|
@@ -1372,11 +1406,11 @@ declare const createWorkspaceSettingsDataLayer: (db: Kysely<Database>) => {
|
|
|
1372
1406
|
*/
|
|
1373
1407
|
markSetupComplete: () => Promise<{
|
|
1374
1408
|
name: string | null;
|
|
1375
|
-
setupComplete: boolean;
|
|
1376
|
-
superAdminId: string | null;
|
|
1377
1409
|
id: string;
|
|
1378
1410
|
createdAt: Date;
|
|
1379
1411
|
updatedAt: Date;
|
|
1412
|
+
setupComplete: boolean;
|
|
1413
|
+
superAdminId: string | null;
|
|
1380
1414
|
} | undefined>;
|
|
1381
1415
|
};
|
|
1382
1416
|
//#endregion
|
|
@@ -1415,72 +1449,72 @@ declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
|
1415
1449
|
createProviderConfig: (params: z$1.infer<typeof createProviderConfig>) => Promise<{
|
|
1416
1450
|
slug: string | null;
|
|
1417
1451
|
name: string | null;
|
|
1418
|
-
enabled: boolean;
|
|
1419
|
-
providerId: string;
|
|
1420
|
-
config: Record<string, unknown>;
|
|
1421
1452
|
id: string;
|
|
1422
1453
|
createdAt: Date;
|
|
1423
1454
|
updatedAt: Date;
|
|
1455
|
+
enabled: boolean;
|
|
1456
|
+
providerId: string;
|
|
1457
|
+
config: Record<string, unknown>;
|
|
1424
1458
|
} | undefined>;
|
|
1425
1459
|
updateProviderConfig: (params: z$1.infer<typeof updateProviderConfig>) => Promise<{
|
|
1426
1460
|
slug: string | null;
|
|
1427
1461
|
name: string | null;
|
|
1428
|
-
enabled: boolean;
|
|
1429
|
-
providerId: string;
|
|
1430
|
-
config: Record<string, unknown>;
|
|
1431
1462
|
id: string;
|
|
1432
1463
|
createdAt: Date;
|
|
1433
1464
|
updatedAt: Date;
|
|
1465
|
+
enabled: boolean;
|
|
1466
|
+
providerId: string;
|
|
1467
|
+
config: Record<string, unknown>;
|
|
1434
1468
|
} | undefined>;
|
|
1435
1469
|
getProviderConfigById: (params: z$1.infer<typeof getProviderConfigById>) => Promise<{
|
|
1436
1470
|
slug: string | null;
|
|
1437
1471
|
name: string | null;
|
|
1438
|
-
enabled: boolean;
|
|
1439
|
-
providerId: string;
|
|
1440
|
-
config: Record<string, unknown>;
|
|
1441
1472
|
id: string;
|
|
1442
1473
|
createdAt: Date;
|
|
1443
1474
|
updatedAt: Date;
|
|
1475
|
+
enabled: boolean;
|
|
1476
|
+
providerId: string;
|
|
1477
|
+
config: Record<string, unknown>;
|
|
1444
1478
|
} | undefined>;
|
|
1445
1479
|
getProviderConfigByProviderId: (params: z$1.infer<typeof getProviderConfigByProviderId>) => Promise<{
|
|
1446
1480
|
slug: string | null;
|
|
1447
1481
|
name: string | null;
|
|
1448
|
-
enabled: boolean;
|
|
1449
|
-
providerId: string;
|
|
1450
|
-
config: Record<string, unknown>;
|
|
1451
1482
|
id: string;
|
|
1452
1483
|
createdAt: Date;
|
|
1453
1484
|
updatedAt: Date;
|
|
1485
|
+
enabled: boolean;
|
|
1486
|
+
providerId: string;
|
|
1487
|
+
config: Record<string, unknown>;
|
|
1454
1488
|
} | undefined>;
|
|
1455
1489
|
getProviderConfigBySlug: (params: z$1.infer<typeof getProviderConfigBySlug>) => Promise<{
|
|
1456
1490
|
slug: string | null;
|
|
1457
1491
|
name: string | null;
|
|
1458
|
-
enabled: boolean;
|
|
1459
|
-
providerId: string;
|
|
1460
|
-
config: Record<string, unknown>;
|
|
1461
1492
|
id: string;
|
|
1462
1493
|
createdAt: Date;
|
|
1463
1494
|
updatedAt: Date;
|
|
1495
|
+
enabled: boolean;
|
|
1496
|
+
providerId: string;
|
|
1497
|
+
config: Record<string, unknown>;
|
|
1464
1498
|
} | undefined>;
|
|
1465
1499
|
deleteProviderConfig: (params: z$1.infer<typeof deleteProviderConfig>) => Promise<{
|
|
1466
1500
|
slug: string | null;
|
|
1467
1501
|
name: string | null;
|
|
1468
|
-
enabled: boolean;
|
|
1469
|
-
providerId: string;
|
|
1470
|
-
config: Record<string, unknown>;
|
|
1471
1502
|
id: string;
|
|
1472
1503
|
createdAt: Date;
|
|
1473
1504
|
updatedAt: Date;
|
|
1505
|
+
enabled: boolean;
|
|
1506
|
+
providerId: string;
|
|
1507
|
+
config: Record<string, unknown>;
|
|
1474
1508
|
} | undefined>;
|
|
1475
1509
|
listProviderConfigs: (params?: z$1.infer<typeof listProviderConfigs>) => Promise<{
|
|
1476
1510
|
slug: string | null;
|
|
1477
1511
|
name: string | null;
|
|
1478
|
-
enabled: boolean;
|
|
1479
|
-
providerId: string;
|
|
1480
|
-
config: Record<string, unknown>;
|
|
1481
1512
|
id: string;
|
|
1482
1513
|
createdAt: Date;
|
|
1483
1514
|
updatedAt: Date;
|
|
1515
|
+
enabled: boolean;
|
|
1516
|
+
providerId: string;
|
|
1517
|
+
config: Record<string, unknown>;
|
|
1484
1518
|
}[]>;
|
|
1485
1519
|
countProviderConfigs: () => Promise<number>;
|
|
1486
1520
|
/**
|
|
@@ -1490,255 +1524,502 @@ declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
|
1490
1524
|
upsertProviderConfig: (params: z$1.infer<typeof createProviderConfig>) => Promise<{
|
|
1491
1525
|
slug: string | null;
|
|
1492
1526
|
name: string | null;
|
|
1527
|
+
id: string;
|
|
1528
|
+
createdAt: Date;
|
|
1529
|
+
updatedAt: Date;
|
|
1493
1530
|
enabled: boolean;
|
|
1494
1531
|
providerId: string;
|
|
1495
1532
|
config: Record<string, unknown>;
|
|
1533
|
+
} | undefined>;
|
|
1534
|
+
};
|
|
1535
|
+
//#endregion
|
|
1536
|
+
//#region src/datalayer/guardrailConfigs.d.ts
|
|
1537
|
+
declare const createGuardrailConfig: z$1.ZodObject<{
|
|
1538
|
+
name: z$1.ZodString;
|
|
1539
|
+
pluginId: z$1.ZodString;
|
|
1540
|
+
functionId: z$1.ZodString;
|
|
1541
|
+
hookType: z$1.ZodEnum<{
|
|
1542
|
+
beforeRequestHook: "beforeRequestHook";
|
|
1543
|
+
afterRequestHook: "afterRequestHook";
|
|
1544
|
+
}>;
|
|
1545
|
+
parameters: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1546
|
+
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1547
|
+
priority: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
1548
|
+
onFail: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1549
|
+
block: "block";
|
|
1550
|
+
log: "log";
|
|
1551
|
+
}>>>;
|
|
1552
|
+
}, z$1.core.$strip>;
|
|
1553
|
+
declare const updateGuardrailConfig: z$1.ZodObject<{
|
|
1554
|
+
id: z$1.ZodString;
|
|
1555
|
+
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1556
|
+
hookType: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1557
|
+
beforeRequestHook: "beforeRequestHook";
|
|
1558
|
+
afterRequestHook: "afterRequestHook";
|
|
1559
|
+
}>>;
|
|
1560
|
+
parameters: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1561
|
+
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1562
|
+
priority: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1563
|
+
onFail: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1564
|
+
block: "block";
|
|
1565
|
+
log: "log";
|
|
1566
|
+
}>>;
|
|
1567
|
+
}, z$1.core.$strip>;
|
|
1568
|
+
declare const getGuardrailConfigById: z$1.ZodObject<{
|
|
1569
|
+
id: z$1.ZodString;
|
|
1570
|
+
}, z$1.core.$strip>;
|
|
1571
|
+
declare const deleteGuardrailConfig: z$1.ZodObject<{
|
|
1572
|
+
id: z$1.ZodString;
|
|
1573
|
+
}, z$1.core.$strip>;
|
|
1574
|
+
declare const listGuardrailConfigs: z$1.ZodObject<{
|
|
1575
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1576
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1577
|
+
hookType: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1578
|
+
beforeRequestHook: "beforeRequestHook";
|
|
1579
|
+
afterRequestHook: "afterRequestHook";
|
|
1580
|
+
}>>;
|
|
1581
|
+
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1582
|
+
}, z$1.core.$strip>;
|
|
1583
|
+
declare const createGuardrailConfigsDataLayer: (db: Kysely<Database>) => {
|
|
1584
|
+
createGuardrailConfig: (params: z$1.infer<typeof createGuardrailConfig>) => Promise<{
|
|
1585
|
+
name: string;
|
|
1496
1586
|
id: string;
|
|
1497
1587
|
createdAt: Date;
|
|
1498
1588
|
updatedAt: Date;
|
|
1589
|
+
priority: number;
|
|
1590
|
+
enabled: boolean;
|
|
1591
|
+
pluginId: string;
|
|
1592
|
+
functionId: string;
|
|
1593
|
+
hookType: string;
|
|
1594
|
+
parameters: Record<string, unknown>;
|
|
1595
|
+
onFail: string;
|
|
1499
1596
|
} | undefined>;
|
|
1597
|
+
updateGuardrailConfig: (params: z$1.infer<typeof updateGuardrailConfig>) => Promise<{
|
|
1598
|
+
name: string;
|
|
1599
|
+
id: string;
|
|
1600
|
+
createdAt: Date;
|
|
1601
|
+
updatedAt: Date;
|
|
1602
|
+
priority: number;
|
|
1603
|
+
enabled: boolean;
|
|
1604
|
+
pluginId: string;
|
|
1605
|
+
functionId: string;
|
|
1606
|
+
hookType: string;
|
|
1607
|
+
parameters: Record<string, unknown>;
|
|
1608
|
+
onFail: string;
|
|
1609
|
+
} | undefined>;
|
|
1610
|
+
getGuardrailConfigById: (params: z$1.infer<typeof getGuardrailConfigById>) => Promise<{
|
|
1611
|
+
name: string;
|
|
1612
|
+
id: string;
|
|
1613
|
+
createdAt: Date;
|
|
1614
|
+
updatedAt: Date;
|
|
1615
|
+
priority: number;
|
|
1616
|
+
enabled: boolean;
|
|
1617
|
+
pluginId: string;
|
|
1618
|
+
functionId: string;
|
|
1619
|
+
hookType: string;
|
|
1620
|
+
parameters: Record<string, unknown>;
|
|
1621
|
+
onFail: string;
|
|
1622
|
+
} | undefined>;
|
|
1623
|
+
deleteGuardrailConfig: (params: z$1.infer<typeof deleteGuardrailConfig>) => Promise<{
|
|
1624
|
+
name: string;
|
|
1625
|
+
id: string;
|
|
1626
|
+
createdAt: Date;
|
|
1627
|
+
updatedAt: Date;
|
|
1628
|
+
priority: number;
|
|
1629
|
+
enabled: boolean;
|
|
1630
|
+
pluginId: string;
|
|
1631
|
+
functionId: string;
|
|
1632
|
+
hookType: string;
|
|
1633
|
+
parameters: Record<string, unknown>;
|
|
1634
|
+
onFail: string;
|
|
1635
|
+
} | undefined>;
|
|
1636
|
+
listGuardrailConfigs: (params?: z$1.infer<typeof listGuardrailConfigs>) => Promise<{
|
|
1637
|
+
name: string;
|
|
1638
|
+
id: string;
|
|
1639
|
+
createdAt: Date;
|
|
1640
|
+
updatedAt: Date;
|
|
1641
|
+
priority: number;
|
|
1642
|
+
enabled: boolean;
|
|
1643
|
+
pluginId: string;
|
|
1644
|
+
functionId: string;
|
|
1645
|
+
hookType: string;
|
|
1646
|
+
parameters: Record<string, unknown>;
|
|
1647
|
+
onFail: string;
|
|
1648
|
+
}[]>;
|
|
1649
|
+
countGuardrailConfigs: () => Promise<number>;
|
|
1650
|
+
/**
|
|
1651
|
+
* Get all enabled guardrails for a specific hook type
|
|
1652
|
+
* Ordered by priority (highest first)
|
|
1653
|
+
*/
|
|
1654
|
+
getEnabledGuardrailsByHookType: (hookType: "beforeRequestHook" | "afterRequestHook") => Promise<{
|
|
1655
|
+
name: string;
|
|
1656
|
+
id: string;
|
|
1657
|
+
createdAt: Date;
|
|
1658
|
+
updatedAt: Date;
|
|
1659
|
+
priority: number;
|
|
1660
|
+
enabled: boolean;
|
|
1661
|
+
pluginId: string;
|
|
1662
|
+
functionId: string;
|
|
1663
|
+
hookType: string;
|
|
1664
|
+
parameters: Record<string, unknown>;
|
|
1665
|
+
onFail: string;
|
|
1666
|
+
}[]>;
|
|
1667
|
+
};
|
|
1668
|
+
//#endregion
|
|
1669
|
+
//#region src/datalayer/providerGuardrailOverrides.d.ts
|
|
1670
|
+
declare const createProviderGuardrailOverride: z$1.ZodObject<{
|
|
1671
|
+
providerConfigId: z$1.ZodString;
|
|
1672
|
+
guardrailConfigId: z$1.ZodString;
|
|
1673
|
+
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1674
|
+
parameters: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1675
|
+
}, z$1.core.$strip>;
|
|
1676
|
+
declare const updateProviderGuardrailOverride: z$1.ZodObject<{
|
|
1677
|
+
id: z$1.ZodString;
|
|
1678
|
+
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1679
|
+
parameters: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1680
|
+
}, z$1.core.$strip>;
|
|
1681
|
+
declare const getOverrideById: z$1.ZodObject<{
|
|
1682
|
+
id: z$1.ZodString;
|
|
1683
|
+
}, z$1.core.$strip>;
|
|
1684
|
+
declare const deleteOverride: z$1.ZodObject<{
|
|
1685
|
+
id: z$1.ZodString;
|
|
1686
|
+
}, z$1.core.$strip>;
|
|
1687
|
+
declare const getOverridesByProviderConfigId: z$1.ZodObject<{
|
|
1688
|
+
providerConfigId: z$1.ZodString;
|
|
1689
|
+
}, z$1.core.$strip>;
|
|
1690
|
+
declare const getOverridesByGuardrailConfigId: z$1.ZodObject<{
|
|
1691
|
+
guardrailConfigId: z$1.ZodString;
|
|
1692
|
+
}, z$1.core.$strip>;
|
|
1693
|
+
declare const getOverrideByProviderAndGuardrail: z$1.ZodObject<{
|
|
1694
|
+
providerConfigId: z$1.ZodString;
|
|
1695
|
+
guardrailConfigId: z$1.ZodString;
|
|
1696
|
+
}, z$1.core.$strip>;
|
|
1697
|
+
declare const createProviderGuardrailOverridesDataLayer: (db: Kysely<Database>) => {
|
|
1698
|
+
createProviderGuardrailOverride: (params: z$1.infer<typeof createProviderGuardrailOverride>) => Promise<{
|
|
1699
|
+
id: string;
|
|
1700
|
+
createdAt: Date;
|
|
1701
|
+
updatedAt: Date;
|
|
1702
|
+
enabled: boolean;
|
|
1703
|
+
parameters: Record<string, unknown> | null;
|
|
1704
|
+
providerConfigId: string;
|
|
1705
|
+
guardrailConfigId: string;
|
|
1706
|
+
} | undefined>;
|
|
1707
|
+
updateProviderGuardrailOverride: (params: z$1.infer<typeof updateProviderGuardrailOverride>) => Promise<{
|
|
1708
|
+
id: string;
|
|
1709
|
+
createdAt: Date;
|
|
1710
|
+
updatedAt: Date;
|
|
1711
|
+
enabled: boolean;
|
|
1712
|
+
parameters: Record<string, unknown> | null;
|
|
1713
|
+
providerConfigId: string;
|
|
1714
|
+
guardrailConfigId: string;
|
|
1715
|
+
} | undefined>;
|
|
1716
|
+
getOverrideById: (params: z$1.infer<typeof getOverrideById>) => Promise<{
|
|
1717
|
+
id: string;
|
|
1718
|
+
createdAt: Date;
|
|
1719
|
+
updatedAt: Date;
|
|
1720
|
+
enabled: boolean;
|
|
1721
|
+
parameters: Record<string, unknown> | null;
|
|
1722
|
+
providerConfigId: string;
|
|
1723
|
+
guardrailConfigId: string;
|
|
1724
|
+
} | undefined>;
|
|
1725
|
+
deleteProviderGuardrailOverride: (params: z$1.infer<typeof deleteOverride>) => Promise<{
|
|
1726
|
+
id: string;
|
|
1727
|
+
createdAt: Date;
|
|
1728
|
+
updatedAt: Date;
|
|
1729
|
+
enabled: boolean;
|
|
1730
|
+
parameters: Record<string, unknown> | null;
|
|
1731
|
+
providerConfigId: string;
|
|
1732
|
+
guardrailConfigId: string;
|
|
1733
|
+
} | undefined>;
|
|
1734
|
+
getOverridesByProviderConfigId: (params: z$1.infer<typeof getOverridesByProviderConfigId>) => Promise<{
|
|
1735
|
+
id: string;
|
|
1736
|
+
createdAt: Date;
|
|
1737
|
+
updatedAt: Date;
|
|
1738
|
+
enabled: boolean;
|
|
1739
|
+
parameters: Record<string, unknown> | null;
|
|
1740
|
+
providerConfigId: string;
|
|
1741
|
+
guardrailConfigId: string;
|
|
1742
|
+
}[]>;
|
|
1743
|
+
getOverridesByGuardrailConfigId: (params: z$1.infer<typeof getOverridesByGuardrailConfigId>) => Promise<{
|
|
1744
|
+
id: string;
|
|
1745
|
+
createdAt: Date;
|
|
1746
|
+
updatedAt: Date;
|
|
1747
|
+
enabled: boolean;
|
|
1748
|
+
parameters: Record<string, unknown> | null;
|
|
1749
|
+
providerConfigId: string;
|
|
1750
|
+
guardrailConfigId: string;
|
|
1751
|
+
}[]>;
|
|
1752
|
+
getOverrideByProviderAndGuardrail: (params: z$1.infer<typeof getOverrideByProviderAndGuardrail>) => Promise<{
|
|
1753
|
+
id: string;
|
|
1754
|
+
createdAt: Date;
|
|
1755
|
+
updatedAt: Date;
|
|
1756
|
+
enabled: boolean;
|
|
1757
|
+
parameters: Record<string, unknown> | null;
|
|
1758
|
+
providerConfigId: string;
|
|
1759
|
+
guardrailConfigId: string;
|
|
1760
|
+
} | undefined>;
|
|
1761
|
+
/**
|
|
1762
|
+
* Upsert provider guardrail override - creates if not exists, updates if exists
|
|
1763
|
+
*/
|
|
1764
|
+
upsertProviderGuardrailOverride: (params: z$1.infer<typeof createProviderGuardrailOverride>) => Promise<{
|
|
1765
|
+
id: string;
|
|
1766
|
+
createdAt: Date;
|
|
1767
|
+
updatedAt: Date;
|
|
1768
|
+
enabled: boolean;
|
|
1769
|
+
parameters: Record<string, unknown> | null;
|
|
1770
|
+
providerConfigId: string;
|
|
1771
|
+
guardrailConfigId: string;
|
|
1772
|
+
} | undefined>;
|
|
1773
|
+
/**
|
|
1774
|
+
* Delete all overrides for a guardrail config
|
|
1775
|
+
* Useful when deleting a guardrail config
|
|
1776
|
+
*/
|
|
1777
|
+
deleteOverridesByGuardrailConfigId: (params: z$1.infer<typeof getOverridesByGuardrailConfigId>) => Promise<kysely0.DeleteResult[]>;
|
|
1500
1778
|
};
|
|
1501
1779
|
//#endregion
|
|
1502
1780
|
//#region src/datalayer/index.d.ts
|
|
1503
1781
|
declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
1504
1782
|
getWorkspaceSettings: () => Promise<{
|
|
1505
1783
|
name: string | null;
|
|
1506
|
-
setupComplete: boolean;
|
|
1507
|
-
superAdminId: string | null;
|
|
1508
1784
|
id: string;
|
|
1509
1785
|
createdAt: Date;
|
|
1510
1786
|
updatedAt: Date;
|
|
1787
|
+
setupComplete: boolean;
|
|
1788
|
+
superAdminId: string | null;
|
|
1511
1789
|
} | undefined>;
|
|
1512
|
-
updateWorkspaceSettings: (params:
|
|
1513
|
-
name:
|
|
1514
|
-
setupComplete:
|
|
1515
|
-
superAdminId:
|
|
1790
|
+
updateWorkspaceSettings: (params: zod37.infer<zod37.ZodObject<{
|
|
1791
|
+
name: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodString>>;
|
|
1792
|
+
setupComplete: zod37.ZodOptional<zod37.ZodBoolean>;
|
|
1793
|
+
superAdminId: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodString>>;
|
|
1516
1794
|
}, better_auth0.$strip>>) => Promise<{
|
|
1517
1795
|
name: string | null;
|
|
1518
|
-
setupComplete: boolean;
|
|
1519
|
-
superAdminId: string | null;
|
|
1520
1796
|
id: string;
|
|
1521
1797
|
createdAt: Date;
|
|
1522
1798
|
updatedAt: Date;
|
|
1799
|
+
setupComplete: boolean;
|
|
1800
|
+
superAdminId: string | null;
|
|
1523
1801
|
} | undefined>;
|
|
1524
1802
|
getSuperAdminId: () => Promise<string | null>;
|
|
1525
1803
|
setSuperAdminId: (userId: string) => Promise<boolean>;
|
|
1526
1804
|
isSetupComplete: () => Promise<boolean>;
|
|
1527
1805
|
markSetupComplete: () => Promise<{
|
|
1528
1806
|
name: string | null;
|
|
1529
|
-
setupComplete: boolean;
|
|
1530
|
-
superAdminId: string | null;
|
|
1531
1807
|
id: string;
|
|
1532
1808
|
createdAt: Date;
|
|
1533
1809
|
updatedAt: Date;
|
|
1810
|
+
setupComplete: boolean;
|
|
1811
|
+
superAdminId: string | null;
|
|
1534
1812
|
} | undefined>;
|
|
1535
|
-
createVariantVersion: (params:
|
|
1536
|
-
variantId:
|
|
1537
|
-
provider:
|
|
1538
|
-
modelName:
|
|
1539
|
-
jsonData:
|
|
1813
|
+
createVariantVersion: (params: zod37.infer<zod37.ZodObject<{
|
|
1814
|
+
variantId: zod37.ZodString;
|
|
1815
|
+
provider: zod37.ZodString;
|
|
1816
|
+
modelName: zod37.ZodString;
|
|
1817
|
+
jsonData: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>>>;
|
|
1540
1818
|
}, better_auth0.$strip>>) => Promise<{
|
|
1541
1819
|
version: number;
|
|
1820
|
+
id: string;
|
|
1821
|
+
createdAt: Date;
|
|
1822
|
+
updatedAt: Date;
|
|
1542
1823
|
variantId: string;
|
|
1543
1824
|
provider: string;
|
|
1544
1825
|
modelName: string;
|
|
1545
1826
|
jsonData: Record<string, unknown>;
|
|
1546
|
-
id: string;
|
|
1547
|
-
createdAt: Date;
|
|
1548
|
-
updatedAt: Date;
|
|
1549
1827
|
} | undefined>;
|
|
1550
|
-
getVariantVersionById: (params:
|
|
1551
|
-
id:
|
|
1828
|
+
getVariantVersionById: (params: zod37.infer<zod37.ZodObject<{
|
|
1829
|
+
id: zod37.ZodString;
|
|
1552
1830
|
}, better_auth0.$strip>>) => Promise<{
|
|
1553
1831
|
version: number;
|
|
1832
|
+
id: string;
|
|
1833
|
+
createdAt: Date;
|
|
1834
|
+
updatedAt: Date;
|
|
1554
1835
|
variantId: string;
|
|
1555
1836
|
provider: string;
|
|
1556
1837
|
modelName: string;
|
|
1557
1838
|
jsonData: Record<string, unknown>;
|
|
1558
|
-
id: string;
|
|
1559
|
-
createdAt: Date;
|
|
1560
|
-
updatedAt: Date;
|
|
1561
1839
|
} | undefined>;
|
|
1562
|
-
getVariantVersionsByVariantId: (params:
|
|
1563
|
-
variantId:
|
|
1564
|
-
limit:
|
|
1565
|
-
offset:
|
|
1840
|
+
getVariantVersionsByVariantId: (params: zod37.infer<zod37.ZodObject<{
|
|
1841
|
+
variantId: zod37.ZodString;
|
|
1842
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
1843
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
1566
1844
|
}, better_auth0.$strip>>) => Promise<{
|
|
1567
1845
|
version: number;
|
|
1846
|
+
id: string;
|
|
1847
|
+
createdAt: Date;
|
|
1848
|
+
updatedAt: Date;
|
|
1568
1849
|
variantId: string;
|
|
1569
1850
|
provider: string;
|
|
1570
1851
|
modelName: string;
|
|
1571
1852
|
jsonData: Record<string, unknown>;
|
|
1572
|
-
id: string;
|
|
1573
|
-
createdAt: Date;
|
|
1574
|
-
updatedAt: Date;
|
|
1575
1853
|
}[]>;
|
|
1576
|
-
getLatestVariantVersion: (params:
|
|
1577
|
-
variantId:
|
|
1854
|
+
getLatestVariantVersion: (params: zod37.infer<zod37.ZodObject<{
|
|
1855
|
+
variantId: zod37.ZodString;
|
|
1578
1856
|
}, better_auth0.$strip>>) => Promise<{
|
|
1579
1857
|
version: number;
|
|
1858
|
+
id: string;
|
|
1859
|
+
createdAt: Date;
|
|
1860
|
+
updatedAt: Date;
|
|
1580
1861
|
variantId: string;
|
|
1581
1862
|
provider: string;
|
|
1582
1863
|
modelName: string;
|
|
1583
1864
|
jsonData: Record<string, unknown>;
|
|
1584
|
-
id: string;
|
|
1585
|
-
createdAt: Date;
|
|
1586
|
-
updatedAt: Date;
|
|
1587
1865
|
} | undefined>;
|
|
1588
|
-
getVariantVersionByNumber: (params:
|
|
1589
|
-
variantId:
|
|
1590
|
-
version:
|
|
1866
|
+
getVariantVersionByNumber: (params: zod37.infer<zod37.ZodObject<{
|
|
1867
|
+
variantId: zod37.ZodString;
|
|
1868
|
+
version: zod37.ZodNumber;
|
|
1591
1869
|
}, better_auth0.$strip>>) => Promise<{
|
|
1592
1870
|
version: number;
|
|
1871
|
+
id: string;
|
|
1872
|
+
createdAt: Date;
|
|
1873
|
+
updatedAt: Date;
|
|
1593
1874
|
variantId: string;
|
|
1594
1875
|
provider: string;
|
|
1595
1876
|
modelName: string;
|
|
1596
1877
|
jsonData: Record<string, unknown>;
|
|
1597
|
-
id: string;
|
|
1598
|
-
createdAt: Date;
|
|
1599
|
-
updatedAt: Date;
|
|
1600
1878
|
} | undefined>;
|
|
1601
|
-
deleteVariantVersion: (params:
|
|
1602
|
-
id:
|
|
1879
|
+
deleteVariantVersion: (params: zod37.infer<zod37.ZodObject<{
|
|
1880
|
+
id: zod37.ZodString;
|
|
1603
1881
|
}, better_auth0.$strip>>) => Promise<{
|
|
1604
1882
|
version: number;
|
|
1883
|
+
id: string;
|
|
1884
|
+
createdAt: Date;
|
|
1885
|
+
updatedAt: Date;
|
|
1605
1886
|
variantId: string;
|
|
1606
1887
|
provider: string;
|
|
1607
1888
|
modelName: string;
|
|
1608
1889
|
jsonData: Record<string, unknown>;
|
|
1609
|
-
id: string;
|
|
1610
|
-
createdAt: Date;
|
|
1611
|
-
updatedAt: Date;
|
|
1612
1890
|
} | undefined>;
|
|
1613
|
-
deleteVariantVersionsByVariantId: (params:
|
|
1614
|
-
variantId:
|
|
1891
|
+
deleteVariantVersionsByVariantId: (params: zod37.infer<zod37.ZodObject<{
|
|
1892
|
+
variantId: zod37.ZodString;
|
|
1615
1893
|
}, better_auth0.$strip>>) => Promise<{
|
|
1616
1894
|
version: number;
|
|
1895
|
+
id: string;
|
|
1896
|
+
createdAt: Date;
|
|
1897
|
+
updatedAt: Date;
|
|
1617
1898
|
variantId: string;
|
|
1618
1899
|
provider: string;
|
|
1619
1900
|
modelName: string;
|
|
1620
1901
|
jsonData: Record<string, unknown>;
|
|
1621
|
-
id: string;
|
|
1622
|
-
createdAt: Date;
|
|
1623
|
-
updatedAt: Date;
|
|
1624
1902
|
}[]>;
|
|
1625
|
-
getVariantVersionWithVariant: (params:
|
|
1626
|
-
id:
|
|
1903
|
+
getVariantVersionWithVariant: (params: zod37.infer<zod37.ZodObject<{
|
|
1904
|
+
id: zod37.ZodString;
|
|
1627
1905
|
}, better_auth0.$strip>>) => Promise<{
|
|
1628
1906
|
version: number;
|
|
1907
|
+
id: string;
|
|
1908
|
+
createdAt: Date;
|
|
1909
|
+
updatedAt: Date;
|
|
1629
1910
|
variantId: string;
|
|
1630
1911
|
provider: string;
|
|
1631
1912
|
modelName: string;
|
|
1632
1913
|
jsonData: Record<string, unknown>;
|
|
1633
|
-
id: string;
|
|
1634
|
-
createdAt: Date;
|
|
1635
|
-
updatedAt: Date;
|
|
1636
1914
|
variantName: string;
|
|
1637
1915
|
} | undefined>;
|
|
1638
|
-
getVariantVersionsWithVariantByVariantId: (params:
|
|
1639
|
-
variantId:
|
|
1640
|
-
limit:
|
|
1641
|
-
offset:
|
|
1916
|
+
getVariantVersionsWithVariantByVariantId: (params: zod37.infer<zod37.ZodObject<{
|
|
1917
|
+
variantId: zod37.ZodString;
|
|
1918
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
1919
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
1642
1920
|
}, better_auth0.$strip>>) => Promise<{
|
|
1643
1921
|
version: number;
|
|
1922
|
+
id: string;
|
|
1923
|
+
createdAt: Date;
|
|
1924
|
+
updatedAt: Date;
|
|
1644
1925
|
variantId: string;
|
|
1645
1926
|
provider: string;
|
|
1646
1927
|
modelName: string;
|
|
1647
1928
|
jsonData: Record<string, unknown>;
|
|
1648
|
-
id: string;
|
|
1649
|
-
createdAt: Date;
|
|
1650
|
-
updatedAt: Date;
|
|
1651
1929
|
variantName: string;
|
|
1652
1930
|
}[]>;
|
|
1653
|
-
createVariant: (params:
|
|
1654
|
-
name:
|
|
1931
|
+
createVariant: (params: zod37.infer<zod37.ZodObject<{
|
|
1932
|
+
name: zod37.ZodString;
|
|
1655
1933
|
}, better_auth0.$strip>>) => Promise<{
|
|
1656
1934
|
name: string;
|
|
1657
1935
|
id: string;
|
|
1658
1936
|
createdAt: Date;
|
|
1659
1937
|
updatedAt: Date;
|
|
1660
1938
|
} | undefined>;
|
|
1661
|
-
updateVariant: (params:
|
|
1662
|
-
variantId:
|
|
1663
|
-
name:
|
|
1939
|
+
updateVariant: (params: zod37.infer<zod37.ZodObject<{
|
|
1940
|
+
variantId: zod37.ZodString;
|
|
1941
|
+
name: zod37.ZodOptional<zod37.ZodString>;
|
|
1664
1942
|
}, better_auth0.$strip>>) => Promise<{
|
|
1665
1943
|
name: string;
|
|
1666
1944
|
id: string;
|
|
1667
1945
|
createdAt: Date;
|
|
1668
1946
|
updatedAt: Date;
|
|
1669
1947
|
} | undefined>;
|
|
1670
|
-
getVariantById: (params:
|
|
1671
|
-
variantId:
|
|
1948
|
+
getVariantById: (params: zod37.infer<zod37.ZodObject<{
|
|
1949
|
+
variantId: zod37.ZodString;
|
|
1672
1950
|
}, better_auth0.$strip>>) => Promise<{
|
|
1673
1951
|
name: string;
|
|
1674
1952
|
id: string;
|
|
1675
1953
|
createdAt: Date;
|
|
1676
1954
|
updatedAt: Date;
|
|
1677
1955
|
} | undefined>;
|
|
1678
|
-
getVariantWithLatestVersion: (params:
|
|
1679
|
-
variantId:
|
|
1956
|
+
getVariantWithLatestVersion: (params: zod37.infer<zod37.ZodObject<{
|
|
1957
|
+
variantId: zod37.ZodString;
|
|
1680
1958
|
}, better_auth0.$strip>>) => Promise<{
|
|
1681
1959
|
latestVersion: {
|
|
1682
1960
|
version: number;
|
|
1961
|
+
id: string;
|
|
1962
|
+
createdAt: Date;
|
|
1963
|
+
updatedAt: Date;
|
|
1683
1964
|
variantId: string;
|
|
1684
1965
|
provider: string;
|
|
1685
1966
|
modelName: string;
|
|
1686
1967
|
jsonData: Record<string, unknown>;
|
|
1687
|
-
id: string;
|
|
1688
|
-
createdAt: Date;
|
|
1689
|
-
updatedAt: Date;
|
|
1690
1968
|
} | null;
|
|
1691
1969
|
name: string;
|
|
1692
1970
|
id: string;
|
|
1693
1971
|
createdAt: Date;
|
|
1694
1972
|
updatedAt: Date;
|
|
1695
1973
|
} | undefined>;
|
|
1696
|
-
deleteVariant: (params:
|
|
1697
|
-
variantId:
|
|
1974
|
+
deleteVariant: (params: zod37.infer<zod37.ZodObject<{
|
|
1975
|
+
variantId: zod37.ZodString;
|
|
1698
1976
|
}, better_auth0.$strip>>) => Promise<{
|
|
1699
1977
|
name: string;
|
|
1700
1978
|
id: string;
|
|
1701
1979
|
createdAt: Date;
|
|
1702
1980
|
updatedAt: Date;
|
|
1703
1981
|
} | undefined>;
|
|
1704
|
-
listVariants: (params?:
|
|
1705
|
-
limit:
|
|
1706
|
-
offset:
|
|
1982
|
+
listVariants: (params?: zod37.infer<zod37.ZodObject<{
|
|
1983
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
1984
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
1707
1985
|
}, better_auth0.$strip>>) => Promise<{
|
|
1708
1986
|
name: string;
|
|
1709
1987
|
id: string;
|
|
1710
1988
|
createdAt: Date;
|
|
1711
1989
|
updatedAt: Date;
|
|
1712
1990
|
}[]>;
|
|
1713
|
-
listVariantsWithLatestVersion: (params?:
|
|
1714
|
-
limit:
|
|
1715
|
-
offset:
|
|
1991
|
+
listVariantsWithLatestVersion: (params?: zod37.infer<zod37.ZodObject<{
|
|
1992
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
1993
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
1716
1994
|
}, better_auth0.$strip>>) => Promise<{
|
|
1717
1995
|
latestVersion: {
|
|
1718
1996
|
version: number;
|
|
1997
|
+
id: string;
|
|
1998
|
+
createdAt: Date;
|
|
1999
|
+
updatedAt: Date;
|
|
1719
2000
|
variantId: string;
|
|
1720
2001
|
provider: string;
|
|
1721
2002
|
modelName: string;
|
|
1722
2003
|
jsonData: Record<string, unknown>;
|
|
1723
|
-
id: string;
|
|
1724
|
-
createdAt: Date;
|
|
1725
|
-
updatedAt: Date;
|
|
1726
2004
|
} | null;
|
|
1727
2005
|
name: string;
|
|
1728
2006
|
id: string;
|
|
1729
2007
|
createdAt: Date;
|
|
1730
2008
|
updatedAt: Date;
|
|
1731
2009
|
}[]>;
|
|
1732
|
-
createTargetingRule: (params:
|
|
1733
|
-
environmentId:
|
|
1734
|
-
configId:
|
|
1735
|
-
configVariantId:
|
|
1736
|
-
variantVersionId:
|
|
1737
|
-
weight:
|
|
1738
|
-
priority:
|
|
1739
|
-
enabled:
|
|
1740
|
-
conditions:
|
|
2010
|
+
createTargetingRule: (params: zod37.infer<zod37.ZodObject<{
|
|
2011
|
+
environmentId: zod37.ZodString;
|
|
2012
|
+
configId: zod37.ZodString;
|
|
2013
|
+
configVariantId: zod37.ZodString;
|
|
2014
|
+
variantVersionId: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodString>>;
|
|
2015
|
+
weight: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodNumber>>;
|
|
2016
|
+
priority: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodNumber>>;
|
|
2017
|
+
enabled: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodBoolean>>;
|
|
2018
|
+
conditions: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>>>;
|
|
1741
2019
|
}, better_auth0.$strip>>) => Promise<{
|
|
2020
|
+
id: string;
|
|
2021
|
+
createdAt: Date;
|
|
2022
|
+
updatedAt: Date;
|
|
1742
2023
|
environmentId: string;
|
|
1743
2024
|
configId: string;
|
|
1744
2025
|
configVariantId: string;
|
|
@@ -1747,18 +2028,18 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1747
2028
|
priority: number;
|
|
1748
2029
|
enabled: boolean;
|
|
1749
2030
|
conditions: Record<string, unknown>;
|
|
2031
|
+
} | undefined>;
|
|
2032
|
+
updateTargetingRule: (params: zod37.infer<zod37.ZodObject<{
|
|
2033
|
+
id: zod37.ZodString;
|
|
2034
|
+
variantVersionId: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodString>>;
|
|
2035
|
+
weight: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2036
|
+
priority: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2037
|
+
enabled: zod37.ZodOptional<zod37.ZodBoolean>;
|
|
2038
|
+
conditions: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>>>;
|
|
2039
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1750
2040
|
id: string;
|
|
1751
2041
|
createdAt: Date;
|
|
1752
2042
|
updatedAt: Date;
|
|
1753
|
-
} | undefined>;
|
|
1754
|
-
updateTargetingRule: (params: zod33.infer<zod33.ZodObject<{
|
|
1755
|
-
id: zod33.ZodString;
|
|
1756
|
-
variantVersionId: zod33.ZodOptional<zod33.ZodNullable<zod33.ZodString>>;
|
|
1757
|
-
weight: zod33.ZodOptional<zod33.ZodNumber>;
|
|
1758
|
-
priority: zod33.ZodOptional<zod33.ZodNumber>;
|
|
1759
|
-
enabled: zod33.ZodOptional<zod33.ZodBoolean>;
|
|
1760
|
-
conditions: zod33.ZodOptional<zod33.ZodNullable<zod33.ZodRecord<zod33.ZodString, zod33.ZodUnknown>>>;
|
|
1761
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
1762
2043
|
environmentId: string;
|
|
1763
2044
|
configId: string;
|
|
1764
2045
|
configVariantId: string;
|
|
@@ -1767,13 +2048,13 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1767
2048
|
priority: number;
|
|
1768
2049
|
enabled: boolean;
|
|
1769
2050
|
conditions: Record<string, unknown>;
|
|
2051
|
+
} | undefined>;
|
|
2052
|
+
getTargetingRuleById: (params: zod37.infer<zod37.ZodObject<{
|
|
2053
|
+
id: zod37.ZodString;
|
|
2054
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1770
2055
|
id: string;
|
|
1771
2056
|
createdAt: Date;
|
|
1772
2057
|
updatedAt: Date;
|
|
1773
|
-
} | undefined>;
|
|
1774
|
-
getTargetingRuleById: (params: zod33.infer<zod33.ZodObject<{
|
|
1775
|
-
id: zod33.ZodString;
|
|
1776
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
1777
2058
|
environmentId: string;
|
|
1778
2059
|
configId: string;
|
|
1779
2060
|
configVariantId: string;
|
|
@@ -1782,15 +2063,15 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1782
2063
|
priority: number;
|
|
1783
2064
|
enabled: boolean;
|
|
1784
2065
|
conditions: Record<string, unknown>;
|
|
2066
|
+
} | undefined>;
|
|
2067
|
+
getTargetingRulesByConfigId: (params: zod37.infer<zod37.ZodObject<{
|
|
2068
|
+
configId: zod37.ZodString;
|
|
2069
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2070
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2071
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1785
2072
|
id: string;
|
|
1786
2073
|
createdAt: Date;
|
|
1787
2074
|
updatedAt: Date;
|
|
1788
|
-
} | undefined>;
|
|
1789
|
-
getTargetingRulesByConfigId: (params: zod33.infer<zod33.ZodObject<{
|
|
1790
|
-
configId: zod33.ZodString;
|
|
1791
|
-
limit: zod33.ZodOptional<zod33.ZodNumber>;
|
|
1792
|
-
offset: zod33.ZodOptional<zod33.ZodNumber>;
|
|
1793
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
1794
2075
|
environmentId: string;
|
|
1795
2076
|
configId: string;
|
|
1796
2077
|
configVariantId: string;
|
|
@@ -1799,15 +2080,15 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1799
2080
|
priority: number;
|
|
1800
2081
|
enabled: boolean;
|
|
1801
2082
|
conditions: Record<string, unknown>;
|
|
2083
|
+
}[]>;
|
|
2084
|
+
getTargetingRulesByEnvironmentId: (params: zod37.infer<zod37.ZodObject<{
|
|
2085
|
+
environmentId: zod37.ZodString;
|
|
2086
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2087
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2088
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1802
2089
|
id: string;
|
|
1803
2090
|
createdAt: Date;
|
|
1804
2091
|
updatedAt: Date;
|
|
1805
|
-
}[]>;
|
|
1806
|
-
getTargetingRulesByEnvironmentId: (params: zod33.infer<zod33.ZodObject<{
|
|
1807
|
-
environmentId: zod33.ZodString;
|
|
1808
|
-
limit: zod33.ZodOptional<zod33.ZodNumber>;
|
|
1809
|
-
offset: zod33.ZodOptional<zod33.ZodNumber>;
|
|
1810
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
1811
2092
|
environmentId: string;
|
|
1812
2093
|
configId: string;
|
|
1813
2094
|
configVariantId: string;
|
|
@@ -1816,14 +2097,14 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1816
2097
|
priority: number;
|
|
1817
2098
|
enabled: boolean;
|
|
1818
2099
|
conditions: Record<string, unknown>;
|
|
2100
|
+
}[]>;
|
|
2101
|
+
getTargetingRulesByConfigAndEnvironment: (params: zod37.infer<zod37.ZodObject<{
|
|
2102
|
+
configId: zod37.ZodString;
|
|
2103
|
+
environmentId: zod37.ZodString;
|
|
2104
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1819
2105
|
id: string;
|
|
1820
2106
|
createdAt: Date;
|
|
1821
2107
|
updatedAt: Date;
|
|
1822
|
-
}[]>;
|
|
1823
|
-
getTargetingRulesByConfigAndEnvironment: (params: zod33.infer<zod33.ZodObject<{
|
|
1824
|
-
configId: zod33.ZodString;
|
|
1825
|
-
environmentId: zod33.ZodString;
|
|
1826
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
1827
2108
|
environmentId: string;
|
|
1828
2109
|
configId: string;
|
|
1829
2110
|
configVariantId: string;
|
|
@@ -1832,13 +2113,13 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1832
2113
|
priority: number;
|
|
1833
2114
|
enabled: boolean;
|
|
1834
2115
|
conditions: Record<string, unknown>;
|
|
2116
|
+
}[]>;
|
|
2117
|
+
deleteTargetingRule: (params: zod37.infer<zod37.ZodObject<{
|
|
2118
|
+
id: zod37.ZodString;
|
|
2119
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1835
2120
|
id: string;
|
|
1836
2121
|
createdAt: Date;
|
|
1837
2122
|
updatedAt: Date;
|
|
1838
|
-
}[]>;
|
|
1839
|
-
deleteTargetingRule: (params: zod33.infer<zod33.ZodObject<{
|
|
1840
|
-
id: zod33.ZodString;
|
|
1841
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
1842
2123
|
environmentId: string;
|
|
1843
2124
|
configId: string;
|
|
1844
2125
|
configVariantId: string;
|
|
@@ -1847,13 +2128,13 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1847
2128
|
priority: number;
|
|
1848
2129
|
enabled: boolean;
|
|
1849
2130
|
conditions: Record<string, unknown>;
|
|
2131
|
+
} | undefined>;
|
|
2132
|
+
deleteTargetingRulesByConfigId: (params: zod37.infer<zod37.ZodObject<{
|
|
2133
|
+
configId: zod37.ZodString;
|
|
2134
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1850
2135
|
id: string;
|
|
1851
2136
|
createdAt: Date;
|
|
1852
2137
|
updatedAt: Date;
|
|
1853
|
-
} | undefined>;
|
|
1854
|
-
deleteTargetingRulesByConfigId: (params: zod33.infer<zod33.ZodObject<{
|
|
1855
|
-
configId: zod33.ZodString;
|
|
1856
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
1857
2138
|
environmentId: string;
|
|
1858
2139
|
configId: string;
|
|
1859
2140
|
configVariantId: string;
|
|
@@ -1862,13 +2143,13 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1862
2143
|
priority: number;
|
|
1863
2144
|
enabled: boolean;
|
|
1864
2145
|
conditions: Record<string, unknown>;
|
|
2146
|
+
}[]>;
|
|
2147
|
+
deleteTargetingRulesByEnvironmentId: (params: zod37.infer<zod37.ZodObject<{
|
|
2148
|
+
environmentId: zod37.ZodString;
|
|
2149
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1865
2150
|
id: string;
|
|
1866
2151
|
createdAt: Date;
|
|
1867
2152
|
updatedAt: Date;
|
|
1868
|
-
}[]>;
|
|
1869
|
-
deleteTargetingRulesByEnvironmentId: (params: zod33.infer<zod33.ZodObject<{
|
|
1870
|
-
environmentId: zod33.ZodString;
|
|
1871
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
1872
2153
|
environmentId: string;
|
|
1873
2154
|
configId: string;
|
|
1874
2155
|
configVariantId: string;
|
|
@@ -1877,14 +2158,14 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1877
2158
|
priority: number;
|
|
1878
2159
|
enabled: boolean;
|
|
1879
2160
|
conditions: Record<string, unknown>;
|
|
2161
|
+
}[]>;
|
|
2162
|
+
listTargetingRules: (params?: zod37.infer<zod37.ZodObject<{
|
|
2163
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2164
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2165
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1880
2166
|
id: string;
|
|
1881
2167
|
createdAt: Date;
|
|
1882
2168
|
updatedAt: Date;
|
|
1883
|
-
}[]>;
|
|
1884
|
-
listTargetingRules: (params?: zod33.infer<zod33.ZodObject<{
|
|
1885
|
-
limit: zod33.ZodOptional<zod33.ZodNumber>;
|
|
1886
|
-
offset: zod33.ZodOptional<zod33.ZodNumber>;
|
|
1887
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
1888
2169
|
environmentId: string;
|
|
1889
2170
|
configId: string;
|
|
1890
2171
|
configVariantId: string;
|
|
@@ -1893,20 +2174,41 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1893
2174
|
priority: number;
|
|
1894
2175
|
enabled: boolean;
|
|
1895
2176
|
conditions: Record<string, unknown>;
|
|
1896
|
-
id: string;
|
|
1897
|
-
createdAt: Date;
|
|
1898
|
-
updatedAt: Date;
|
|
1899
2177
|
}[]>;
|
|
1900
|
-
getTargetingRulesWithDetailsByConfigId: (params:
|
|
1901
|
-
configId:
|
|
1902
|
-
limit:
|
|
1903
|
-
offset:
|
|
2178
|
+
getTargetingRulesWithDetailsByConfigId: (params: zod37.infer<zod37.ZodObject<{
|
|
2179
|
+
configId: zod37.ZodString;
|
|
2180
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2181
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
1904
2182
|
}, better_auth0.$strip>>) => Promise<{
|
|
1905
2183
|
variantProvider: string | null;
|
|
1906
2184
|
variantModelName: string | null;
|
|
1907
2185
|
pinnedVersion: number | null | undefined;
|
|
1908
2186
|
latestVersion: number | null | undefined;
|
|
1909
2187
|
variantName: string | null;
|
|
2188
|
+
id: string;
|
|
2189
|
+
createdAt: Date;
|
|
2190
|
+
updatedAt: Date;
|
|
2191
|
+
environmentId: string;
|
|
2192
|
+
configId: string;
|
|
2193
|
+
configVariantId: string;
|
|
2194
|
+
variantVersionId: string | null;
|
|
2195
|
+
weight: number;
|
|
2196
|
+
priority: number;
|
|
2197
|
+
enabled: boolean;
|
|
2198
|
+
conditions: Record<string, unknown>;
|
|
2199
|
+
variantId: string | null;
|
|
2200
|
+
environmentName: string | null;
|
|
2201
|
+
environmentSlug: string | null;
|
|
2202
|
+
}[]>;
|
|
2203
|
+
setTargetingForEnvironment: (params: zod37.infer<zod37.ZodObject<{
|
|
2204
|
+
environmentId: zod37.ZodString;
|
|
2205
|
+
configId: zod37.ZodString;
|
|
2206
|
+
configVariantId: zod37.ZodString;
|
|
2207
|
+
variantVersionId: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodString>>;
|
|
2208
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2209
|
+
id: string;
|
|
2210
|
+
createdAt: Date;
|
|
2211
|
+
updatedAt: Date;
|
|
1910
2212
|
environmentId: string;
|
|
1911
2213
|
configId: string;
|
|
1912
2214
|
configVariantId: string;
|
|
@@ -1914,152 +2216,231 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1914
2216
|
weight: number;
|
|
1915
2217
|
priority: number;
|
|
1916
2218
|
enabled: boolean;
|
|
1917
|
-
conditions: Record<string, unknown>;
|
|
2219
|
+
conditions: Record<string, unknown>;
|
|
2220
|
+
} | undefined>;
|
|
2221
|
+
createProviderGuardrailOverride: (params: zod37.infer<zod37.ZodObject<{
|
|
2222
|
+
providerConfigId: zod37.ZodString;
|
|
2223
|
+
guardrailConfigId: zod37.ZodString;
|
|
2224
|
+
enabled: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodBoolean>>;
|
|
2225
|
+
parameters: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>>>;
|
|
2226
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2227
|
+
id: string;
|
|
2228
|
+
createdAt: Date;
|
|
2229
|
+
updatedAt: Date;
|
|
2230
|
+
enabled: boolean;
|
|
2231
|
+
parameters: Record<string, unknown> | null;
|
|
2232
|
+
providerConfigId: string;
|
|
2233
|
+
guardrailConfigId: string;
|
|
2234
|
+
} | undefined>;
|
|
2235
|
+
updateProviderGuardrailOverride: (params: zod37.infer<zod37.ZodObject<{
|
|
2236
|
+
id: zod37.ZodString;
|
|
2237
|
+
enabled: zod37.ZodOptional<zod37.ZodBoolean>;
|
|
2238
|
+
parameters: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>>>;
|
|
2239
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2240
|
+
id: string;
|
|
2241
|
+
createdAt: Date;
|
|
2242
|
+
updatedAt: Date;
|
|
2243
|
+
enabled: boolean;
|
|
2244
|
+
parameters: Record<string, unknown> | null;
|
|
2245
|
+
providerConfigId: string;
|
|
2246
|
+
guardrailConfigId: string;
|
|
2247
|
+
} | undefined>;
|
|
2248
|
+
getOverrideById: (params: zod37.infer<zod37.ZodObject<{
|
|
2249
|
+
id: zod37.ZodString;
|
|
2250
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2251
|
+
id: string;
|
|
2252
|
+
createdAt: Date;
|
|
2253
|
+
updatedAt: Date;
|
|
2254
|
+
enabled: boolean;
|
|
2255
|
+
parameters: Record<string, unknown> | null;
|
|
2256
|
+
providerConfigId: string;
|
|
2257
|
+
guardrailConfigId: string;
|
|
2258
|
+
} | undefined>;
|
|
2259
|
+
deleteProviderGuardrailOverride: (params: zod37.infer<zod37.ZodObject<{
|
|
2260
|
+
id: zod37.ZodString;
|
|
2261
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2262
|
+
id: string;
|
|
2263
|
+
createdAt: Date;
|
|
2264
|
+
updatedAt: Date;
|
|
2265
|
+
enabled: boolean;
|
|
2266
|
+
parameters: Record<string, unknown> | null;
|
|
2267
|
+
providerConfigId: string;
|
|
2268
|
+
guardrailConfigId: string;
|
|
2269
|
+
} | undefined>;
|
|
2270
|
+
getOverridesByProviderConfigId: (params: zod37.infer<zod37.ZodObject<{
|
|
2271
|
+
providerConfigId: zod37.ZodString;
|
|
2272
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1918
2273
|
id: string;
|
|
1919
2274
|
createdAt: Date;
|
|
1920
2275
|
updatedAt: Date;
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
2276
|
+
enabled: boolean;
|
|
2277
|
+
parameters: Record<string, unknown> | null;
|
|
2278
|
+
providerConfigId: string;
|
|
2279
|
+
guardrailConfigId: string;
|
|
1924
2280
|
}[]>;
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
configId: zod33.ZodString;
|
|
1928
|
-
configVariantId: zod33.ZodString;
|
|
1929
|
-
variantVersionId: zod33.ZodOptional<zod33.ZodNullable<zod33.ZodString>>;
|
|
2281
|
+
getOverridesByGuardrailConfigId: (params: zod37.infer<zod37.ZodObject<{
|
|
2282
|
+
guardrailConfigId: zod37.ZodString;
|
|
1930
2283
|
}, better_auth0.$strip>>) => Promise<{
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
variantVersionId: string | null;
|
|
1935
|
-
weight: number;
|
|
1936
|
-
priority: number;
|
|
2284
|
+
id: string;
|
|
2285
|
+
createdAt: Date;
|
|
2286
|
+
updatedAt: Date;
|
|
1937
2287
|
enabled: boolean;
|
|
1938
|
-
|
|
2288
|
+
parameters: Record<string, unknown> | null;
|
|
2289
|
+
providerConfigId: string;
|
|
2290
|
+
guardrailConfigId: string;
|
|
2291
|
+
}[]>;
|
|
2292
|
+
getOverrideByProviderAndGuardrail: (params: zod37.infer<zod37.ZodObject<{
|
|
2293
|
+
providerConfigId: zod37.ZodString;
|
|
2294
|
+
guardrailConfigId: zod37.ZodString;
|
|
2295
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1939
2296
|
id: string;
|
|
1940
2297
|
createdAt: Date;
|
|
1941
2298
|
updatedAt: Date;
|
|
2299
|
+
enabled: boolean;
|
|
2300
|
+
parameters: Record<string, unknown> | null;
|
|
2301
|
+
providerConfigId: string;
|
|
2302
|
+
guardrailConfigId: string;
|
|
1942
2303
|
} | undefined>;
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
enabled: zod33.ZodDefault<zod33.ZodOptional<zod33.ZodBoolean>>;
|
|
2304
|
+
upsertProviderGuardrailOverride: (params: zod37.infer<zod37.ZodObject<{
|
|
2305
|
+
providerConfigId: zod37.ZodString;
|
|
2306
|
+
guardrailConfigId: zod37.ZodString;
|
|
2307
|
+
enabled: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodBoolean>>;
|
|
2308
|
+
parameters: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>>>;
|
|
1949
2309
|
}, better_auth0.$strip>>) => Promise<{
|
|
1950
|
-
slug: string | null;
|
|
1951
|
-
name: string | null;
|
|
1952
|
-
enabled: boolean;
|
|
1953
|
-
providerId: string;
|
|
1954
|
-
config: Record<string, unknown>;
|
|
1955
2310
|
id: string;
|
|
1956
2311
|
createdAt: Date;
|
|
1957
2312
|
updatedAt: Date;
|
|
2313
|
+
enabled: boolean;
|
|
2314
|
+
parameters: Record<string, unknown> | null;
|
|
2315
|
+
providerConfigId: string;
|
|
2316
|
+
guardrailConfigId: string;
|
|
1958
2317
|
} | undefined>;
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2318
|
+
deleteOverridesByGuardrailConfigId: (params: zod37.infer<zod37.ZodObject<{
|
|
2319
|
+
guardrailConfigId: zod37.ZodString;
|
|
2320
|
+
}, better_auth0.$strip>>) => Promise<kysely0.DeleteResult[]>;
|
|
2321
|
+
createProviderConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
2322
|
+
providerId: zod37.ZodString;
|
|
2323
|
+
slug: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodString>>;
|
|
2324
|
+
name: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodString>>;
|
|
2325
|
+
config: zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>;
|
|
2326
|
+
enabled: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodBoolean>>;
|
|
1965
2327
|
}, better_auth0.$strip>>) => Promise<{
|
|
1966
2328
|
slug: string | null;
|
|
1967
2329
|
name: string | null;
|
|
1968
|
-
enabled: boolean;
|
|
1969
|
-
providerId: string;
|
|
1970
|
-
config: Record<string, unknown>;
|
|
1971
2330
|
id: string;
|
|
1972
2331
|
createdAt: Date;
|
|
1973
2332
|
updatedAt: Date;
|
|
2333
|
+
enabled: boolean;
|
|
2334
|
+
providerId: string;
|
|
2335
|
+
config: Record<string, unknown>;
|
|
1974
2336
|
} | undefined>;
|
|
1975
|
-
|
|
1976
|
-
id:
|
|
2337
|
+
updateProviderConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
2338
|
+
id: zod37.ZodUUID;
|
|
2339
|
+
slug: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodString>>;
|
|
2340
|
+
name: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodString>>;
|
|
2341
|
+
config: zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>>;
|
|
2342
|
+
enabled: zod37.ZodOptional<zod37.ZodBoolean>;
|
|
1977
2343
|
}, better_auth0.$strip>>) => Promise<{
|
|
1978
2344
|
slug: string | null;
|
|
1979
2345
|
name: string | null;
|
|
1980
|
-
enabled: boolean;
|
|
1981
|
-
providerId: string;
|
|
1982
|
-
config: Record<string, unknown>;
|
|
1983
2346
|
id: string;
|
|
1984
2347
|
createdAt: Date;
|
|
1985
2348
|
updatedAt: Date;
|
|
2349
|
+
enabled: boolean;
|
|
2350
|
+
providerId: string;
|
|
2351
|
+
config: Record<string, unknown>;
|
|
1986
2352
|
} | undefined>;
|
|
1987
|
-
|
|
1988
|
-
|
|
2353
|
+
getProviderConfigById: (params: zod37.infer<zod37.ZodObject<{
|
|
2354
|
+
id: zod37.ZodUUID;
|
|
1989
2355
|
}, better_auth0.$strip>>) => Promise<{
|
|
1990
2356
|
slug: string | null;
|
|
1991
2357
|
name: string | null;
|
|
1992
|
-
enabled: boolean;
|
|
1993
|
-
providerId: string;
|
|
1994
|
-
config: Record<string, unknown>;
|
|
1995
2358
|
id: string;
|
|
1996
2359
|
createdAt: Date;
|
|
1997
2360
|
updatedAt: Date;
|
|
2361
|
+
enabled: boolean;
|
|
2362
|
+
providerId: string;
|
|
2363
|
+
config: Record<string, unknown>;
|
|
1998
2364
|
} | undefined>;
|
|
1999
|
-
|
|
2000
|
-
|
|
2365
|
+
getProviderConfigByProviderId: (params: zod37.infer<zod37.ZodObject<{
|
|
2366
|
+
providerId: zod37.ZodString;
|
|
2001
2367
|
}, better_auth0.$strip>>) => Promise<{
|
|
2002
2368
|
slug: string | null;
|
|
2003
2369
|
name: string | null;
|
|
2004
|
-
enabled: boolean;
|
|
2005
|
-
providerId: string;
|
|
2006
|
-
config: Record<string, unknown>;
|
|
2007
2370
|
id: string;
|
|
2008
2371
|
createdAt: Date;
|
|
2009
2372
|
updatedAt: Date;
|
|
2373
|
+
enabled: boolean;
|
|
2374
|
+
providerId: string;
|
|
2375
|
+
config: Record<string, unknown>;
|
|
2010
2376
|
} | undefined>;
|
|
2011
|
-
|
|
2012
|
-
|
|
2377
|
+
getProviderConfigBySlug: (params: zod37.infer<zod37.ZodObject<{
|
|
2378
|
+
slug: zod37.ZodString;
|
|
2013
2379
|
}, better_auth0.$strip>>) => Promise<{
|
|
2014
2380
|
slug: string | null;
|
|
2015
2381
|
name: string | null;
|
|
2016
|
-
enabled: boolean;
|
|
2017
|
-
providerId: string;
|
|
2018
|
-
config: Record<string, unknown>;
|
|
2019
2382
|
id: string;
|
|
2020
2383
|
createdAt: Date;
|
|
2021
2384
|
updatedAt: Date;
|
|
2385
|
+
enabled: boolean;
|
|
2386
|
+
providerId: string;
|
|
2387
|
+
config: Record<string, unknown>;
|
|
2022
2388
|
} | undefined>;
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
offset: zod33.ZodOptional<zod33.ZodNumber>;
|
|
2389
|
+
deleteProviderConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
2390
|
+
id: zod37.ZodUUID;
|
|
2026
2391
|
}, better_auth0.$strip>>) => Promise<{
|
|
2027
2392
|
slug: string | null;
|
|
2028
2393
|
name: string | null;
|
|
2394
|
+
id: string;
|
|
2395
|
+
createdAt: Date;
|
|
2396
|
+
updatedAt: Date;
|
|
2029
2397
|
enabled: boolean;
|
|
2030
2398
|
providerId: string;
|
|
2031
2399
|
config: Record<string, unknown>;
|
|
2400
|
+
} | undefined>;
|
|
2401
|
+
listProviderConfigs: (params?: zod37.infer<zod37.ZodObject<{
|
|
2402
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2403
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2404
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2405
|
+
slug: string | null;
|
|
2406
|
+
name: string | null;
|
|
2032
2407
|
id: string;
|
|
2033
2408
|
createdAt: Date;
|
|
2034
2409
|
updatedAt: Date;
|
|
2410
|
+
enabled: boolean;
|
|
2411
|
+
providerId: string;
|
|
2412
|
+
config: Record<string, unknown>;
|
|
2035
2413
|
}[]>;
|
|
2036
2414
|
countProviderConfigs: () => Promise<number>;
|
|
2037
|
-
upsertProviderConfig: (params:
|
|
2038
|
-
providerId:
|
|
2039
|
-
slug:
|
|
2040
|
-
name:
|
|
2041
|
-
config:
|
|
2042
|
-
enabled:
|
|
2415
|
+
upsertProviderConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
2416
|
+
providerId: zod37.ZodString;
|
|
2417
|
+
slug: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodString>>;
|
|
2418
|
+
name: zod37.ZodOptional<zod37.ZodNullable<zod37.ZodString>>;
|
|
2419
|
+
config: zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>;
|
|
2420
|
+
enabled: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodBoolean>>;
|
|
2043
2421
|
}, better_auth0.$strip>>) => Promise<{
|
|
2044
2422
|
slug: string | null;
|
|
2045
2423
|
name: string | null;
|
|
2046
|
-
enabled: boolean;
|
|
2047
|
-
providerId: string;
|
|
2048
|
-
config: Record<string, unknown>;
|
|
2049
2424
|
id: string;
|
|
2050
2425
|
createdAt: Date;
|
|
2051
2426
|
updatedAt: Date;
|
|
2427
|
+
enabled: boolean;
|
|
2428
|
+
providerId: string;
|
|
2429
|
+
config: Record<string, unknown>;
|
|
2052
2430
|
} | undefined>;
|
|
2053
2431
|
batchInsertRequests: (requests: LLMRequestInsert[]) => Promise<{
|
|
2054
2432
|
count: number;
|
|
2055
2433
|
}>;
|
|
2056
2434
|
insertRequest: (request: LLMRequestInsert) => Promise<{
|
|
2435
|
+
id: string;
|
|
2436
|
+
createdAt: Date;
|
|
2437
|
+
updatedAt: Date;
|
|
2057
2438
|
variantId: string | null;
|
|
2058
2439
|
provider: string;
|
|
2059
2440
|
environmentId: string | null;
|
|
2060
2441
|
configId: string | null;
|
|
2061
|
-
requestId: string;
|
|
2062
2442
|
providerConfigId: string | null;
|
|
2443
|
+
requestId: string;
|
|
2063
2444
|
model: string;
|
|
2064
2445
|
promptTokens: number;
|
|
2065
2446
|
completionTokens: number;
|
|
@@ -2074,30 +2455,41 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2074
2455
|
isStreaming: boolean;
|
|
2075
2456
|
userId: string | null;
|
|
2076
2457
|
tags: Record<string, string>;
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2458
|
+
guardrailResults: {
|
|
2459
|
+
results: {
|
|
2460
|
+
configId: string;
|
|
2461
|
+
functionId: string;
|
|
2462
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
2463
|
+
verdict: boolean;
|
|
2464
|
+
latencyMs: number;
|
|
2465
|
+
}[];
|
|
2466
|
+
action: "allowed" | "blocked" | "logged";
|
|
2467
|
+
totalLatencyMs: number;
|
|
2468
|
+
} | null;
|
|
2080
2469
|
} | undefined>;
|
|
2081
|
-
listRequests: (params?:
|
|
2082
|
-
limit:
|
|
2083
|
-
offset:
|
|
2084
|
-
configId:
|
|
2085
|
-
variantId:
|
|
2086
|
-
environmentId:
|
|
2087
|
-
providerConfigId:
|
|
2088
|
-
provider:
|
|
2089
|
-
model:
|
|
2090
|
-
startDate:
|
|
2091
|
-
endDate:
|
|
2092
|
-
tags:
|
|
2470
|
+
listRequests: (params?: zod37.infer<zod37.ZodObject<{
|
|
2471
|
+
limit: zod37.ZodDefault<zod37.ZodNumber>;
|
|
2472
|
+
offset: zod37.ZodDefault<zod37.ZodNumber>;
|
|
2473
|
+
configId: zod37.ZodOptional<zod37.ZodString>;
|
|
2474
|
+
variantId: zod37.ZodOptional<zod37.ZodString>;
|
|
2475
|
+
environmentId: zod37.ZodOptional<zod37.ZodString>;
|
|
2476
|
+
providerConfigId: zod37.ZodOptional<zod37.ZodString>;
|
|
2477
|
+
provider: zod37.ZodOptional<zod37.ZodString>;
|
|
2478
|
+
model: zod37.ZodOptional<zod37.ZodString>;
|
|
2479
|
+
startDate: zod37.ZodOptional<zod37.ZodDate>;
|
|
2480
|
+
endDate: zod37.ZodOptional<zod37.ZodDate>;
|
|
2481
|
+
tags: zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodArray<zod37.ZodString>>>;
|
|
2093
2482
|
}, better_auth0.$strip>>) => Promise<{
|
|
2094
2483
|
data: {
|
|
2484
|
+
id: string;
|
|
2485
|
+
createdAt: Date;
|
|
2486
|
+
updatedAt: Date;
|
|
2095
2487
|
variantId: string | null;
|
|
2096
2488
|
provider: string;
|
|
2097
2489
|
environmentId: string | null;
|
|
2098
2490
|
configId: string | null;
|
|
2099
|
-
requestId: string;
|
|
2100
2491
|
providerConfigId: string | null;
|
|
2492
|
+
requestId: string;
|
|
2101
2493
|
model: string;
|
|
2102
2494
|
promptTokens: number;
|
|
2103
2495
|
completionTokens: number;
|
|
@@ -2112,21 +2504,32 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2112
2504
|
isStreaming: boolean;
|
|
2113
2505
|
userId: string | null;
|
|
2114
2506
|
tags: Record<string, string>;
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2507
|
+
guardrailResults: {
|
|
2508
|
+
results: {
|
|
2509
|
+
configId: string;
|
|
2510
|
+
functionId: string;
|
|
2511
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
2512
|
+
verdict: boolean;
|
|
2513
|
+
latencyMs: number;
|
|
2514
|
+
}[];
|
|
2515
|
+
action: "allowed" | "blocked" | "logged";
|
|
2516
|
+
totalLatencyMs: number;
|
|
2517
|
+
} | null;
|
|
2118
2518
|
}[];
|
|
2119
2519
|
total: number;
|
|
2120
2520
|
limit: number;
|
|
2121
2521
|
offset: number;
|
|
2122
2522
|
}>;
|
|
2123
2523
|
getRequestByRequestId: (requestId: string) => Promise<{
|
|
2524
|
+
id: string;
|
|
2525
|
+
createdAt: Date;
|
|
2526
|
+
updatedAt: Date;
|
|
2124
2527
|
variantId: string | null;
|
|
2125
2528
|
provider: string;
|
|
2126
2529
|
environmentId: string | null;
|
|
2127
2530
|
configId: string | null;
|
|
2128
|
-
requestId: string;
|
|
2129
2531
|
providerConfigId: string | null;
|
|
2532
|
+
requestId: string;
|
|
2130
2533
|
model: string;
|
|
2131
2534
|
promptTokens: number;
|
|
2132
2535
|
completionTokens: number;
|
|
@@ -2141,17 +2544,25 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2141
2544
|
isStreaming: boolean;
|
|
2142
2545
|
userId: string | null;
|
|
2143
2546
|
tags: Record<string, string>;
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2547
|
+
guardrailResults: {
|
|
2548
|
+
results: {
|
|
2549
|
+
configId: string;
|
|
2550
|
+
functionId: string;
|
|
2551
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
2552
|
+
verdict: boolean;
|
|
2553
|
+
latencyMs: number;
|
|
2554
|
+
}[];
|
|
2555
|
+
action: "allowed" | "blocked" | "logged";
|
|
2556
|
+
totalLatencyMs: number;
|
|
2557
|
+
} | null;
|
|
2147
2558
|
} | undefined>;
|
|
2148
|
-
getTotalCost: (params:
|
|
2149
|
-
startDate:
|
|
2150
|
-
endDate:
|
|
2151
|
-
configId:
|
|
2152
|
-
variantId:
|
|
2153
|
-
environmentId:
|
|
2154
|
-
tags:
|
|
2559
|
+
getTotalCost: (params: zod37.infer<zod37.ZodObject<{
|
|
2560
|
+
startDate: zod37.ZodDate;
|
|
2561
|
+
endDate: zod37.ZodDate;
|
|
2562
|
+
configId: zod37.ZodOptional<zod37.ZodString>;
|
|
2563
|
+
variantId: zod37.ZodOptional<zod37.ZodString>;
|
|
2564
|
+
environmentId: zod37.ZodOptional<zod37.ZodString>;
|
|
2565
|
+
tags: zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodArray<zod37.ZodString>>>;
|
|
2155
2566
|
}, better_auth0.$strip>>) => Promise<{
|
|
2156
2567
|
totalCost: number;
|
|
2157
2568
|
totalInputCost: number;
|
|
@@ -2161,13 +2572,13 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2161
2572
|
totalTokens: number;
|
|
2162
2573
|
requestCount: number;
|
|
2163
2574
|
} | undefined>;
|
|
2164
|
-
getCostByModel: (params:
|
|
2165
|
-
startDate:
|
|
2166
|
-
endDate:
|
|
2167
|
-
configId:
|
|
2168
|
-
variantId:
|
|
2169
|
-
environmentId:
|
|
2170
|
-
tags:
|
|
2575
|
+
getCostByModel: (params: zod37.infer<zod37.ZodObject<{
|
|
2576
|
+
startDate: zod37.ZodDate;
|
|
2577
|
+
endDate: zod37.ZodDate;
|
|
2578
|
+
configId: zod37.ZodOptional<zod37.ZodString>;
|
|
2579
|
+
variantId: zod37.ZodOptional<zod37.ZodString>;
|
|
2580
|
+
environmentId: zod37.ZodOptional<zod37.ZodString>;
|
|
2581
|
+
tags: zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodArray<zod37.ZodString>>>;
|
|
2171
2582
|
}, better_auth0.$strip>>) => Promise<{
|
|
2172
2583
|
provider: string;
|
|
2173
2584
|
model: string;
|
|
@@ -2178,13 +2589,13 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2178
2589
|
requestCount: number;
|
|
2179
2590
|
avgLatencyMs: number;
|
|
2180
2591
|
}[]>;
|
|
2181
|
-
getCostByProvider: (params:
|
|
2182
|
-
startDate:
|
|
2183
|
-
endDate:
|
|
2184
|
-
configId:
|
|
2185
|
-
variantId:
|
|
2186
|
-
environmentId:
|
|
2187
|
-
tags:
|
|
2592
|
+
getCostByProvider: (params: zod37.infer<zod37.ZodObject<{
|
|
2593
|
+
startDate: zod37.ZodDate;
|
|
2594
|
+
endDate: zod37.ZodDate;
|
|
2595
|
+
configId: zod37.ZodOptional<zod37.ZodString>;
|
|
2596
|
+
variantId: zod37.ZodOptional<zod37.ZodString>;
|
|
2597
|
+
environmentId: zod37.ZodOptional<zod37.ZodString>;
|
|
2598
|
+
tags: zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodArray<zod37.ZodString>>>;
|
|
2188
2599
|
}, better_auth0.$strip>>) => Promise<{
|
|
2189
2600
|
provider: string;
|
|
2190
2601
|
totalCost: number;
|
|
@@ -2194,13 +2605,13 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2194
2605
|
requestCount: number;
|
|
2195
2606
|
avgLatencyMs: number;
|
|
2196
2607
|
}[]>;
|
|
2197
|
-
getCostByConfig: (params:
|
|
2198
|
-
startDate:
|
|
2199
|
-
endDate:
|
|
2200
|
-
configId:
|
|
2201
|
-
variantId:
|
|
2202
|
-
environmentId:
|
|
2203
|
-
tags:
|
|
2608
|
+
getCostByConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
2609
|
+
startDate: zod37.ZodDate;
|
|
2610
|
+
endDate: zod37.ZodDate;
|
|
2611
|
+
configId: zod37.ZodOptional<zod37.ZodString>;
|
|
2612
|
+
variantId: zod37.ZodOptional<zod37.ZodString>;
|
|
2613
|
+
environmentId: zod37.ZodOptional<zod37.ZodString>;
|
|
2614
|
+
tags: zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodArray<zod37.ZodString>>>;
|
|
2204
2615
|
}, better_auth0.$strip>>) => Promise<{
|
|
2205
2616
|
configId: string | null;
|
|
2206
2617
|
totalCost: number;
|
|
@@ -2211,13 +2622,13 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2211
2622
|
configName: string | null | undefined;
|
|
2212
2623
|
configSlug: string | null;
|
|
2213
2624
|
}[]>;
|
|
2214
|
-
getDailyCosts: (params:
|
|
2215
|
-
startDate:
|
|
2216
|
-
endDate:
|
|
2217
|
-
configId:
|
|
2218
|
-
variantId:
|
|
2219
|
-
environmentId:
|
|
2220
|
-
tags:
|
|
2625
|
+
getDailyCosts: (params: zod37.infer<zod37.ZodObject<{
|
|
2626
|
+
startDate: zod37.ZodDate;
|
|
2627
|
+
endDate: zod37.ZodDate;
|
|
2628
|
+
configId: zod37.ZodOptional<zod37.ZodString>;
|
|
2629
|
+
variantId: zod37.ZodOptional<zod37.ZodString>;
|
|
2630
|
+
environmentId: zod37.ZodOptional<zod37.ZodString>;
|
|
2631
|
+
tags: zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodArray<zod37.ZodString>>>;
|
|
2221
2632
|
}, better_auth0.$strip>>) => Promise<{
|
|
2222
2633
|
totalCost: number;
|
|
2223
2634
|
totalInputCost: number;
|
|
@@ -2226,14 +2637,14 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2226
2637
|
requestCount: number;
|
|
2227
2638
|
date: string;
|
|
2228
2639
|
}[]>;
|
|
2229
|
-
getCostSummary: (params:
|
|
2230
|
-
startDate:
|
|
2231
|
-
endDate:
|
|
2232
|
-
configId:
|
|
2233
|
-
variantId:
|
|
2234
|
-
environmentId:
|
|
2235
|
-
tags:
|
|
2236
|
-
groupBy:
|
|
2640
|
+
getCostSummary: (params: zod37.infer<zod37.ZodObject<{
|
|
2641
|
+
startDate: zod37.ZodDate;
|
|
2642
|
+
endDate: zod37.ZodDate;
|
|
2643
|
+
configId: zod37.ZodOptional<zod37.ZodString>;
|
|
2644
|
+
variantId: zod37.ZodOptional<zod37.ZodString>;
|
|
2645
|
+
environmentId: zod37.ZodOptional<zod37.ZodString>;
|
|
2646
|
+
tags: zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodArray<zod37.ZodString>>>;
|
|
2647
|
+
groupBy: zod37.ZodOptional<zod37.ZodEnum<{
|
|
2237
2648
|
provider: "provider";
|
|
2238
2649
|
config: "config";
|
|
2239
2650
|
model: "model";
|
|
@@ -2245,13 +2656,13 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2245
2656
|
requestCount: number;
|
|
2246
2657
|
groupKey: string;
|
|
2247
2658
|
}[]>;
|
|
2248
|
-
getRequestStats: (params:
|
|
2249
|
-
startDate:
|
|
2250
|
-
endDate:
|
|
2251
|
-
configId:
|
|
2252
|
-
variantId:
|
|
2253
|
-
environmentId:
|
|
2254
|
-
tags:
|
|
2659
|
+
getRequestStats: (params: zod37.infer<zod37.ZodObject<{
|
|
2660
|
+
startDate: zod37.ZodDate;
|
|
2661
|
+
endDate: zod37.ZodDate;
|
|
2662
|
+
configId: zod37.ZodOptional<zod37.ZodString>;
|
|
2663
|
+
variantId: zod37.ZodOptional<zod37.ZodString>;
|
|
2664
|
+
environmentId: zod37.ZodOptional<zod37.ZodString>;
|
|
2665
|
+
tags: zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodArray<zod37.ZodString>>>;
|
|
2255
2666
|
}, better_auth0.$strip>>) => Promise<{
|
|
2256
2667
|
avgLatencyMs: number;
|
|
2257
2668
|
totalRequests: number;
|
|
@@ -2265,270 +2676,390 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2265
2676
|
key: string;
|
|
2266
2677
|
value: string;
|
|
2267
2678
|
}[]>;
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2679
|
+
createGuardrailConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
2680
|
+
name: zod37.ZodString;
|
|
2681
|
+
pluginId: zod37.ZodString;
|
|
2682
|
+
functionId: zod37.ZodString;
|
|
2683
|
+
hookType: zod37.ZodEnum<{
|
|
2684
|
+
beforeRequestHook: "beforeRequestHook";
|
|
2685
|
+
afterRequestHook: "afterRequestHook";
|
|
2686
|
+
}>;
|
|
2687
|
+
parameters: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>>>;
|
|
2688
|
+
enabled: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodBoolean>>;
|
|
2689
|
+
priority: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodNumber>>;
|
|
2690
|
+
onFail: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodEnum<{
|
|
2691
|
+
block: "block";
|
|
2692
|
+
log: "log";
|
|
2693
|
+
}>>>;
|
|
2272
2694
|
}, better_auth0.$strip>>) => Promise<{
|
|
2273
|
-
|
|
2274
|
-
keyName: string;
|
|
2275
|
-
keyValue: string;
|
|
2695
|
+
name: string;
|
|
2276
2696
|
id: string;
|
|
2277
2697
|
createdAt: Date;
|
|
2278
2698
|
updatedAt: Date;
|
|
2699
|
+
priority: number;
|
|
2700
|
+
enabled: boolean;
|
|
2701
|
+
pluginId: string;
|
|
2702
|
+
functionId: string;
|
|
2703
|
+
hookType: string;
|
|
2704
|
+
parameters: Record<string, unknown>;
|
|
2705
|
+
onFail: string;
|
|
2279
2706
|
} | undefined>;
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2707
|
+
updateGuardrailConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
2708
|
+
id: zod37.ZodString;
|
|
2709
|
+
name: zod37.ZodOptional<zod37.ZodString>;
|
|
2710
|
+
hookType: zod37.ZodOptional<zod37.ZodEnum<{
|
|
2711
|
+
beforeRequestHook: "beforeRequestHook";
|
|
2712
|
+
afterRequestHook: "afterRequestHook";
|
|
2713
|
+
}>>;
|
|
2714
|
+
parameters: zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>>;
|
|
2715
|
+
enabled: zod37.ZodOptional<zod37.ZodBoolean>;
|
|
2716
|
+
priority: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2717
|
+
onFail: zod37.ZodOptional<zod37.ZodEnum<{
|
|
2718
|
+
block: "block";
|
|
2719
|
+
log: "log";
|
|
2720
|
+
}>>;
|
|
2284
2721
|
}, better_auth0.$strip>>) => Promise<{
|
|
2285
|
-
|
|
2286
|
-
keyName: string;
|
|
2287
|
-
keyValue: string;
|
|
2722
|
+
name: string;
|
|
2288
2723
|
id: string;
|
|
2289
2724
|
createdAt: Date;
|
|
2290
2725
|
updatedAt: Date;
|
|
2726
|
+
priority: number;
|
|
2727
|
+
enabled: boolean;
|
|
2728
|
+
pluginId: string;
|
|
2729
|
+
functionId: string;
|
|
2730
|
+
hookType: string;
|
|
2731
|
+
parameters: Record<string, unknown>;
|
|
2732
|
+
onFail: string;
|
|
2291
2733
|
} | undefined>;
|
|
2292
|
-
|
|
2293
|
-
|
|
2734
|
+
getGuardrailConfigById: (params: zod37.infer<zod37.ZodObject<{
|
|
2735
|
+
id: zod37.ZodString;
|
|
2294
2736
|
}, better_auth0.$strip>>) => Promise<{
|
|
2295
|
-
|
|
2296
|
-
keyName: string;
|
|
2297
|
-
keyValue: string;
|
|
2737
|
+
name: string;
|
|
2298
2738
|
id: string;
|
|
2299
2739
|
createdAt: Date;
|
|
2300
2740
|
updatedAt: Date;
|
|
2741
|
+
priority: number;
|
|
2742
|
+
enabled: boolean;
|
|
2743
|
+
pluginId: string;
|
|
2744
|
+
functionId: string;
|
|
2745
|
+
hookType: string;
|
|
2746
|
+
parameters: Record<string, unknown>;
|
|
2747
|
+
onFail: string;
|
|
2301
2748
|
} | undefined>;
|
|
2302
|
-
|
|
2303
|
-
|
|
2749
|
+
deleteGuardrailConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
2750
|
+
id: zod37.ZodString;
|
|
2304
2751
|
}, better_auth0.$strip>>) => Promise<{
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2752
|
+
name: string;
|
|
2753
|
+
id: string;
|
|
2754
|
+
createdAt: Date;
|
|
2755
|
+
updatedAt: Date;
|
|
2756
|
+
priority: number;
|
|
2757
|
+
enabled: boolean;
|
|
2758
|
+
pluginId: string;
|
|
2759
|
+
functionId: string;
|
|
2760
|
+
hookType: string;
|
|
2761
|
+
parameters: Record<string, unknown>;
|
|
2762
|
+
onFail: string;
|
|
2763
|
+
} | undefined>;
|
|
2764
|
+
listGuardrailConfigs: (params?: zod37.infer<zod37.ZodObject<{
|
|
2765
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2766
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2767
|
+
hookType: zod37.ZodOptional<zod37.ZodEnum<{
|
|
2768
|
+
beforeRequestHook: "beforeRequestHook";
|
|
2769
|
+
afterRequestHook: "afterRequestHook";
|
|
2770
|
+
}>>;
|
|
2771
|
+
enabled: zod37.ZodOptional<zod37.ZodBoolean>;
|
|
2772
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2773
|
+
name: string;
|
|
2774
|
+
id: string;
|
|
2775
|
+
createdAt: Date;
|
|
2776
|
+
updatedAt: Date;
|
|
2777
|
+
priority: number;
|
|
2778
|
+
enabled: boolean;
|
|
2779
|
+
pluginId: string;
|
|
2780
|
+
functionId: string;
|
|
2781
|
+
hookType: string;
|
|
2782
|
+
parameters: Record<string, unknown>;
|
|
2783
|
+
onFail: string;
|
|
2784
|
+
}[]>;
|
|
2785
|
+
countGuardrailConfigs: () => Promise<number>;
|
|
2786
|
+
getEnabledGuardrailsByHookType: (hookType: "beforeRequestHook" | "afterRequestHook") => Promise<{
|
|
2787
|
+
name: string;
|
|
2308
2788
|
id: string;
|
|
2309
2789
|
createdAt: Date;
|
|
2310
2790
|
updatedAt: Date;
|
|
2791
|
+
priority: number;
|
|
2792
|
+
enabled: boolean;
|
|
2793
|
+
pluginId: string;
|
|
2794
|
+
functionId: string;
|
|
2795
|
+
hookType: string;
|
|
2796
|
+
parameters: Record<string, unknown>;
|
|
2797
|
+
onFail: string;
|
|
2311
2798
|
}[]>;
|
|
2312
|
-
|
|
2313
|
-
|
|
2799
|
+
createEnvironmentSecret: (params: zod37.infer<zod37.ZodObject<{
|
|
2800
|
+
environmentId: zod37.ZodUUID;
|
|
2801
|
+
keyName: zod37.ZodString;
|
|
2802
|
+
keyValue: zod37.ZodString;
|
|
2314
2803
|
}, better_auth0.$strip>>) => Promise<{
|
|
2804
|
+
id: string;
|
|
2805
|
+
createdAt: Date;
|
|
2806
|
+
updatedAt: Date;
|
|
2315
2807
|
environmentId: string;
|
|
2316
2808
|
keyName: string;
|
|
2317
2809
|
keyValue: string;
|
|
2810
|
+
} | undefined>;
|
|
2811
|
+
updateEnvironmentSecret: (params: zod37.infer<zod37.ZodObject<{
|
|
2812
|
+
secretId: zod37.ZodUUID;
|
|
2813
|
+
keyName: zod37.ZodOptional<zod37.ZodString>;
|
|
2814
|
+
keyValue: zod37.ZodOptional<zod37.ZodString>;
|
|
2815
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2318
2816
|
id: string;
|
|
2319
2817
|
createdAt: Date;
|
|
2320
2818
|
updatedAt: Date;
|
|
2819
|
+
environmentId: string;
|
|
2820
|
+
keyName: string;
|
|
2821
|
+
keyValue: string;
|
|
2321
2822
|
} | undefined>;
|
|
2322
|
-
|
|
2323
|
-
|
|
2823
|
+
getEnvironmentSecretById: (params: zod37.infer<zod37.ZodObject<{
|
|
2824
|
+
secretId: zod37.ZodUUID;
|
|
2324
2825
|
}, better_auth0.$strip>>) => Promise<{
|
|
2826
|
+
id: string;
|
|
2827
|
+
createdAt: Date;
|
|
2828
|
+
updatedAt: Date;
|
|
2325
2829
|
environmentId: string;
|
|
2326
2830
|
keyName: string;
|
|
2327
2831
|
keyValue: string;
|
|
2832
|
+
} | undefined>;
|
|
2833
|
+
getSecretsByEnvironmentId: (params: zod37.infer<zod37.ZodObject<{
|
|
2834
|
+
environmentId: zod37.ZodUUID;
|
|
2835
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2328
2836
|
id: string;
|
|
2329
2837
|
createdAt: Date;
|
|
2330
2838
|
updatedAt: Date;
|
|
2839
|
+
environmentId: string;
|
|
2840
|
+
keyName: string;
|
|
2841
|
+
keyValue: string;
|
|
2331
2842
|
}[]>;
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2843
|
+
deleteEnvironmentSecret: (params: zod37.infer<zod37.ZodObject<{
|
|
2844
|
+
secretId: zod37.ZodUUID;
|
|
2845
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2846
|
+
id: string;
|
|
2847
|
+
createdAt: Date;
|
|
2848
|
+
updatedAt: Date;
|
|
2849
|
+
environmentId: string;
|
|
2850
|
+
keyName: string;
|
|
2851
|
+
keyValue: string;
|
|
2852
|
+
} | undefined>;
|
|
2853
|
+
deleteSecretsByEnvironmentId: (params: zod37.infer<zod37.ZodObject<{
|
|
2854
|
+
environmentId: zod37.ZodUUID;
|
|
2335
2855
|
}, better_auth0.$strip>>) => Promise<{
|
|
2856
|
+
id: string;
|
|
2857
|
+
createdAt: Date;
|
|
2858
|
+
updatedAt: Date;
|
|
2336
2859
|
environmentId: string;
|
|
2337
2860
|
keyName: string;
|
|
2338
2861
|
keyValue: string;
|
|
2862
|
+
}[]>;
|
|
2863
|
+
listEnvironmentSecrets: (params?: zod37.infer<zod37.ZodObject<{
|
|
2864
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2865
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2866
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2339
2867
|
id: string;
|
|
2340
2868
|
createdAt: Date;
|
|
2341
2869
|
updatedAt: Date;
|
|
2870
|
+
environmentId: string;
|
|
2871
|
+
keyName: string;
|
|
2872
|
+
keyValue: string;
|
|
2342
2873
|
}[]>;
|
|
2343
2874
|
countEnvironmentSecrets: () => Promise<number>;
|
|
2344
|
-
createNewEnvironment: (params:
|
|
2345
|
-
name:
|
|
2346
|
-
slug:
|
|
2347
|
-
isProd:
|
|
2875
|
+
createNewEnvironment: (params: zod37.infer<zod37.ZodObject<{
|
|
2876
|
+
name: zod37.ZodString;
|
|
2877
|
+
slug: zod37.ZodString;
|
|
2878
|
+
isProd: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodBoolean>>;
|
|
2348
2879
|
}, better_auth0.$strip>>) => Promise<{
|
|
2349
2880
|
slug: string;
|
|
2350
2881
|
name: string;
|
|
2351
|
-
isProd: boolean;
|
|
2352
2882
|
id: string;
|
|
2353
2883
|
createdAt: Date;
|
|
2354
2884
|
updatedAt: Date;
|
|
2885
|
+
isProd: boolean;
|
|
2355
2886
|
} | undefined>;
|
|
2356
|
-
updateEnvironment: (params:
|
|
2357
|
-
environmentId:
|
|
2358
|
-
name:
|
|
2359
|
-
slug:
|
|
2887
|
+
updateEnvironment: (params: zod37.infer<zod37.ZodObject<{
|
|
2888
|
+
environmentId: zod37.ZodUUID;
|
|
2889
|
+
name: zod37.ZodOptional<zod37.ZodString>;
|
|
2890
|
+
slug: zod37.ZodOptional<zod37.ZodString>;
|
|
2360
2891
|
}, better_auth0.$strip>>) => Promise<{
|
|
2361
2892
|
slug: string;
|
|
2362
2893
|
name: string;
|
|
2363
|
-
isProd: boolean;
|
|
2364
2894
|
id: string;
|
|
2365
2895
|
createdAt: Date;
|
|
2366
2896
|
updatedAt: Date;
|
|
2897
|
+
isProd: boolean;
|
|
2367
2898
|
} | undefined>;
|
|
2368
|
-
getEnvironmentById: (params:
|
|
2369
|
-
environmentId:
|
|
2899
|
+
getEnvironmentById: (params: zod37.infer<zod37.ZodObject<{
|
|
2900
|
+
environmentId: zod37.ZodUUID;
|
|
2370
2901
|
}, better_auth0.$strip>>) => Promise<{
|
|
2371
2902
|
slug: string;
|
|
2372
2903
|
name: string;
|
|
2373
|
-
isProd: boolean;
|
|
2374
2904
|
id: string;
|
|
2375
2905
|
createdAt: Date;
|
|
2376
2906
|
updatedAt: Date;
|
|
2907
|
+
isProd: boolean;
|
|
2377
2908
|
} | undefined>;
|
|
2378
|
-
getEnvironmentBySlug: (params:
|
|
2379
|
-
slug:
|
|
2909
|
+
getEnvironmentBySlug: (params: zod37.infer<zod37.ZodObject<{
|
|
2910
|
+
slug: zod37.ZodString;
|
|
2380
2911
|
}, better_auth0.$strip>>) => Promise<{
|
|
2381
2912
|
slug: string;
|
|
2382
2913
|
name: string;
|
|
2383
|
-
isProd: boolean;
|
|
2384
2914
|
id: string;
|
|
2385
2915
|
createdAt: Date;
|
|
2386
2916
|
updatedAt: Date;
|
|
2917
|
+
isProd: boolean;
|
|
2387
2918
|
} | undefined>;
|
|
2388
|
-
deleteEnvironment: (params:
|
|
2389
|
-
environmentId:
|
|
2919
|
+
deleteEnvironment: (params: zod37.infer<zod37.ZodObject<{
|
|
2920
|
+
environmentId: zod37.ZodUUID;
|
|
2390
2921
|
}, better_auth0.$strip>>) => Promise<{
|
|
2391
2922
|
slug: string;
|
|
2392
2923
|
name: string;
|
|
2393
|
-
isProd: boolean;
|
|
2394
2924
|
id: string;
|
|
2395
2925
|
createdAt: Date;
|
|
2396
2926
|
updatedAt: Date;
|
|
2927
|
+
isProd: boolean;
|
|
2397
2928
|
} | undefined>;
|
|
2398
|
-
listEnvironments: (params?:
|
|
2399
|
-
limit:
|
|
2400
|
-
offset:
|
|
2929
|
+
listEnvironments: (params?: zod37.infer<zod37.ZodObject<{
|
|
2930
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2931
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2401
2932
|
}, better_auth0.$strip>>) => Promise<{
|
|
2402
2933
|
slug: string;
|
|
2403
2934
|
name: string;
|
|
2404
|
-
isProd: boolean;
|
|
2405
2935
|
id: string;
|
|
2406
2936
|
createdAt: Date;
|
|
2407
2937
|
updatedAt: Date;
|
|
2938
|
+
isProd: boolean;
|
|
2408
2939
|
}[]>;
|
|
2409
2940
|
countEnvironments: () => Promise<number>;
|
|
2410
|
-
createConfigVariant: (params:
|
|
2411
|
-
configId:
|
|
2412
|
-
variantId:
|
|
2941
|
+
createConfigVariant: (params: zod37.infer<zod37.ZodObject<{
|
|
2942
|
+
configId: zod37.ZodString;
|
|
2943
|
+
variantId: zod37.ZodString;
|
|
2413
2944
|
}, better_auth0.$strip>>) => Promise<{
|
|
2414
|
-
variantId: string;
|
|
2415
|
-
configId: string;
|
|
2416
2945
|
id: string;
|
|
2417
2946
|
createdAt: Date;
|
|
2418
2947
|
updatedAt: Date;
|
|
2419
|
-
} | undefined>;
|
|
2420
|
-
getConfigVariantById: (params: zod33.infer<zod33.ZodObject<{
|
|
2421
|
-
id: zod33.ZodString;
|
|
2422
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2423
2948
|
variantId: string;
|
|
2424
2949
|
configId: string;
|
|
2950
|
+
} | undefined>;
|
|
2951
|
+
getConfigVariantById: (params: zod37.infer<zod37.ZodObject<{
|
|
2952
|
+
id: zod37.ZodString;
|
|
2953
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2425
2954
|
id: string;
|
|
2426
2955
|
createdAt: Date;
|
|
2427
2956
|
updatedAt: Date;
|
|
2428
|
-
} | undefined>;
|
|
2429
|
-
getConfigVariantsByConfigId: (params: zod33.infer<zod33.ZodObject<{
|
|
2430
|
-
configId: zod33.ZodString;
|
|
2431
|
-
limit: zod33.ZodOptional<zod33.ZodNumber>;
|
|
2432
|
-
offset: zod33.ZodOptional<zod33.ZodNumber>;
|
|
2433
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2434
2957
|
variantId: string;
|
|
2435
2958
|
configId: string;
|
|
2959
|
+
} | undefined>;
|
|
2960
|
+
getConfigVariantsByConfigId: (params: zod37.infer<zod37.ZodObject<{
|
|
2961
|
+
configId: zod37.ZodString;
|
|
2962
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2963
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2964
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2436
2965
|
id: string;
|
|
2437
2966
|
createdAt: Date;
|
|
2438
2967
|
updatedAt: Date;
|
|
2439
|
-
}[]>;
|
|
2440
|
-
getConfigVariantsByVariantId: (params: zod33.infer<zod33.ZodObject<{
|
|
2441
|
-
variantId: zod33.ZodString;
|
|
2442
|
-
limit: zod33.ZodOptional<zod33.ZodNumber>;
|
|
2443
|
-
offset: zod33.ZodOptional<zod33.ZodNumber>;
|
|
2444
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2445
2968
|
variantId: string;
|
|
2446
2969
|
configId: string;
|
|
2970
|
+
}[]>;
|
|
2971
|
+
getConfigVariantsByVariantId: (params: zod37.infer<zod37.ZodObject<{
|
|
2972
|
+
variantId: zod37.ZodString;
|
|
2973
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2974
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2975
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2447
2976
|
id: string;
|
|
2448
2977
|
createdAt: Date;
|
|
2449
2978
|
updatedAt: Date;
|
|
2450
|
-
}[]>;
|
|
2451
|
-
deleteConfigVariant: (params: zod33.infer<zod33.ZodObject<{
|
|
2452
|
-
id: zod33.ZodString;
|
|
2453
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2454
2979
|
variantId: string;
|
|
2455
2980
|
configId: string;
|
|
2981
|
+
}[]>;
|
|
2982
|
+
deleteConfigVariant: (params: zod37.infer<zod37.ZodObject<{
|
|
2983
|
+
id: zod37.ZodString;
|
|
2984
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2456
2985
|
id: string;
|
|
2457
2986
|
createdAt: Date;
|
|
2458
2987
|
updatedAt: Date;
|
|
2459
|
-
} | undefined>;
|
|
2460
|
-
deleteConfigVariantByIds: (params: zod33.infer<zod33.ZodObject<{
|
|
2461
|
-
configId: zod33.ZodString;
|
|
2462
|
-
variantId: zod33.ZodString;
|
|
2463
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2464
2988
|
variantId: string;
|
|
2465
2989
|
configId: string;
|
|
2990
|
+
} | undefined>;
|
|
2991
|
+
deleteConfigVariantByIds: (params: zod37.infer<zod37.ZodObject<{
|
|
2992
|
+
configId: zod37.ZodString;
|
|
2993
|
+
variantId: zod37.ZodString;
|
|
2994
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2466
2995
|
id: string;
|
|
2467
2996
|
createdAt: Date;
|
|
2468
2997
|
updatedAt: Date;
|
|
2469
|
-
} | undefined>;
|
|
2470
|
-
listConfigVariants: (params?: zod33.infer<zod33.ZodObject<{
|
|
2471
|
-
limit: zod33.ZodOptional<zod33.ZodNumber>;
|
|
2472
|
-
offset: zod33.ZodOptional<zod33.ZodNumber>;
|
|
2473
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2474
2998
|
variantId: string;
|
|
2475
2999
|
configId: string;
|
|
3000
|
+
} | undefined>;
|
|
3001
|
+
listConfigVariants: (params?: zod37.infer<zod37.ZodObject<{
|
|
3002
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
3003
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
3004
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
2476
3005
|
id: string;
|
|
2477
3006
|
createdAt: Date;
|
|
2478
3007
|
updatedAt: Date;
|
|
3008
|
+
variantId: string;
|
|
3009
|
+
configId: string;
|
|
2479
3010
|
}[]>;
|
|
2480
|
-
getConfigVariantWithDetails: (params:
|
|
2481
|
-
id:
|
|
3011
|
+
getConfigVariantWithDetails: (params: zod37.infer<zod37.ZodObject<{
|
|
3012
|
+
id: zod37.ZodString;
|
|
2482
3013
|
}, better_auth0.$strip>>) => Promise<{
|
|
2483
3014
|
latestVersion: {
|
|
2484
3015
|
version: number;
|
|
3016
|
+
id: string;
|
|
3017
|
+
createdAt: Date;
|
|
3018
|
+
updatedAt: Date;
|
|
2485
3019
|
variantId: string;
|
|
2486
3020
|
provider: string;
|
|
2487
3021
|
modelName: string;
|
|
2488
3022
|
jsonData: Record<string, unknown>;
|
|
2489
|
-
id: string;
|
|
2490
|
-
createdAt: Date;
|
|
2491
|
-
updatedAt: Date;
|
|
2492
3023
|
} | null;
|
|
2493
3024
|
variantName: string | null;
|
|
2494
3025
|
id: string;
|
|
2495
|
-
variantId: string;
|
|
2496
|
-
configId: string;
|
|
2497
3026
|
createdAt: Date;
|
|
2498
3027
|
updatedAt: Date;
|
|
3028
|
+
variantId: string;
|
|
3029
|
+
configId: string;
|
|
2499
3030
|
configName: string | null | undefined;
|
|
2500
3031
|
} | undefined>;
|
|
2501
|
-
getConfigVariantsWithDetailsByConfigId: (params:
|
|
2502
|
-
configId:
|
|
2503
|
-
limit:
|
|
2504
|
-
offset:
|
|
3032
|
+
getConfigVariantsWithDetailsByConfigId: (params: zod37.infer<zod37.ZodObject<{
|
|
3033
|
+
configId: zod37.ZodString;
|
|
3034
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
3035
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2505
3036
|
}, better_auth0.$strip>>) => Promise<{
|
|
2506
3037
|
provider: string | null;
|
|
2507
3038
|
modelName: string | null;
|
|
2508
3039
|
jsonData: Record<string, unknown> | null;
|
|
2509
3040
|
latestVersion: {
|
|
2510
3041
|
version: number;
|
|
3042
|
+
id: string;
|
|
3043
|
+
createdAt: Date;
|
|
3044
|
+
updatedAt: Date;
|
|
2511
3045
|
variantId: string;
|
|
2512
3046
|
provider: string;
|
|
2513
3047
|
modelName: string;
|
|
2514
3048
|
jsonData: Record<string, unknown>;
|
|
2515
|
-
id: string;
|
|
2516
|
-
createdAt: Date;
|
|
2517
|
-
updatedAt: Date;
|
|
2518
3049
|
} | null;
|
|
2519
3050
|
name: string | null;
|
|
2520
3051
|
id: string;
|
|
2521
|
-
variantId: string;
|
|
2522
|
-
configId: string;
|
|
2523
3052
|
createdAt: Date;
|
|
2524
3053
|
updatedAt: Date;
|
|
3054
|
+
variantId: string;
|
|
3055
|
+
configId: string;
|
|
2525
3056
|
}[]>;
|
|
2526
|
-
createVariantAndLinkToConfig: (params:
|
|
2527
|
-
configId:
|
|
2528
|
-
name:
|
|
2529
|
-
provider:
|
|
2530
|
-
modelName:
|
|
2531
|
-
jsonData:
|
|
3057
|
+
createVariantAndLinkToConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
3058
|
+
configId: zod37.ZodString;
|
|
3059
|
+
name: zod37.ZodString;
|
|
3060
|
+
provider: zod37.ZodString;
|
|
3061
|
+
modelName: zod37.ZodString;
|
|
3062
|
+
jsonData: zod37.ZodDefault<zod37.ZodOptional<zod37.ZodRecord<zod37.ZodString, zod37.ZodUnknown>>>;
|
|
2532
3063
|
}, better_auth0.$strip>>) => Promise<{
|
|
2533
3064
|
variant: {
|
|
2534
3065
|
name: string;
|
|
@@ -2538,25 +3069,25 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2538
3069
|
};
|
|
2539
3070
|
version: {
|
|
2540
3071
|
version: number;
|
|
3072
|
+
id: string;
|
|
3073
|
+
createdAt: Date;
|
|
3074
|
+
updatedAt: Date;
|
|
2541
3075
|
variantId: string;
|
|
2542
3076
|
provider: string;
|
|
2543
3077
|
modelName: string;
|
|
2544
3078
|
jsonData: Record<string, unknown>;
|
|
2545
|
-
id: string;
|
|
2546
|
-
createdAt: Date;
|
|
2547
|
-
updatedAt: Date;
|
|
2548
3079
|
};
|
|
2549
3080
|
configVariant: {
|
|
2550
|
-
variantId: string;
|
|
2551
|
-
configId: string;
|
|
2552
3081
|
id: string;
|
|
2553
3082
|
createdAt: Date;
|
|
2554
3083
|
updatedAt: Date;
|
|
3084
|
+
variantId: string;
|
|
3085
|
+
configId: string;
|
|
2555
3086
|
};
|
|
2556
3087
|
}>;
|
|
2557
|
-
getVariantJsonDataForConfig: (params:
|
|
2558
|
-
configId:
|
|
2559
|
-
envSecret:
|
|
3088
|
+
getVariantJsonDataForConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
3089
|
+
configId: zod37.ZodString;
|
|
3090
|
+
envSecret: zod37.ZodOptional<zod37.ZodString>;
|
|
2560
3091
|
}, better_auth0.$strip>>) => Promise<{
|
|
2561
3092
|
provider: string;
|
|
2562
3093
|
providerConfigId: string | null;
|
|
@@ -2567,8 +3098,8 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2567
3098
|
modelName: string;
|
|
2568
3099
|
jsonData: Record<string, unknown>;
|
|
2569
3100
|
}>;
|
|
2570
|
-
createNewConfig: (params:
|
|
2571
|
-
name:
|
|
3101
|
+
createNewConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
3102
|
+
name: zod37.ZodString;
|
|
2572
3103
|
}, better_auth0.$strip>>) => Promise<{
|
|
2573
3104
|
slug: string;
|
|
2574
3105
|
name: string | undefined;
|
|
@@ -2576,9 +3107,9 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2576
3107
|
createdAt: Date;
|
|
2577
3108
|
updatedAt: Date;
|
|
2578
3109
|
} | undefined>;
|
|
2579
|
-
updateConfigName: (params:
|
|
2580
|
-
configId:
|
|
2581
|
-
newName:
|
|
3110
|
+
updateConfigName: (params: zod37.infer<zod37.ZodObject<{
|
|
3111
|
+
configId: zod37.ZodUUID;
|
|
3112
|
+
newName: zod37.ZodString;
|
|
2582
3113
|
}, better_auth0.$strip>>) => Promise<{
|
|
2583
3114
|
slug: string;
|
|
2584
3115
|
name: string | undefined;
|
|
@@ -2586,8 +3117,8 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2586
3117
|
createdAt: Date;
|
|
2587
3118
|
updatedAt: Date;
|
|
2588
3119
|
} | undefined>;
|
|
2589
|
-
getConfigById: (params:
|
|
2590
|
-
configId:
|
|
3120
|
+
getConfigById: (params: zod37.infer<zod37.ZodObject<{
|
|
3121
|
+
configId: zod37.ZodUUID;
|
|
2591
3122
|
}, better_auth0.$strip>>) => Promise<{
|
|
2592
3123
|
slug: string;
|
|
2593
3124
|
name: string | undefined;
|
|
@@ -2595,8 +3126,8 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2595
3126
|
createdAt: Date;
|
|
2596
3127
|
updatedAt: Date;
|
|
2597
3128
|
} | undefined>;
|
|
2598
|
-
deleteConfig: (params:
|
|
2599
|
-
configId:
|
|
3129
|
+
deleteConfig: (params: zod37.infer<zod37.ZodObject<{
|
|
3130
|
+
configId: zod37.ZodUUID;
|
|
2600
3131
|
}, better_auth0.$strip>>) => Promise<{
|
|
2601
3132
|
slug: string;
|
|
2602
3133
|
name: string | undefined;
|
|
@@ -2604,9 +3135,9 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2604
3135
|
createdAt: Date;
|
|
2605
3136
|
updatedAt: Date;
|
|
2606
3137
|
} | undefined>;
|
|
2607
|
-
listConfigs: (params?:
|
|
2608
|
-
limit:
|
|
2609
|
-
offset:
|
|
3138
|
+
listConfigs: (params?: zod37.infer<zod37.ZodObject<{
|
|
3139
|
+
limit: zod37.ZodOptional<zod37.ZodNumber>;
|
|
3140
|
+
offset: zod37.ZodOptional<zod37.ZodNumber>;
|
|
2610
3141
|
}, better_auth0.$strip>>) => Promise<{
|
|
2611
3142
|
slug: string;
|
|
2612
3143
|
name: string | undefined;
|
|
@@ -2614,8 +3145,8 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2614
3145
|
createdAt: Date;
|
|
2615
3146
|
updatedAt: Date;
|
|
2616
3147
|
}[]>;
|
|
2617
|
-
getConfigWithVariants: (params:
|
|
2618
|
-
configId:
|
|
3148
|
+
getConfigWithVariants: (params: zod37.infer<zod37.ZodObject<{
|
|
3149
|
+
configId: zod37.ZodUUID;
|
|
2619
3150
|
}, better_auth0.$strip>>) => Promise<{
|
|
2620
3151
|
provider: string | null;
|
|
2621
3152
|
modelName: string | null;
|
|
@@ -2895,6 +3426,30 @@ interface ManifestEnvironment {
|
|
|
2895
3426
|
name: string;
|
|
2896
3427
|
isProd: boolean;
|
|
2897
3428
|
}
|
|
3429
|
+
/**
|
|
3430
|
+
* Guardrail configuration in the manifest
|
|
3431
|
+
* Pre-loaded for gateway use without additional DB queries
|
|
3432
|
+
*/
|
|
3433
|
+
interface ManifestGuardrail {
|
|
3434
|
+
id: string;
|
|
3435
|
+
name: string;
|
|
3436
|
+
pluginId: string;
|
|
3437
|
+
functionId: string;
|
|
3438
|
+
hookType: 'beforeRequestHook' | 'afterRequestHook';
|
|
3439
|
+
parameters: Record<string, unknown>;
|
|
3440
|
+
priority: number;
|
|
3441
|
+
onFail: 'block' | 'log';
|
|
3442
|
+
}
|
|
3443
|
+
/**
|
|
3444
|
+
* Provider-specific guardrail override in the manifest
|
|
3445
|
+
*/
|
|
3446
|
+
interface ManifestProviderGuardrailOverride {
|
|
3447
|
+
id: string;
|
|
3448
|
+
providerConfigId: string;
|
|
3449
|
+
guardrailConfigId: string;
|
|
3450
|
+
enabled: boolean;
|
|
3451
|
+
parameters: Record<string, unknown> | null;
|
|
3452
|
+
}
|
|
2898
3453
|
/**
|
|
2899
3454
|
* The complete routing manifest
|
|
2900
3455
|
* Stored in cache under key: "gateway:manifest"
|
|
@@ -2908,6 +3463,11 @@ interface GatewayManifest {
|
|
|
2908
3463
|
environmentsBySlug: Record<string, string>;
|
|
2909
3464
|
routingTable: Record<string, Record<string, ManifestTargetingRule[]>>;
|
|
2910
3465
|
secretToEnvironment: Record<string, string>;
|
|
3466
|
+
guardrails: {
|
|
3467
|
+
beforeRequestHook: ManifestGuardrail[];
|
|
3468
|
+
afterRequestHook: ManifestGuardrail[];
|
|
3469
|
+
};
|
|
3470
|
+
providerGuardrailOverrides: Record<string, ManifestProviderGuardrailOverride[]>;
|
|
2911
3471
|
}
|
|
2912
3472
|
/**
|
|
2913
3473
|
* Context passed to JSONLogic for condition evaluation
|
|
@@ -3018,4 +3578,4 @@ declare class ManifestRouter {
|
|
|
3018
3578
|
routeWithWeights(configIdOrSlug: string, environmentId: string, context?: RoutingContext): RoutingResult | null;
|
|
3019
3579
|
}
|
|
3020
3580
|
//#endregion
|
|
3021
|
-
export { type AnthropicProviderConfig, type AnyProviderConfig, AuthClientDatabaseConfig, AuthClientOptions, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, BaseCacheConfig, type BaseProviderConfig, type BedrockProviderConfig, CacheBackend, CacheBackendType, CacheConfig, CacheEntry, CacheOptions, CacheService, CacheStats, ChatCompletionCreateParamsBase, Config, ConfigVariant, type ConfigVariantsTable, type ConfigsTable, type CortexProviderConfig, CostResult, type Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, type EnvironmentSecretsTable, type EnvironmentsTable, FileCacheBackend, FileCacheConfig, type FireworksAIProviderConfig, type GatewayManifest, type GoogleProviderConfig, type HuggingFaceProviderConfig, Insertable, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, LLMRequest, type LLMRequestInsert, LLMRequestsTable, MS, ManifestBuilder, type ManifestConfig, type ManifestEnvironment, ManifestRouter, ManifestService, type ManifestTargetingRule, type ManifestVariantVersion, MemoryCacheBackend, MemoryCacheConfig, MigrationOptions, MigrationResult, type MistralAIProviderConfig, ModelPricing, ModelsDevPricingProvider, type OpenAIProviderConfig, type OracleProviderConfig, Prettify, PricingProvider, ProviderConfig, type ProviderConfigMap, ProviderConfigsTable, type ProvidersConfig, type RoutingContext, type RoutingResult, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, type StabilityAIProviderConfig, SupportedProviders, type TableName, TargetingRule, type TargetingRulesTable, Updateable, UsageData, type ValidatedLLMOpsConfig, Variant, VariantJsonData, VariantVersion, VariantVersionsTable, type VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, WorkspaceSettings, WorkspaceSettingsTable, calculateCost, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, createLLMRequestsDataLayer, createNeonDialect, createProviderConfigsDataLayer, createWorkspaceSettingsDataLayer, detectDatabaseType, dollarsToMicroDollars, environmentSecretsSchema, environmentsSchema, executeWithSchema, formatCost, gateway, generateId, getAuthClientOptions, getDefaultPricingProvider, getMigrations, llmRequestsSchema, llmopsConfigSchema, logger, matchType, microDollarsToDollars, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
|
3581
|
+
export { type AnthropicProviderConfig, type AnyProviderConfig, AuthClientDatabaseConfig, AuthClientOptions, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, BaseCacheConfig, type BaseProviderConfig, type BedrockProviderConfig, CacheBackend, CacheBackendType, CacheConfig, CacheEntry, CacheOptions, CacheService, CacheStats, ChatCompletionCreateParamsBase, Config, ConfigVariant, type ConfigVariantsTable, type ConfigsTable, type CortexProviderConfig, CostResult, type Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, type EnvironmentSecretsTable, type EnvironmentsTable, FileCacheBackend, FileCacheConfig, type FireworksAIProviderConfig, type GatewayManifest, type GoogleProviderConfig, GuardrailConfig, GuardrailConfigsTable, GuardrailResult, GuardrailResults, type HuggingFaceProviderConfig, Insertable, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, LLMRequest, type LLMRequestInsert, LLMRequestsTable, MS, ManifestBuilder, type ManifestConfig, type ManifestEnvironment, type ManifestGuardrail, type ManifestProviderGuardrailOverride, ManifestRouter, ManifestService, type ManifestTargetingRule, type ManifestVariantVersion, MemoryCacheBackend, MemoryCacheConfig, MigrationOptions, MigrationResult, type MistralAIProviderConfig, ModelPricing, ModelsDevPricingProvider, type OpenAIProviderConfig, type OracleProviderConfig, Prettify, PricingProvider, ProviderConfig, type ProviderConfigMap, ProviderConfigsTable, ProviderGuardrailOverride, ProviderGuardrailOverridesTable, type ProvidersConfig, type RoutingContext, type RoutingResult, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, type StabilityAIProviderConfig, SupportedProviders, type TableName, TargetingRule, type TargetingRulesTable, Updateable, UsageData, type ValidatedLLMOpsConfig, Variant, VariantJsonData, VariantVersion, VariantVersionsTable, type VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, WorkspaceSettings, WorkspaceSettingsTable, calculateCost, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, createGuardrailConfigsDataLayer, createLLMRequestsDataLayer, createNeonDialect, createProviderConfigsDataLayer, createProviderGuardrailOverridesDataLayer, createWorkspaceSettingsDataLayer, detectDatabaseType, dollarsToMicroDollars, environmentSecretsSchema, environmentsSchema, executeWithSchema, formatCost, gateway, generateId, getAuthClientOptions, getDefaultPricingProvider, getMigrations, guardrailConfigsSchema, llmRequestsSchema, llmopsConfigSchema, logger, matchType, microDollarsToDollars, parsePartialTableData, parseTableData, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|