@llmops/core 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/db/index.d.cts +1 -1
- package/dist/db/index.d.mts +1 -1
- package/dist/{index-DTrGHajL.d.cts → index-BtZBaB4H.d.cts} +59 -59
- package/dist/{index-apsBKXTb.d.mts → index-DkZvY6Q3.d.mts} +59 -59
- package/dist/index.cjs +15 -3
- package/dist/index.d.cts +1769 -2652
- package/dist/index.d.mts +1769 -2652
- package/dist/index.mjs +8 -4
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { $ as SCHEMA_METADATA, A as DatasetsTable, At as variantsSchema, B as LLMRequest, C as Dataset, Ct as playgroundRunsSchema, D as DatasetVersionRecord, Dt as schemas, E as DatasetVersion, Et as providerGuardrailOverridesSchema, F as GuardrailConfig, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, M as EnvironmentSecret, N as EnvironmentSecretsTable, O as DatasetVersionRecordsTable, Ot as targetingRulesSchema, P as EnvironmentsTable, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, S as Database, St as playgroundResultsSchema, T as DatasetRecordsTable, Tt as providerConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as environmentSecretsSchema, a as createDatabaseFromConnection, at as Variant, b as ConfigVariantsTable, bt as llmRequestsSchema, c as executeWithSchema, ct as VariantsTable, d as getMigrations, dt as configVariantsSchema, et as Selectable, f as matchType, ft as configsSchema, g as validatePartialTableData, gt as datasetsSchema, h as parseTableData, ht as datasetVersionsSchema, i as createDatabase, it as Updateable, j as Environment, jt as workspaceSettingsSchema, k as DatasetVersionsTable, kt as variantVersionsSchema, l as MigrationOptions, lt as WorkspaceSettings, m as parsePartialTableData, mt as datasetVersionRecordsSchema, n as DatabaseOptions, nt as TargetingRule, o as detectDatabaseType, ot as VariantVersion, p as runAutoMigrations, pt as datasetRecordsSchema, q as PlaygroundRunsTable, r as DatabaseType, rt as TargetingRulesTable, s as createNeonDialect, st as VariantVersionsTable, t as DatabaseConnection, tt as TableName, u as MigrationResult, ut as WorkspaceSettingsTable, v as Config, vt as environmentsSchema, w as DatasetRecord, wt as playgroundsSchema, x as ConfigsTable, xt as playgroundColumnSchema, y as ConfigVariant, yt as guardrailConfigsSchema, z as Insertable } from "./index-
|
|
1
|
+
import { $ as SCHEMA_METADATA, A as DatasetsTable, At as variantsSchema, B as LLMRequest, C as Dataset, Ct as playgroundRunsSchema, D as DatasetVersionRecord, Dt as schemas, E as DatasetVersion, Et as providerGuardrailOverridesSchema, F as GuardrailConfig, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, M as EnvironmentSecret, N as EnvironmentSecretsTable, O as DatasetVersionRecordsTable, Ot as targetingRulesSchema, P as EnvironmentsTable, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, S as Database, St as playgroundResultsSchema, T as DatasetRecordsTable, Tt as providerConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as environmentSecretsSchema, a as createDatabaseFromConnection, at as Variant, b as ConfigVariantsTable, bt as llmRequestsSchema, c as executeWithSchema, ct as VariantsTable, d as getMigrations, dt as configVariantsSchema, et as Selectable, f as matchType, ft as configsSchema, g as validatePartialTableData, gt as datasetsSchema, h as parseTableData, ht as datasetVersionsSchema, i as createDatabase, it as Updateable, j as Environment, jt as workspaceSettingsSchema, k as DatasetVersionsTable, kt as variantVersionsSchema, l as MigrationOptions, lt as WorkspaceSettings, m as parsePartialTableData, mt as datasetVersionRecordsSchema, n as DatabaseOptions, nt as TargetingRule, o as detectDatabaseType, ot as VariantVersion, p as runAutoMigrations, pt as datasetRecordsSchema, q as PlaygroundRunsTable, r as DatabaseType, rt as TargetingRulesTable, s as createNeonDialect, st as VariantVersionsTable, t as DatabaseConnection, tt as TableName, u as MigrationResult, ut as WorkspaceSettingsTable, v as Config, vt as environmentsSchema, w as DatasetRecord, wt as playgroundsSchema, x as ConfigsTable, xt as playgroundColumnSchema, y as ConfigVariant, yt as guardrailConfigsSchema, z as Insertable } from "./index-BtZBaB4H.cjs";
|
|
2
2
|
import * as kysely0 from "kysely";
|
|
3
3
|
import { Kysely } from "kysely";
|
|
4
|
-
import * as zod0 from "zod";
|
|
5
4
|
import z$1, { z } from "zod";
|
|
6
5
|
import gateway from "@llmops/gateway";
|
|
7
6
|
import pino from "pino";
|
|
8
|
-
import * as better_auth0 from "better-auth";
|
|
9
7
|
import { BetterAuthOptions } from "better-auth";
|
|
10
8
|
import { RulesLogic } from "json-logic-js";
|
|
11
9
|
|
|
@@ -1066,2129 +1064,1133 @@ declare const logger: pino.Logger<never, boolean>;
|
|
|
1066
1064
|
//#region src/utils/id.d.ts
|
|
1067
1065
|
declare const generateId: (size?: number) => string;
|
|
1068
1066
|
//#endregion
|
|
1069
|
-
//#region src/datalayer/
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
*/
|
|
1073
|
-
declare const insertLLMRequestSchema: z$1.ZodObject<{
|
|
1074
|
-
requestId: z$1.ZodString;
|
|
1075
|
-
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1076
|
-
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1077
|
-
environmentId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1078
|
-
providerConfigId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1079
|
-
provider: z$1.ZodString;
|
|
1080
|
-
model: z$1.ZodString;
|
|
1081
|
-
promptTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1082
|
-
completionTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1083
|
-
totalTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1084
|
-
cachedTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1085
|
-
cost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1086
|
-
inputCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1087
|
-
outputCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1088
|
-
endpoint: z$1.ZodString;
|
|
1089
|
-
statusCode: z$1.ZodNumber;
|
|
1090
|
-
latencyMs: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1091
|
-
isStreaming: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1092
|
-
userId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1093
|
-
tags: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
1094
|
-
guardrailResults: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodObject<{
|
|
1095
|
-
results: z$1.ZodArray<z$1.ZodObject<{
|
|
1096
|
-
checkId: z$1.ZodString;
|
|
1097
|
-
functionId: z$1.ZodString;
|
|
1098
|
-
hookType: z$1.ZodEnum<{
|
|
1099
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1100
|
-
afterRequestHook: "afterRequestHook";
|
|
1101
|
-
}>;
|
|
1102
|
-
verdict: z$1.ZodBoolean;
|
|
1103
|
-
latencyMs: z$1.ZodNumber;
|
|
1104
|
-
}, z$1.core.$strip>>;
|
|
1105
|
-
action: z$1.ZodEnum<{
|
|
1106
|
-
allowed: "allowed";
|
|
1107
|
-
blocked: "blocked";
|
|
1108
|
-
logged: "logged";
|
|
1109
|
-
}>;
|
|
1110
|
-
totalLatencyMs: z$1.ZodNumber;
|
|
1111
|
-
}, z$1.core.$strip>>>;
|
|
1067
|
+
//#region src/datalayer/configs.d.ts
|
|
1068
|
+
declare const createNewConfig: z$1.ZodObject<{
|
|
1069
|
+
name: z$1.ZodString;
|
|
1112
1070
|
}, z$1.core.$strip>;
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
*/
|
|
1117
|
-
declare const listRequestsSchema: z$1.ZodObject<{
|
|
1118
|
-
limit: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1119
|
-
offset: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1120
|
-
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
1121
|
-
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
1122
|
-
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
1123
|
-
providerConfigId: z$1.ZodOptional<z$1.ZodString>;
|
|
1124
|
-
provider: z$1.ZodOptional<z$1.ZodString>;
|
|
1125
|
-
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1126
|
-
startDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
1127
|
-
endDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
1128
|
-
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
1071
|
+
declare const updateConfigName: z$1.ZodObject<{
|
|
1072
|
+
configId: z$1.ZodUUID;
|
|
1073
|
+
newName: z$1.ZodString;
|
|
1129
1074
|
}, z$1.core.$strip>;
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
*/
|
|
1133
|
-
declare const dateRangeSchema: z$1.ZodObject<{
|
|
1134
|
-
startDate: z$1.ZodDate;
|
|
1135
|
-
endDate: z$1.ZodDate;
|
|
1136
|
-
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
1137
|
-
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
1138
|
-
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
1139
|
-
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
1075
|
+
declare const getConfigById: z$1.ZodObject<{
|
|
1076
|
+
configId: z$1.ZodUUID;
|
|
1140
1077
|
}, z$1.core.$strip>;
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
*/
|
|
1144
|
-
declare const costSummarySchema: z$1.ZodObject<{
|
|
1145
|
-
startDate: z$1.ZodDate;
|
|
1146
|
-
endDate: z$1.ZodDate;
|
|
1147
|
-
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
1148
|
-
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
1149
|
-
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
1150
|
-
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
1151
|
-
groupBy: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1152
|
-
provider: "provider";
|
|
1153
|
-
model: "model";
|
|
1154
|
-
day: "day";
|
|
1155
|
-
hour: "hour";
|
|
1156
|
-
config: "config";
|
|
1157
|
-
}>>;
|
|
1078
|
+
declare const deleteConfig: z$1.ZodObject<{
|
|
1079
|
+
configId: z$1.ZodUUID;
|
|
1158
1080
|
}, z$1.core.$strip>;
|
|
1159
|
-
declare const
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
/**
|
|
1168
|
-
* Insert a single LLM request log
|
|
1169
|
-
*/
|
|
1170
|
-
insertRequest: (request: LLMRequestInsert) => Promise<{
|
|
1171
|
-
configId: string | null;
|
|
1172
|
-
variantId: string | null;
|
|
1081
|
+
declare const listConfigs: z$1.ZodObject<{
|
|
1082
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1083
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1084
|
+
}, z$1.core.$strip>;
|
|
1085
|
+
declare const createConfigDataLayer: (db: Kysely<Database>) => {
|
|
1086
|
+
createNewConfig: (params: z$1.infer<typeof createNewConfig>) => Promise<{
|
|
1087
|
+
slug: string;
|
|
1088
|
+
name: string | undefined;
|
|
1173
1089
|
id: string;
|
|
1174
|
-
provider: string;
|
|
1175
|
-
environmentId: string | null;
|
|
1176
|
-
requestId: string;
|
|
1177
|
-
providerConfigId: string | null;
|
|
1178
|
-
model: string;
|
|
1179
|
-
promptTokens: number;
|
|
1180
|
-
completionTokens: number;
|
|
1181
|
-
totalTokens: number;
|
|
1182
|
-
cachedTokens: number;
|
|
1183
|
-
cost: number;
|
|
1184
|
-
inputCost: number;
|
|
1185
|
-
outputCost: number;
|
|
1186
|
-
endpoint: string;
|
|
1187
|
-
statusCode: number;
|
|
1188
|
-
latencyMs: number;
|
|
1189
|
-
isStreaming: boolean;
|
|
1190
|
-
userId: string | null;
|
|
1191
|
-
tags: Record<string, string>;
|
|
1192
|
-
guardrailResults: {
|
|
1193
|
-
results: {
|
|
1194
|
-
checkId: string;
|
|
1195
|
-
functionId: string;
|
|
1196
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1197
|
-
verdict: boolean;
|
|
1198
|
-
latencyMs: number;
|
|
1199
|
-
}[];
|
|
1200
|
-
action: "allowed" | "blocked" | "logged";
|
|
1201
|
-
totalLatencyMs: number;
|
|
1202
|
-
} | null;
|
|
1203
1090
|
createdAt: Date;
|
|
1204
1091
|
updatedAt: Date;
|
|
1205
1092
|
} | undefined>;
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
*/
|
|
1210
|
-
listRequests: (params?: z$1.infer<typeof listRequestsSchema>) => Promise<{
|
|
1211
|
-
data: {
|
|
1212
|
-
configId: string | null;
|
|
1213
|
-
variantId: string | null;
|
|
1214
|
-
id: string;
|
|
1215
|
-
provider: string;
|
|
1216
|
-
environmentId: string | null;
|
|
1217
|
-
requestId: string;
|
|
1218
|
-
providerConfigId: string | null;
|
|
1219
|
-
model: string;
|
|
1220
|
-
promptTokens: number;
|
|
1221
|
-
completionTokens: number;
|
|
1222
|
-
totalTokens: number;
|
|
1223
|
-
cachedTokens: number;
|
|
1224
|
-
cost: number;
|
|
1225
|
-
inputCost: number;
|
|
1226
|
-
outputCost: number;
|
|
1227
|
-
endpoint: string;
|
|
1228
|
-
statusCode: number;
|
|
1229
|
-
latencyMs: number;
|
|
1230
|
-
isStreaming: boolean;
|
|
1231
|
-
userId: string | null;
|
|
1232
|
-
tags: Record<string, string>;
|
|
1233
|
-
guardrailResults: {
|
|
1234
|
-
results: {
|
|
1235
|
-
checkId: string;
|
|
1236
|
-
functionId: string;
|
|
1237
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1238
|
-
verdict: boolean;
|
|
1239
|
-
latencyMs: number;
|
|
1240
|
-
}[];
|
|
1241
|
-
action: "allowed" | "blocked" | "logged";
|
|
1242
|
-
totalLatencyMs: number;
|
|
1243
|
-
} | null;
|
|
1244
|
-
createdAt: Date;
|
|
1245
|
-
updatedAt: Date;
|
|
1246
|
-
}[];
|
|
1247
|
-
total: number;
|
|
1248
|
-
limit: number;
|
|
1249
|
-
offset: number;
|
|
1250
|
-
}>;
|
|
1251
|
-
/**
|
|
1252
|
-
* Get a single request by requestId
|
|
1253
|
-
*/
|
|
1254
|
-
getRequestByRequestId: (requestId: string) => Promise<{
|
|
1255
|
-
configId: string | null;
|
|
1256
|
-
variantId: string | null;
|
|
1093
|
+
updateConfigName: (params: z$1.infer<typeof updateConfigName>) => Promise<{
|
|
1094
|
+
slug: string;
|
|
1095
|
+
name: string | undefined;
|
|
1257
1096
|
id: string;
|
|
1258
|
-
provider: string;
|
|
1259
|
-
environmentId: string | null;
|
|
1260
|
-
requestId: string;
|
|
1261
|
-
providerConfigId: string | null;
|
|
1262
|
-
model: string;
|
|
1263
|
-
promptTokens: number;
|
|
1264
|
-
completionTokens: number;
|
|
1265
|
-
totalTokens: number;
|
|
1266
|
-
cachedTokens: number;
|
|
1267
|
-
cost: number;
|
|
1268
|
-
inputCost: number;
|
|
1269
|
-
outputCost: number;
|
|
1270
|
-
endpoint: string;
|
|
1271
|
-
statusCode: number;
|
|
1272
|
-
latencyMs: number;
|
|
1273
|
-
isStreaming: boolean;
|
|
1274
|
-
userId: string | null;
|
|
1275
|
-
tags: Record<string, string>;
|
|
1276
|
-
guardrailResults: {
|
|
1277
|
-
results: {
|
|
1278
|
-
checkId: string;
|
|
1279
|
-
functionId: string;
|
|
1280
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1281
|
-
verdict: boolean;
|
|
1282
|
-
latencyMs: number;
|
|
1283
|
-
}[];
|
|
1284
|
-
action: "allowed" | "blocked" | "logged";
|
|
1285
|
-
totalLatencyMs: number;
|
|
1286
|
-
} | null;
|
|
1287
1097
|
createdAt: Date;
|
|
1288
1098
|
updatedAt: Date;
|
|
1289
1099
|
} | undefined>;
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
totalOutputCost: number;
|
|
1297
|
-
totalPromptTokens: number;
|
|
1298
|
-
totalCompletionTokens: number;
|
|
1299
|
-
totalTokens: number;
|
|
1300
|
-
requestCount: number;
|
|
1100
|
+
getConfigById: (params: z$1.infer<typeof getConfigById>) => Promise<{
|
|
1101
|
+
slug: string;
|
|
1102
|
+
name: string | undefined;
|
|
1103
|
+
id: string;
|
|
1104
|
+
createdAt: Date;
|
|
1105
|
+
updatedAt: Date;
|
|
1301
1106
|
} | undefined>;
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1107
|
+
deleteConfig: (params: z$1.infer<typeof deleteConfig>) => Promise<{
|
|
1108
|
+
slug: string;
|
|
1109
|
+
name: string | undefined;
|
|
1110
|
+
id: string;
|
|
1111
|
+
createdAt: Date;
|
|
1112
|
+
updatedAt: Date;
|
|
1113
|
+
} | undefined>;
|
|
1114
|
+
listConfigs: (params?: z$1.infer<typeof listConfigs>) => Promise<{
|
|
1115
|
+
slug: string;
|
|
1116
|
+
name: string | undefined;
|
|
1117
|
+
id: string;
|
|
1118
|
+
createdAt: Date;
|
|
1119
|
+
updatedAt: Date;
|
|
1314
1120
|
}[]>;
|
|
1315
1121
|
/**
|
|
1316
|
-
* Get
|
|
1317
|
-
*/
|
|
1318
|
-
getCostByProvider: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
1319
|
-
provider: string;
|
|
1320
|
-
totalCost: number;
|
|
1321
|
-
totalInputCost: number;
|
|
1322
|
-
totalOutputCost: number;
|
|
1323
|
-
totalTokens: number;
|
|
1324
|
-
requestCount: number;
|
|
1325
|
-
avgLatencyMs: number;
|
|
1326
|
-
}[]>;
|
|
1327
|
-
/**
|
|
1328
|
-
* Get cost breakdown by config
|
|
1329
|
-
*/
|
|
1330
|
-
getCostByConfig: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
1331
|
-
configId: string | null;
|
|
1332
|
-
totalCost: number;
|
|
1333
|
-
totalInputCost: number;
|
|
1334
|
-
totalOutputCost: number;
|
|
1335
|
-
totalTokens: number;
|
|
1336
|
-
requestCount: number;
|
|
1337
|
-
configName: string | null | undefined;
|
|
1338
|
-
configSlug: string | null;
|
|
1339
|
-
}[]>;
|
|
1340
|
-
/**
|
|
1341
|
-
* Get daily cost summary
|
|
1342
|
-
*/
|
|
1343
|
-
getDailyCosts: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
1344
|
-
totalCost: number;
|
|
1345
|
-
totalInputCost: number;
|
|
1346
|
-
totalOutputCost: number;
|
|
1347
|
-
totalTokens: number;
|
|
1348
|
-
requestCount: number;
|
|
1349
|
-
date: string;
|
|
1350
|
-
}[]>;
|
|
1351
|
-
/**
|
|
1352
|
-
* Get cost summary with flexible grouping and optional filters
|
|
1353
|
-
*/
|
|
1354
|
-
getCostSummary: (params: z$1.infer<typeof costSummarySchema>) => Promise<{
|
|
1355
|
-
totalCost: number;
|
|
1356
|
-
requestCount: number;
|
|
1357
|
-
groupKey: string;
|
|
1358
|
-
}[]>;
|
|
1359
|
-
/**
|
|
1360
|
-
* Get request count and stats for a time range with optional filters
|
|
1361
|
-
*/
|
|
1362
|
-
getRequestStats: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
1363
|
-
avgLatencyMs: number;
|
|
1364
|
-
totalRequests: number;
|
|
1365
|
-
successfulRequests: number;
|
|
1366
|
-
failedRequests: number;
|
|
1367
|
-
streamingRequests: number;
|
|
1368
|
-
maxLatencyMs: number;
|
|
1369
|
-
minLatencyMs: number;
|
|
1370
|
-
} | undefined>;
|
|
1371
|
-
/**
|
|
1372
|
-
* Get all distinct tag key-value pairs from llm_requests
|
|
1373
|
-
* Used for populating tag filter dropdowns in the UI
|
|
1374
|
-
*/
|
|
1375
|
-
getDistinctTags: () => Promise<{
|
|
1376
|
-
key: string;
|
|
1377
|
-
value: string;
|
|
1378
|
-
}[]>;
|
|
1379
|
-
};
|
|
1380
|
-
//#endregion
|
|
1381
|
-
//#region src/datalayer/workspaceSettings.d.ts
|
|
1382
|
-
declare const updateWorkspaceSettings: z$1.ZodObject<{
|
|
1383
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1384
|
-
setupComplete: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1385
|
-
superAdminId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1386
|
-
}, z$1.core.$strip>;
|
|
1387
|
-
declare const createWorkspaceSettingsDataLayer: (db: Kysely<Database>) => {
|
|
1388
|
-
/**
|
|
1389
|
-
* Get workspace settings (creates default if not exists)
|
|
1390
|
-
*/
|
|
1391
|
-
getWorkspaceSettings: () => Promise<{
|
|
1392
|
-
name: string | null;
|
|
1393
|
-
id: string;
|
|
1394
|
-
setupComplete: boolean;
|
|
1395
|
-
superAdminId: string | null;
|
|
1396
|
-
createdAt: Date;
|
|
1397
|
-
updatedAt: Date;
|
|
1398
|
-
} | undefined>;
|
|
1399
|
-
/**
|
|
1400
|
-
* Update workspace settings
|
|
1401
|
-
*/
|
|
1402
|
-
updateWorkspaceSettings: (params: z$1.infer<typeof updateWorkspaceSettings>) => Promise<{
|
|
1403
|
-
name: string | null;
|
|
1404
|
-
id: string;
|
|
1405
|
-
setupComplete: boolean;
|
|
1406
|
-
superAdminId: string | null;
|
|
1407
|
-
createdAt: Date;
|
|
1408
|
-
updatedAt: Date;
|
|
1409
|
-
} | undefined>;
|
|
1410
|
-
/**
|
|
1411
|
-
* Get the super admin user ID
|
|
1122
|
+
* Get config with its variants and their latest versions
|
|
1412
1123
|
*/
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
*/
|
|
1421
|
-
isSetupComplete: () => Promise<boolean>;
|
|
1422
|
-
/**
|
|
1423
|
-
* Mark initial setup as complete
|
|
1424
|
-
*/
|
|
1425
|
-
markSetupComplete: () => Promise<{
|
|
1426
|
-
name: string | null;
|
|
1124
|
+
getConfigWithVariants: (params: z$1.infer<typeof getConfigById>) => Promise<{
|
|
1125
|
+
provider: string | null;
|
|
1126
|
+
modelName: string | null;
|
|
1127
|
+
jsonData: Record<string, unknown> | null;
|
|
1128
|
+
variantVersionId: string | null;
|
|
1129
|
+
slug: string;
|
|
1130
|
+
name: string | undefined;
|
|
1427
1131
|
id: string;
|
|
1428
|
-
setupComplete: boolean;
|
|
1429
|
-
superAdminId: string | null;
|
|
1430
1132
|
createdAt: Date;
|
|
1431
1133
|
updatedAt: Date;
|
|
1432
|
-
|
|
1134
|
+
variantId: string | null;
|
|
1135
|
+
variantName: string | null;
|
|
1136
|
+
}[]>;
|
|
1433
1137
|
};
|
|
1434
1138
|
//#endregion
|
|
1435
|
-
//#region src/datalayer/
|
|
1436
|
-
declare const
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1440
|
-
config: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
1441
|
-
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1139
|
+
//#region src/datalayer/configVariants.d.ts
|
|
1140
|
+
declare const createConfigVariant: z$1.ZodObject<{
|
|
1141
|
+
configId: z$1.ZodString;
|
|
1142
|
+
variantId: z$1.ZodString;
|
|
1442
1143
|
}, z$1.core.$strip>;
|
|
1443
|
-
declare const
|
|
1444
|
-
id: z$1.
|
|
1445
|
-
slug: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1446
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1447
|
-
config: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1448
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1144
|
+
declare const getConfigVariantById: z$1.ZodObject<{
|
|
1145
|
+
id: z$1.ZodString;
|
|
1449
1146
|
}, z$1.core.$strip>;
|
|
1450
|
-
declare const
|
|
1451
|
-
|
|
1147
|
+
declare const getConfigVariantsByConfigId: z$1.ZodObject<{
|
|
1148
|
+
configId: z$1.ZodString;
|
|
1149
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1150
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1452
1151
|
}, z$1.core.$strip>;
|
|
1453
|
-
declare const
|
|
1454
|
-
|
|
1152
|
+
declare const getConfigVariantsByVariantId: z$1.ZodObject<{
|
|
1153
|
+
variantId: z$1.ZodString;
|
|
1154
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1155
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1455
1156
|
}, z$1.core.$strip>;
|
|
1456
|
-
declare const
|
|
1457
|
-
|
|
1157
|
+
declare const deleteConfigVariant: z$1.ZodObject<{
|
|
1158
|
+
id: z$1.ZodString;
|
|
1458
1159
|
}, z$1.core.$strip>;
|
|
1459
|
-
declare const
|
|
1460
|
-
|
|
1160
|
+
declare const deleteConfigVariantByIds: z$1.ZodObject<{
|
|
1161
|
+
configId: z$1.ZodString;
|
|
1162
|
+
variantId: z$1.ZodString;
|
|
1461
1163
|
}, z$1.core.$strip>;
|
|
1462
|
-
declare const
|
|
1164
|
+
declare const listConfigVariants: z$1.ZodObject<{
|
|
1463
1165
|
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1464
1166
|
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1465
1167
|
}, z$1.core.$strip>;
|
|
1466
|
-
declare const
|
|
1467
|
-
|
|
1468
|
-
|
|
1168
|
+
declare const createVariantAndLinkToConfig: z$1.ZodObject<{
|
|
1169
|
+
configId: z$1.ZodString;
|
|
1170
|
+
name: z$1.ZodString;
|
|
1171
|
+
provider: z$1.ZodString;
|
|
1172
|
+
modelName: z$1.ZodString;
|
|
1173
|
+
jsonData: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1174
|
+
}, z$1.core.$strip>;
|
|
1175
|
+
declare const getVariantJsonDataForConfig: z$1.ZodObject<{
|
|
1176
|
+
configId: z$1.ZodString;
|
|
1177
|
+
envSecret: z$1.ZodOptional<z$1.ZodString>;
|
|
1178
|
+
}, z$1.core.$strip>;
|
|
1179
|
+
declare const createConfigVariantDataLayer: (db: Kysely<Database>) => {
|
|
1180
|
+
createConfigVariant: (params: z$1.infer<typeof createConfigVariant>) => Promise<{
|
|
1469
1181
|
id: string;
|
|
1470
|
-
slug: string | null;
|
|
1471
|
-
enabled: boolean;
|
|
1472
|
-
config: Record<string, unknown>;
|
|
1473
|
-
providerId: string;
|
|
1474
1182
|
createdAt: Date;
|
|
1475
1183
|
updatedAt: Date;
|
|
1184
|
+
variantId: string;
|
|
1185
|
+
configId: string;
|
|
1476
1186
|
} | undefined>;
|
|
1477
|
-
|
|
1478
|
-
name: string | null;
|
|
1187
|
+
getConfigVariantById: (params: z$1.infer<typeof getConfigVariantById>) => Promise<{
|
|
1479
1188
|
id: string;
|
|
1480
|
-
slug: string | null;
|
|
1481
|
-
enabled: boolean;
|
|
1482
|
-
config: Record<string, unknown>;
|
|
1483
|
-
providerId: string;
|
|
1484
1189
|
createdAt: Date;
|
|
1485
1190
|
updatedAt: Date;
|
|
1191
|
+
variantId: string;
|
|
1192
|
+
configId: string;
|
|
1486
1193
|
} | undefined>;
|
|
1487
|
-
|
|
1488
|
-
name: string | null;
|
|
1194
|
+
getConfigVariantsByConfigId: (params: z$1.infer<typeof getConfigVariantsByConfigId>) => Promise<{
|
|
1489
1195
|
id: string;
|
|
1490
|
-
slug: string | null;
|
|
1491
|
-
enabled: boolean;
|
|
1492
|
-
config: Record<string, unknown>;
|
|
1493
|
-
providerId: string;
|
|
1494
1196
|
createdAt: Date;
|
|
1495
1197
|
updatedAt: Date;
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1198
|
+
variantId: string;
|
|
1199
|
+
configId: string;
|
|
1200
|
+
}[]>;
|
|
1201
|
+
getConfigVariantsByVariantId: (params: z$1.infer<typeof getConfigVariantsByVariantId>) => Promise<{
|
|
1499
1202
|
id: string;
|
|
1500
|
-
slug: string | null;
|
|
1501
|
-
enabled: boolean;
|
|
1502
|
-
config: Record<string, unknown>;
|
|
1503
|
-
providerId: string;
|
|
1504
1203
|
createdAt: Date;
|
|
1505
1204
|
updatedAt: Date;
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1205
|
+
variantId: string;
|
|
1206
|
+
configId: string;
|
|
1207
|
+
}[]>;
|
|
1208
|
+
deleteConfigVariant: (params: z$1.infer<typeof deleteConfigVariant>) => Promise<{
|
|
1509
1209
|
id: string;
|
|
1510
|
-
slug: string | null;
|
|
1511
|
-
enabled: boolean;
|
|
1512
|
-
config: Record<string, unknown>;
|
|
1513
|
-
providerId: string;
|
|
1514
1210
|
createdAt: Date;
|
|
1515
1211
|
updatedAt: Date;
|
|
1212
|
+
variantId: string;
|
|
1213
|
+
configId: string;
|
|
1516
1214
|
} | undefined>;
|
|
1517
|
-
|
|
1518
|
-
name: string | null;
|
|
1215
|
+
deleteConfigVariantByIds: (params: z$1.infer<typeof deleteConfigVariantByIds>) => Promise<{
|
|
1519
1216
|
id: string;
|
|
1520
|
-
slug: string | null;
|
|
1521
|
-
enabled: boolean;
|
|
1522
|
-
config: Record<string, unknown>;
|
|
1523
|
-
providerId: string;
|
|
1524
1217
|
createdAt: Date;
|
|
1525
1218
|
updatedAt: Date;
|
|
1219
|
+
variantId: string;
|
|
1220
|
+
configId: string;
|
|
1526
1221
|
} | undefined>;
|
|
1527
|
-
|
|
1528
|
-
name: string | null;
|
|
1222
|
+
listConfigVariants: (params?: z$1.infer<typeof listConfigVariants>) => Promise<{
|
|
1529
1223
|
id: string;
|
|
1530
|
-
slug: string | null;
|
|
1531
|
-
enabled: boolean;
|
|
1532
|
-
config: Record<string, unknown>;
|
|
1533
|
-
providerId: string;
|
|
1534
1224
|
createdAt: Date;
|
|
1535
1225
|
updatedAt: Date;
|
|
1226
|
+
variantId: string;
|
|
1227
|
+
configId: string;
|
|
1536
1228
|
}[]>;
|
|
1537
|
-
|
|
1229
|
+
getConfigVariantWithDetails: (params: z$1.infer<typeof getConfigVariantById>) => Promise<{
|
|
1230
|
+
latestVersion: {
|
|
1231
|
+
version: number;
|
|
1232
|
+
id: string;
|
|
1233
|
+
createdAt: Date;
|
|
1234
|
+
updatedAt: Date;
|
|
1235
|
+
variantId: string;
|
|
1236
|
+
provider: string;
|
|
1237
|
+
modelName: string;
|
|
1238
|
+
jsonData: Record<string, unknown>;
|
|
1239
|
+
} | null;
|
|
1240
|
+
configId: string;
|
|
1241
|
+
id: string;
|
|
1242
|
+
createdAt: Date;
|
|
1243
|
+
updatedAt: Date;
|
|
1244
|
+
variantId: string;
|
|
1245
|
+
variantName: string | null;
|
|
1246
|
+
configName: string | null | undefined;
|
|
1247
|
+
} | undefined>;
|
|
1538
1248
|
/**
|
|
1539
|
-
*
|
|
1540
|
-
* Useful for the dashboard UI where you want to set/update a provider config
|
|
1249
|
+
* Get config variants with details including latest version data
|
|
1541
1250
|
*/
|
|
1542
|
-
|
|
1543
|
-
|
|
1251
|
+
getConfigVariantsWithDetailsByConfigId: (params: z$1.infer<typeof getConfigVariantsByConfigId>) => Promise<{
|
|
1252
|
+
provider: string | null;
|
|
1253
|
+
modelName: string | null;
|
|
1254
|
+
jsonData: Record<string, unknown> | null;
|
|
1255
|
+
latestVersion: {
|
|
1256
|
+
version: number;
|
|
1257
|
+
id: string;
|
|
1258
|
+
createdAt: Date;
|
|
1259
|
+
updatedAt: Date;
|
|
1260
|
+
variantId: string;
|
|
1261
|
+
provider: string;
|
|
1262
|
+
modelName: string;
|
|
1263
|
+
jsonData: Record<string, unknown>;
|
|
1264
|
+
} | null;
|
|
1265
|
+
configId: string;
|
|
1544
1266
|
id: string;
|
|
1545
|
-
slug: string | null;
|
|
1546
|
-
enabled: boolean;
|
|
1547
|
-
config: Record<string, unknown>;
|
|
1548
|
-
providerId: string;
|
|
1549
1267
|
createdAt: Date;
|
|
1550
1268
|
updatedAt: Date;
|
|
1551
|
-
|
|
1269
|
+
variantId: string;
|
|
1270
|
+
name: string | null;
|
|
1271
|
+
}[]>;
|
|
1272
|
+
/**
|
|
1273
|
+
* Create a new variant with its first version and link to config
|
|
1274
|
+
*/
|
|
1275
|
+
createVariantAndLinkToConfig: (params: z$1.infer<typeof createVariantAndLinkToConfig>) => Promise<{
|
|
1276
|
+
variant: {
|
|
1277
|
+
name: string;
|
|
1278
|
+
id: string;
|
|
1279
|
+
createdAt: Date;
|
|
1280
|
+
updatedAt: Date;
|
|
1281
|
+
};
|
|
1282
|
+
version: {
|
|
1283
|
+
version: number;
|
|
1284
|
+
id: string;
|
|
1285
|
+
createdAt: Date;
|
|
1286
|
+
updatedAt: Date;
|
|
1287
|
+
variantId: string;
|
|
1288
|
+
provider: string;
|
|
1289
|
+
modelName: string;
|
|
1290
|
+
jsonData: Record<string, unknown>;
|
|
1291
|
+
};
|
|
1292
|
+
configVariant: {
|
|
1293
|
+
id: string;
|
|
1294
|
+
createdAt: Date;
|
|
1295
|
+
updatedAt: Date;
|
|
1296
|
+
variantId: string;
|
|
1297
|
+
configId: string;
|
|
1298
|
+
};
|
|
1299
|
+
}>;
|
|
1300
|
+
/**
|
|
1301
|
+
* Get the variant version data for a config based on targeting rules.
|
|
1302
|
+
* If variantVersionId is specified in the targeting rule, use that specific version.
|
|
1303
|
+
* Otherwise, use the latest version.
|
|
1304
|
+
*
|
|
1305
|
+
* configId can be either a UUID or a short slug.
|
|
1306
|
+
*/
|
|
1307
|
+
getVariantJsonDataForConfig: (params: z$1.infer<typeof getVariantJsonDataForConfig>) => Promise<{
|
|
1308
|
+
provider: string;
|
|
1309
|
+
providerConfigId: string | null;
|
|
1310
|
+
configId: string;
|
|
1311
|
+
variantId: string;
|
|
1312
|
+
environmentId: string;
|
|
1313
|
+
version: number;
|
|
1314
|
+
modelName: string;
|
|
1315
|
+
jsonData: Record<string, unknown>;
|
|
1316
|
+
}>;
|
|
1552
1317
|
};
|
|
1553
1318
|
//#endregion
|
|
1554
|
-
//#region src/datalayer/
|
|
1555
|
-
declare const
|
|
1319
|
+
//#region src/datalayer/datasets.d.ts
|
|
1320
|
+
declare const createDataset: z$1.ZodObject<{
|
|
1556
1321
|
name: z$1.ZodString;
|
|
1557
|
-
|
|
1558
|
-
functionId: z$1.ZodString;
|
|
1559
|
-
hookType: z$1.ZodEnum<{
|
|
1560
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1561
|
-
afterRequestHook: "afterRequestHook";
|
|
1562
|
-
}>;
|
|
1563
|
-
parameters: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1564
|
-
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1565
|
-
priority: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
1566
|
-
onFail: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1567
|
-
block: "block";
|
|
1568
|
-
log: "log";
|
|
1569
|
-
}>>>;
|
|
1322
|
+
description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1570
1323
|
}, z$1.core.$strip>;
|
|
1571
|
-
declare const
|
|
1572
|
-
|
|
1324
|
+
declare const updateDataset: z$1.ZodObject<{
|
|
1325
|
+
datasetId: z$1.ZodString;
|
|
1573
1326
|
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1574
|
-
|
|
1575
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1576
|
-
afterRequestHook: "afterRequestHook";
|
|
1577
|
-
}>>;
|
|
1578
|
-
parameters: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1579
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1580
|
-
priority: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1581
|
-
onFail: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1582
|
-
block: "block";
|
|
1583
|
-
log: "log";
|
|
1584
|
-
}>>;
|
|
1327
|
+
description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1585
1328
|
}, z$1.core.$strip>;
|
|
1586
|
-
declare const
|
|
1587
|
-
|
|
1329
|
+
declare const getDatasetById: z$1.ZodObject<{
|
|
1330
|
+
datasetId: z$1.ZodString;
|
|
1588
1331
|
}, z$1.core.$strip>;
|
|
1589
|
-
declare const
|
|
1590
|
-
|
|
1332
|
+
declare const deleteDataset: z$1.ZodObject<{
|
|
1333
|
+
datasetId: z$1.ZodString;
|
|
1591
1334
|
}, z$1.core.$strip>;
|
|
1592
|
-
declare const
|
|
1335
|
+
declare const listDatasets: z$1.ZodObject<{
|
|
1593
1336
|
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1594
1337
|
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1595
|
-
hookType: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1596
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1597
|
-
afterRequestHook: "afterRequestHook";
|
|
1598
|
-
}>>;
|
|
1599
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1600
1338
|
}, z$1.core.$strip>;
|
|
1601
|
-
declare const
|
|
1602
|
-
|
|
1339
|
+
declare const createRecord: z$1.ZodObject<{
|
|
1340
|
+
datasetId: z$1.ZodString;
|
|
1341
|
+
input: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
1342
|
+
expected: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1343
|
+
metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1344
|
+
}, z$1.core.$strip>;
|
|
1345
|
+
declare const updateRecord: z$1.ZodObject<{
|
|
1346
|
+
recordId: z$1.ZodString;
|
|
1347
|
+
input: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1348
|
+
expected: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1349
|
+
metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1350
|
+
}, z$1.core.$strip>;
|
|
1351
|
+
declare const deleteRecord: z$1.ZodObject<{
|
|
1352
|
+
recordId: z$1.ZodString;
|
|
1353
|
+
}, z$1.core.$strip>;
|
|
1354
|
+
declare const listRecords: z$1.ZodObject<{
|
|
1355
|
+
datasetId: z$1.ZodString;
|
|
1356
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1357
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1358
|
+
}, z$1.core.$strip>;
|
|
1359
|
+
declare const createVersion: z$1.ZodObject<{
|
|
1360
|
+
datasetId: z$1.ZodString;
|
|
1361
|
+
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1362
|
+
description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1363
|
+
}, z$1.core.$strip>;
|
|
1364
|
+
declare const getVersionById: z$1.ZodObject<{
|
|
1365
|
+
versionId: z$1.ZodString;
|
|
1366
|
+
}, z$1.core.$strip>;
|
|
1367
|
+
declare const listVersions: z$1.ZodObject<{
|
|
1368
|
+
datasetId: z$1.ZodString;
|
|
1369
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1370
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1371
|
+
}, z$1.core.$strip>;
|
|
1372
|
+
declare const getVersionRecords: z$1.ZodObject<{
|
|
1373
|
+
versionId: z$1.ZodString;
|
|
1374
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1375
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1376
|
+
}, z$1.core.$strip>;
|
|
1377
|
+
declare const createDatasetsDataLayer: (db: Kysely<Database>) => {
|
|
1378
|
+
createDataset: (params: z$1.infer<typeof createDataset>) => Promise<{
|
|
1603
1379
|
name: string;
|
|
1604
1380
|
id: string;
|
|
1605
|
-
pluginId: string;
|
|
1606
|
-
functionId: string;
|
|
1607
|
-
hookType: string;
|
|
1608
|
-
parameters: Record<string, unknown>;
|
|
1609
|
-
enabled: boolean;
|
|
1610
|
-
priority: number;
|
|
1611
|
-
onFail: string;
|
|
1612
1381
|
createdAt: Date;
|
|
1613
1382
|
updatedAt: Date;
|
|
1383
|
+
description: string | null;
|
|
1384
|
+
recordCount: number;
|
|
1385
|
+
latestVersionNumber: number;
|
|
1614
1386
|
} | undefined>;
|
|
1615
|
-
|
|
1387
|
+
updateDataset: (params: z$1.infer<typeof updateDataset>) => Promise<{
|
|
1616
1388
|
name: string;
|
|
1617
1389
|
id: string;
|
|
1618
|
-
pluginId: string;
|
|
1619
|
-
functionId: string;
|
|
1620
|
-
hookType: string;
|
|
1621
|
-
parameters: Record<string, unknown>;
|
|
1622
|
-
enabled: boolean;
|
|
1623
|
-
priority: number;
|
|
1624
|
-
onFail: string;
|
|
1625
1390
|
createdAt: Date;
|
|
1626
1391
|
updatedAt: Date;
|
|
1392
|
+
description: string | null;
|
|
1393
|
+
recordCount: number;
|
|
1394
|
+
latestVersionNumber: number;
|
|
1627
1395
|
} | undefined>;
|
|
1628
|
-
|
|
1396
|
+
getDatasetById: (params: z$1.infer<typeof getDatasetById>) => Promise<{
|
|
1629
1397
|
name: string;
|
|
1630
1398
|
id: string;
|
|
1631
|
-
pluginId: string;
|
|
1632
|
-
functionId: string;
|
|
1633
|
-
hookType: string;
|
|
1634
|
-
parameters: Record<string, unknown>;
|
|
1635
|
-
enabled: boolean;
|
|
1636
|
-
priority: number;
|
|
1637
|
-
onFail: string;
|
|
1638
1399
|
createdAt: Date;
|
|
1639
1400
|
updatedAt: Date;
|
|
1401
|
+
description: string | null;
|
|
1402
|
+
recordCount: number;
|
|
1403
|
+
latestVersionNumber: number;
|
|
1640
1404
|
} | undefined>;
|
|
1641
|
-
|
|
1405
|
+
deleteDataset: (params: z$1.infer<typeof deleteDataset>) => Promise<{
|
|
1642
1406
|
name: string;
|
|
1643
1407
|
id: string;
|
|
1644
|
-
pluginId: string;
|
|
1645
|
-
functionId: string;
|
|
1646
|
-
hookType: string;
|
|
1647
|
-
parameters: Record<string, unknown>;
|
|
1648
|
-
enabled: boolean;
|
|
1649
|
-
priority: number;
|
|
1650
|
-
onFail: string;
|
|
1651
1408
|
createdAt: Date;
|
|
1652
1409
|
updatedAt: Date;
|
|
1410
|
+
description: string | null;
|
|
1411
|
+
recordCount: number;
|
|
1412
|
+
latestVersionNumber: number;
|
|
1653
1413
|
} | undefined>;
|
|
1654
|
-
|
|
1414
|
+
listDatasets: (params?: z$1.infer<typeof listDatasets>) => Promise<{
|
|
1655
1415
|
name: string;
|
|
1656
1416
|
id: string;
|
|
1657
|
-
pluginId: string;
|
|
1658
|
-
functionId: string;
|
|
1659
|
-
hookType: string;
|
|
1660
|
-
parameters: Record<string, unknown>;
|
|
1661
|
-
enabled: boolean;
|
|
1662
|
-
priority: number;
|
|
1663
|
-
onFail: string;
|
|
1664
1417
|
createdAt: Date;
|
|
1665
1418
|
updatedAt: Date;
|
|
1419
|
+
description: string | null;
|
|
1420
|
+
recordCount: number;
|
|
1421
|
+
latestVersionNumber: number;
|
|
1666
1422
|
}[]>;
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
* Get all enabled guardrails for a specific hook type
|
|
1670
|
-
* Ordered by priority (highest first)
|
|
1671
|
-
*/
|
|
1672
|
-
getEnabledGuardrailsByHookType: (hookType: "beforeRequestHook" | "afterRequestHook") => Promise<{
|
|
1673
|
-
name: string;
|
|
1423
|
+
countDatasets: () => Promise<number>;
|
|
1424
|
+
createRecord: (params: z$1.infer<typeof createRecord>) => Promise<{
|
|
1674
1425
|
id: string;
|
|
1675
|
-
pluginId: string;
|
|
1676
|
-
functionId: string;
|
|
1677
|
-
hookType: string;
|
|
1678
|
-
parameters: Record<string, unknown>;
|
|
1679
|
-
enabled: boolean;
|
|
1680
|
-
priority: number;
|
|
1681
|
-
onFail: string;
|
|
1682
1426
|
createdAt: Date;
|
|
1683
1427
|
updatedAt: Date;
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
guardrailConfigId: z$1.ZodString;
|
|
1691
|
-
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1692
|
-
parameters: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1693
|
-
}, z$1.core.$strip>;
|
|
1694
|
-
declare const updateProviderGuardrailOverride: z$1.ZodObject<{
|
|
1695
|
-
id: z$1.ZodString;
|
|
1696
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1697
|
-
parameters: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1698
|
-
}, z$1.core.$strip>;
|
|
1699
|
-
declare const getOverrideById: z$1.ZodObject<{
|
|
1700
|
-
id: z$1.ZodString;
|
|
1701
|
-
}, z$1.core.$strip>;
|
|
1702
|
-
declare const deleteOverride: z$1.ZodObject<{
|
|
1703
|
-
id: z$1.ZodString;
|
|
1704
|
-
}, z$1.core.$strip>;
|
|
1705
|
-
declare const getOverridesByProviderConfigId: z$1.ZodObject<{
|
|
1706
|
-
providerConfigId: z$1.ZodString;
|
|
1707
|
-
}, z$1.core.$strip>;
|
|
1708
|
-
declare const getOverridesByGuardrailConfigId: z$1.ZodObject<{
|
|
1709
|
-
guardrailConfigId: z$1.ZodString;
|
|
1710
|
-
}, z$1.core.$strip>;
|
|
1711
|
-
declare const getOverrideByProviderAndGuardrail: z$1.ZodObject<{
|
|
1712
|
-
providerConfigId: z$1.ZodString;
|
|
1713
|
-
guardrailConfigId: z$1.ZodString;
|
|
1714
|
-
}, z$1.core.$strip>;
|
|
1715
|
-
declare const createProviderGuardrailOverridesDataLayer: (db: Kysely<Database>) => {
|
|
1716
|
-
createProviderGuardrailOverride: (params: z$1.infer<typeof createProviderGuardrailOverride>) => Promise<{
|
|
1428
|
+
input: Record<string, unknown>;
|
|
1429
|
+
datasetId: string;
|
|
1430
|
+
expected: Record<string, unknown> | null;
|
|
1431
|
+
metadata: Record<string, unknown>;
|
|
1432
|
+
} | undefined>;
|
|
1433
|
+
updateRecord: (params: z$1.infer<typeof updateRecord>) => Promise<{
|
|
1717
1434
|
id: string;
|
|
1718
|
-
parameters: Record<string, unknown> | null;
|
|
1719
|
-
enabled: boolean;
|
|
1720
|
-
providerConfigId: string;
|
|
1721
|
-
guardrailConfigId: string;
|
|
1722
1435
|
createdAt: Date;
|
|
1723
1436
|
updatedAt: Date;
|
|
1437
|
+
input: Record<string, unknown>;
|
|
1438
|
+
datasetId: string;
|
|
1439
|
+
expected: Record<string, unknown> | null;
|
|
1440
|
+
metadata: Record<string, unknown>;
|
|
1724
1441
|
} | undefined>;
|
|
1725
|
-
|
|
1442
|
+
deleteRecord: (params: z$1.infer<typeof deleteRecord>) => Promise<{
|
|
1726
1443
|
id: string;
|
|
1727
|
-
parameters: Record<string, unknown> | null;
|
|
1728
|
-
enabled: boolean;
|
|
1729
|
-
providerConfigId: string;
|
|
1730
|
-
guardrailConfigId: string;
|
|
1731
1444
|
createdAt: Date;
|
|
1732
1445
|
updatedAt: Date;
|
|
1446
|
+
input: Record<string, unknown>;
|
|
1447
|
+
datasetId: string;
|
|
1448
|
+
expected: Record<string, unknown> | null;
|
|
1449
|
+
metadata: Record<string, unknown>;
|
|
1733
1450
|
} | undefined>;
|
|
1734
|
-
|
|
1451
|
+
listRecords: (params: z$1.infer<typeof listRecords>) => Promise<{
|
|
1735
1452
|
id: string;
|
|
1736
|
-
parameters: Record<string, unknown> | null;
|
|
1737
|
-
enabled: boolean;
|
|
1738
|
-
providerConfigId: string;
|
|
1739
|
-
guardrailConfigId: string;
|
|
1740
1453
|
createdAt: Date;
|
|
1741
1454
|
updatedAt: Date;
|
|
1742
|
-
|
|
1743
|
-
|
|
1455
|
+
input: Record<string, unknown>;
|
|
1456
|
+
datasetId: string;
|
|
1457
|
+
expected: Record<string, unknown> | null;
|
|
1458
|
+
metadata: Record<string, unknown>;
|
|
1459
|
+
}[]>;
|
|
1460
|
+
getRecordById: (recordId: string) => Promise<{
|
|
1744
1461
|
id: string;
|
|
1745
|
-
parameters: Record<string, unknown> | null;
|
|
1746
|
-
enabled: boolean;
|
|
1747
|
-
providerConfigId: string;
|
|
1748
|
-
guardrailConfigId: string;
|
|
1749
1462
|
createdAt: Date;
|
|
1750
1463
|
updatedAt: Date;
|
|
1464
|
+
input: Record<string, unknown>;
|
|
1465
|
+
datasetId: string;
|
|
1466
|
+
expected: Record<string, unknown> | null;
|
|
1467
|
+
metadata: Record<string, unknown>;
|
|
1751
1468
|
} | undefined>;
|
|
1752
|
-
|
|
1469
|
+
createVersion: (params: z$1.infer<typeof createVersion>) => Promise<{
|
|
1470
|
+
name: string | null;
|
|
1753
1471
|
id: string;
|
|
1754
|
-
parameters: Record<string, unknown> | null;
|
|
1755
|
-
enabled: boolean;
|
|
1756
|
-
providerConfigId: string;
|
|
1757
|
-
guardrailConfigId: string;
|
|
1758
1472
|
createdAt: Date;
|
|
1759
1473
|
updatedAt: Date;
|
|
1760
|
-
|
|
1761
|
-
|
|
1474
|
+
datasetId: string;
|
|
1475
|
+
description: string | null;
|
|
1476
|
+
recordCount: number;
|
|
1477
|
+
versionNumber: number;
|
|
1478
|
+
snapshotHash: string;
|
|
1479
|
+
} | undefined>;
|
|
1480
|
+
getVersionById: (params: z$1.infer<typeof getVersionById>) => Promise<{
|
|
1481
|
+
name: string | null;
|
|
1762
1482
|
id: string;
|
|
1763
|
-
parameters: Record<string, unknown> | null;
|
|
1764
|
-
enabled: boolean;
|
|
1765
|
-
providerConfigId: string;
|
|
1766
|
-
guardrailConfigId: string;
|
|
1767
1483
|
createdAt: Date;
|
|
1768
1484
|
updatedAt: Date;
|
|
1769
|
-
|
|
1770
|
-
|
|
1485
|
+
datasetId: string;
|
|
1486
|
+
description: string | null;
|
|
1487
|
+
recordCount: number;
|
|
1488
|
+
versionNumber: number;
|
|
1489
|
+
snapshotHash: string;
|
|
1490
|
+
} | undefined>;
|
|
1491
|
+
listVersions: (params: z$1.infer<typeof listVersions>) => Promise<{
|
|
1492
|
+
name: string | null;
|
|
1771
1493
|
id: string;
|
|
1772
|
-
parameters: Record<string, unknown> | null;
|
|
1773
|
-
enabled: boolean;
|
|
1774
|
-
providerConfigId: string;
|
|
1775
|
-
guardrailConfigId: string;
|
|
1776
1494
|
createdAt: Date;
|
|
1777
1495
|
updatedAt: Date;
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1496
|
+
datasetId: string;
|
|
1497
|
+
description: string | null;
|
|
1498
|
+
recordCount: number;
|
|
1499
|
+
versionNumber: number;
|
|
1500
|
+
snapshotHash: string;
|
|
1501
|
+
}[]>;
|
|
1502
|
+
getVersionRecords: (params: z$1.infer<typeof getVersionRecords>) => Promise<{
|
|
1783
1503
|
id: string;
|
|
1784
|
-
parameters: Record<string, unknown> | null;
|
|
1785
|
-
enabled: boolean;
|
|
1786
|
-
providerConfigId: string;
|
|
1787
|
-
guardrailConfigId: string;
|
|
1788
1504
|
createdAt: Date;
|
|
1789
1505
|
updatedAt: Date;
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1506
|
+
input: Record<string, unknown>;
|
|
1507
|
+
datasetId: string;
|
|
1508
|
+
expected: Record<string, unknown> | null;
|
|
1509
|
+
metadata: Record<string, unknown>;
|
|
1510
|
+
position: number;
|
|
1511
|
+
}[]>;
|
|
1796
1512
|
};
|
|
1797
1513
|
//#endregion
|
|
1798
|
-
//#region src/datalayer/
|
|
1799
|
-
declare const
|
|
1514
|
+
//#region src/datalayer/environments.d.ts
|
|
1515
|
+
declare const createNewEnvironment: z$1.ZodObject<{
|
|
1800
1516
|
name: z$1.ZodString;
|
|
1801
|
-
|
|
1517
|
+
slug: z$1.ZodString;
|
|
1518
|
+
isProd: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1802
1519
|
}, z$1.core.$strip>;
|
|
1803
|
-
declare const
|
|
1804
|
-
|
|
1520
|
+
declare const updateEnvironment: z$1.ZodObject<{
|
|
1521
|
+
environmentId: z$1.ZodUUID;
|
|
1805
1522
|
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1806
|
-
|
|
1807
|
-
}, z$1.core.$strip>;
|
|
1808
|
-
declare const getDatasetById: z$1.ZodObject<{
|
|
1809
|
-
datasetId: z$1.ZodString;
|
|
1810
|
-
}, z$1.core.$strip>;
|
|
1811
|
-
declare const deleteDataset: z$1.ZodObject<{
|
|
1812
|
-
datasetId: z$1.ZodString;
|
|
1813
|
-
}, z$1.core.$strip>;
|
|
1814
|
-
declare const listDatasets: z$1.ZodObject<{
|
|
1815
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1816
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1817
|
-
}, z$1.core.$strip>;
|
|
1818
|
-
declare const createRecord: z$1.ZodObject<{
|
|
1819
|
-
datasetId: z$1.ZodString;
|
|
1820
|
-
input: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
1821
|
-
expected: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1822
|
-
metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1823
|
-
}, z$1.core.$strip>;
|
|
1824
|
-
declare const updateRecord: z$1.ZodObject<{
|
|
1825
|
-
recordId: z$1.ZodString;
|
|
1826
|
-
input: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1827
|
-
expected: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1828
|
-
metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1829
|
-
}, z$1.core.$strip>;
|
|
1830
|
-
declare const deleteRecord: z$1.ZodObject<{
|
|
1831
|
-
recordId: z$1.ZodString;
|
|
1832
|
-
}, z$1.core.$strip>;
|
|
1833
|
-
declare const listRecords: z$1.ZodObject<{
|
|
1834
|
-
datasetId: z$1.ZodString;
|
|
1835
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1836
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1523
|
+
slug: z$1.ZodOptional<z$1.ZodString>;
|
|
1837
1524
|
}, z$1.core.$strip>;
|
|
1838
|
-
declare const
|
|
1839
|
-
|
|
1840
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1841
|
-
description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1525
|
+
declare const getEnvironmentById: z$1.ZodObject<{
|
|
1526
|
+
environmentId: z$1.ZodUUID;
|
|
1842
1527
|
}, z$1.core.$strip>;
|
|
1843
|
-
declare const
|
|
1844
|
-
|
|
1528
|
+
declare const getEnvironmentBySlug: z$1.ZodObject<{
|
|
1529
|
+
slug: z$1.ZodString;
|
|
1845
1530
|
}, z$1.core.$strip>;
|
|
1846
|
-
declare const
|
|
1847
|
-
|
|
1848
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1849
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1531
|
+
declare const deleteEnvironment: z$1.ZodObject<{
|
|
1532
|
+
environmentId: z$1.ZodUUID;
|
|
1850
1533
|
}, z$1.core.$strip>;
|
|
1851
|
-
declare const
|
|
1852
|
-
versionId: z$1.ZodString;
|
|
1534
|
+
declare const listEnvironments: z$1.ZodObject<{
|
|
1853
1535
|
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1854
1536
|
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1855
1537
|
}, z$1.core.$strip>;
|
|
1856
|
-
declare const
|
|
1857
|
-
|
|
1538
|
+
declare const createEnvironmentDataLayer: (db: Kysely<Database>) => {
|
|
1539
|
+
createNewEnvironment: (params: z$1.infer<typeof createNewEnvironment>) => Promise<{
|
|
1540
|
+
slug: string;
|
|
1858
1541
|
name: string;
|
|
1859
1542
|
id: string;
|
|
1860
|
-
description: string | null;
|
|
1861
1543
|
createdAt: Date;
|
|
1862
1544
|
updatedAt: Date;
|
|
1863
|
-
|
|
1864
|
-
latestVersionNumber: number;
|
|
1545
|
+
isProd: boolean;
|
|
1865
1546
|
} | undefined>;
|
|
1866
|
-
|
|
1547
|
+
updateEnvironment: (params: z$1.infer<typeof updateEnvironment>) => Promise<{
|
|
1548
|
+
slug: string;
|
|
1867
1549
|
name: string;
|
|
1868
1550
|
id: string;
|
|
1869
|
-
description: string | null;
|
|
1870
1551
|
createdAt: Date;
|
|
1871
1552
|
updatedAt: Date;
|
|
1872
|
-
|
|
1873
|
-
latestVersionNumber: number;
|
|
1553
|
+
isProd: boolean;
|
|
1874
1554
|
} | undefined>;
|
|
1875
|
-
|
|
1555
|
+
getEnvironmentById: (params: z$1.infer<typeof getEnvironmentById>) => Promise<{
|
|
1556
|
+
slug: string;
|
|
1876
1557
|
name: string;
|
|
1877
1558
|
id: string;
|
|
1878
|
-
description: string | null;
|
|
1879
1559
|
createdAt: Date;
|
|
1880
1560
|
updatedAt: Date;
|
|
1881
|
-
|
|
1882
|
-
latestVersionNumber: number;
|
|
1561
|
+
isProd: boolean;
|
|
1883
1562
|
} | undefined>;
|
|
1884
|
-
|
|
1563
|
+
getEnvironmentBySlug: (params: z$1.infer<typeof getEnvironmentBySlug>) => Promise<{
|
|
1564
|
+
slug: string;
|
|
1885
1565
|
name: string;
|
|
1886
1566
|
id: string;
|
|
1887
|
-
description: string | null;
|
|
1888
1567
|
createdAt: Date;
|
|
1889
1568
|
updatedAt: Date;
|
|
1890
|
-
|
|
1891
|
-
latestVersionNumber: number;
|
|
1569
|
+
isProd: boolean;
|
|
1892
1570
|
} | undefined>;
|
|
1893
|
-
|
|
1571
|
+
deleteEnvironment: (params: z$1.infer<typeof deleteEnvironment>) => Promise<{
|
|
1572
|
+
slug: string;
|
|
1894
1573
|
name: string;
|
|
1895
1574
|
id: string;
|
|
1896
|
-
description: string | null;
|
|
1897
1575
|
createdAt: Date;
|
|
1898
1576
|
updatedAt: Date;
|
|
1899
|
-
|
|
1900
|
-
|
|
1577
|
+
isProd: boolean;
|
|
1578
|
+
} | undefined>;
|
|
1579
|
+
listEnvironments: (params?: z$1.infer<typeof listEnvironments>) => Promise<{
|
|
1580
|
+
slug: string;
|
|
1581
|
+
name: string;
|
|
1582
|
+
id: string;
|
|
1583
|
+
createdAt: Date;
|
|
1584
|
+
updatedAt: Date;
|
|
1585
|
+
isProd: boolean;
|
|
1901
1586
|
}[]>;
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1587
|
+
countEnvironments: () => Promise<number>;
|
|
1588
|
+
};
|
|
1589
|
+
//#endregion
|
|
1590
|
+
//#region src/datalayer/environmentSecrets.d.ts
|
|
1591
|
+
declare const createEnvironmentSecret: z$1.ZodObject<{
|
|
1592
|
+
environmentId: z$1.ZodUUID;
|
|
1593
|
+
keyName: z$1.ZodString;
|
|
1594
|
+
keyValue: z$1.ZodString;
|
|
1595
|
+
}, z$1.core.$strip>;
|
|
1596
|
+
declare const updateEnvironmentSecret: z$1.ZodObject<{
|
|
1597
|
+
secretId: z$1.ZodUUID;
|
|
1598
|
+
keyName: z$1.ZodOptional<z$1.ZodString>;
|
|
1599
|
+
keyValue: z$1.ZodOptional<z$1.ZodString>;
|
|
1600
|
+
}, z$1.core.$strip>;
|
|
1601
|
+
declare const getEnvironmentSecretById: z$1.ZodObject<{
|
|
1602
|
+
secretId: z$1.ZodUUID;
|
|
1603
|
+
}, z$1.core.$strip>;
|
|
1604
|
+
declare const getSecretsByEnvironmentId: z$1.ZodObject<{
|
|
1605
|
+
environmentId: z$1.ZodUUID;
|
|
1606
|
+
}, z$1.core.$strip>;
|
|
1607
|
+
declare const deleteEnvironmentSecret: z$1.ZodObject<{
|
|
1608
|
+
secretId: z$1.ZodUUID;
|
|
1609
|
+
}, z$1.core.$strip>;
|
|
1610
|
+
declare const deleteSecretsByEnvironmentId: z$1.ZodObject<{
|
|
1611
|
+
environmentId: z$1.ZodUUID;
|
|
1612
|
+
}, z$1.core.$strip>;
|
|
1613
|
+
declare const listEnvironmentSecrets: z$1.ZodObject<{
|
|
1614
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1615
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1616
|
+
}, z$1.core.$strip>;
|
|
1617
|
+
declare const createEnvironmentSecretDataLayer: (db: Kysely<Database>) => {
|
|
1618
|
+
createEnvironmentSecret: (params: z$1.infer<typeof createEnvironmentSecret>) => Promise<{
|
|
1905
1619
|
id: string;
|
|
1906
|
-
datasetId: string;
|
|
1907
|
-
expected: Record<string, unknown> | null;
|
|
1908
|
-
metadata: Record<string, unknown>;
|
|
1909
1620
|
createdAt: Date;
|
|
1910
1621
|
updatedAt: Date;
|
|
1622
|
+
environmentId: string;
|
|
1623
|
+
keyName: string;
|
|
1624
|
+
keyValue: string;
|
|
1911
1625
|
} | undefined>;
|
|
1912
|
-
|
|
1913
|
-
input: Record<string, unknown>;
|
|
1626
|
+
updateEnvironmentSecret: (params: z$1.infer<typeof updateEnvironmentSecret>) => Promise<{
|
|
1914
1627
|
id: string;
|
|
1915
|
-
datasetId: string;
|
|
1916
|
-
expected: Record<string, unknown> | null;
|
|
1917
|
-
metadata: Record<string, unknown>;
|
|
1918
1628
|
createdAt: Date;
|
|
1919
1629
|
updatedAt: Date;
|
|
1630
|
+
environmentId: string;
|
|
1631
|
+
keyName: string;
|
|
1632
|
+
keyValue: string;
|
|
1920
1633
|
} | undefined>;
|
|
1921
|
-
|
|
1922
|
-
input: Record<string, unknown>;
|
|
1634
|
+
getEnvironmentSecretById: (params: z$1.infer<typeof getEnvironmentSecretById>) => Promise<{
|
|
1923
1635
|
id: string;
|
|
1924
|
-
datasetId: string;
|
|
1925
|
-
expected: Record<string, unknown> | null;
|
|
1926
|
-
metadata: Record<string, unknown>;
|
|
1927
1636
|
createdAt: Date;
|
|
1928
1637
|
updatedAt: Date;
|
|
1638
|
+
environmentId: string;
|
|
1639
|
+
keyName: string;
|
|
1640
|
+
keyValue: string;
|
|
1929
1641
|
} | undefined>;
|
|
1930
|
-
|
|
1931
|
-
input: Record<string, unknown>;
|
|
1642
|
+
getSecretsByEnvironmentId: (params: z$1.infer<typeof getSecretsByEnvironmentId>) => Promise<{
|
|
1932
1643
|
id: string;
|
|
1933
|
-
datasetId: string;
|
|
1934
|
-
expected: Record<string, unknown> | null;
|
|
1935
|
-
metadata: Record<string, unknown>;
|
|
1936
1644
|
createdAt: Date;
|
|
1937
1645
|
updatedAt: Date;
|
|
1646
|
+
environmentId: string;
|
|
1647
|
+
keyName: string;
|
|
1648
|
+
keyValue: string;
|
|
1938
1649
|
}[]>;
|
|
1939
|
-
|
|
1940
|
-
input: Record<string, unknown>;
|
|
1650
|
+
deleteEnvironmentSecret: (params: z$1.infer<typeof deleteEnvironmentSecret>) => Promise<{
|
|
1941
1651
|
id: string;
|
|
1942
|
-
datasetId: string;
|
|
1943
|
-
expected: Record<string, unknown> | null;
|
|
1944
|
-
metadata: Record<string, unknown>;
|
|
1945
1652
|
createdAt: Date;
|
|
1946
1653
|
updatedAt: Date;
|
|
1654
|
+
environmentId: string;
|
|
1655
|
+
keyName: string;
|
|
1656
|
+
keyValue: string;
|
|
1947
1657
|
} | undefined>;
|
|
1948
|
-
|
|
1949
|
-
name: string | null;
|
|
1658
|
+
deleteSecretsByEnvironmentId: (params: z$1.infer<typeof deleteSecretsByEnvironmentId>) => Promise<{
|
|
1950
1659
|
id: string;
|
|
1951
|
-
description: string | null;
|
|
1952
|
-
datasetId: string;
|
|
1953
1660
|
createdAt: Date;
|
|
1954
1661
|
updatedAt: Date;
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
name: string | null;
|
|
1662
|
+
environmentId: string;
|
|
1663
|
+
keyName: string;
|
|
1664
|
+
keyValue: string;
|
|
1665
|
+
}[]>;
|
|
1666
|
+
listEnvironmentSecrets: (params?: z$1.infer<typeof listEnvironmentSecrets>) => Promise<{
|
|
1961
1667
|
id: string;
|
|
1962
|
-
description: string | null;
|
|
1963
|
-
datasetId: string;
|
|
1964
1668
|
createdAt: Date;
|
|
1965
1669
|
updatedAt: Date;
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
} | undefined>;
|
|
1970
|
-
listVersions: (params: z$1.infer<typeof listVersions>) => Promise<{
|
|
1971
|
-
name: string | null;
|
|
1972
|
-
id: string;
|
|
1973
|
-
description: string | null;
|
|
1974
|
-
datasetId: string;
|
|
1975
|
-
createdAt: Date;
|
|
1976
|
-
updatedAt: Date;
|
|
1977
|
-
recordCount: number;
|
|
1978
|
-
versionNumber: number;
|
|
1979
|
-
snapshotHash: string;
|
|
1980
|
-
}[]>;
|
|
1981
|
-
getVersionRecords: (params: z$1.infer<typeof getVersionRecords>) => Promise<{
|
|
1982
|
-
input: Record<string, unknown>;
|
|
1983
|
-
id: string;
|
|
1984
|
-
datasetId: string;
|
|
1985
|
-
expected: Record<string, unknown> | null;
|
|
1986
|
-
metadata: Record<string, unknown>;
|
|
1987
|
-
createdAt: Date;
|
|
1988
|
-
updatedAt: Date;
|
|
1989
|
-
position: number;
|
|
1670
|
+
environmentId: string;
|
|
1671
|
+
keyName: string;
|
|
1672
|
+
keyValue: string;
|
|
1990
1673
|
}[]>;
|
|
1674
|
+
countEnvironmentSecrets: () => Promise<number>;
|
|
1991
1675
|
};
|
|
1992
1676
|
//#endregion
|
|
1993
|
-
//#region src/datalayer/
|
|
1994
|
-
declare const
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
1677
|
+
//#region src/datalayer/guardrailConfigs.d.ts
|
|
1678
|
+
declare const createGuardrailConfig: z$1.ZodObject<{
|
|
1679
|
+
name: z$1.ZodString;
|
|
1680
|
+
pluginId: z$1.ZodString;
|
|
1681
|
+
functionId: z$1.ZodString;
|
|
1682
|
+
hookType: z$1.ZodEnum<{
|
|
1683
|
+
beforeRequestHook: "beforeRequestHook";
|
|
1684
|
+
afterRequestHook: "afterRequestHook";
|
|
1685
|
+
}>;
|
|
1686
|
+
parameters: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1687
|
+
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1688
|
+
priority: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
1689
|
+
onFail: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1690
|
+
block: "block";
|
|
1691
|
+
log: "log";
|
|
1692
|
+
}>>>;
|
|
2006
1693
|
}, z$1.core.$strip>;
|
|
2007
|
-
declare const
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
1694
|
+
declare const updateGuardrailConfig: z$1.ZodObject<{
|
|
1695
|
+
id: z$1.ZodString;
|
|
1696
|
+
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1697
|
+
hookType: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1698
|
+
beforeRequestHook: "beforeRequestHook";
|
|
1699
|
+
afterRequestHook: "afterRequestHook";
|
|
1700
|
+
}>>;
|
|
1701
|
+
parameters: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1702
|
+
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1703
|
+
priority: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1704
|
+
onFail: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1705
|
+
block: "block";
|
|
1706
|
+
log: "log";
|
|
2015
1707
|
}>>;
|
|
2016
|
-
startedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
2017
|
-
completedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
2018
|
-
completedRecords: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2019
1708
|
}, z$1.core.$strip>;
|
|
2020
|
-
declare const
|
|
2021
|
-
|
|
1709
|
+
declare const getGuardrailConfigById: z$1.ZodObject<{
|
|
1710
|
+
id: z$1.ZodString;
|
|
2022
1711
|
}, z$1.core.$strip>;
|
|
2023
|
-
declare const
|
|
2024
|
-
|
|
1712
|
+
declare const deleteGuardrailConfig: z$1.ZodObject<{
|
|
1713
|
+
id: z$1.ZodString;
|
|
1714
|
+
}, z$1.core.$strip>;
|
|
1715
|
+
declare const listGuardrailConfigs: z$1.ZodObject<{
|
|
2025
1716
|
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2026
1717
|
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1718
|
+
hookType: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1719
|
+
beforeRequestHook: "beforeRequestHook";
|
|
1720
|
+
afterRequestHook: "afterRequestHook";
|
|
1721
|
+
}>>;
|
|
1722
|
+
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2027
1723
|
}, z$1.core.$strip>;
|
|
2028
|
-
declare const
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
declare const createPlaygroundRunsDataLayer: (db: Kysely<Database>) => {
|
|
2032
|
-
createPlaygroundRun: (params: z$1.infer<typeof createPlaygroundRun>) => Promise<{
|
|
1724
|
+
declare const createGuardrailConfigsDataLayer: (db: Kysely<Database>) => {
|
|
1725
|
+
createGuardrailConfig: (params: z$1.infer<typeof createGuardrailConfig>) => Promise<{
|
|
1726
|
+
name: string;
|
|
2033
1727
|
id: string;
|
|
2034
|
-
datasetId: string | null;
|
|
2035
|
-
playgroundId: string;
|
|
2036
|
-
status: string;
|
|
2037
|
-
datasetVersionId: string | null;
|
|
2038
|
-
totalRecords: number;
|
|
2039
|
-
startedAt: Date | null;
|
|
2040
|
-
completedAt: Date | null;
|
|
2041
|
-
completedRecords: number;
|
|
2042
1728
|
createdAt: Date;
|
|
2043
1729
|
updatedAt: Date;
|
|
1730
|
+
priority: number;
|
|
1731
|
+
enabled: boolean;
|
|
1732
|
+
pluginId: string;
|
|
1733
|
+
functionId: string;
|
|
1734
|
+
hookType: string;
|
|
1735
|
+
parameters: Record<string, unknown>;
|
|
1736
|
+
onFail: string;
|
|
2044
1737
|
} | undefined>;
|
|
2045
|
-
|
|
1738
|
+
updateGuardrailConfig: (params: z$1.infer<typeof updateGuardrailConfig>) => Promise<{
|
|
1739
|
+
name: string;
|
|
1740
|
+
id: string;
|
|
1741
|
+
createdAt: Date;
|
|
1742
|
+
updatedAt: Date;
|
|
1743
|
+
priority: number;
|
|
1744
|
+
enabled: boolean;
|
|
1745
|
+
pluginId: string;
|
|
1746
|
+
functionId: string;
|
|
1747
|
+
hookType: string;
|
|
1748
|
+
parameters: Record<string, unknown>;
|
|
1749
|
+
onFail: string;
|
|
1750
|
+
} | undefined>;
|
|
1751
|
+
getGuardrailConfigById: (params: z$1.infer<typeof getGuardrailConfigById>) => Promise<{
|
|
1752
|
+
name: string;
|
|
2046
1753
|
id: string;
|
|
2047
|
-
datasetId: string | null;
|
|
2048
|
-
playgroundId: string;
|
|
2049
|
-
status: string;
|
|
2050
|
-
datasetVersionId: string | null;
|
|
2051
|
-
totalRecords: number;
|
|
2052
|
-
startedAt: Date | null;
|
|
2053
|
-
completedAt: Date | null;
|
|
2054
|
-
completedRecords: number;
|
|
2055
1754
|
createdAt: Date;
|
|
2056
1755
|
updatedAt: Date;
|
|
1756
|
+
priority: number;
|
|
1757
|
+
enabled: boolean;
|
|
1758
|
+
pluginId: string;
|
|
1759
|
+
functionId: string;
|
|
1760
|
+
hookType: string;
|
|
1761
|
+
parameters: Record<string, unknown>;
|
|
1762
|
+
onFail: string;
|
|
2057
1763
|
} | undefined>;
|
|
2058
|
-
|
|
1764
|
+
deleteGuardrailConfig: (params: z$1.infer<typeof deleteGuardrailConfig>) => Promise<{
|
|
1765
|
+
name: string;
|
|
2059
1766
|
id: string;
|
|
2060
|
-
datasetId: string | null;
|
|
2061
|
-
playgroundId: string;
|
|
2062
|
-
status: string;
|
|
2063
|
-
datasetVersionId: string | null;
|
|
2064
|
-
totalRecords: number;
|
|
2065
|
-
startedAt: Date | null;
|
|
2066
|
-
completedAt: Date | null;
|
|
2067
|
-
completedRecords: number;
|
|
2068
1767
|
createdAt: Date;
|
|
2069
1768
|
updatedAt: Date;
|
|
1769
|
+
priority: number;
|
|
1770
|
+
enabled: boolean;
|
|
1771
|
+
pluginId: string;
|
|
1772
|
+
functionId: string;
|
|
1773
|
+
hookType: string;
|
|
1774
|
+
parameters: Record<string, unknown>;
|
|
1775
|
+
onFail: string;
|
|
2070
1776
|
} | undefined>;
|
|
2071
|
-
|
|
1777
|
+
listGuardrailConfigs: (params?: z$1.infer<typeof listGuardrailConfigs>) => Promise<{
|
|
1778
|
+
name: string;
|
|
2072
1779
|
id: string;
|
|
2073
|
-
datasetId: string | null;
|
|
2074
|
-
playgroundId: string;
|
|
2075
|
-
status: string;
|
|
2076
|
-
datasetVersionId: string | null;
|
|
2077
|
-
totalRecords: number;
|
|
2078
|
-
startedAt: Date | null;
|
|
2079
|
-
completedAt: Date | null;
|
|
2080
|
-
completedRecords: number;
|
|
2081
1780
|
createdAt: Date;
|
|
2082
1781
|
updatedAt: Date;
|
|
1782
|
+
priority: number;
|
|
1783
|
+
enabled: boolean;
|
|
1784
|
+
pluginId: string;
|
|
1785
|
+
functionId: string;
|
|
1786
|
+
hookType: string;
|
|
1787
|
+
parameters: Record<string, unknown>;
|
|
1788
|
+
onFail: string;
|
|
2083
1789
|
}[]>;
|
|
2084
|
-
|
|
1790
|
+
countGuardrailConfigs: () => Promise<number>;
|
|
1791
|
+
/**
|
|
1792
|
+
* Get all enabled guardrails for a specific hook type
|
|
1793
|
+
* Ordered by priority (highest first)
|
|
1794
|
+
*/
|
|
1795
|
+
getEnabledGuardrailsByHookType: (hookType: "beforeRequestHook" | "afterRequestHook") => Promise<{
|
|
1796
|
+
name: string;
|
|
2085
1797
|
id: string;
|
|
2086
|
-
datasetId: string | null;
|
|
2087
|
-
playgroundId: string;
|
|
2088
|
-
status: string;
|
|
2089
|
-
datasetVersionId: string | null;
|
|
2090
|
-
totalRecords: number;
|
|
2091
|
-
startedAt: Date | null;
|
|
2092
|
-
completedAt: Date | null;
|
|
2093
|
-
completedRecords: number;
|
|
2094
1798
|
createdAt: Date;
|
|
2095
1799
|
updatedAt: Date;
|
|
2096
|
-
|
|
2097
|
-
|
|
1800
|
+
priority: number;
|
|
1801
|
+
enabled: boolean;
|
|
1802
|
+
pluginId: string;
|
|
1803
|
+
functionId: string;
|
|
1804
|
+
hookType: string;
|
|
1805
|
+
parameters: Record<string, unknown>;
|
|
1806
|
+
onFail: string;
|
|
1807
|
+
}[]>;
|
|
2098
1808
|
};
|
|
2099
1809
|
//#endregion
|
|
2100
|
-
//#region src/datalayer/
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
}, z$1.core.$strip
|
|
2143
|
-
declare const getPlaygroundResultById: z$1.ZodObject<{
|
|
2144
|
-
resultId: z$1.ZodString;
|
|
2145
|
-
}, z$1.core.$strip>;
|
|
2146
|
-
declare const listPlaygroundResults: z$1.ZodObject<{
|
|
2147
|
-
runId: z$1.ZodString;
|
|
2148
|
-
columnId: z$1.ZodOptional<z$1.ZodString>;
|
|
2149
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2150
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1810
|
+
//#region src/datalayer/llmRequests.d.ts
|
|
1811
|
+
/**
|
|
1812
|
+
* Schema for inserting a new LLM request log
|
|
1813
|
+
*/
|
|
1814
|
+
declare const insertLLMRequestSchema: z$1.ZodObject<{
|
|
1815
|
+
requestId: z$1.ZodString;
|
|
1816
|
+
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1817
|
+
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1818
|
+
environmentId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1819
|
+
providerConfigId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1820
|
+
provider: z$1.ZodString;
|
|
1821
|
+
model: z$1.ZodString;
|
|
1822
|
+
promptTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1823
|
+
completionTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1824
|
+
totalTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1825
|
+
cachedTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1826
|
+
cost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1827
|
+
inputCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1828
|
+
outputCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1829
|
+
endpoint: z$1.ZodString;
|
|
1830
|
+
statusCode: z$1.ZodNumber;
|
|
1831
|
+
latencyMs: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1832
|
+
isStreaming: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1833
|
+
userId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1834
|
+
tags: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
1835
|
+
guardrailResults: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodObject<{
|
|
1836
|
+
results: z$1.ZodArray<z$1.ZodObject<{
|
|
1837
|
+
checkId: z$1.ZodString;
|
|
1838
|
+
functionId: z$1.ZodString;
|
|
1839
|
+
hookType: z$1.ZodEnum<{
|
|
1840
|
+
beforeRequestHook: "beforeRequestHook";
|
|
1841
|
+
afterRequestHook: "afterRequestHook";
|
|
1842
|
+
}>;
|
|
1843
|
+
verdict: z$1.ZodBoolean;
|
|
1844
|
+
latencyMs: z$1.ZodNumber;
|
|
1845
|
+
}, z$1.core.$strip>>;
|
|
1846
|
+
action: z$1.ZodEnum<{
|
|
1847
|
+
allowed: "allowed";
|
|
1848
|
+
blocked: "blocked";
|
|
1849
|
+
logged: "logged";
|
|
1850
|
+
}>;
|
|
1851
|
+
totalLatencyMs: z$1.ZodNumber;
|
|
1852
|
+
}, z$1.core.$strip>>>;
|
|
2151
1853
|
}, z$1.core.$strip>;
|
|
2152
|
-
|
|
2153
|
-
|
|
1854
|
+
type LLMRequestInsert = z$1.infer<typeof insertLLMRequestSchema>;
|
|
1855
|
+
/**
|
|
1856
|
+
* Schema for listing LLM requests
|
|
1857
|
+
*/
|
|
1858
|
+
declare const listRequestsSchema: z$1.ZodObject<{
|
|
1859
|
+
limit: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1860
|
+
offset: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1861
|
+
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
1862
|
+
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
1863
|
+
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
1864
|
+
providerConfigId: z$1.ZodOptional<z$1.ZodString>;
|
|
1865
|
+
provider: z$1.ZodOptional<z$1.ZodString>;
|
|
1866
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1867
|
+
startDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
1868
|
+
endDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
1869
|
+
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
2154
1870
|
}, z$1.core.$strip>;
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
cost: number | null;
|
|
2197
|
-
latencyMs: number | null;
|
|
2198
|
-
runId: string;
|
|
2199
|
-
columnId: string;
|
|
2200
|
-
datasetRecordId: string | null;
|
|
2201
|
-
inputVariables: Record<string, unknown>;
|
|
2202
|
-
status: string;
|
|
2203
|
-
outputContent: string | null;
|
|
2204
|
-
createdAt: Date;
|
|
2205
|
-
updatedAt: Date;
|
|
2206
|
-
} | undefined>;
|
|
2207
|
-
getPlaygroundResultById: (params: z$1.infer<typeof getPlaygroundResultById>) => Promise<{
|
|
2208
|
-
error: string | null;
|
|
2209
|
-
id: string;
|
|
2210
|
-
promptTokens: number | null;
|
|
2211
|
-
completionTokens: number | null;
|
|
2212
|
-
totalTokens: number | null;
|
|
2213
|
-
cost: number | null;
|
|
2214
|
-
latencyMs: number | null;
|
|
2215
|
-
runId: string;
|
|
2216
|
-
columnId: string;
|
|
2217
|
-
datasetRecordId: string | null;
|
|
2218
|
-
inputVariables: Record<string, unknown>;
|
|
2219
|
-
status: string;
|
|
2220
|
-
outputContent: string | null;
|
|
2221
|
-
createdAt: Date;
|
|
2222
|
-
updatedAt: Date;
|
|
2223
|
-
} | undefined>;
|
|
2224
|
-
listPlaygroundResults: (params: z$1.infer<typeof listPlaygroundResults>) => Promise<{
|
|
2225
|
-
error: string | null;
|
|
2226
|
-
id: string;
|
|
2227
|
-
promptTokens: number | null;
|
|
2228
|
-
completionTokens: number | null;
|
|
2229
|
-
totalTokens: number | null;
|
|
2230
|
-
cost: number | null;
|
|
2231
|
-
latencyMs: number | null;
|
|
2232
|
-
runId: string;
|
|
2233
|
-
columnId: string;
|
|
2234
|
-
datasetRecordId: string | null;
|
|
2235
|
-
inputVariables: Record<string, unknown>;
|
|
2236
|
-
status: string;
|
|
2237
|
-
outputContent: string | null;
|
|
2238
|
-
createdAt: Date;
|
|
2239
|
-
updatedAt: Date;
|
|
2240
|
-
}[]>;
|
|
2241
|
-
deletePlaygroundResultsByRunId: (params: z$1.infer<typeof deletePlaygroundResultsByRunId>) => Promise<{
|
|
2242
|
-
error: string | null;
|
|
2243
|
-
id: string;
|
|
2244
|
-
promptTokens: number | null;
|
|
2245
|
-
completionTokens: number | null;
|
|
2246
|
-
totalTokens: number | null;
|
|
2247
|
-
cost: number | null;
|
|
2248
|
-
latencyMs: number | null;
|
|
2249
|
-
runId: string;
|
|
2250
|
-
columnId: string;
|
|
2251
|
-
datasetRecordId: string | null;
|
|
2252
|
-
inputVariables: Record<string, unknown>;
|
|
2253
|
-
status: string;
|
|
2254
|
-
outputContent: string | null;
|
|
2255
|
-
createdAt: Date;
|
|
2256
|
-
updatedAt: Date;
|
|
2257
|
-
}[]>;
|
|
2258
|
-
countPlaygroundResults: (runId: string) => Promise<number>;
|
|
2259
|
-
countCompletedPlaygroundResults: (runId: string) => Promise<number>;
|
|
2260
|
-
};
|
|
2261
|
-
//#endregion
|
|
2262
|
-
//#region src/datalayer/index.d.ts
|
|
2263
|
-
declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
2264
|
-
getWorkspaceSettings: () => Promise<{
|
|
2265
|
-
name: string | null;
|
|
2266
|
-
id: string;
|
|
2267
|
-
setupComplete: boolean;
|
|
2268
|
-
superAdminId: string | null;
|
|
2269
|
-
createdAt: Date;
|
|
2270
|
-
updatedAt: Date;
|
|
2271
|
-
} | undefined>;
|
|
2272
|
-
updateWorkspaceSettings: (params: zod0.infer<zod0.ZodObject<{
|
|
2273
|
-
name: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2274
|
-
setupComplete: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
2275
|
-
superAdminId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2276
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2277
|
-
name: string | null;
|
|
2278
|
-
id: string;
|
|
2279
|
-
setupComplete: boolean;
|
|
2280
|
-
superAdminId: string | null;
|
|
2281
|
-
createdAt: Date;
|
|
2282
|
-
updatedAt: Date;
|
|
2283
|
-
} | undefined>;
|
|
2284
|
-
getSuperAdminId: () => Promise<string | null>;
|
|
2285
|
-
setSuperAdminId: (userId: string) => Promise<boolean>;
|
|
2286
|
-
isSetupComplete: () => Promise<boolean>;
|
|
2287
|
-
markSetupComplete: () => Promise<{
|
|
2288
|
-
name: string | null;
|
|
2289
|
-
id: string;
|
|
2290
|
-
setupComplete: boolean;
|
|
2291
|
-
superAdminId: string | null;
|
|
2292
|
-
createdAt: Date;
|
|
2293
|
-
updatedAt: Date;
|
|
2294
|
-
} | undefined>;
|
|
2295
|
-
createVariantVersion: (params: zod0.infer<zod0.ZodObject<{
|
|
2296
|
-
variantId: zod0.ZodString;
|
|
2297
|
-
provider: zod0.ZodString;
|
|
2298
|
-
modelName: zod0.ZodString;
|
|
2299
|
-
jsonData: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>>;
|
|
2300
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2301
|
-
version: number;
|
|
2302
|
-
variantId: string;
|
|
2303
|
-
id: string;
|
|
2304
|
-
provider: string;
|
|
2305
|
-
modelName: string;
|
|
2306
|
-
jsonData: Record<string, unknown>;
|
|
2307
|
-
createdAt: Date;
|
|
2308
|
-
updatedAt: Date;
|
|
2309
|
-
} | undefined>;
|
|
2310
|
-
getVariantVersionById: (params: zod0.infer<zod0.ZodObject<{
|
|
2311
|
-
id: zod0.ZodString;
|
|
2312
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2313
|
-
version: number;
|
|
2314
|
-
variantId: string;
|
|
2315
|
-
id: string;
|
|
2316
|
-
provider: string;
|
|
2317
|
-
modelName: string;
|
|
2318
|
-
jsonData: Record<string, unknown>;
|
|
2319
|
-
createdAt: Date;
|
|
2320
|
-
updatedAt: Date;
|
|
2321
|
-
} | undefined>;
|
|
2322
|
-
getVariantVersionsByVariantId: (params: zod0.infer<zod0.ZodObject<{
|
|
2323
|
-
variantId: zod0.ZodString;
|
|
2324
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2325
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2326
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2327
|
-
version: number;
|
|
2328
|
-
variantId: string;
|
|
2329
|
-
id: string;
|
|
2330
|
-
provider: string;
|
|
2331
|
-
modelName: string;
|
|
2332
|
-
jsonData: Record<string, unknown>;
|
|
2333
|
-
createdAt: Date;
|
|
2334
|
-
updatedAt: Date;
|
|
2335
|
-
}[]>;
|
|
2336
|
-
getLatestVariantVersion: (params: zod0.infer<zod0.ZodObject<{
|
|
2337
|
-
variantId: zod0.ZodString;
|
|
2338
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2339
|
-
version: number;
|
|
2340
|
-
variantId: string;
|
|
2341
|
-
id: string;
|
|
2342
|
-
provider: string;
|
|
2343
|
-
modelName: string;
|
|
2344
|
-
jsonData: Record<string, unknown>;
|
|
2345
|
-
createdAt: Date;
|
|
2346
|
-
updatedAt: Date;
|
|
2347
|
-
} | undefined>;
|
|
2348
|
-
getVariantVersionByNumber: (params: zod0.infer<zod0.ZodObject<{
|
|
2349
|
-
variantId: zod0.ZodString;
|
|
2350
|
-
version: zod0.ZodNumber;
|
|
2351
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2352
|
-
version: number;
|
|
2353
|
-
variantId: string;
|
|
2354
|
-
id: string;
|
|
2355
|
-
provider: string;
|
|
2356
|
-
modelName: string;
|
|
2357
|
-
jsonData: Record<string, unknown>;
|
|
2358
|
-
createdAt: Date;
|
|
2359
|
-
updatedAt: Date;
|
|
2360
|
-
} | undefined>;
|
|
2361
|
-
deleteVariantVersion: (params: zod0.infer<zod0.ZodObject<{
|
|
2362
|
-
id: zod0.ZodString;
|
|
2363
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2364
|
-
version: number;
|
|
2365
|
-
variantId: string;
|
|
2366
|
-
id: string;
|
|
2367
|
-
provider: string;
|
|
2368
|
-
modelName: string;
|
|
2369
|
-
jsonData: Record<string, unknown>;
|
|
2370
|
-
createdAt: Date;
|
|
2371
|
-
updatedAt: Date;
|
|
2372
|
-
} | undefined>;
|
|
2373
|
-
deleteVariantVersionsByVariantId: (params: zod0.infer<zod0.ZodObject<{
|
|
2374
|
-
variantId: zod0.ZodString;
|
|
2375
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2376
|
-
version: number;
|
|
2377
|
-
variantId: string;
|
|
2378
|
-
id: string;
|
|
2379
|
-
provider: string;
|
|
2380
|
-
modelName: string;
|
|
2381
|
-
jsonData: Record<string, unknown>;
|
|
2382
|
-
createdAt: Date;
|
|
2383
|
-
updatedAt: Date;
|
|
2384
|
-
}[]>;
|
|
2385
|
-
getVariantVersionWithVariant: (params: zod0.infer<zod0.ZodObject<{
|
|
2386
|
-
id: zod0.ZodString;
|
|
2387
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2388
|
-
version: number;
|
|
2389
|
-
variantId: string;
|
|
2390
|
-
id: string;
|
|
2391
|
-
provider: string;
|
|
2392
|
-
modelName: string;
|
|
2393
|
-
jsonData: Record<string, unknown>;
|
|
2394
|
-
createdAt: Date;
|
|
2395
|
-
updatedAt: Date;
|
|
2396
|
-
variantName: string;
|
|
2397
|
-
} | undefined>;
|
|
2398
|
-
getVariantVersionsWithVariantByVariantId: (params: zod0.infer<zod0.ZodObject<{
|
|
2399
|
-
variantId: zod0.ZodString;
|
|
2400
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2401
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2402
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2403
|
-
version: number;
|
|
2404
|
-
variantId: string;
|
|
2405
|
-
id: string;
|
|
2406
|
-
provider: string;
|
|
2407
|
-
modelName: string;
|
|
2408
|
-
jsonData: Record<string, unknown>;
|
|
2409
|
-
createdAt: Date;
|
|
2410
|
-
updatedAt: Date;
|
|
2411
|
-
variantName: string;
|
|
2412
|
-
}[]>;
|
|
2413
|
-
createVariant: (params: zod0.infer<zod0.ZodObject<{
|
|
2414
|
-
name: zod0.ZodString;
|
|
2415
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2416
|
-
name: string;
|
|
2417
|
-
id: string;
|
|
2418
|
-
createdAt: Date;
|
|
2419
|
-
updatedAt: Date;
|
|
2420
|
-
} | undefined>;
|
|
2421
|
-
updateVariant: (params: zod0.infer<zod0.ZodObject<{
|
|
2422
|
-
variantId: zod0.ZodString;
|
|
2423
|
-
name: zod0.ZodOptional<zod0.ZodString>;
|
|
2424
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2425
|
-
name: string;
|
|
2426
|
-
id: string;
|
|
2427
|
-
createdAt: Date;
|
|
2428
|
-
updatedAt: Date;
|
|
2429
|
-
} | undefined>;
|
|
2430
|
-
getVariantById: (params: zod0.infer<zod0.ZodObject<{
|
|
2431
|
-
variantId: zod0.ZodString;
|
|
2432
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2433
|
-
name: string;
|
|
2434
|
-
id: string;
|
|
2435
|
-
createdAt: Date;
|
|
2436
|
-
updatedAt: Date;
|
|
2437
|
-
} | undefined>;
|
|
2438
|
-
getVariantWithLatestVersion: (params: zod0.infer<zod0.ZodObject<{
|
|
2439
|
-
variantId: zod0.ZodString;
|
|
2440
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2441
|
-
latestVersion: {
|
|
2442
|
-
version: number;
|
|
2443
|
-
variantId: string;
|
|
2444
|
-
id: string;
|
|
2445
|
-
provider: string;
|
|
2446
|
-
modelName: string;
|
|
2447
|
-
jsonData: Record<string, unknown>;
|
|
2448
|
-
createdAt: Date;
|
|
2449
|
-
updatedAt: Date;
|
|
2450
|
-
} | null;
|
|
2451
|
-
name: string;
|
|
2452
|
-
id: string;
|
|
2453
|
-
createdAt: Date;
|
|
2454
|
-
updatedAt: Date;
|
|
2455
|
-
} | undefined>;
|
|
2456
|
-
deleteVariant: (params: zod0.infer<zod0.ZodObject<{
|
|
2457
|
-
variantId: zod0.ZodString;
|
|
2458
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2459
|
-
name: string;
|
|
2460
|
-
id: string;
|
|
2461
|
-
createdAt: Date;
|
|
2462
|
-
updatedAt: Date;
|
|
2463
|
-
} | undefined>;
|
|
2464
|
-
listVariants: (params?: zod0.infer<zod0.ZodObject<{
|
|
2465
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2466
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2467
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2468
|
-
name: string;
|
|
2469
|
-
id: string;
|
|
2470
|
-
createdAt: Date;
|
|
2471
|
-
updatedAt: Date;
|
|
2472
|
-
}[]>;
|
|
2473
|
-
listVariantsWithLatestVersion: (params?: zod0.infer<zod0.ZodObject<{
|
|
2474
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2475
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2476
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2477
|
-
latestVersion: {
|
|
2478
|
-
version: number;
|
|
2479
|
-
variantId: string;
|
|
2480
|
-
id: string;
|
|
2481
|
-
provider: string;
|
|
2482
|
-
modelName: string;
|
|
2483
|
-
jsonData: Record<string, unknown>;
|
|
2484
|
-
createdAt: Date;
|
|
2485
|
-
updatedAt: Date;
|
|
2486
|
-
} | null;
|
|
2487
|
-
name: string;
|
|
2488
|
-
id: string;
|
|
2489
|
-
createdAt: Date;
|
|
2490
|
-
updatedAt: Date;
|
|
2491
|
-
}[]>;
|
|
2492
|
-
createTargetingRule: (params: zod0.infer<zod0.ZodObject<{
|
|
2493
|
-
environmentId: zod0.ZodString;
|
|
2494
|
-
configId: zod0.ZodString;
|
|
2495
|
-
configVariantId: zod0.ZodString;
|
|
2496
|
-
variantVersionId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2497
|
-
weight: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodNumber>>;
|
|
2498
|
-
priority: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodNumber>>;
|
|
2499
|
-
enabled: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodBoolean>>;
|
|
2500
|
-
conditions: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>>;
|
|
2501
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2502
|
-
configId: string;
|
|
2503
|
-
id: string;
|
|
2504
|
-
environmentId: string;
|
|
2505
|
-
enabled: boolean;
|
|
2506
|
-
priority: number;
|
|
2507
|
-
variantVersionId: string | null;
|
|
2508
|
-
configVariantId: string;
|
|
2509
|
-
weight: number;
|
|
2510
|
-
conditions: Record<string, unknown>;
|
|
2511
|
-
createdAt: Date;
|
|
2512
|
-
updatedAt: Date;
|
|
2513
|
-
} | undefined>;
|
|
2514
|
-
updateTargetingRule: (params: zod0.infer<zod0.ZodObject<{
|
|
2515
|
-
id: zod0.ZodString;
|
|
2516
|
-
variantVersionId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2517
|
-
weight: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2518
|
-
priority: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2519
|
-
enabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
2520
|
-
conditions: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>>;
|
|
2521
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2522
|
-
configId: string;
|
|
2523
|
-
id: string;
|
|
2524
|
-
environmentId: string;
|
|
2525
|
-
enabled: boolean;
|
|
2526
|
-
priority: number;
|
|
2527
|
-
variantVersionId: string | null;
|
|
2528
|
-
configVariantId: string;
|
|
2529
|
-
weight: number;
|
|
2530
|
-
conditions: Record<string, unknown>;
|
|
2531
|
-
createdAt: Date;
|
|
2532
|
-
updatedAt: Date;
|
|
2533
|
-
} | undefined>;
|
|
2534
|
-
getTargetingRuleById: (params: zod0.infer<zod0.ZodObject<{
|
|
2535
|
-
id: zod0.ZodString;
|
|
2536
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2537
|
-
configId: string;
|
|
2538
|
-
id: string;
|
|
2539
|
-
environmentId: string;
|
|
2540
|
-
enabled: boolean;
|
|
2541
|
-
priority: number;
|
|
2542
|
-
variantVersionId: string | null;
|
|
2543
|
-
configVariantId: string;
|
|
2544
|
-
weight: number;
|
|
2545
|
-
conditions: Record<string, unknown>;
|
|
2546
|
-
createdAt: Date;
|
|
2547
|
-
updatedAt: Date;
|
|
2548
|
-
} | undefined>;
|
|
2549
|
-
getTargetingRulesByConfigId: (params: zod0.infer<zod0.ZodObject<{
|
|
2550
|
-
configId: zod0.ZodString;
|
|
2551
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2552
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2553
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2554
|
-
configId: string;
|
|
2555
|
-
id: string;
|
|
2556
|
-
environmentId: string;
|
|
2557
|
-
enabled: boolean;
|
|
2558
|
-
priority: number;
|
|
2559
|
-
variantVersionId: string | null;
|
|
2560
|
-
configVariantId: string;
|
|
2561
|
-
weight: number;
|
|
2562
|
-
conditions: Record<string, unknown>;
|
|
2563
|
-
createdAt: Date;
|
|
2564
|
-
updatedAt: Date;
|
|
2565
|
-
}[]>;
|
|
2566
|
-
getTargetingRulesByEnvironmentId: (params: zod0.infer<zod0.ZodObject<{
|
|
2567
|
-
environmentId: zod0.ZodString;
|
|
2568
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2569
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2570
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2571
|
-
configId: string;
|
|
2572
|
-
id: string;
|
|
2573
|
-
environmentId: string;
|
|
2574
|
-
enabled: boolean;
|
|
2575
|
-
priority: number;
|
|
2576
|
-
variantVersionId: string | null;
|
|
2577
|
-
configVariantId: string;
|
|
2578
|
-
weight: number;
|
|
2579
|
-
conditions: Record<string, unknown>;
|
|
2580
|
-
createdAt: Date;
|
|
2581
|
-
updatedAt: Date;
|
|
2582
|
-
}[]>;
|
|
2583
|
-
getTargetingRulesByConfigAndEnvironment: (params: zod0.infer<zod0.ZodObject<{
|
|
2584
|
-
configId: zod0.ZodString;
|
|
2585
|
-
environmentId: zod0.ZodString;
|
|
2586
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2587
|
-
configId: string;
|
|
2588
|
-
id: string;
|
|
2589
|
-
environmentId: string;
|
|
2590
|
-
enabled: boolean;
|
|
2591
|
-
priority: number;
|
|
2592
|
-
variantVersionId: string | null;
|
|
2593
|
-
configVariantId: string;
|
|
2594
|
-
weight: number;
|
|
2595
|
-
conditions: Record<string, unknown>;
|
|
2596
|
-
createdAt: Date;
|
|
2597
|
-
updatedAt: Date;
|
|
2598
|
-
}[]>;
|
|
2599
|
-
deleteTargetingRule: (params: zod0.infer<zod0.ZodObject<{
|
|
2600
|
-
id: zod0.ZodString;
|
|
2601
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2602
|
-
configId: string;
|
|
2603
|
-
id: string;
|
|
2604
|
-
environmentId: string;
|
|
2605
|
-
enabled: boolean;
|
|
2606
|
-
priority: number;
|
|
2607
|
-
variantVersionId: string | null;
|
|
2608
|
-
configVariantId: string;
|
|
2609
|
-
weight: number;
|
|
2610
|
-
conditions: Record<string, unknown>;
|
|
2611
|
-
createdAt: Date;
|
|
2612
|
-
updatedAt: Date;
|
|
2613
|
-
} | undefined>;
|
|
2614
|
-
deleteTargetingRulesByConfigId: (params: zod0.infer<zod0.ZodObject<{
|
|
2615
|
-
configId: zod0.ZodString;
|
|
2616
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2617
|
-
configId: string;
|
|
2618
|
-
id: string;
|
|
2619
|
-
environmentId: string;
|
|
2620
|
-
enabled: boolean;
|
|
2621
|
-
priority: number;
|
|
2622
|
-
variantVersionId: string | null;
|
|
2623
|
-
configVariantId: string;
|
|
2624
|
-
weight: number;
|
|
2625
|
-
conditions: Record<string, unknown>;
|
|
2626
|
-
createdAt: Date;
|
|
2627
|
-
updatedAt: Date;
|
|
2628
|
-
}[]>;
|
|
2629
|
-
deleteTargetingRulesByEnvironmentId: (params: zod0.infer<zod0.ZodObject<{
|
|
2630
|
-
environmentId: zod0.ZodString;
|
|
2631
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2632
|
-
configId: string;
|
|
2633
|
-
id: string;
|
|
2634
|
-
environmentId: string;
|
|
2635
|
-
enabled: boolean;
|
|
2636
|
-
priority: number;
|
|
2637
|
-
variantVersionId: string | null;
|
|
2638
|
-
configVariantId: string;
|
|
2639
|
-
weight: number;
|
|
2640
|
-
conditions: Record<string, unknown>;
|
|
2641
|
-
createdAt: Date;
|
|
2642
|
-
updatedAt: Date;
|
|
2643
|
-
}[]>;
|
|
2644
|
-
listTargetingRules: (params?: zod0.infer<zod0.ZodObject<{
|
|
2645
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2646
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2647
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2648
|
-
configId: string;
|
|
2649
|
-
id: string;
|
|
2650
|
-
environmentId: string;
|
|
2651
|
-
enabled: boolean;
|
|
2652
|
-
priority: number;
|
|
2653
|
-
variantVersionId: string | null;
|
|
2654
|
-
configVariantId: string;
|
|
2655
|
-
weight: number;
|
|
2656
|
-
conditions: Record<string, unknown>;
|
|
2657
|
-
createdAt: Date;
|
|
2658
|
-
updatedAt: Date;
|
|
2659
|
-
}[]>;
|
|
2660
|
-
getTargetingRulesWithDetailsByConfigId: (params: zod0.infer<zod0.ZodObject<{
|
|
2661
|
-
configId: zod0.ZodString;
|
|
2662
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2663
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2664
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2665
|
-
variantProvider: string | null;
|
|
2666
|
-
variantModelName: string | null;
|
|
2667
|
-
pinnedVersion: number | null | undefined;
|
|
2668
|
-
latestVersion: number | null | undefined;
|
|
2669
|
-
variantName: string | null;
|
|
2670
|
-
configId: string;
|
|
2671
|
-
id: string;
|
|
2672
|
-
environmentId: string;
|
|
2673
|
-
enabled: boolean;
|
|
2674
|
-
priority: number;
|
|
2675
|
-
variantVersionId: string | null;
|
|
2676
|
-
configVariantId: string;
|
|
2677
|
-
weight: number;
|
|
2678
|
-
conditions: Record<string, unknown>;
|
|
2679
|
-
createdAt: Date;
|
|
2680
|
-
updatedAt: Date;
|
|
2681
|
-
variantId: string | null;
|
|
2682
|
-
environmentName: string | null;
|
|
2683
|
-
environmentSlug: string | null;
|
|
2684
|
-
}[]>;
|
|
2685
|
-
setTargetingForEnvironment: (params: zod0.infer<zod0.ZodObject<{
|
|
2686
|
-
environmentId: zod0.ZodString;
|
|
2687
|
-
configId: zod0.ZodString;
|
|
2688
|
-
configVariantId: zod0.ZodString;
|
|
2689
|
-
variantVersionId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2690
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2691
|
-
configId: string;
|
|
2692
|
-
id: string;
|
|
2693
|
-
environmentId: string;
|
|
2694
|
-
enabled: boolean;
|
|
2695
|
-
priority: number;
|
|
2696
|
-
variantVersionId: string | null;
|
|
2697
|
-
configVariantId: string;
|
|
2698
|
-
weight: number;
|
|
2699
|
-
conditions: Record<string, unknown>;
|
|
2700
|
-
createdAt: Date;
|
|
2701
|
-
updatedAt: Date;
|
|
2702
|
-
} | undefined>;
|
|
2703
|
-
createProviderGuardrailOverride: (params: zod0.infer<zod0.ZodObject<{
|
|
2704
|
-
providerConfigId: zod0.ZodString;
|
|
2705
|
-
guardrailConfigId: zod0.ZodString;
|
|
2706
|
-
enabled: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodBoolean>>;
|
|
2707
|
-
parameters: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>>;
|
|
2708
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2709
|
-
id: string;
|
|
2710
|
-
parameters: Record<string, unknown> | null;
|
|
2711
|
-
enabled: boolean;
|
|
2712
|
-
providerConfigId: string;
|
|
2713
|
-
guardrailConfigId: string;
|
|
2714
|
-
createdAt: Date;
|
|
2715
|
-
updatedAt: Date;
|
|
2716
|
-
} | undefined>;
|
|
2717
|
-
updateProviderGuardrailOverride: (params: zod0.infer<zod0.ZodObject<{
|
|
2718
|
-
id: zod0.ZodString;
|
|
2719
|
-
enabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
2720
|
-
parameters: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>>;
|
|
2721
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2722
|
-
id: string;
|
|
2723
|
-
parameters: Record<string, unknown> | null;
|
|
2724
|
-
enabled: boolean;
|
|
2725
|
-
providerConfigId: string;
|
|
2726
|
-
guardrailConfigId: string;
|
|
2727
|
-
createdAt: Date;
|
|
2728
|
-
updatedAt: Date;
|
|
2729
|
-
} | undefined>;
|
|
2730
|
-
getOverrideById: (params: zod0.infer<zod0.ZodObject<{
|
|
2731
|
-
id: zod0.ZodString;
|
|
2732
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2733
|
-
id: string;
|
|
2734
|
-
parameters: Record<string, unknown> | null;
|
|
2735
|
-
enabled: boolean;
|
|
2736
|
-
providerConfigId: string;
|
|
2737
|
-
guardrailConfigId: string;
|
|
2738
|
-
createdAt: Date;
|
|
2739
|
-
updatedAt: Date;
|
|
2740
|
-
} | undefined>;
|
|
2741
|
-
deleteProviderGuardrailOverride: (params: zod0.infer<zod0.ZodObject<{
|
|
2742
|
-
id: zod0.ZodString;
|
|
2743
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2744
|
-
id: string;
|
|
2745
|
-
parameters: Record<string, unknown> | null;
|
|
2746
|
-
enabled: boolean;
|
|
2747
|
-
providerConfigId: string;
|
|
2748
|
-
guardrailConfigId: string;
|
|
2749
|
-
createdAt: Date;
|
|
2750
|
-
updatedAt: Date;
|
|
2751
|
-
} | undefined>;
|
|
2752
|
-
getOverridesByProviderConfigId: (params: zod0.infer<zod0.ZodObject<{
|
|
2753
|
-
providerConfigId: zod0.ZodString;
|
|
2754
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2755
|
-
id: string;
|
|
2756
|
-
parameters: Record<string, unknown> | null;
|
|
2757
|
-
enabled: boolean;
|
|
2758
|
-
providerConfigId: string;
|
|
2759
|
-
guardrailConfigId: string;
|
|
2760
|
-
createdAt: Date;
|
|
2761
|
-
updatedAt: Date;
|
|
2762
|
-
}[]>;
|
|
2763
|
-
getOverridesByGuardrailConfigId: (params: zod0.infer<zod0.ZodObject<{
|
|
2764
|
-
guardrailConfigId: zod0.ZodString;
|
|
2765
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2766
|
-
id: string;
|
|
2767
|
-
parameters: Record<string, unknown> | null;
|
|
2768
|
-
enabled: boolean;
|
|
2769
|
-
providerConfigId: string;
|
|
2770
|
-
guardrailConfigId: string;
|
|
2771
|
-
createdAt: Date;
|
|
2772
|
-
updatedAt: Date;
|
|
2773
|
-
}[]>;
|
|
2774
|
-
getOverrideByProviderAndGuardrail: (params: zod0.infer<zod0.ZodObject<{
|
|
2775
|
-
providerConfigId: zod0.ZodString;
|
|
2776
|
-
guardrailConfigId: zod0.ZodString;
|
|
2777
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2778
|
-
id: string;
|
|
2779
|
-
parameters: Record<string, unknown> | null;
|
|
2780
|
-
enabled: boolean;
|
|
2781
|
-
providerConfigId: string;
|
|
2782
|
-
guardrailConfigId: string;
|
|
2783
|
-
createdAt: Date;
|
|
2784
|
-
updatedAt: Date;
|
|
2785
|
-
} | undefined>;
|
|
2786
|
-
upsertProviderGuardrailOverride: (params: zod0.infer<zod0.ZodObject<{
|
|
2787
|
-
providerConfigId: zod0.ZodString;
|
|
2788
|
-
guardrailConfigId: zod0.ZodString;
|
|
2789
|
-
enabled: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodBoolean>>;
|
|
2790
|
-
parameters: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>>;
|
|
2791
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2792
|
-
id: string;
|
|
2793
|
-
parameters: Record<string, unknown> | null;
|
|
2794
|
-
enabled: boolean;
|
|
2795
|
-
providerConfigId: string;
|
|
2796
|
-
guardrailConfigId: string;
|
|
2797
|
-
createdAt: Date;
|
|
2798
|
-
updatedAt: Date;
|
|
2799
|
-
} | undefined>;
|
|
2800
|
-
deleteOverridesByGuardrailConfigId: (params: zod0.infer<zod0.ZodObject<{
|
|
2801
|
-
guardrailConfigId: zod0.ZodString;
|
|
2802
|
-
}, better_auth0.$strip>>) => Promise<kysely0.DeleteResult[]>;
|
|
2803
|
-
createProviderConfig: (params: zod0.infer<zod0.ZodObject<{
|
|
2804
|
-
providerId: zod0.ZodString;
|
|
2805
|
-
slug: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2806
|
-
name: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2807
|
-
config: zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>;
|
|
2808
|
-
enabled: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodBoolean>>;
|
|
2809
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2810
|
-
name: string | null;
|
|
2811
|
-
id: string;
|
|
2812
|
-
slug: string | null;
|
|
2813
|
-
enabled: boolean;
|
|
2814
|
-
config: Record<string, unknown>;
|
|
2815
|
-
providerId: string;
|
|
2816
|
-
createdAt: Date;
|
|
2817
|
-
updatedAt: Date;
|
|
2818
|
-
} | undefined>;
|
|
2819
|
-
updateProviderConfig: (params: zod0.infer<zod0.ZodObject<{
|
|
2820
|
-
id: zod0.ZodUUID;
|
|
2821
|
-
slug: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2822
|
-
name: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2823
|
-
config: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
2824
|
-
enabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
2825
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2826
|
-
name: string | null;
|
|
2827
|
-
id: string;
|
|
2828
|
-
slug: string | null;
|
|
2829
|
-
enabled: boolean;
|
|
2830
|
-
config: Record<string, unknown>;
|
|
2831
|
-
providerId: string;
|
|
2832
|
-
createdAt: Date;
|
|
2833
|
-
updatedAt: Date;
|
|
2834
|
-
} | undefined>;
|
|
2835
|
-
getProviderConfigById: (params: zod0.infer<zod0.ZodObject<{
|
|
2836
|
-
id: zod0.ZodUUID;
|
|
2837
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2838
|
-
name: string | null;
|
|
2839
|
-
id: string;
|
|
2840
|
-
slug: string | null;
|
|
2841
|
-
enabled: boolean;
|
|
2842
|
-
config: Record<string, unknown>;
|
|
2843
|
-
providerId: string;
|
|
2844
|
-
createdAt: Date;
|
|
2845
|
-
updatedAt: Date;
|
|
2846
|
-
} | undefined>;
|
|
2847
|
-
getProviderConfigByProviderId: (params: zod0.infer<zod0.ZodObject<{
|
|
2848
|
-
providerId: zod0.ZodString;
|
|
2849
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2850
|
-
name: string | null;
|
|
2851
|
-
id: string;
|
|
2852
|
-
slug: string | null;
|
|
2853
|
-
enabled: boolean;
|
|
2854
|
-
config: Record<string, unknown>;
|
|
2855
|
-
providerId: string;
|
|
2856
|
-
createdAt: Date;
|
|
2857
|
-
updatedAt: Date;
|
|
2858
|
-
} | undefined>;
|
|
2859
|
-
getProviderConfigBySlug: (params: zod0.infer<zod0.ZodObject<{
|
|
2860
|
-
slug: zod0.ZodString;
|
|
2861
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2862
|
-
name: string | null;
|
|
2863
|
-
id: string;
|
|
2864
|
-
slug: string | null;
|
|
2865
|
-
enabled: boolean;
|
|
2866
|
-
config: Record<string, unknown>;
|
|
2867
|
-
providerId: string;
|
|
2868
|
-
createdAt: Date;
|
|
2869
|
-
updatedAt: Date;
|
|
2870
|
-
} | undefined>;
|
|
2871
|
-
deleteProviderConfig: (params: zod0.infer<zod0.ZodObject<{
|
|
2872
|
-
id: zod0.ZodUUID;
|
|
2873
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2874
|
-
name: string | null;
|
|
2875
|
-
id: string;
|
|
2876
|
-
slug: string | null;
|
|
2877
|
-
enabled: boolean;
|
|
2878
|
-
config: Record<string, unknown>;
|
|
2879
|
-
providerId: string;
|
|
2880
|
-
createdAt: Date;
|
|
2881
|
-
updatedAt: Date;
|
|
2882
|
-
} | undefined>;
|
|
2883
|
-
listProviderConfigs: (params?: zod0.infer<zod0.ZodObject<{
|
|
2884
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2885
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2886
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2887
|
-
name: string | null;
|
|
2888
|
-
id: string;
|
|
2889
|
-
slug: string | null;
|
|
2890
|
-
enabled: boolean;
|
|
2891
|
-
config: Record<string, unknown>;
|
|
2892
|
-
providerId: string;
|
|
2893
|
-
createdAt: Date;
|
|
2894
|
-
updatedAt: Date;
|
|
2895
|
-
}[]>;
|
|
2896
|
-
countProviderConfigs: () => Promise<number>;
|
|
2897
|
-
upsertProviderConfig: (params: zod0.infer<zod0.ZodObject<{
|
|
2898
|
-
providerId: zod0.ZodString;
|
|
2899
|
-
slug: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2900
|
-
name: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2901
|
-
config: zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>;
|
|
2902
|
-
enabled: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodBoolean>>;
|
|
2903
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2904
|
-
name: string | null;
|
|
2905
|
-
id: string;
|
|
2906
|
-
slug: string | null;
|
|
2907
|
-
enabled: boolean;
|
|
2908
|
-
config: Record<string, unknown>;
|
|
2909
|
-
providerId: string;
|
|
2910
|
-
createdAt: Date;
|
|
2911
|
-
updatedAt: Date;
|
|
2912
|
-
} | undefined>;
|
|
2913
|
-
createPlaygroundRun: (params: zod0.infer<zod0.ZodObject<{
|
|
2914
|
-
playgroundId: zod0.ZodString;
|
|
2915
|
-
datasetId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2916
|
-
datasetVersionId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
2917
|
-
status: zod0.ZodDefault<zod0.ZodEnum<{
|
|
2918
|
-
pending: "pending";
|
|
2919
|
-
running: "running";
|
|
2920
|
-
completed: "completed";
|
|
2921
|
-
failed: "failed";
|
|
2922
|
-
cancelled: "cancelled";
|
|
2923
|
-
}>>;
|
|
2924
|
-
totalRecords: zod0.ZodDefault<zod0.ZodNumber>;
|
|
2925
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2926
|
-
id: string;
|
|
2927
|
-
datasetId: string | null;
|
|
2928
|
-
playgroundId: string;
|
|
2929
|
-
status: string;
|
|
2930
|
-
datasetVersionId: string | null;
|
|
2931
|
-
totalRecords: number;
|
|
2932
|
-
startedAt: Date | null;
|
|
2933
|
-
completedAt: Date | null;
|
|
2934
|
-
completedRecords: number;
|
|
2935
|
-
createdAt: Date;
|
|
2936
|
-
updatedAt: Date;
|
|
2937
|
-
} | undefined>;
|
|
2938
|
-
updatePlaygroundRun: (params: zod0.infer<zod0.ZodObject<{
|
|
2939
|
-
runId: zod0.ZodString;
|
|
2940
|
-
status: zod0.ZodOptional<zod0.ZodEnum<{
|
|
2941
|
-
pending: "pending";
|
|
2942
|
-
running: "running";
|
|
2943
|
-
completed: "completed";
|
|
2944
|
-
failed: "failed";
|
|
2945
|
-
cancelled: "cancelled";
|
|
2946
|
-
}>>;
|
|
2947
|
-
startedAt: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodDate>>;
|
|
2948
|
-
completedAt: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodDate>>;
|
|
2949
|
-
completedRecords: zod0.ZodOptional<zod0.ZodNumber>;
|
|
2950
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2951
|
-
id: string;
|
|
2952
|
-
datasetId: string | null;
|
|
2953
|
-
playgroundId: string;
|
|
2954
|
-
status: string;
|
|
2955
|
-
datasetVersionId: string | null;
|
|
2956
|
-
totalRecords: number;
|
|
2957
|
-
startedAt: Date | null;
|
|
2958
|
-
completedAt: Date | null;
|
|
2959
|
-
completedRecords: number;
|
|
2960
|
-
createdAt: Date;
|
|
2961
|
-
updatedAt: Date;
|
|
2962
|
-
} | undefined>;
|
|
2963
|
-
getPlaygroundRunById: (params: zod0.infer<zod0.ZodObject<{
|
|
2964
|
-
runId: zod0.ZodString;
|
|
2965
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
1871
|
+
/**
|
|
1872
|
+
* Schema for date range queries with optional filters
|
|
1873
|
+
*/
|
|
1874
|
+
declare const dateRangeSchema: z$1.ZodObject<{
|
|
1875
|
+
startDate: z$1.ZodDate;
|
|
1876
|
+
endDate: z$1.ZodDate;
|
|
1877
|
+
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
1878
|
+
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
1879
|
+
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
1880
|
+
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
1881
|
+
}, z$1.core.$strip>;
|
|
1882
|
+
/**
|
|
1883
|
+
* Schema for cost summary with grouping
|
|
1884
|
+
*/
|
|
1885
|
+
declare const costSummarySchema: z$1.ZodObject<{
|
|
1886
|
+
startDate: z$1.ZodDate;
|
|
1887
|
+
endDate: z$1.ZodDate;
|
|
1888
|
+
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
1889
|
+
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
1890
|
+
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
1891
|
+
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
1892
|
+
groupBy: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1893
|
+
provider: "provider";
|
|
1894
|
+
config: "config";
|
|
1895
|
+
model: "model";
|
|
1896
|
+
day: "day";
|
|
1897
|
+
hour: "hour";
|
|
1898
|
+
}>>;
|
|
1899
|
+
}, z$1.core.$strip>;
|
|
1900
|
+
declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
1901
|
+
/**
|
|
1902
|
+
* Batch insert LLM request logs
|
|
1903
|
+
* Used by the BatchWriter service for efficient writes
|
|
1904
|
+
*/
|
|
1905
|
+
batchInsertRequests: (requests: LLMRequestInsert[]) => Promise<{
|
|
1906
|
+
count: number;
|
|
1907
|
+
}>;
|
|
1908
|
+
/**
|
|
1909
|
+
* Insert a single LLM request log
|
|
1910
|
+
*/
|
|
1911
|
+
insertRequest: (request: LLMRequestInsert) => Promise<{
|
|
2966
1912
|
id: string;
|
|
2967
|
-
datasetId: string | null;
|
|
2968
|
-
playgroundId: string;
|
|
2969
|
-
status: string;
|
|
2970
|
-
datasetVersionId: string | null;
|
|
2971
|
-
totalRecords: number;
|
|
2972
|
-
startedAt: Date | null;
|
|
2973
|
-
completedAt: Date | null;
|
|
2974
|
-
completedRecords: number;
|
|
2975
1913
|
createdAt: Date;
|
|
2976
1914
|
updatedAt: Date;
|
|
1915
|
+
variantId: string | null;
|
|
1916
|
+
provider: string;
|
|
1917
|
+
environmentId: string | null;
|
|
1918
|
+
configId: string | null;
|
|
1919
|
+
providerConfigId: string | null;
|
|
1920
|
+
latencyMs: number;
|
|
1921
|
+
promptTokens: number;
|
|
1922
|
+
completionTokens: number;
|
|
1923
|
+
totalTokens: number;
|
|
1924
|
+
cost: number;
|
|
1925
|
+
requestId: string;
|
|
1926
|
+
model: string;
|
|
1927
|
+
cachedTokens: number;
|
|
1928
|
+
inputCost: number;
|
|
1929
|
+
outputCost: number;
|
|
1930
|
+
endpoint: string;
|
|
1931
|
+
statusCode: number;
|
|
1932
|
+
isStreaming: boolean;
|
|
1933
|
+
userId: string | null;
|
|
1934
|
+
tags: Record<string, string>;
|
|
1935
|
+
guardrailResults: {
|
|
1936
|
+
results: {
|
|
1937
|
+
checkId: string;
|
|
1938
|
+
functionId: string;
|
|
1939
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1940
|
+
verdict: boolean;
|
|
1941
|
+
latencyMs: number;
|
|
1942
|
+
}[];
|
|
1943
|
+
action: "allowed" | "blocked" | "logged";
|
|
1944
|
+
totalLatencyMs: number;
|
|
1945
|
+
} | null;
|
|
2977
1946
|
} | undefined>;
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
1947
|
+
/**
|
|
1948
|
+
* List LLM requests with filtering and pagination
|
|
1949
|
+
* Returns data and total count for pagination
|
|
1950
|
+
*/
|
|
1951
|
+
listRequests: (params?: z$1.infer<typeof listRequestsSchema>) => Promise<{
|
|
1952
|
+
data: {
|
|
1953
|
+
id: string;
|
|
1954
|
+
createdAt: Date;
|
|
1955
|
+
updatedAt: Date;
|
|
1956
|
+
variantId: string | null;
|
|
1957
|
+
provider: string;
|
|
1958
|
+
environmentId: string | null;
|
|
1959
|
+
configId: string | null;
|
|
1960
|
+
providerConfigId: string | null;
|
|
1961
|
+
latencyMs: number;
|
|
1962
|
+
promptTokens: number;
|
|
1963
|
+
completionTokens: number;
|
|
1964
|
+
totalTokens: number;
|
|
1965
|
+
cost: number;
|
|
1966
|
+
requestId: string;
|
|
1967
|
+
model: string;
|
|
1968
|
+
cachedTokens: number;
|
|
1969
|
+
inputCost: number;
|
|
1970
|
+
outputCost: number;
|
|
1971
|
+
endpoint: string;
|
|
1972
|
+
statusCode: number;
|
|
1973
|
+
isStreaming: boolean;
|
|
1974
|
+
userId: string | null;
|
|
1975
|
+
tags: Record<string, string>;
|
|
1976
|
+
guardrailResults: {
|
|
1977
|
+
results: {
|
|
1978
|
+
checkId: string;
|
|
1979
|
+
functionId: string;
|
|
1980
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1981
|
+
verdict: boolean;
|
|
1982
|
+
latencyMs: number;
|
|
1983
|
+
}[];
|
|
1984
|
+
action: "allowed" | "blocked" | "logged";
|
|
1985
|
+
totalLatencyMs: number;
|
|
1986
|
+
} | null;
|
|
1987
|
+
}[];
|
|
1988
|
+
total: number;
|
|
1989
|
+
limit: number;
|
|
1990
|
+
offset: number;
|
|
1991
|
+
}>;
|
|
1992
|
+
/**
|
|
1993
|
+
* Get a single request by requestId
|
|
1994
|
+
*/
|
|
1995
|
+
getRequestByRequestId: (requestId: string) => Promise<{
|
|
2998
1996
|
id: string;
|
|
2999
|
-
datasetId: string | null;
|
|
3000
|
-
playgroundId: string;
|
|
3001
|
-
status: string;
|
|
3002
|
-
datasetVersionId: string | null;
|
|
3003
|
-
totalRecords: number;
|
|
3004
|
-
startedAt: Date | null;
|
|
3005
|
-
completedAt: Date | null;
|
|
3006
|
-
completedRecords: number;
|
|
3007
1997
|
createdAt: Date;
|
|
3008
1998
|
updatedAt: Date;
|
|
1999
|
+
variantId: string | null;
|
|
2000
|
+
provider: string;
|
|
2001
|
+
environmentId: string | null;
|
|
2002
|
+
configId: string | null;
|
|
2003
|
+
providerConfigId: string | null;
|
|
2004
|
+
latencyMs: number;
|
|
2005
|
+
promptTokens: number;
|
|
2006
|
+
completionTokens: number;
|
|
2007
|
+
totalTokens: number;
|
|
2008
|
+
cost: number;
|
|
2009
|
+
requestId: string;
|
|
2010
|
+
model: string;
|
|
2011
|
+
cachedTokens: number;
|
|
2012
|
+
inputCost: number;
|
|
2013
|
+
outputCost: number;
|
|
2014
|
+
endpoint: string;
|
|
2015
|
+
statusCode: number;
|
|
2016
|
+
isStreaming: boolean;
|
|
2017
|
+
userId: string | null;
|
|
2018
|
+
tags: Record<string, string>;
|
|
2019
|
+
guardrailResults: {
|
|
2020
|
+
results: {
|
|
2021
|
+
checkId: string;
|
|
2022
|
+
functionId: string;
|
|
2023
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
2024
|
+
verdict: boolean;
|
|
2025
|
+
latencyMs: number;
|
|
2026
|
+
}[];
|
|
2027
|
+
action: "allowed" | "blocked" | "logged";
|
|
2028
|
+
totalLatencyMs: number;
|
|
2029
|
+
} | null;
|
|
3009
2030
|
} | undefined>;
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
}>>;
|
|
3022
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3023
|
-
error: string | null;
|
|
3024
|
-
id: string;
|
|
3025
|
-
promptTokens: number | null;
|
|
3026
|
-
completionTokens: number | null;
|
|
3027
|
-
totalTokens: number | null;
|
|
3028
|
-
cost: number | null;
|
|
3029
|
-
latencyMs: number | null;
|
|
3030
|
-
runId: string;
|
|
3031
|
-
columnId: string;
|
|
3032
|
-
datasetRecordId: string | null;
|
|
3033
|
-
inputVariables: Record<string, unknown>;
|
|
3034
|
-
status: string;
|
|
3035
|
-
outputContent: string | null;
|
|
3036
|
-
createdAt: Date;
|
|
3037
|
-
updatedAt: Date;
|
|
2031
|
+
/**
|
|
2032
|
+
* Get total cost for a date range with optional filters
|
|
2033
|
+
*/
|
|
2034
|
+
getTotalCost: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2035
|
+
totalCost: number;
|
|
2036
|
+
totalInputCost: number;
|
|
2037
|
+
totalOutputCost: number;
|
|
2038
|
+
totalPromptTokens: number;
|
|
2039
|
+
totalCompletionTokens: number;
|
|
2040
|
+
totalTokens: number;
|
|
2041
|
+
requestCount: number;
|
|
3038
2042
|
} | undefined>;
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
}, better_auth0.$strip>>;
|
|
3052
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3053
|
-
error: string | null;
|
|
3054
|
-
id: string;
|
|
3055
|
-
promptTokens: number | null;
|
|
3056
|
-
completionTokens: number | null;
|
|
3057
|
-
totalTokens: number | null;
|
|
3058
|
-
cost: number | null;
|
|
3059
|
-
latencyMs: number | null;
|
|
3060
|
-
runId: string;
|
|
3061
|
-
columnId: string;
|
|
3062
|
-
datasetRecordId: string | null;
|
|
3063
|
-
inputVariables: Record<string, unknown>;
|
|
3064
|
-
status: string;
|
|
3065
|
-
outputContent: string | null;
|
|
3066
|
-
createdAt: Date;
|
|
3067
|
-
updatedAt: Date;
|
|
2043
|
+
/**
|
|
2044
|
+
* Get cost breakdown by model
|
|
2045
|
+
*/
|
|
2046
|
+
getCostByModel: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2047
|
+
provider: string;
|
|
2048
|
+
model: string;
|
|
2049
|
+
totalCost: number;
|
|
2050
|
+
totalInputCost: number;
|
|
2051
|
+
totalOutputCost: number;
|
|
2052
|
+
totalTokens: number;
|
|
2053
|
+
requestCount: number;
|
|
2054
|
+
avgLatencyMs: number;
|
|
3068
2055
|
}[]>;
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
2056
|
+
/**
|
|
2057
|
+
* Get cost breakdown by provider
|
|
2058
|
+
*/
|
|
2059
|
+
getCostByProvider: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2060
|
+
provider: string;
|
|
2061
|
+
totalCost: number;
|
|
2062
|
+
totalInputCost: number;
|
|
2063
|
+
totalOutputCost: number;
|
|
2064
|
+
totalTokens: number;
|
|
2065
|
+
requestCount: number;
|
|
2066
|
+
avgLatencyMs: number;
|
|
2067
|
+
}[]>;
|
|
2068
|
+
/**
|
|
2069
|
+
* Get cost breakdown by config
|
|
2070
|
+
*/
|
|
2071
|
+
getCostByConfig: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2072
|
+
configName: string | null | undefined;
|
|
2073
|
+
configId: string | null;
|
|
2074
|
+
totalCost: number;
|
|
2075
|
+
totalInputCost: number;
|
|
2076
|
+
totalOutputCost: number;
|
|
2077
|
+
totalTokens: number;
|
|
2078
|
+
requestCount: number;
|
|
2079
|
+
configSlug: string | null;
|
|
2080
|
+
}[]>;
|
|
2081
|
+
/**
|
|
2082
|
+
* Get daily cost summary
|
|
2083
|
+
*/
|
|
2084
|
+
getDailyCosts: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2085
|
+
totalCost: number;
|
|
2086
|
+
totalInputCost: number;
|
|
2087
|
+
totalOutputCost: number;
|
|
2088
|
+
totalTokens: number;
|
|
2089
|
+
requestCount: number;
|
|
2090
|
+
date: string;
|
|
2091
|
+
}[]>;
|
|
2092
|
+
/**
|
|
2093
|
+
* Get cost summary with flexible grouping and optional filters
|
|
2094
|
+
*/
|
|
2095
|
+
getCostSummary: (params: z$1.infer<typeof costSummarySchema>) => Promise<{
|
|
2096
|
+
totalCost: number;
|
|
2097
|
+
requestCount: number;
|
|
2098
|
+
groupKey: string;
|
|
2099
|
+
}[]>;
|
|
2100
|
+
/**
|
|
2101
|
+
* Get request count and stats for a time range with optional filters
|
|
2102
|
+
*/
|
|
2103
|
+
getRequestStats: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2104
|
+
avgLatencyMs: number;
|
|
2105
|
+
totalRequests: number;
|
|
2106
|
+
successfulRequests: number;
|
|
2107
|
+
failedRequests: number;
|
|
2108
|
+
streamingRequests: number;
|
|
2109
|
+
maxLatencyMs: number;
|
|
2110
|
+
minLatencyMs: number;
|
|
3119
2111
|
} | undefined>;
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
id: string;
|
|
3128
|
-
promptTokens: number | null;
|
|
3129
|
-
completionTokens: number | null;
|
|
3130
|
-
totalTokens: number | null;
|
|
3131
|
-
cost: number | null;
|
|
3132
|
-
latencyMs: number | null;
|
|
3133
|
-
runId: string;
|
|
3134
|
-
columnId: string;
|
|
3135
|
-
datasetRecordId: string | null;
|
|
3136
|
-
inputVariables: Record<string, unknown>;
|
|
3137
|
-
status: string;
|
|
3138
|
-
outputContent: string | null;
|
|
3139
|
-
createdAt: Date;
|
|
3140
|
-
updatedAt: Date;
|
|
2112
|
+
/**
|
|
2113
|
+
* Get all distinct tag key-value pairs from llm_requests
|
|
2114
|
+
* Used for populating tag filter dropdowns in the UI
|
|
2115
|
+
*/
|
|
2116
|
+
getDistinctTags: () => Promise<{
|
|
2117
|
+
key: string;
|
|
2118
|
+
value: string;
|
|
3141
2119
|
}[]>;
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
2120
|
+
};
|
|
2121
|
+
//#endregion
|
|
2122
|
+
//#region src/datalayer/playgrounds.d.ts
|
|
2123
|
+
declare const createNewPlayground: z$1.ZodObject<{
|
|
2124
|
+
name: z$1.ZodString;
|
|
2125
|
+
datasetId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2126
|
+
columns: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodObject<{
|
|
2127
|
+
id: z$1.ZodString;
|
|
2128
|
+
name: z$1.ZodString;
|
|
2129
|
+
position: z$1.ZodNumber;
|
|
2130
|
+
providerConfigId: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNull]>;
|
|
2131
|
+
modelName: z$1.ZodString;
|
|
2132
|
+
messages: z$1.ZodArray<z$1.ZodObject<{
|
|
2133
|
+
role: z$1.ZodEnum<{
|
|
2134
|
+
system: "system";
|
|
2135
|
+
user: "user";
|
|
2136
|
+
assistant: "assistant";
|
|
2137
|
+
}>;
|
|
2138
|
+
content: z$1.ZodString;
|
|
2139
|
+
}, z$1.core.$strip>>;
|
|
2140
|
+
temperature: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2141
|
+
maxTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2142
|
+
topP: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2143
|
+
frequencyPenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2144
|
+
presencePenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2145
|
+
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2146
|
+
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2147
|
+
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2148
|
+
}, z$1.core.$strip>>>>;
|
|
2149
|
+
}, z$1.core.$strip>;
|
|
2150
|
+
declare const updatePlayground: z$1.ZodObject<{
|
|
2151
|
+
playgroundId: z$1.ZodUUID;
|
|
2152
|
+
name: z$1.ZodOptional<z$1.ZodString>;
|
|
2153
|
+
datasetId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2154
|
+
columns: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodObject<{
|
|
2155
|
+
id: z$1.ZodString;
|
|
2156
|
+
name: z$1.ZodString;
|
|
2157
|
+
position: z$1.ZodNumber;
|
|
2158
|
+
providerConfigId: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNull]>;
|
|
2159
|
+
modelName: z$1.ZodString;
|
|
2160
|
+
messages: z$1.ZodArray<z$1.ZodObject<{
|
|
2161
|
+
role: z$1.ZodEnum<{
|
|
2162
|
+
system: "system";
|
|
2163
|
+
user: "user";
|
|
2164
|
+
assistant: "assistant";
|
|
2165
|
+
}>;
|
|
2166
|
+
content: z$1.ZodString;
|
|
2167
|
+
}, z$1.core.$strip>>;
|
|
2168
|
+
temperature: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2169
|
+
maxTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2170
|
+
topP: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2171
|
+
frequencyPenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2172
|
+
presencePenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2173
|
+
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2174
|
+
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2175
|
+
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2176
|
+
}, z$1.core.$strip>>>>;
|
|
2177
|
+
}, z$1.core.$strip>;
|
|
2178
|
+
declare const getPlaygroundById: z$1.ZodObject<{
|
|
2179
|
+
playgroundId: z$1.ZodUUID;
|
|
2180
|
+
}, z$1.core.$strip>;
|
|
2181
|
+
declare const deletePlayground: z$1.ZodObject<{
|
|
2182
|
+
playgroundId: z$1.ZodUUID;
|
|
2183
|
+
}, z$1.core.$strip>;
|
|
2184
|
+
declare const listPlaygrounds: z$1.ZodObject<{
|
|
2185
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2186
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2187
|
+
}, z$1.core.$strip>;
|
|
2188
|
+
declare const createPlaygroundDataLayer: (db: Kysely<Database>) => {
|
|
2189
|
+
createNewPlayground: (params: z$1.infer<typeof createNewPlayground>) => Promise<{
|
|
2190
|
+
name: string;
|
|
3146
2191
|
id: string;
|
|
3147
|
-
promptTokens: number | null;
|
|
3148
|
-
completionTokens: number | null;
|
|
3149
|
-
totalTokens: number | null;
|
|
3150
|
-
cost: number | null;
|
|
3151
|
-
latencyMs: number | null;
|
|
3152
|
-
runId: string;
|
|
3153
|
-
columnId: string;
|
|
3154
|
-
datasetRecordId: string | null;
|
|
3155
|
-
inputVariables: Record<string, unknown>;
|
|
3156
|
-
status: string;
|
|
3157
|
-
outputContent: string | null;
|
|
3158
2192
|
createdAt: Date;
|
|
3159
2193
|
updatedAt: Date;
|
|
3160
|
-
}[]>;
|
|
3161
|
-
countPlaygroundResults: (runId: string) => Promise<number>;
|
|
3162
|
-
countCompletedPlaygroundResults: (runId: string) => Promise<number>;
|
|
3163
|
-
createNewPlayground: (params: zod0.infer<zod0.ZodObject<{
|
|
3164
|
-
name: zod0.ZodString;
|
|
3165
|
-
datasetId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
3166
|
-
columns: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodArray<zod0.ZodObject<{
|
|
3167
|
-
id: zod0.ZodString;
|
|
3168
|
-
name: zod0.ZodString;
|
|
3169
|
-
position: zod0.ZodNumber;
|
|
3170
|
-
providerConfigId: zod0.ZodUnion<readonly [zod0.ZodString, zod0.ZodNull]>;
|
|
3171
|
-
modelName: zod0.ZodString;
|
|
3172
|
-
messages: zod0.ZodArray<zod0.ZodObject<{
|
|
3173
|
-
role: zod0.ZodEnum<{
|
|
3174
|
-
system: "system";
|
|
3175
|
-
user: "user";
|
|
3176
|
-
assistant: "assistant";
|
|
3177
|
-
}>;
|
|
3178
|
-
content: zod0.ZodString;
|
|
3179
|
-
}, better_auth0.$strip>>;
|
|
3180
|
-
temperature: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodNumber>>;
|
|
3181
|
-
maxTokens: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodNumber>>;
|
|
3182
|
-
topP: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodNumber>>;
|
|
3183
|
-
frequencyPenalty: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodNumber>>;
|
|
3184
|
-
presencePenalty: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodNumber>>;
|
|
3185
|
-
configId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
3186
|
-
variantId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
3187
|
-
variantVersionId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
3188
|
-
}, better_auth0.$strip>>>>;
|
|
3189
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3190
|
-
name: string;
|
|
3191
|
-
id: string;
|
|
3192
2194
|
datasetId: string | null;
|
|
3193
2195
|
columns: {
|
|
3194
2196
|
id: string;
|
|
@@ -3209,39 +2211,12 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
3209
2211
|
variantId?: string | null | undefined;
|
|
3210
2212
|
variantVersionId?: string | null | undefined;
|
|
3211
2213
|
}[] | null;
|
|
3212
|
-
createdAt: Date;
|
|
3213
|
-
updatedAt: Date;
|
|
3214
2214
|
} | undefined>;
|
|
3215
|
-
updatePlayground: (params:
|
|
3216
|
-
playgroundId: zod0.ZodUUID;
|
|
3217
|
-
name: zod0.ZodOptional<zod0.ZodString>;
|
|
3218
|
-
datasetId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
3219
|
-
columns: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodArray<zod0.ZodObject<{
|
|
3220
|
-
id: zod0.ZodString;
|
|
3221
|
-
name: zod0.ZodString;
|
|
3222
|
-
position: zod0.ZodNumber;
|
|
3223
|
-
providerConfigId: zod0.ZodUnion<readonly [zod0.ZodString, zod0.ZodNull]>;
|
|
3224
|
-
modelName: zod0.ZodString;
|
|
3225
|
-
messages: zod0.ZodArray<zod0.ZodObject<{
|
|
3226
|
-
role: zod0.ZodEnum<{
|
|
3227
|
-
system: "system";
|
|
3228
|
-
user: "user";
|
|
3229
|
-
assistant: "assistant";
|
|
3230
|
-
}>;
|
|
3231
|
-
content: zod0.ZodString;
|
|
3232
|
-
}, better_auth0.$strip>>;
|
|
3233
|
-
temperature: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodNumber>>;
|
|
3234
|
-
maxTokens: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodNumber>>;
|
|
3235
|
-
topP: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodNumber>>;
|
|
3236
|
-
frequencyPenalty: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodNumber>>;
|
|
3237
|
-
presencePenalty: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodNumber>>;
|
|
3238
|
-
configId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
3239
|
-
variantId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
3240
|
-
variantVersionId: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
3241
|
-
}, better_auth0.$strip>>>>;
|
|
3242
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2215
|
+
updatePlayground: (params: z$1.infer<typeof updatePlayground>) => Promise<{
|
|
3243
2216
|
name: string;
|
|
3244
2217
|
id: string;
|
|
2218
|
+
createdAt: Date;
|
|
2219
|
+
updatedAt: Date;
|
|
3245
2220
|
datasetId: string | null;
|
|
3246
2221
|
columns: {
|
|
3247
2222
|
id: string;
|
|
@@ -3262,14 +2237,12 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
3262
2237
|
variantId?: string | null | undefined;
|
|
3263
2238
|
variantVersionId?: string | null | undefined;
|
|
3264
2239
|
}[] | null;
|
|
3265
|
-
createdAt: Date;
|
|
3266
|
-
updatedAt: Date;
|
|
3267
2240
|
} | undefined>;
|
|
3268
|
-
getPlaygroundById: (params:
|
|
3269
|
-
playgroundId: zod0.ZodUUID;
|
|
3270
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2241
|
+
getPlaygroundById: (params: z$1.infer<typeof getPlaygroundById>) => Promise<{
|
|
3271
2242
|
name: string;
|
|
3272
2243
|
id: string;
|
|
2244
|
+
createdAt: Date;
|
|
2245
|
+
updatedAt: Date;
|
|
3273
2246
|
datasetId: string | null;
|
|
3274
2247
|
columns: {
|
|
3275
2248
|
id: string;
|
|
@@ -3290,14 +2263,12 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
3290
2263
|
variantId?: string | null | undefined;
|
|
3291
2264
|
variantVersionId?: string | null | undefined;
|
|
3292
2265
|
}[] | null;
|
|
3293
|
-
createdAt: Date;
|
|
3294
|
-
updatedAt: Date;
|
|
3295
2266
|
} | undefined>;
|
|
3296
|
-
deletePlayground: (params:
|
|
3297
|
-
playgroundId: zod0.ZodUUID;
|
|
3298
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2267
|
+
deletePlayground: (params: z$1.infer<typeof deletePlayground>) => Promise<{
|
|
3299
2268
|
name: string;
|
|
3300
2269
|
id: string;
|
|
2270
|
+
createdAt: Date;
|
|
2271
|
+
updatedAt: Date;
|
|
3301
2272
|
datasetId: string | null;
|
|
3302
2273
|
columns: {
|
|
3303
2274
|
id: string;
|
|
@@ -3318,15 +2289,12 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
3318
2289
|
variantId?: string | null | undefined;
|
|
3319
2290
|
variantVersionId?: string | null | undefined;
|
|
3320
2291
|
}[] | null;
|
|
3321
|
-
createdAt: Date;
|
|
3322
|
-
updatedAt: Date;
|
|
3323
2292
|
} | undefined>;
|
|
3324
|
-
listPlaygrounds: (params?:
|
|
3325
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
3326
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
3327
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2293
|
+
listPlaygrounds: (params?: z$1.infer<typeof listPlaygrounds>) => Promise<{
|
|
3328
2294
|
name: string;
|
|
3329
2295
|
id: string;
|
|
2296
|
+
createdAt: Date;
|
|
2297
|
+
updatedAt: Date;
|
|
3330
2298
|
datasetId: string | null;
|
|
3331
2299
|
columns: {
|
|
3332
2300
|
id: string;
|
|
@@ -3347,921 +2315,1070 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
3347
2315
|
variantId?: string | null | undefined;
|
|
3348
2316
|
variantVersionId?: string | null | undefined;
|
|
3349
2317
|
}[] | null;
|
|
3350
|
-
createdAt: Date;
|
|
3351
|
-
updatedAt: Date;
|
|
3352
2318
|
}[]>;
|
|
3353
2319
|
countPlaygrounds: () => Promise<number>;
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
model: string;
|
|
3415
|
-
promptTokens: number;
|
|
3416
|
-
completionTokens: number;
|
|
3417
|
-
totalTokens: number;
|
|
3418
|
-
cachedTokens: number;
|
|
3419
|
-
cost: number;
|
|
3420
|
-
inputCost: number;
|
|
3421
|
-
outputCost: number;
|
|
3422
|
-
endpoint: string;
|
|
3423
|
-
statusCode: number;
|
|
3424
|
-
latencyMs: number;
|
|
3425
|
-
isStreaming: boolean;
|
|
3426
|
-
userId: string | null;
|
|
3427
|
-
tags: Record<string, string>;
|
|
3428
|
-
guardrailResults: {
|
|
3429
|
-
results: {
|
|
3430
|
-
checkId: string;
|
|
3431
|
-
functionId: string;
|
|
3432
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
3433
|
-
verdict: boolean;
|
|
3434
|
-
latencyMs: number;
|
|
3435
|
-
}[];
|
|
3436
|
-
action: "allowed" | "blocked" | "logged";
|
|
3437
|
-
totalLatencyMs: number;
|
|
3438
|
-
} | null;
|
|
3439
|
-
createdAt: Date;
|
|
3440
|
-
updatedAt: Date;
|
|
3441
|
-
}[];
|
|
3442
|
-
total: number;
|
|
3443
|
-
limit: number;
|
|
3444
|
-
offset: number;
|
|
3445
|
-
}>;
|
|
3446
|
-
getRequestByRequestId: (requestId: string) => Promise<{
|
|
3447
|
-
configId: string | null;
|
|
3448
|
-
variantId: string | null;
|
|
2320
|
+
};
|
|
2321
|
+
//#endregion
|
|
2322
|
+
//#region src/datalayer/playgroundResults.d.ts
|
|
2323
|
+
declare const createPlaygroundResult: z$1.ZodObject<{
|
|
2324
|
+
runId: z$1.ZodString;
|
|
2325
|
+
columnId: z$1.ZodString;
|
|
2326
|
+
datasetRecordId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2327
|
+
inputVariables: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2328
|
+
status: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2329
|
+
pending: "pending";
|
|
2330
|
+
running: "running";
|
|
2331
|
+
completed: "completed";
|
|
2332
|
+
failed: "failed";
|
|
2333
|
+
}>>;
|
|
2334
|
+
}, z$1.core.$strip>;
|
|
2335
|
+
declare const createPlaygroundResultsBatch: z$1.ZodObject<{
|
|
2336
|
+
results: z$1.ZodArray<z$1.ZodObject<{
|
|
2337
|
+
runId: z$1.ZodString;
|
|
2338
|
+
columnId: z$1.ZodString;
|
|
2339
|
+
datasetRecordId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2340
|
+
inputVariables: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2341
|
+
status: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2342
|
+
pending: "pending";
|
|
2343
|
+
running: "running";
|
|
2344
|
+
completed: "completed";
|
|
2345
|
+
failed: "failed";
|
|
2346
|
+
}>>;
|
|
2347
|
+
}, z$1.core.$strip>>;
|
|
2348
|
+
}, z$1.core.$strip>;
|
|
2349
|
+
declare const updatePlaygroundResult: z$1.ZodObject<{
|
|
2350
|
+
resultId: z$1.ZodString;
|
|
2351
|
+
outputContent: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2352
|
+
status: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2353
|
+
pending: "pending";
|
|
2354
|
+
running: "running";
|
|
2355
|
+
completed: "completed";
|
|
2356
|
+
failed: "failed";
|
|
2357
|
+
}>>;
|
|
2358
|
+
error: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2359
|
+
latencyMs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2360
|
+
promptTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2361
|
+
completionTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2362
|
+
totalTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2363
|
+
cost: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2364
|
+
}, z$1.core.$strip>;
|
|
2365
|
+
declare const getPlaygroundResultById: z$1.ZodObject<{
|
|
2366
|
+
resultId: z$1.ZodString;
|
|
2367
|
+
}, z$1.core.$strip>;
|
|
2368
|
+
declare const listPlaygroundResults: z$1.ZodObject<{
|
|
2369
|
+
runId: z$1.ZodString;
|
|
2370
|
+
columnId: z$1.ZodOptional<z$1.ZodString>;
|
|
2371
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2372
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2373
|
+
}, z$1.core.$strip>;
|
|
2374
|
+
declare const deletePlaygroundResultsByRunId: z$1.ZodObject<{
|
|
2375
|
+
runId: z$1.ZodString;
|
|
2376
|
+
}, z$1.core.$strip>;
|
|
2377
|
+
declare const createPlaygroundResultsDataLayer: (db: Kysely<Database>) => {
|
|
2378
|
+
createPlaygroundResult: (params: z$1.infer<typeof createPlaygroundResult>) => Promise<{
|
|
2379
|
+
error: string | null;
|
|
3449
2380
|
id: string;
|
|
3450
|
-
provider: string;
|
|
3451
|
-
environmentId: string | null;
|
|
3452
|
-
requestId: string;
|
|
3453
|
-
providerConfigId: string | null;
|
|
3454
|
-
model: string;
|
|
3455
|
-
promptTokens: number;
|
|
3456
|
-
completionTokens: number;
|
|
3457
|
-
totalTokens: number;
|
|
3458
|
-
cachedTokens: number;
|
|
3459
|
-
cost: number;
|
|
3460
|
-
inputCost: number;
|
|
3461
|
-
outputCost: number;
|
|
3462
|
-
endpoint: string;
|
|
3463
|
-
statusCode: number;
|
|
3464
|
-
latencyMs: number;
|
|
3465
|
-
isStreaming: boolean;
|
|
3466
|
-
userId: string | null;
|
|
3467
|
-
tags: Record<string, string>;
|
|
3468
|
-
guardrailResults: {
|
|
3469
|
-
results: {
|
|
3470
|
-
checkId: string;
|
|
3471
|
-
functionId: string;
|
|
3472
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
3473
|
-
verdict: boolean;
|
|
3474
|
-
latencyMs: number;
|
|
3475
|
-
}[];
|
|
3476
|
-
action: "allowed" | "blocked" | "logged";
|
|
3477
|
-
totalLatencyMs: number;
|
|
3478
|
-
} | null;
|
|
3479
2381
|
createdAt: Date;
|
|
3480
2382
|
updatedAt: Date;
|
|
2383
|
+
status: string;
|
|
2384
|
+
runId: string;
|
|
2385
|
+
columnId: string;
|
|
2386
|
+
datasetRecordId: string | null;
|
|
2387
|
+
inputVariables: Record<string, unknown>;
|
|
2388
|
+
outputContent: string | null;
|
|
2389
|
+
latencyMs: number | null;
|
|
2390
|
+
promptTokens: number | null;
|
|
2391
|
+
completionTokens: number | null;
|
|
2392
|
+
totalTokens: number | null;
|
|
2393
|
+
cost: number | null;
|
|
3481
2394
|
} | undefined>;
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
getCostByModel: (params: zod0.infer<zod0.ZodObject<{
|
|
3499
|
-
startDate: zod0.ZodDate;
|
|
3500
|
-
endDate: zod0.ZodDate;
|
|
3501
|
-
configId: zod0.ZodOptional<zod0.ZodString>;
|
|
3502
|
-
variantId: zod0.ZodOptional<zod0.ZodString>;
|
|
3503
|
-
environmentId: zod0.ZodOptional<zod0.ZodString>;
|
|
3504
|
-
tags: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>>;
|
|
3505
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3506
|
-
provider: string;
|
|
3507
|
-
model: string;
|
|
3508
|
-
totalCost: number;
|
|
3509
|
-
totalInputCost: number;
|
|
3510
|
-
totalOutputCost: number;
|
|
3511
|
-
totalTokens: number;
|
|
3512
|
-
requestCount: number;
|
|
3513
|
-
avgLatencyMs: number;
|
|
3514
|
-
}[]>;
|
|
3515
|
-
getCostByProvider: (params: zod0.infer<zod0.ZodObject<{
|
|
3516
|
-
startDate: zod0.ZodDate;
|
|
3517
|
-
endDate: zod0.ZodDate;
|
|
3518
|
-
configId: zod0.ZodOptional<zod0.ZodString>;
|
|
3519
|
-
variantId: zod0.ZodOptional<zod0.ZodString>;
|
|
3520
|
-
environmentId: zod0.ZodOptional<zod0.ZodString>;
|
|
3521
|
-
tags: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>>;
|
|
3522
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3523
|
-
provider: string;
|
|
3524
|
-
totalCost: number;
|
|
3525
|
-
totalInputCost: number;
|
|
3526
|
-
totalOutputCost: number;
|
|
3527
|
-
totalTokens: number;
|
|
3528
|
-
requestCount: number;
|
|
3529
|
-
avgLatencyMs: number;
|
|
3530
|
-
}[]>;
|
|
3531
|
-
getCostByConfig: (params: zod0.infer<zod0.ZodObject<{
|
|
3532
|
-
startDate: zod0.ZodDate;
|
|
3533
|
-
endDate: zod0.ZodDate;
|
|
3534
|
-
configId: zod0.ZodOptional<zod0.ZodString>;
|
|
3535
|
-
variantId: zod0.ZodOptional<zod0.ZodString>;
|
|
3536
|
-
environmentId: zod0.ZodOptional<zod0.ZodString>;
|
|
3537
|
-
tags: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>>;
|
|
3538
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3539
|
-
configId: string | null;
|
|
3540
|
-
totalCost: number;
|
|
3541
|
-
totalInputCost: number;
|
|
3542
|
-
totalOutputCost: number;
|
|
3543
|
-
totalTokens: number;
|
|
3544
|
-
requestCount: number;
|
|
3545
|
-
configName: string | null | undefined;
|
|
3546
|
-
configSlug: string | null;
|
|
3547
|
-
}[]>;
|
|
3548
|
-
getDailyCosts: (params: zod0.infer<zod0.ZodObject<{
|
|
3549
|
-
startDate: zod0.ZodDate;
|
|
3550
|
-
endDate: zod0.ZodDate;
|
|
3551
|
-
configId: zod0.ZodOptional<zod0.ZodString>;
|
|
3552
|
-
variantId: zod0.ZodOptional<zod0.ZodString>;
|
|
3553
|
-
environmentId: zod0.ZodOptional<zod0.ZodString>;
|
|
3554
|
-
tags: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>>;
|
|
3555
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3556
|
-
totalCost: number;
|
|
3557
|
-
totalInputCost: number;
|
|
3558
|
-
totalOutputCost: number;
|
|
3559
|
-
totalTokens: number;
|
|
3560
|
-
requestCount: number;
|
|
3561
|
-
date: string;
|
|
3562
|
-
}[]>;
|
|
3563
|
-
getCostSummary: (params: zod0.infer<zod0.ZodObject<{
|
|
3564
|
-
startDate: zod0.ZodDate;
|
|
3565
|
-
endDate: zod0.ZodDate;
|
|
3566
|
-
configId: zod0.ZodOptional<zod0.ZodString>;
|
|
3567
|
-
variantId: zod0.ZodOptional<zod0.ZodString>;
|
|
3568
|
-
environmentId: zod0.ZodOptional<zod0.ZodString>;
|
|
3569
|
-
tags: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>>;
|
|
3570
|
-
groupBy: zod0.ZodOptional<zod0.ZodEnum<{
|
|
3571
|
-
provider: "provider";
|
|
3572
|
-
model: "model";
|
|
3573
|
-
day: "day";
|
|
3574
|
-
hour: "hour";
|
|
3575
|
-
config: "config";
|
|
3576
|
-
}>>;
|
|
3577
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3578
|
-
totalCost: number;
|
|
3579
|
-
requestCount: number;
|
|
3580
|
-
groupKey: string;
|
|
3581
|
-
}[]>;
|
|
3582
|
-
getRequestStats: (params: zod0.infer<zod0.ZodObject<{
|
|
3583
|
-
startDate: zod0.ZodDate;
|
|
3584
|
-
endDate: zod0.ZodDate;
|
|
3585
|
-
configId: zod0.ZodOptional<zod0.ZodString>;
|
|
3586
|
-
variantId: zod0.ZodOptional<zod0.ZodString>;
|
|
3587
|
-
environmentId: zod0.ZodOptional<zod0.ZodString>;
|
|
3588
|
-
tags: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>>;
|
|
3589
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3590
|
-
avgLatencyMs: number;
|
|
3591
|
-
totalRequests: number;
|
|
3592
|
-
successfulRequests: number;
|
|
3593
|
-
failedRequests: number;
|
|
3594
|
-
streamingRequests: number;
|
|
3595
|
-
maxLatencyMs: number;
|
|
3596
|
-
minLatencyMs: number;
|
|
3597
|
-
} | undefined>;
|
|
3598
|
-
getDistinctTags: () => Promise<{
|
|
3599
|
-
key: string;
|
|
3600
|
-
value: string;
|
|
2395
|
+
createPlaygroundResultsBatch: (params: z$1.infer<typeof createPlaygroundResultsBatch>) => Promise<{
|
|
2396
|
+
error: string | null;
|
|
2397
|
+
id: string;
|
|
2398
|
+
createdAt: Date;
|
|
2399
|
+
updatedAt: Date;
|
|
2400
|
+
status: string;
|
|
2401
|
+
runId: string;
|
|
2402
|
+
columnId: string;
|
|
2403
|
+
datasetRecordId: string | null;
|
|
2404
|
+
inputVariables: Record<string, unknown>;
|
|
2405
|
+
outputContent: string | null;
|
|
2406
|
+
latencyMs: number | null;
|
|
2407
|
+
promptTokens: number | null;
|
|
2408
|
+
completionTokens: number | null;
|
|
2409
|
+
totalTokens: number | null;
|
|
2410
|
+
cost: number | null;
|
|
3601
2411
|
}[]>;
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
pluginId: zod0.ZodString;
|
|
3605
|
-
functionId: zod0.ZodString;
|
|
3606
|
-
hookType: zod0.ZodEnum<{
|
|
3607
|
-
beforeRequestHook: "beforeRequestHook";
|
|
3608
|
-
afterRequestHook: "afterRequestHook";
|
|
3609
|
-
}>;
|
|
3610
|
-
parameters: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>>;
|
|
3611
|
-
enabled: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodBoolean>>;
|
|
3612
|
-
priority: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodNumber>>;
|
|
3613
|
-
onFail: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodEnum<{
|
|
3614
|
-
block: "block";
|
|
3615
|
-
log: "log";
|
|
3616
|
-
}>>>;
|
|
3617
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3618
|
-
name: string;
|
|
2412
|
+
updatePlaygroundResult: (params: z$1.infer<typeof updatePlaygroundResult>) => Promise<{
|
|
2413
|
+
error: string | null;
|
|
3619
2414
|
id: string;
|
|
3620
|
-
pluginId: string;
|
|
3621
|
-
functionId: string;
|
|
3622
|
-
hookType: string;
|
|
3623
|
-
parameters: Record<string, unknown>;
|
|
3624
|
-
enabled: boolean;
|
|
3625
|
-
priority: number;
|
|
3626
|
-
onFail: string;
|
|
3627
2415
|
createdAt: Date;
|
|
3628
2416
|
updatedAt: Date;
|
|
2417
|
+
status: string;
|
|
2418
|
+
runId: string;
|
|
2419
|
+
columnId: string;
|
|
2420
|
+
datasetRecordId: string | null;
|
|
2421
|
+
inputVariables: Record<string, unknown>;
|
|
2422
|
+
outputContent: string | null;
|
|
2423
|
+
latencyMs: number | null;
|
|
2424
|
+
promptTokens: number | null;
|
|
2425
|
+
completionTokens: number | null;
|
|
2426
|
+
totalTokens: number | null;
|
|
2427
|
+
cost: number | null;
|
|
3629
2428
|
} | undefined>;
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
name: zod0.ZodOptional<zod0.ZodString>;
|
|
3633
|
-
hookType: zod0.ZodOptional<zod0.ZodEnum<{
|
|
3634
|
-
beforeRequestHook: "beforeRequestHook";
|
|
3635
|
-
afterRequestHook: "afterRequestHook";
|
|
3636
|
-
}>>;
|
|
3637
|
-
parameters: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
3638
|
-
enabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
3639
|
-
priority: zod0.ZodOptional<zod0.ZodNumber>;
|
|
3640
|
-
onFail: zod0.ZodOptional<zod0.ZodEnum<{
|
|
3641
|
-
block: "block";
|
|
3642
|
-
log: "log";
|
|
3643
|
-
}>>;
|
|
3644
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3645
|
-
name: string;
|
|
2429
|
+
getPlaygroundResultById: (params: z$1.infer<typeof getPlaygroundResultById>) => Promise<{
|
|
2430
|
+
error: string | null;
|
|
3646
2431
|
id: string;
|
|
3647
|
-
pluginId: string;
|
|
3648
|
-
functionId: string;
|
|
3649
|
-
hookType: string;
|
|
3650
|
-
parameters: Record<string, unknown>;
|
|
3651
|
-
enabled: boolean;
|
|
3652
|
-
priority: number;
|
|
3653
|
-
onFail: string;
|
|
3654
2432
|
createdAt: Date;
|
|
3655
2433
|
updatedAt: Date;
|
|
2434
|
+
status: string;
|
|
2435
|
+
runId: string;
|
|
2436
|
+
columnId: string;
|
|
2437
|
+
datasetRecordId: string | null;
|
|
2438
|
+
inputVariables: Record<string, unknown>;
|
|
2439
|
+
outputContent: string | null;
|
|
2440
|
+
latencyMs: number | null;
|
|
2441
|
+
promptTokens: number | null;
|
|
2442
|
+
completionTokens: number | null;
|
|
2443
|
+
totalTokens: number | null;
|
|
2444
|
+
cost: number | null;
|
|
3656
2445
|
} | undefined>;
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
2446
|
+
listPlaygroundResults: (params: z$1.infer<typeof listPlaygroundResults>) => Promise<{
|
|
2447
|
+
error: string | null;
|
|
2448
|
+
id: string;
|
|
2449
|
+
createdAt: Date;
|
|
2450
|
+
updatedAt: Date;
|
|
2451
|
+
status: string;
|
|
2452
|
+
runId: string;
|
|
2453
|
+
columnId: string;
|
|
2454
|
+
datasetRecordId: string | null;
|
|
2455
|
+
inputVariables: Record<string, unknown>;
|
|
2456
|
+
outputContent: string | null;
|
|
2457
|
+
latencyMs: number | null;
|
|
2458
|
+
promptTokens: number | null;
|
|
2459
|
+
completionTokens: number | null;
|
|
2460
|
+
totalTokens: number | null;
|
|
2461
|
+
cost: number | null;
|
|
2462
|
+
}[]>;
|
|
2463
|
+
deletePlaygroundResultsByRunId: (params: z$1.infer<typeof deletePlaygroundResultsByRunId>) => Promise<{
|
|
2464
|
+
error: string | null;
|
|
2465
|
+
id: string;
|
|
2466
|
+
createdAt: Date;
|
|
2467
|
+
updatedAt: Date;
|
|
2468
|
+
status: string;
|
|
2469
|
+
runId: string;
|
|
2470
|
+
columnId: string;
|
|
2471
|
+
datasetRecordId: string | null;
|
|
2472
|
+
inputVariables: Record<string, unknown>;
|
|
2473
|
+
outputContent: string | null;
|
|
2474
|
+
latencyMs: number | null;
|
|
2475
|
+
promptTokens: number | null;
|
|
2476
|
+
completionTokens: number | null;
|
|
2477
|
+
totalTokens: number | null;
|
|
2478
|
+
cost: number | null;
|
|
2479
|
+
}[]>;
|
|
2480
|
+
countPlaygroundResults: (runId: string) => Promise<number>;
|
|
2481
|
+
countCompletedPlaygroundResults: (runId: string) => Promise<number>;
|
|
2482
|
+
};
|
|
2483
|
+
//#endregion
|
|
2484
|
+
//#region src/datalayer/playgroundRuns.d.ts
|
|
2485
|
+
declare const createPlaygroundRun: z$1.ZodObject<{
|
|
2486
|
+
playgroundId: z$1.ZodString;
|
|
2487
|
+
datasetId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2488
|
+
datasetVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2489
|
+
status: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2490
|
+
pending: "pending";
|
|
2491
|
+
running: "running";
|
|
2492
|
+
completed: "completed";
|
|
2493
|
+
failed: "failed";
|
|
2494
|
+
cancelled: "cancelled";
|
|
2495
|
+
}>>;
|
|
2496
|
+
totalRecords: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2497
|
+
}, z$1.core.$strip>;
|
|
2498
|
+
declare const updatePlaygroundRun: z$1.ZodObject<{
|
|
2499
|
+
runId: z$1.ZodString;
|
|
2500
|
+
status: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2501
|
+
pending: "pending";
|
|
2502
|
+
running: "running";
|
|
2503
|
+
completed: "completed";
|
|
2504
|
+
failed: "failed";
|
|
2505
|
+
cancelled: "cancelled";
|
|
2506
|
+
}>>;
|
|
2507
|
+
startedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
2508
|
+
completedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
2509
|
+
completedRecords: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2510
|
+
}, z$1.core.$strip>;
|
|
2511
|
+
declare const getPlaygroundRunById: z$1.ZodObject<{
|
|
2512
|
+
runId: z$1.ZodString;
|
|
2513
|
+
}, z$1.core.$strip>;
|
|
2514
|
+
declare const listPlaygroundRuns: z$1.ZodObject<{
|
|
2515
|
+
playgroundId: z$1.ZodString;
|
|
2516
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2517
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2518
|
+
}, z$1.core.$strip>;
|
|
2519
|
+
declare const deletePlaygroundRun: z$1.ZodObject<{
|
|
2520
|
+
runId: z$1.ZodString;
|
|
2521
|
+
}, z$1.core.$strip>;
|
|
2522
|
+
declare const createPlaygroundRunsDataLayer: (db: Kysely<Database>) => {
|
|
2523
|
+
createPlaygroundRun: (params: z$1.infer<typeof createPlaygroundRun>) => Promise<{
|
|
3661
2524
|
id: string;
|
|
3662
|
-
pluginId: string;
|
|
3663
|
-
functionId: string;
|
|
3664
|
-
hookType: string;
|
|
3665
|
-
parameters: Record<string, unknown>;
|
|
3666
|
-
enabled: boolean;
|
|
3667
|
-
priority: number;
|
|
3668
|
-
onFail: string;
|
|
3669
2525
|
createdAt: Date;
|
|
3670
2526
|
updatedAt: Date;
|
|
2527
|
+
datasetId: string | null;
|
|
2528
|
+
playgroundId: string;
|
|
2529
|
+
datasetVersionId: string | null;
|
|
2530
|
+
status: string;
|
|
2531
|
+
startedAt: Date | null;
|
|
2532
|
+
completedAt: Date | null;
|
|
2533
|
+
totalRecords: number;
|
|
2534
|
+
completedRecords: number;
|
|
3671
2535
|
} | undefined>;
|
|
3672
|
-
|
|
3673
|
-
id: zod0.ZodString;
|
|
3674
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3675
|
-
name: string;
|
|
2536
|
+
updatePlaygroundRun: (params: z$1.infer<typeof updatePlaygroundRun>) => Promise<{
|
|
3676
2537
|
id: string;
|
|
3677
|
-
pluginId: string;
|
|
3678
|
-
functionId: string;
|
|
3679
|
-
hookType: string;
|
|
3680
|
-
parameters: Record<string, unknown>;
|
|
3681
|
-
enabled: boolean;
|
|
3682
|
-
priority: number;
|
|
3683
|
-
onFail: string;
|
|
3684
2538
|
createdAt: Date;
|
|
3685
2539
|
updatedAt: Date;
|
|
2540
|
+
datasetId: string | null;
|
|
2541
|
+
playgroundId: string;
|
|
2542
|
+
datasetVersionId: string | null;
|
|
2543
|
+
status: string;
|
|
2544
|
+
startedAt: Date | null;
|
|
2545
|
+
completedAt: Date | null;
|
|
2546
|
+
totalRecords: number;
|
|
2547
|
+
completedRecords: number;
|
|
3686
2548
|
} | undefined>;
|
|
3687
|
-
|
|
3688
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
3689
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
3690
|
-
hookType: zod0.ZodOptional<zod0.ZodEnum<{
|
|
3691
|
-
beforeRequestHook: "beforeRequestHook";
|
|
3692
|
-
afterRequestHook: "afterRequestHook";
|
|
3693
|
-
}>>;
|
|
3694
|
-
enabled: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
3695
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3696
|
-
name: string;
|
|
2549
|
+
getPlaygroundRunById: (params: z$1.infer<typeof getPlaygroundRunById>) => Promise<{
|
|
3697
2550
|
id: string;
|
|
3698
|
-
pluginId: string;
|
|
3699
|
-
functionId: string;
|
|
3700
|
-
hookType: string;
|
|
3701
|
-
parameters: Record<string, unknown>;
|
|
3702
|
-
enabled: boolean;
|
|
3703
|
-
priority: number;
|
|
3704
|
-
onFail: string;
|
|
3705
2551
|
createdAt: Date;
|
|
3706
2552
|
updatedAt: Date;
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
2553
|
+
datasetId: string | null;
|
|
2554
|
+
playgroundId: string;
|
|
2555
|
+
datasetVersionId: string | null;
|
|
2556
|
+
status: string;
|
|
2557
|
+
startedAt: Date | null;
|
|
2558
|
+
completedAt: Date | null;
|
|
2559
|
+
totalRecords: number;
|
|
2560
|
+
completedRecords: number;
|
|
2561
|
+
} | undefined>;
|
|
2562
|
+
listPlaygroundRuns: (params: z$1.infer<typeof listPlaygroundRuns>) => Promise<{
|
|
3711
2563
|
id: string;
|
|
3712
|
-
pluginId: string;
|
|
3713
|
-
functionId: string;
|
|
3714
|
-
hookType: string;
|
|
3715
|
-
parameters: Record<string, unknown>;
|
|
3716
|
-
enabled: boolean;
|
|
3717
|
-
priority: number;
|
|
3718
|
-
onFail: string;
|
|
3719
2564
|
createdAt: Date;
|
|
3720
2565
|
updatedAt: Date;
|
|
2566
|
+
datasetId: string | null;
|
|
2567
|
+
playgroundId: string;
|
|
2568
|
+
datasetVersionId: string | null;
|
|
2569
|
+
status: string;
|
|
2570
|
+
startedAt: Date | null;
|
|
2571
|
+
completedAt: Date | null;
|
|
2572
|
+
totalRecords: number;
|
|
2573
|
+
completedRecords: number;
|
|
3721
2574
|
}[]>;
|
|
3722
|
-
|
|
3723
|
-
environmentId: zod0.ZodUUID;
|
|
3724
|
-
keyName: zod0.ZodString;
|
|
3725
|
-
keyValue: zod0.ZodString;
|
|
3726
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2575
|
+
deletePlaygroundRun: (params: z$1.infer<typeof deletePlaygroundRun>) => Promise<{
|
|
3727
2576
|
id: string;
|
|
3728
|
-
environmentId: string;
|
|
3729
|
-
keyName: string;
|
|
3730
|
-
keyValue: string;
|
|
3731
2577
|
createdAt: Date;
|
|
3732
2578
|
updatedAt: Date;
|
|
2579
|
+
datasetId: string | null;
|
|
2580
|
+
playgroundId: string;
|
|
2581
|
+
datasetVersionId: string | null;
|
|
2582
|
+
status: string;
|
|
2583
|
+
startedAt: Date | null;
|
|
2584
|
+
completedAt: Date | null;
|
|
2585
|
+
totalRecords: number;
|
|
2586
|
+
completedRecords: number;
|
|
3733
2587
|
} | undefined>;
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
2588
|
+
countPlaygroundRuns: (playgroundId: string) => Promise<number>;
|
|
2589
|
+
};
|
|
2590
|
+
//#endregion
|
|
2591
|
+
//#region src/datalayer/providerConfigs.d.ts
|
|
2592
|
+
declare const createProviderConfig: z$1.ZodObject<{
|
|
2593
|
+
providerId: z$1.ZodString;
|
|
2594
|
+
slug: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2595
|
+
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2596
|
+
config: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
2597
|
+
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
2598
|
+
}, z$1.core.$strip>;
|
|
2599
|
+
declare const updateProviderConfig: z$1.ZodObject<{
|
|
2600
|
+
id: z$1.ZodUUID;
|
|
2601
|
+
slug: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2602
|
+
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2603
|
+
config: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2604
|
+
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2605
|
+
}, z$1.core.$strip>;
|
|
2606
|
+
declare const getProviderConfigById: z$1.ZodObject<{
|
|
2607
|
+
id: z$1.ZodUUID;
|
|
2608
|
+
}, z$1.core.$strip>;
|
|
2609
|
+
declare const getProviderConfigByProviderId: z$1.ZodObject<{
|
|
2610
|
+
providerId: z$1.ZodString;
|
|
2611
|
+
}, z$1.core.$strip>;
|
|
2612
|
+
declare const getProviderConfigBySlug: z$1.ZodObject<{
|
|
2613
|
+
slug: z$1.ZodString;
|
|
2614
|
+
}, z$1.core.$strip>;
|
|
2615
|
+
declare const deleteProviderConfig: z$1.ZodObject<{
|
|
2616
|
+
id: z$1.ZodUUID;
|
|
2617
|
+
}, z$1.core.$strip>;
|
|
2618
|
+
declare const listProviderConfigs: z$1.ZodObject<{
|
|
2619
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2620
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2621
|
+
}, z$1.core.$strip>;
|
|
2622
|
+
declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
2623
|
+
createProviderConfig: (params: z$1.infer<typeof createProviderConfig>) => Promise<{
|
|
2624
|
+
slug: string | null;
|
|
2625
|
+
name: string | null;
|
|
3739
2626
|
id: string;
|
|
3740
|
-
environmentId: string;
|
|
3741
|
-
keyName: string;
|
|
3742
|
-
keyValue: string;
|
|
3743
2627
|
createdAt: Date;
|
|
3744
2628
|
updatedAt: Date;
|
|
2629
|
+
enabled: boolean;
|
|
2630
|
+
providerId: string;
|
|
2631
|
+
config: Record<string, unknown>;
|
|
3745
2632
|
} | undefined>;
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
2633
|
+
updateProviderConfig: (params: z$1.infer<typeof updateProviderConfig>) => Promise<{
|
|
2634
|
+
slug: string | null;
|
|
2635
|
+
name: string | null;
|
|
3749
2636
|
id: string;
|
|
3750
|
-
environmentId: string;
|
|
3751
|
-
keyName: string;
|
|
3752
|
-
keyValue: string;
|
|
3753
2637
|
createdAt: Date;
|
|
3754
2638
|
updatedAt: Date;
|
|
2639
|
+
enabled: boolean;
|
|
2640
|
+
providerId: string;
|
|
2641
|
+
config: Record<string, unknown>;
|
|
3755
2642
|
} | undefined>;
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
id: string;
|
|
3760
|
-
environmentId: string;
|
|
3761
|
-
keyName: string;
|
|
3762
|
-
keyValue: string;
|
|
3763
|
-
createdAt: Date;
|
|
3764
|
-
updatedAt: Date;
|
|
3765
|
-
}[]>;
|
|
3766
|
-
deleteEnvironmentSecret: (params: zod0.infer<zod0.ZodObject<{
|
|
3767
|
-
secretId: zod0.ZodUUID;
|
|
3768
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2643
|
+
getProviderConfigById: (params: z$1.infer<typeof getProviderConfigById>) => Promise<{
|
|
2644
|
+
slug: string | null;
|
|
2645
|
+
name: string | null;
|
|
3769
2646
|
id: string;
|
|
3770
|
-
environmentId: string;
|
|
3771
|
-
keyName: string;
|
|
3772
|
-
keyValue: string;
|
|
3773
2647
|
createdAt: Date;
|
|
3774
2648
|
updatedAt: Date;
|
|
2649
|
+
enabled: boolean;
|
|
2650
|
+
providerId: string;
|
|
2651
|
+
config: Record<string, unknown>;
|
|
3775
2652
|
} | undefined>;
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
id: string;
|
|
3780
|
-
environmentId: string;
|
|
3781
|
-
keyName: string;
|
|
3782
|
-
keyValue: string;
|
|
3783
|
-
createdAt: Date;
|
|
3784
|
-
updatedAt: Date;
|
|
3785
|
-
}[]>;
|
|
3786
|
-
listEnvironmentSecrets: (params?: zod0.infer<zod0.ZodObject<{
|
|
3787
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
3788
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
3789
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3790
|
-
id: string;
|
|
3791
|
-
environmentId: string;
|
|
3792
|
-
keyName: string;
|
|
3793
|
-
keyValue: string;
|
|
3794
|
-
createdAt: Date;
|
|
3795
|
-
updatedAt: Date;
|
|
3796
|
-
}[]>;
|
|
3797
|
-
countEnvironmentSecrets: () => Promise<number>;
|
|
3798
|
-
createNewEnvironment: (params: zod0.infer<zod0.ZodObject<{
|
|
3799
|
-
name: zod0.ZodString;
|
|
3800
|
-
slug: zod0.ZodString;
|
|
3801
|
-
isProd: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodBoolean>>;
|
|
3802
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3803
|
-
name: string;
|
|
2653
|
+
getProviderConfigByProviderId: (params: z$1.infer<typeof getProviderConfigByProviderId>) => Promise<{
|
|
2654
|
+
slug: string | null;
|
|
2655
|
+
name: string | null;
|
|
3804
2656
|
id: string;
|
|
3805
|
-
slug: string;
|
|
3806
|
-
isProd: boolean;
|
|
3807
2657
|
createdAt: Date;
|
|
3808
2658
|
updatedAt: Date;
|
|
2659
|
+
enabled: boolean;
|
|
2660
|
+
providerId: string;
|
|
2661
|
+
config: Record<string, unknown>;
|
|
3809
2662
|
} | undefined>;
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
name:
|
|
3813
|
-
slug: zod0.ZodOptional<zod0.ZodString>;
|
|
3814
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3815
|
-
name: string;
|
|
2663
|
+
getProviderConfigBySlug: (params: z$1.infer<typeof getProviderConfigBySlug>) => Promise<{
|
|
2664
|
+
slug: string | null;
|
|
2665
|
+
name: string | null;
|
|
3816
2666
|
id: string;
|
|
3817
|
-
slug: string;
|
|
3818
|
-
isProd: boolean;
|
|
3819
2667
|
createdAt: Date;
|
|
3820
2668
|
updatedAt: Date;
|
|
2669
|
+
enabled: boolean;
|
|
2670
|
+
providerId: string;
|
|
2671
|
+
config: Record<string, unknown>;
|
|
3821
2672
|
} | undefined>;
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
name: string;
|
|
2673
|
+
deleteProviderConfig: (params: z$1.infer<typeof deleteProviderConfig>) => Promise<{
|
|
2674
|
+
slug: string | null;
|
|
2675
|
+
name: string | null;
|
|
3826
2676
|
id: string;
|
|
3827
|
-
slug: string;
|
|
3828
|
-
isProd: boolean;
|
|
3829
2677
|
createdAt: Date;
|
|
3830
2678
|
updatedAt: Date;
|
|
2679
|
+
enabled: boolean;
|
|
2680
|
+
providerId: string;
|
|
2681
|
+
config: Record<string, unknown>;
|
|
3831
2682
|
} | undefined>;
|
|
3832
|
-
|
|
3833
|
-
slug:
|
|
3834
|
-
|
|
3835
|
-
name: string;
|
|
2683
|
+
listProviderConfigs: (params?: z$1.infer<typeof listProviderConfigs>) => Promise<{
|
|
2684
|
+
slug: string | null;
|
|
2685
|
+
name: string | null;
|
|
3836
2686
|
id: string;
|
|
3837
|
-
slug: string;
|
|
3838
|
-
isProd: boolean;
|
|
3839
2687
|
createdAt: Date;
|
|
3840
2688
|
updatedAt: Date;
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
}
|
|
3845
|
-
|
|
2689
|
+
enabled: boolean;
|
|
2690
|
+
providerId: string;
|
|
2691
|
+
config: Record<string, unknown>;
|
|
2692
|
+
}[]>;
|
|
2693
|
+
countProviderConfigs: () => Promise<number>;
|
|
2694
|
+
/**
|
|
2695
|
+
* Upsert provider config - creates if not exists, updates if exists
|
|
2696
|
+
* Useful for the dashboard UI where you want to set/update a provider config
|
|
2697
|
+
*/
|
|
2698
|
+
upsertProviderConfig: (params: z$1.infer<typeof createProviderConfig>) => Promise<{
|
|
2699
|
+
slug: string | null;
|
|
2700
|
+
name: string | null;
|
|
3846
2701
|
id: string;
|
|
3847
|
-
slug: string;
|
|
3848
|
-
isProd: boolean;
|
|
3849
2702
|
createdAt: Date;
|
|
3850
2703
|
updatedAt: Date;
|
|
2704
|
+
enabled: boolean;
|
|
2705
|
+
providerId: string;
|
|
2706
|
+
config: Record<string, unknown>;
|
|
3851
2707
|
} | undefined>;
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
2708
|
+
};
|
|
2709
|
+
//#endregion
|
|
2710
|
+
//#region src/datalayer/providerGuardrailOverrides.d.ts
|
|
2711
|
+
declare const createProviderGuardrailOverride: z$1.ZodObject<{
|
|
2712
|
+
providerConfigId: z$1.ZodString;
|
|
2713
|
+
guardrailConfigId: z$1.ZodString;
|
|
2714
|
+
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
2715
|
+
parameters: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
2716
|
+
}, z$1.core.$strip>;
|
|
2717
|
+
declare const updateProviderGuardrailOverride: z$1.ZodObject<{
|
|
2718
|
+
id: z$1.ZodString;
|
|
2719
|
+
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2720
|
+
parameters: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
2721
|
+
}, z$1.core.$strip>;
|
|
2722
|
+
declare const getOverrideById: z$1.ZodObject<{
|
|
2723
|
+
id: z$1.ZodString;
|
|
2724
|
+
}, z$1.core.$strip>;
|
|
2725
|
+
declare const deleteOverride: z$1.ZodObject<{
|
|
2726
|
+
id: z$1.ZodString;
|
|
2727
|
+
}, z$1.core.$strip>;
|
|
2728
|
+
declare const getOverridesByProviderConfigId: z$1.ZodObject<{
|
|
2729
|
+
providerConfigId: z$1.ZodString;
|
|
2730
|
+
}, z$1.core.$strip>;
|
|
2731
|
+
declare const getOverridesByGuardrailConfigId: z$1.ZodObject<{
|
|
2732
|
+
guardrailConfigId: z$1.ZodString;
|
|
2733
|
+
}, z$1.core.$strip>;
|
|
2734
|
+
declare const getOverrideByProviderAndGuardrail: z$1.ZodObject<{
|
|
2735
|
+
providerConfigId: z$1.ZodString;
|
|
2736
|
+
guardrailConfigId: z$1.ZodString;
|
|
2737
|
+
}, z$1.core.$strip>;
|
|
2738
|
+
declare const createProviderGuardrailOverridesDataLayer: (db: Kysely<Database>) => {
|
|
2739
|
+
createProviderGuardrailOverride: (params: z$1.infer<typeof createProviderGuardrailOverride>) => Promise<{
|
|
3857
2740
|
id: string;
|
|
3858
|
-
slug: string;
|
|
3859
|
-
isProd: boolean;
|
|
3860
2741
|
createdAt: Date;
|
|
3861
2742
|
updatedAt: Date;
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
name: string;
|
|
2743
|
+
enabled: boolean;
|
|
2744
|
+
providerConfigId: string;
|
|
2745
|
+
parameters: Record<string, unknown> | null;
|
|
2746
|
+
guardrailConfigId: string;
|
|
2747
|
+
} | undefined>;
|
|
2748
|
+
updateProviderGuardrailOverride: (params: z$1.infer<typeof updateProviderGuardrailOverride>) => Promise<{
|
|
3869
2749
|
id: string;
|
|
3870
|
-
description: string | null;
|
|
3871
2750
|
createdAt: Date;
|
|
3872
2751
|
updatedAt: Date;
|
|
3873
|
-
|
|
3874
|
-
|
|
2752
|
+
enabled: boolean;
|
|
2753
|
+
providerConfigId: string;
|
|
2754
|
+
parameters: Record<string, unknown> | null;
|
|
2755
|
+
guardrailConfigId: string;
|
|
3875
2756
|
} | undefined>;
|
|
3876
|
-
|
|
3877
|
-
datasetId: zod0.ZodString;
|
|
3878
|
-
name: zod0.ZodOptional<zod0.ZodString>;
|
|
3879
|
-
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
3880
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3881
|
-
name: string;
|
|
2757
|
+
getOverrideById: (params: z$1.infer<typeof getOverrideById>) => Promise<{
|
|
3882
2758
|
id: string;
|
|
3883
|
-
description: string | null;
|
|
3884
2759
|
createdAt: Date;
|
|
3885
2760
|
updatedAt: Date;
|
|
3886
|
-
|
|
3887
|
-
|
|
2761
|
+
enabled: boolean;
|
|
2762
|
+
providerConfigId: string;
|
|
2763
|
+
parameters: Record<string, unknown> | null;
|
|
2764
|
+
guardrailConfigId: string;
|
|
3888
2765
|
} | undefined>;
|
|
3889
|
-
|
|
3890
|
-
datasetId: zod0.ZodString;
|
|
3891
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3892
|
-
name: string;
|
|
2766
|
+
deleteProviderGuardrailOverride: (params: z$1.infer<typeof deleteOverride>) => Promise<{
|
|
3893
2767
|
id: string;
|
|
3894
|
-
description: string | null;
|
|
3895
2768
|
createdAt: Date;
|
|
3896
2769
|
updatedAt: Date;
|
|
3897
|
-
|
|
3898
|
-
|
|
2770
|
+
enabled: boolean;
|
|
2771
|
+
providerConfigId: string;
|
|
2772
|
+
parameters: Record<string, unknown> | null;
|
|
2773
|
+
guardrailConfigId: string;
|
|
3899
2774
|
} | undefined>;
|
|
3900
|
-
|
|
3901
|
-
datasetId: zod0.ZodString;
|
|
3902
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3903
|
-
name: string;
|
|
2775
|
+
getOverridesByProviderConfigId: (params: z$1.infer<typeof getOverridesByProviderConfigId>) => Promise<{
|
|
3904
2776
|
id: string;
|
|
3905
|
-
description: string | null;
|
|
3906
2777
|
createdAt: Date;
|
|
3907
2778
|
updatedAt: Date;
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3915
|
-
name: string;
|
|
2779
|
+
enabled: boolean;
|
|
2780
|
+
providerConfigId: string;
|
|
2781
|
+
parameters: Record<string, unknown> | null;
|
|
2782
|
+
guardrailConfigId: string;
|
|
2783
|
+
}[]>;
|
|
2784
|
+
getOverridesByGuardrailConfigId: (params: z$1.infer<typeof getOverridesByGuardrailConfigId>) => Promise<{
|
|
3916
2785
|
id: string;
|
|
3917
|
-
description: string | null;
|
|
3918
2786
|
createdAt: Date;
|
|
3919
2787
|
updatedAt: Date;
|
|
3920
|
-
|
|
3921
|
-
|
|
2788
|
+
enabled: boolean;
|
|
2789
|
+
providerConfigId: string;
|
|
2790
|
+
parameters: Record<string, unknown> | null;
|
|
2791
|
+
guardrailConfigId: string;
|
|
3922
2792
|
}[]>;
|
|
3923
|
-
|
|
3924
|
-
createRecord: (params: zod0.infer<zod0.ZodObject<{
|
|
3925
|
-
datasetId: zod0.ZodString;
|
|
3926
|
-
input: zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>;
|
|
3927
|
-
expected: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>>;
|
|
3928
|
-
metadata: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
3929
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3930
|
-
input: Record<string, unknown>;
|
|
2793
|
+
getOverrideByProviderAndGuardrail: (params: z$1.infer<typeof getOverrideByProviderAndGuardrail>) => Promise<{
|
|
3931
2794
|
id: string;
|
|
3932
|
-
datasetId: string;
|
|
3933
|
-
expected: Record<string, unknown> | null;
|
|
3934
|
-
metadata: Record<string, unknown>;
|
|
3935
2795
|
createdAt: Date;
|
|
3936
2796
|
updatedAt: Date;
|
|
2797
|
+
enabled: boolean;
|
|
2798
|
+
providerConfigId: string;
|
|
2799
|
+
parameters: Record<string, unknown> | null;
|
|
2800
|
+
guardrailConfigId: string;
|
|
3937
2801
|
} | undefined>;
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
metadata: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
3943
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3944
|
-
input: Record<string, unknown>;
|
|
2802
|
+
/**
|
|
2803
|
+
* Upsert provider guardrail override - creates if not exists, updates if exists
|
|
2804
|
+
*/
|
|
2805
|
+
upsertProviderGuardrailOverride: (params: z$1.infer<typeof createProviderGuardrailOverride>) => Promise<{
|
|
3945
2806
|
id: string;
|
|
3946
|
-
datasetId: string;
|
|
3947
|
-
expected: Record<string, unknown> | null;
|
|
3948
|
-
metadata: Record<string, unknown>;
|
|
3949
2807
|
createdAt: Date;
|
|
3950
2808
|
updatedAt: Date;
|
|
2809
|
+
enabled: boolean;
|
|
2810
|
+
providerConfigId: string;
|
|
2811
|
+
parameters: Record<string, unknown> | null;
|
|
2812
|
+
guardrailConfigId: string;
|
|
3951
2813
|
} | undefined>;
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
2814
|
+
/**
|
|
2815
|
+
* Delete all overrides for a guardrail config
|
|
2816
|
+
* Useful when deleting a guardrail config
|
|
2817
|
+
*/
|
|
2818
|
+
deleteOverridesByGuardrailConfigId: (params: z$1.infer<typeof getOverridesByGuardrailConfigId>) => Promise<kysely0.DeleteResult[]>;
|
|
2819
|
+
};
|
|
2820
|
+
//#endregion
|
|
2821
|
+
//#region src/datalayer/targetingRules.d.ts
|
|
2822
|
+
declare const createTargetingRule: z$1.ZodObject<{
|
|
2823
|
+
environmentId: z$1.ZodString;
|
|
2824
|
+
configId: z$1.ZodString;
|
|
2825
|
+
configVariantId: z$1.ZodString;
|
|
2826
|
+
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2827
|
+
weight: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
2828
|
+
priority: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
2829
|
+
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
2830
|
+
conditions: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
2831
|
+
}, z$1.core.$strip>;
|
|
2832
|
+
declare const updateTargetingRule: z$1.ZodObject<{
|
|
2833
|
+
id: z$1.ZodString;
|
|
2834
|
+
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2835
|
+
weight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2836
|
+
priority: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2837
|
+
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2838
|
+
conditions: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
2839
|
+
}, z$1.core.$strip>;
|
|
2840
|
+
declare const getTargetingRuleById: z$1.ZodObject<{
|
|
2841
|
+
id: z$1.ZodString;
|
|
2842
|
+
}, z$1.core.$strip>;
|
|
2843
|
+
declare const getTargetingRulesByConfigId: z$1.ZodObject<{
|
|
2844
|
+
configId: z$1.ZodString;
|
|
2845
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2846
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2847
|
+
}, z$1.core.$strip>;
|
|
2848
|
+
declare const getTargetingRulesByEnvironmentId: z$1.ZodObject<{
|
|
2849
|
+
environmentId: z$1.ZodString;
|
|
2850
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2851
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2852
|
+
}, z$1.core.$strip>;
|
|
2853
|
+
declare const getTargetingRulesByConfigAndEnvironment: z$1.ZodObject<{
|
|
2854
|
+
configId: z$1.ZodString;
|
|
2855
|
+
environmentId: z$1.ZodString;
|
|
2856
|
+
}, z$1.core.$strip>;
|
|
2857
|
+
declare const deleteTargetingRule: z$1.ZodObject<{
|
|
2858
|
+
id: z$1.ZodString;
|
|
2859
|
+
}, z$1.core.$strip>;
|
|
2860
|
+
declare const deleteTargetingRulesByConfigId: z$1.ZodObject<{
|
|
2861
|
+
configId: z$1.ZodString;
|
|
2862
|
+
}, z$1.core.$strip>;
|
|
2863
|
+
declare const deleteTargetingRulesByEnvironmentId: z$1.ZodObject<{
|
|
2864
|
+
environmentId: z$1.ZodString;
|
|
2865
|
+
}, z$1.core.$strip>;
|
|
2866
|
+
declare const listTargetingRules: z$1.ZodObject<{
|
|
2867
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2868
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2869
|
+
}, z$1.core.$strip>;
|
|
2870
|
+
declare const setTargetingForEnvironment: z$1.ZodObject<{
|
|
2871
|
+
environmentId: z$1.ZodString;
|
|
2872
|
+
configId: z$1.ZodString;
|
|
2873
|
+
configVariantId: z$1.ZodString;
|
|
2874
|
+
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2875
|
+
}, z$1.core.$strip>;
|
|
2876
|
+
declare const createTargetingRulesDataLayer: (db: Kysely<Database>) => {
|
|
2877
|
+
createTargetingRule: (params: z$1.infer<typeof createTargetingRule>) => Promise<{
|
|
3956
2878
|
id: string;
|
|
3957
|
-
datasetId: string;
|
|
3958
|
-
expected: Record<string, unknown> | null;
|
|
3959
|
-
metadata: Record<string, unknown>;
|
|
3960
2879
|
createdAt: Date;
|
|
3961
2880
|
updatedAt: Date;
|
|
2881
|
+
environmentId: string;
|
|
2882
|
+
configId: string;
|
|
2883
|
+
configVariantId: string;
|
|
2884
|
+
variantVersionId: string | null;
|
|
2885
|
+
weight: number;
|
|
2886
|
+
priority: number;
|
|
2887
|
+
enabled: boolean;
|
|
2888
|
+
conditions: Record<string, unknown>;
|
|
3962
2889
|
} | undefined>;
|
|
3963
|
-
|
|
3964
|
-
datasetId: zod0.ZodString;
|
|
3965
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
3966
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
3967
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3968
|
-
input: Record<string, unknown>;
|
|
2890
|
+
updateTargetingRule: (params: z$1.infer<typeof updateTargetingRule>) => Promise<{
|
|
3969
2891
|
id: string;
|
|
3970
|
-
datasetId: string;
|
|
3971
|
-
expected: Record<string, unknown> | null;
|
|
3972
|
-
metadata: Record<string, unknown>;
|
|
3973
2892
|
createdAt: Date;
|
|
3974
2893
|
updatedAt: Date;
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
2894
|
+
environmentId: string;
|
|
2895
|
+
configId: string;
|
|
2896
|
+
configVariantId: string;
|
|
2897
|
+
variantVersionId: string | null;
|
|
2898
|
+
weight: number;
|
|
2899
|
+
priority: number;
|
|
2900
|
+
enabled: boolean;
|
|
2901
|
+
conditions: Record<string, unknown>;
|
|
2902
|
+
} | undefined>;
|
|
2903
|
+
getTargetingRuleById: (params: z$1.infer<typeof getTargetingRuleById>) => Promise<{
|
|
3978
2904
|
id: string;
|
|
3979
|
-
datasetId: string;
|
|
3980
|
-
expected: Record<string, unknown> | null;
|
|
3981
|
-
metadata: Record<string, unknown>;
|
|
3982
2905
|
createdAt: Date;
|
|
3983
2906
|
updatedAt: Date;
|
|
2907
|
+
environmentId: string;
|
|
2908
|
+
configId: string;
|
|
2909
|
+
configVariantId: string;
|
|
2910
|
+
variantVersionId: string | null;
|
|
2911
|
+
weight: number;
|
|
2912
|
+
priority: number;
|
|
2913
|
+
enabled: boolean;
|
|
2914
|
+
conditions: Record<string, unknown>;
|
|
3984
2915
|
} | undefined>;
|
|
3985
|
-
|
|
3986
|
-
datasetId: zod0.ZodString;
|
|
3987
|
-
name: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
3988
|
-
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
3989
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
3990
|
-
name: string | null;
|
|
2916
|
+
getTargetingRulesByConfigId: (params: z$1.infer<typeof getTargetingRulesByConfigId>) => Promise<{
|
|
3991
2917
|
id: string;
|
|
3992
|
-
description: string | null;
|
|
3993
|
-
datasetId: string;
|
|
3994
2918
|
createdAt: Date;
|
|
3995
2919
|
updatedAt: Date;
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
2920
|
+
environmentId: string;
|
|
2921
|
+
configId: string;
|
|
2922
|
+
configVariantId: string;
|
|
2923
|
+
variantVersionId: string | null;
|
|
2924
|
+
weight: number;
|
|
2925
|
+
priority: number;
|
|
2926
|
+
enabled: boolean;
|
|
2927
|
+
conditions: Record<string, unknown>;
|
|
2928
|
+
}[]>;
|
|
2929
|
+
getTargetingRulesByEnvironmentId: (params: z$1.infer<typeof getTargetingRulesByEnvironmentId>) => Promise<{
|
|
4004
2930
|
id: string;
|
|
4005
|
-
description: string | null;
|
|
4006
|
-
datasetId: string;
|
|
4007
2931
|
createdAt: Date;
|
|
4008
2932
|
updatedAt: Date;
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
}
|
|
4018
|
-
|
|
2933
|
+
environmentId: string;
|
|
2934
|
+
configId: string;
|
|
2935
|
+
configVariantId: string;
|
|
2936
|
+
variantVersionId: string | null;
|
|
2937
|
+
weight: number;
|
|
2938
|
+
priority: number;
|
|
2939
|
+
enabled: boolean;
|
|
2940
|
+
conditions: Record<string, unknown>;
|
|
2941
|
+
}[]>;
|
|
2942
|
+
getTargetingRulesByConfigAndEnvironment: (params: z$1.infer<typeof getTargetingRulesByConfigAndEnvironment>) => Promise<{
|
|
4019
2943
|
id: string;
|
|
4020
|
-
description: string | null;
|
|
4021
|
-
datasetId: string;
|
|
4022
2944
|
createdAt: Date;
|
|
4023
2945
|
updatedAt: Date;
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
2946
|
+
environmentId: string;
|
|
2947
|
+
configId: string;
|
|
2948
|
+
configVariantId: string;
|
|
2949
|
+
variantVersionId: string | null;
|
|
2950
|
+
weight: number;
|
|
2951
|
+
priority: number;
|
|
2952
|
+
enabled: boolean;
|
|
2953
|
+
conditions: Record<string, unknown>;
|
|
4027
2954
|
}[]>;
|
|
4028
|
-
|
|
4029
|
-
versionId: zod0.ZodString;
|
|
4030
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
4031
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
4032
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
4033
|
-
input: Record<string, unknown>;
|
|
2955
|
+
deleteTargetingRule: (params: z$1.infer<typeof deleteTargetingRule>) => Promise<{
|
|
4034
2956
|
id: string;
|
|
4035
|
-
datasetId: string;
|
|
4036
|
-
expected: Record<string, unknown> | null;
|
|
4037
|
-
metadata: Record<string, unknown>;
|
|
4038
2957
|
createdAt: Date;
|
|
4039
2958
|
updatedAt: Date;
|
|
4040
|
-
|
|
4041
|
-
}[]>;
|
|
4042
|
-
createConfigVariant: (params: zod0.infer<zod0.ZodObject<{
|
|
4043
|
-
configId: zod0.ZodString;
|
|
4044
|
-
variantId: zod0.ZodString;
|
|
4045
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2959
|
+
environmentId: string;
|
|
4046
2960
|
configId: string;
|
|
4047
|
-
|
|
2961
|
+
configVariantId: string;
|
|
2962
|
+
variantVersionId: string | null;
|
|
2963
|
+
weight: number;
|
|
2964
|
+
priority: number;
|
|
2965
|
+
enabled: boolean;
|
|
2966
|
+
conditions: Record<string, unknown>;
|
|
2967
|
+
} | undefined>;
|
|
2968
|
+
deleteTargetingRulesByConfigId: (params: z$1.infer<typeof deleteTargetingRulesByConfigId>) => Promise<{
|
|
4048
2969
|
id: string;
|
|
4049
2970
|
createdAt: Date;
|
|
4050
2971
|
updatedAt: Date;
|
|
4051
|
-
|
|
4052
|
-
getConfigVariantById: (params: zod0.infer<zod0.ZodObject<{
|
|
4053
|
-
id: zod0.ZodString;
|
|
4054
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2972
|
+
environmentId: string;
|
|
4055
2973
|
configId: string;
|
|
4056
|
-
|
|
2974
|
+
configVariantId: string;
|
|
2975
|
+
variantVersionId: string | null;
|
|
2976
|
+
weight: number;
|
|
2977
|
+
priority: number;
|
|
2978
|
+
enabled: boolean;
|
|
2979
|
+
conditions: Record<string, unknown>;
|
|
2980
|
+
}[]>;
|
|
2981
|
+
deleteTargetingRulesByEnvironmentId: (params: z$1.infer<typeof deleteTargetingRulesByEnvironmentId>) => Promise<{
|
|
4057
2982
|
id: string;
|
|
4058
2983
|
createdAt: Date;
|
|
4059
2984
|
updatedAt: Date;
|
|
4060
|
-
|
|
4061
|
-
getConfigVariantsByConfigId: (params: zod0.infer<zod0.ZodObject<{
|
|
4062
|
-
configId: zod0.ZodString;
|
|
4063
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
4064
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
4065
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2985
|
+
environmentId: string;
|
|
4066
2986
|
configId: string;
|
|
4067
|
-
|
|
2987
|
+
configVariantId: string;
|
|
2988
|
+
variantVersionId: string | null;
|
|
2989
|
+
weight: number;
|
|
2990
|
+
priority: number;
|
|
2991
|
+
enabled: boolean;
|
|
2992
|
+
conditions: Record<string, unknown>;
|
|
2993
|
+
}[]>;
|
|
2994
|
+
listTargetingRules: (params?: z$1.infer<typeof listTargetingRules>) => Promise<{
|
|
4068
2995
|
id: string;
|
|
4069
2996
|
createdAt: Date;
|
|
4070
2997
|
updatedAt: Date;
|
|
4071
|
-
|
|
4072
|
-
getConfigVariantsByVariantId: (params: zod0.infer<zod0.ZodObject<{
|
|
4073
|
-
variantId: zod0.ZodString;
|
|
4074
|
-
limit: zod0.ZodOptional<zod0.ZodNumber>;
|
|
4075
|
-
offset: zod0.ZodOptional<zod0.ZodNumber>;
|
|
4076
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
2998
|
+
environmentId: string;
|
|
4077
2999
|
configId: string;
|
|
4078
|
-
|
|
3000
|
+
configVariantId: string;
|
|
3001
|
+
variantVersionId: string | null;
|
|
3002
|
+
weight: number;
|
|
3003
|
+
priority: number;
|
|
3004
|
+
enabled: boolean;
|
|
3005
|
+
conditions: Record<string, unknown>;
|
|
3006
|
+
}[]>;
|
|
3007
|
+
/**
|
|
3008
|
+
* Get targeting rules with full details (environment, config, variant info)
|
|
3009
|
+
* Now includes variantVersionId and resolves the actual version being used
|
|
3010
|
+
*/
|
|
3011
|
+
getTargetingRulesWithDetailsByConfigId: (params: z$1.infer<typeof getTargetingRulesByConfigId>) => Promise<{
|
|
3012
|
+
variantProvider: string | null;
|
|
3013
|
+
variantModelName: string | null;
|
|
3014
|
+
pinnedVersion: number | null | undefined;
|
|
3015
|
+
latestVersion: number | null | undefined;
|
|
3016
|
+
variantId: string | null;
|
|
3017
|
+
variantName: string | null;
|
|
4079
3018
|
id: string;
|
|
4080
3019
|
createdAt: Date;
|
|
4081
3020
|
updatedAt: Date;
|
|
3021
|
+
environmentId: string;
|
|
3022
|
+
configId: string;
|
|
3023
|
+
configVariantId: string;
|
|
3024
|
+
variantVersionId: string | null;
|
|
3025
|
+
weight: number;
|
|
3026
|
+
priority: number;
|
|
3027
|
+
enabled: boolean;
|
|
3028
|
+
conditions: Record<string, unknown>;
|
|
3029
|
+
environmentName: string | null;
|
|
3030
|
+
environmentSlug: string | null;
|
|
4082
3031
|
}[]>;
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
3032
|
+
/**
|
|
3033
|
+
* Set a single variant for an environment (replaces existing).
|
|
3034
|
+
* Now supports optional variantVersionId to pin to a specific version.
|
|
3035
|
+
*/
|
|
3036
|
+
setTargetingForEnvironment: (params: z$1.infer<typeof setTargetingForEnvironment>) => Promise<{
|
|
3037
|
+
id: string;
|
|
3038
|
+
createdAt: Date;
|
|
3039
|
+
updatedAt: Date;
|
|
3040
|
+
environmentId: string;
|
|
4086
3041
|
configId: string;
|
|
4087
|
-
|
|
3042
|
+
configVariantId: string;
|
|
3043
|
+
variantVersionId: string | null;
|
|
3044
|
+
weight: number;
|
|
3045
|
+
priority: number;
|
|
3046
|
+
enabled: boolean;
|
|
3047
|
+
conditions: Record<string, unknown>;
|
|
3048
|
+
} | undefined>;
|
|
3049
|
+
};
|
|
3050
|
+
//#endregion
|
|
3051
|
+
//#region src/datalayer/variants.d.ts
|
|
3052
|
+
declare const createVariant: z$1.ZodObject<{
|
|
3053
|
+
name: z$1.ZodString;
|
|
3054
|
+
}, z$1.core.$strip>;
|
|
3055
|
+
declare const updateVariant: z$1.ZodObject<{
|
|
3056
|
+
variantId: z$1.ZodString;
|
|
3057
|
+
name: z$1.ZodOptional<z$1.ZodString>;
|
|
3058
|
+
}, z$1.core.$strip>;
|
|
3059
|
+
declare const getVariantById: z$1.ZodObject<{
|
|
3060
|
+
variantId: z$1.ZodString;
|
|
3061
|
+
}, z$1.core.$strip>;
|
|
3062
|
+
declare const deleteVariant: z$1.ZodObject<{
|
|
3063
|
+
variantId: z$1.ZodString;
|
|
3064
|
+
}, z$1.core.$strip>;
|
|
3065
|
+
declare const listVariants: z$1.ZodObject<{
|
|
3066
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3067
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3068
|
+
}, z$1.core.$strip>;
|
|
3069
|
+
declare const createVariantDataLayer: (db: Kysely<Database>) => {
|
|
3070
|
+
/**
|
|
3071
|
+
* Create a new variant (metadata only, no version data)
|
|
3072
|
+
*/
|
|
3073
|
+
createVariant: (params: z$1.infer<typeof createVariant>) => Promise<{
|
|
3074
|
+
name: string;
|
|
4088
3075
|
id: string;
|
|
4089
3076
|
createdAt: Date;
|
|
4090
3077
|
updatedAt: Date;
|
|
4091
3078
|
} | undefined>;
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
variantId: string;
|
|
3079
|
+
/**
|
|
3080
|
+
* Update variant metadata (name only)
|
|
3081
|
+
*/
|
|
3082
|
+
updateVariant: (params: z$1.infer<typeof updateVariant>) => Promise<{
|
|
3083
|
+
name: string;
|
|
4098
3084
|
id: string;
|
|
4099
3085
|
createdAt: Date;
|
|
4100
3086
|
updatedAt: Date;
|
|
4101
3087
|
} | undefined>;
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
variantId: string;
|
|
3088
|
+
/**
|
|
3089
|
+
* Get variant by ID (metadata only)
|
|
3090
|
+
*/
|
|
3091
|
+
getVariantById: (params: z$1.infer<typeof getVariantById>) => Promise<{
|
|
3092
|
+
name: string;
|
|
4108
3093
|
id: string;
|
|
4109
3094
|
createdAt: Date;
|
|
4110
3095
|
updatedAt: Date;
|
|
4111
|
-
}
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
3096
|
+
} | undefined>;
|
|
3097
|
+
/**
|
|
3098
|
+
* Get variant with its latest version data
|
|
3099
|
+
*/
|
|
3100
|
+
getVariantWithLatestVersion: (params: z$1.infer<typeof getVariantById>) => Promise<{
|
|
4115
3101
|
latestVersion: {
|
|
4116
3102
|
version: number;
|
|
4117
|
-
variantId: string;
|
|
4118
3103
|
id: string;
|
|
3104
|
+
createdAt: Date;
|
|
3105
|
+
updatedAt: Date;
|
|
3106
|
+
variantId: string;
|
|
4119
3107
|
provider: string;
|
|
4120
3108
|
modelName: string;
|
|
4121
3109
|
jsonData: Record<string, unknown>;
|
|
4122
|
-
createdAt: Date;
|
|
4123
|
-
updatedAt: Date;
|
|
4124
3110
|
} | null;
|
|
4125
|
-
|
|
3111
|
+
name: string;
|
|
4126
3112
|
id: string;
|
|
4127
|
-
configId: string;
|
|
4128
|
-
variantId: string;
|
|
4129
3113
|
createdAt: Date;
|
|
4130
3114
|
updatedAt: Date;
|
|
4131
|
-
configName: string | null | undefined;
|
|
4132
3115
|
} | undefined>;
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
jsonData: Record<string, unknown>;
|
|
4148
|
-
createdAt: Date;
|
|
4149
|
-
updatedAt: Date;
|
|
4150
|
-
} | null;
|
|
4151
|
-
name: string | null;
|
|
3116
|
+
/**
|
|
3117
|
+
* Delete variant and all its versions
|
|
3118
|
+
*/
|
|
3119
|
+
deleteVariant: (params: z$1.infer<typeof deleteVariant>) => Promise<{
|
|
3120
|
+
name: string;
|
|
3121
|
+
id: string;
|
|
3122
|
+
createdAt: Date;
|
|
3123
|
+
updatedAt: Date;
|
|
3124
|
+
} | undefined>;
|
|
3125
|
+
/**
|
|
3126
|
+
* List all variants (metadata only)
|
|
3127
|
+
*/
|
|
3128
|
+
listVariants: (params?: z$1.infer<typeof listVariants>) => Promise<{
|
|
3129
|
+
name: string;
|
|
4152
3130
|
id: string;
|
|
4153
|
-
configId: string;
|
|
4154
|
-
variantId: string;
|
|
4155
3131
|
createdAt: Date;
|
|
4156
3132
|
updatedAt: Date;
|
|
4157
3133
|
}[]>;
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
}, better_auth0.$strip>>) => Promise<{
|
|
4165
|
-
variant: {
|
|
4166
|
-
name: string;
|
|
3134
|
+
/**
|
|
3135
|
+
* List all variants with their latest version data
|
|
3136
|
+
*/
|
|
3137
|
+
listVariantsWithLatestVersion: (params?: z$1.infer<typeof listVariants>) => Promise<{
|
|
3138
|
+
latestVersion: {
|
|
3139
|
+
version: number;
|
|
4167
3140
|
id: string;
|
|
4168
3141
|
createdAt: Date;
|
|
4169
3142
|
updatedAt: Date;
|
|
4170
|
-
};
|
|
4171
|
-
version: {
|
|
4172
|
-
version: number;
|
|
4173
3143
|
variantId: string;
|
|
4174
|
-
id: string;
|
|
4175
3144
|
provider: string;
|
|
4176
3145
|
modelName: string;
|
|
4177
3146
|
jsonData: Record<string, unknown>;
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
3147
|
+
} | null;
|
|
3148
|
+
name: string;
|
|
3149
|
+
id: string;
|
|
3150
|
+
createdAt: Date;
|
|
3151
|
+
updatedAt: Date;
|
|
3152
|
+
}[]>;
|
|
3153
|
+
};
|
|
3154
|
+
//#endregion
|
|
3155
|
+
//#region src/datalayer/variantVersions.d.ts
|
|
3156
|
+
declare const createVariantVersion: z$1.ZodObject<{
|
|
3157
|
+
variantId: z$1.ZodString;
|
|
3158
|
+
provider: z$1.ZodString;
|
|
3159
|
+
modelName: z$1.ZodString;
|
|
3160
|
+
jsonData: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
3161
|
+
}, z$1.core.$strip>;
|
|
3162
|
+
declare const getVariantVersionById: z$1.ZodObject<{
|
|
3163
|
+
id: z$1.ZodString;
|
|
3164
|
+
}, z$1.core.$strip>;
|
|
3165
|
+
declare const getVariantVersionsByVariantId: z$1.ZodObject<{
|
|
3166
|
+
variantId: z$1.ZodString;
|
|
3167
|
+
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3168
|
+
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3169
|
+
}, z$1.core.$strip>;
|
|
3170
|
+
declare const getLatestVariantVersion: z$1.ZodObject<{
|
|
3171
|
+
variantId: z$1.ZodString;
|
|
3172
|
+
}, z$1.core.$strip>;
|
|
3173
|
+
declare const getVariantVersionByNumber: z$1.ZodObject<{
|
|
3174
|
+
variantId: z$1.ZodString;
|
|
3175
|
+
version: z$1.ZodNumber;
|
|
3176
|
+
}, z$1.core.$strip>;
|
|
3177
|
+
declare const deleteVariantVersion: z$1.ZodObject<{
|
|
3178
|
+
id: z$1.ZodString;
|
|
3179
|
+
}, z$1.core.$strip>;
|
|
3180
|
+
declare const createVariantVersionsDataLayer: (db: Kysely<Database>) => {
|
|
3181
|
+
/**
|
|
3182
|
+
* Create a new version for a variant.
|
|
3183
|
+
* Auto-increments the version number based on existing versions.
|
|
3184
|
+
*/
|
|
3185
|
+
createVariantVersion: (params: z$1.infer<typeof createVariantVersion>) => Promise<{
|
|
3186
|
+
version: number;
|
|
3187
|
+
id: string;
|
|
3188
|
+
createdAt: Date;
|
|
3189
|
+
updatedAt: Date;
|
|
3190
|
+
variantId: string;
|
|
4193
3191
|
provider: string;
|
|
4194
|
-
|
|
4195
|
-
|
|
3192
|
+
modelName: string;
|
|
3193
|
+
jsonData: Record<string, unknown>;
|
|
3194
|
+
} | undefined>;
|
|
3195
|
+
/**
|
|
3196
|
+
* Get a specific version by its UUID
|
|
3197
|
+
*/
|
|
3198
|
+
getVariantVersionById: (params: z$1.infer<typeof getVariantVersionById>) => Promise<{
|
|
3199
|
+
version: number;
|
|
3200
|
+
id: string;
|
|
3201
|
+
createdAt: Date;
|
|
3202
|
+
updatedAt: Date;
|
|
4196
3203
|
variantId: string;
|
|
4197
|
-
|
|
3204
|
+
provider: string;
|
|
3205
|
+
modelName: string;
|
|
3206
|
+
jsonData: Record<string, unknown>;
|
|
3207
|
+
} | undefined>;
|
|
3208
|
+
/**
|
|
3209
|
+
* Get all versions for a variant, ordered by version number descending (latest first)
|
|
3210
|
+
*/
|
|
3211
|
+
getVariantVersionsByVariantId: (params: z$1.infer<typeof getVariantVersionsByVariantId>) => Promise<{
|
|
4198
3212
|
version: number;
|
|
3213
|
+
id: string;
|
|
3214
|
+
createdAt: Date;
|
|
3215
|
+
updatedAt: Date;
|
|
3216
|
+
variantId: string;
|
|
3217
|
+
provider: string;
|
|
4199
3218
|
modelName: string;
|
|
4200
3219
|
jsonData: Record<string, unknown>;
|
|
4201
|
-
}>;
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
3220
|
+
}[]>;
|
|
3221
|
+
/**
|
|
3222
|
+
* Get the latest version for a variant
|
|
3223
|
+
*/
|
|
3224
|
+
getLatestVariantVersion: (params: z$1.infer<typeof getLatestVariantVersion>) => Promise<{
|
|
3225
|
+
version: number;
|
|
4206
3226
|
id: string;
|
|
4207
|
-
slug: string;
|
|
4208
3227
|
createdAt: Date;
|
|
4209
3228
|
updatedAt: Date;
|
|
3229
|
+
variantId: string;
|
|
3230
|
+
provider: string;
|
|
3231
|
+
modelName: string;
|
|
3232
|
+
jsonData: Record<string, unknown>;
|
|
4210
3233
|
} | undefined>;
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
3234
|
+
/**
|
|
3235
|
+
* Get a specific version by variant ID and version number
|
|
3236
|
+
*/
|
|
3237
|
+
getVariantVersionByNumber: (params: z$1.infer<typeof getVariantVersionByNumber>) => Promise<{
|
|
3238
|
+
version: number;
|
|
4216
3239
|
id: string;
|
|
4217
|
-
slug: string;
|
|
4218
3240
|
createdAt: Date;
|
|
4219
3241
|
updatedAt: Date;
|
|
3242
|
+
variantId: string;
|
|
3243
|
+
provider: string;
|
|
3244
|
+
modelName: string;
|
|
3245
|
+
jsonData: Record<string, unknown>;
|
|
4220
3246
|
} | undefined>;
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
3247
|
+
/**
|
|
3248
|
+
* Delete a specific version (use with caution, may break targeting rules)
|
|
3249
|
+
*/
|
|
3250
|
+
deleteVariantVersion: (params: z$1.infer<typeof deleteVariantVersion>) => Promise<{
|
|
3251
|
+
version: number;
|
|
4225
3252
|
id: string;
|
|
4226
|
-
slug: string;
|
|
4227
3253
|
createdAt: Date;
|
|
4228
3254
|
updatedAt: Date;
|
|
3255
|
+
variantId: string;
|
|
3256
|
+
provider: string;
|
|
3257
|
+
modelName: string;
|
|
3258
|
+
jsonData: Record<string, unknown>;
|
|
4229
3259
|
} | undefined>;
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
3260
|
+
/**
|
|
3261
|
+
* Delete all versions for a variant (typically when deleting the variant itself)
|
|
3262
|
+
*/
|
|
3263
|
+
deleteVariantVersionsByVariantId: (params: z$1.infer<typeof getLatestVariantVersion>) => Promise<{
|
|
3264
|
+
version: number;
|
|
3265
|
+
id: string;
|
|
3266
|
+
createdAt: Date;
|
|
3267
|
+
updatedAt: Date;
|
|
3268
|
+
variantId: string;
|
|
3269
|
+
provider: string;
|
|
3270
|
+
modelName: string;
|
|
3271
|
+
jsonData: Record<string, unknown>;
|
|
3272
|
+
}[]>;
|
|
3273
|
+
/**
|
|
3274
|
+
* Get version with variant metadata (name)
|
|
3275
|
+
*/
|
|
3276
|
+
getVariantVersionWithVariant: (params: z$1.infer<typeof getVariantVersionById>) => Promise<{
|
|
3277
|
+
variantName: string;
|
|
3278
|
+
version: number;
|
|
4234
3279
|
id: string;
|
|
4235
|
-
slug: string;
|
|
4236
3280
|
createdAt: Date;
|
|
4237
3281
|
updatedAt: Date;
|
|
3282
|
+
variantId: string;
|
|
3283
|
+
provider: string;
|
|
3284
|
+
modelName: string;
|
|
3285
|
+
jsonData: Record<string, unknown>;
|
|
4238
3286
|
} | undefined>;
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
3287
|
+
/**
|
|
3288
|
+
* Get all versions for a variant with variant metadata
|
|
3289
|
+
*/
|
|
3290
|
+
getVariantVersionsWithVariantByVariantId: (params: z$1.infer<typeof getVariantVersionsByVariantId>) => Promise<{
|
|
3291
|
+
variantName: string;
|
|
3292
|
+
version: number;
|
|
4244
3293
|
id: string;
|
|
4245
|
-
slug: string;
|
|
4246
3294
|
createdAt: Date;
|
|
4247
3295
|
updatedAt: Date;
|
|
3296
|
+
variantId: string;
|
|
3297
|
+
provider: string;
|
|
3298
|
+
modelName: string;
|
|
3299
|
+
jsonData: Record<string, unknown>;
|
|
4248
3300
|
}[]>;
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
3301
|
+
};
|
|
3302
|
+
//#endregion
|
|
3303
|
+
//#region src/datalayer/workspaceSettings.d.ts
|
|
3304
|
+
declare const updateWorkspaceSettings: z$1.ZodObject<{
|
|
3305
|
+
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3306
|
+
setupComplete: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
3307
|
+
superAdminId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3308
|
+
}, z$1.core.$strip>;
|
|
3309
|
+
declare const createWorkspaceSettingsDataLayer: (db: Kysely<Database>) => {
|
|
3310
|
+
/**
|
|
3311
|
+
* Get workspace settings (creates default if not exists)
|
|
3312
|
+
*/
|
|
3313
|
+
getWorkspaceSettings: () => Promise<{
|
|
3314
|
+
name: string | null;
|
|
4257
3315
|
id: string;
|
|
4258
|
-
name: string | undefined;
|
|
4259
|
-
slug: string;
|
|
4260
3316
|
createdAt: Date;
|
|
4261
3317
|
updatedAt: Date;
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
}>;
|
|
3318
|
+
setupComplete: boolean;
|
|
3319
|
+
superAdminId: string | null;
|
|
3320
|
+
} | undefined>;
|
|
3321
|
+
/**
|
|
3322
|
+
* Update workspace settings
|
|
3323
|
+
*/
|
|
3324
|
+
updateWorkspaceSettings: (params: z$1.infer<typeof updateWorkspaceSettings>) => Promise<{
|
|
3325
|
+
name: string | null;
|
|
3326
|
+
id: string;
|
|
3327
|
+
createdAt: Date;
|
|
3328
|
+
updatedAt: Date;
|
|
3329
|
+
setupComplete: boolean;
|
|
3330
|
+
superAdminId: string | null;
|
|
3331
|
+
} | undefined>;
|
|
3332
|
+
/**
|
|
3333
|
+
* Get the super admin user ID
|
|
3334
|
+
*/
|
|
3335
|
+
getSuperAdminId: () => Promise<string | null>;
|
|
3336
|
+
/**
|
|
3337
|
+
* Set the super admin user ID (only if not already set)
|
|
3338
|
+
*/
|
|
3339
|
+
setSuperAdminId: (userId: string) => Promise<boolean>;
|
|
3340
|
+
/**
|
|
3341
|
+
* Check if initial setup has been completed
|
|
3342
|
+
*/
|
|
3343
|
+
isSetupComplete: () => Promise<boolean>;
|
|
3344
|
+
/**
|
|
3345
|
+
* Mark initial setup as complete
|
|
3346
|
+
*/
|
|
3347
|
+
markSetupComplete: () => Promise<{
|
|
3348
|
+
name: string | null;
|
|
3349
|
+
id: string;
|
|
3350
|
+
createdAt: Date;
|
|
3351
|
+
updatedAt: Date;
|
|
3352
|
+
setupComplete: boolean;
|
|
3353
|
+
superAdminId: string | null;
|
|
3354
|
+
} | undefined>;
|
|
3355
|
+
};
|
|
3356
|
+
//#endregion
|
|
3357
|
+
//#region src/datalayer/interface.d.ts
|
|
3358
|
+
type ConfigsDataLayer = ReturnType<typeof createConfigDataLayer>;
|
|
3359
|
+
type ConfigVariantsDataLayer = ReturnType<typeof createConfigVariantDataLayer>;
|
|
3360
|
+
type DatasetsDataLayer = ReturnType<typeof createDatasetsDataLayer>;
|
|
3361
|
+
type EnvironmentsDataLayer = ReturnType<typeof createEnvironmentDataLayer>;
|
|
3362
|
+
type EnvironmentSecretsDataLayer = ReturnType<typeof createEnvironmentSecretDataLayer>;
|
|
3363
|
+
type GuardrailConfigsDataLayer = ReturnType<typeof createGuardrailConfigsDataLayer>;
|
|
3364
|
+
type LLMRequestsDataLayer = ReturnType<typeof createLLMRequestsDataLayer>;
|
|
3365
|
+
type PlaygroundsDataLayer = ReturnType<typeof createPlaygroundDataLayer>;
|
|
3366
|
+
type PlaygroundResultsDataLayer = ReturnType<typeof createPlaygroundResultsDataLayer>;
|
|
3367
|
+
type PlaygroundRunsDataLayer = ReturnType<typeof createPlaygroundRunsDataLayer>;
|
|
3368
|
+
type ProviderConfigsDataLayer = ReturnType<typeof createProviderConfigsDataLayer>;
|
|
3369
|
+
type ProviderGuardrailOverridesDataLayer = ReturnType<typeof createProviderGuardrailOverridesDataLayer>;
|
|
3370
|
+
type TargetingRulesDataLayer = ReturnType<typeof createTargetingRulesDataLayer>;
|
|
3371
|
+
type VariantsDataLayer = ReturnType<typeof createVariantDataLayer>;
|
|
3372
|
+
type VariantVersionsDataLayer = ReturnType<typeof createVariantVersionsDataLayer>;
|
|
3373
|
+
type WorkspaceSettingsDataLayer = ReturnType<typeof createWorkspaceSettingsDataLayer>;
|
|
3374
|
+
type DataLayer = ConfigsDataLayer & ConfigVariantsDataLayer & DatasetsDataLayer & EnvironmentsDataLayer & EnvironmentSecretsDataLayer & GuardrailConfigsDataLayer & LLMRequestsDataLayer & PlaygroundsDataLayer & PlaygroundResultsDataLayer & PlaygroundRunsDataLayer & ProviderConfigsDataLayer & ProviderGuardrailOverridesDataLayer & TargetingRulesDataLayer & VariantsDataLayer & VariantVersionsDataLayer & WorkspaceSettingsDataLayer;
|
|
3375
|
+
//#endregion
|
|
3376
|
+
//#region src/datalayer/create.d.ts
|
|
3377
|
+
/**
|
|
3378
|
+
* Create all datalayers from a Kysely database instance.
|
|
3379
|
+
* Returns a flat object with all datalayer methods spread together.
|
|
3380
|
+
*/
|
|
3381
|
+
declare function createDataLayer(db: Kysely<Database>): DataLayer;
|
|
4265
3382
|
//#endregion
|
|
4266
3383
|
//#region src/pricing/types.d.ts
|
|
4267
3384
|
/**
|
|
@@ -4680,4 +3797,4 @@ declare class ManifestRouter {
|
|
|
4680
3797
|
routeWithWeights(configIdOrSlug: string, environmentId: string, context?: RoutingContext): RoutingResult | null;
|
|
4681
3798
|
}
|
|
4682
3799
|
//#endregion
|
|
4683
|
-
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, ConfigVariantsTable, ConfigsTable, type CortexProviderConfig, CostResult, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Dataset, DatasetRecord, DatasetRecordsTable, DatasetVersion, DatasetVersionRecord, DatasetVersionRecordsTable, DatasetVersionsTable, DatasetsTable, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, FileCacheBackend, FileCacheConfig, type FireworksAIProviderConfig, GatewayManifest, type GoogleProviderConfig, GuardrailConfig, GuardrailConfigsTable, GuardrailResult, GuardrailResults, type HuggingFaceProviderConfig, Insertable, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, LLMRequest,
|
|
3800
|
+
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, ConfigVariantsDataLayer, ConfigVariantsTable, ConfigsDataLayer, ConfigsTable, type CortexProviderConfig, CostResult, DataLayer, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Dataset, DatasetRecord, DatasetRecordsTable, DatasetVersion, DatasetVersionRecord, DatasetVersionRecordsTable, DatasetVersionsTable, DatasetsDataLayer, DatasetsTable, Environment, EnvironmentSecret, EnvironmentSecretsDataLayer, EnvironmentSecretsTable, EnvironmentsDataLayer, EnvironmentsTable, FileCacheBackend, FileCacheConfig, type FireworksAIProviderConfig, GatewayManifest, type GoogleProviderConfig, GuardrailConfig, GuardrailConfigsDataLayer, GuardrailConfigsTable, GuardrailResult, GuardrailResults, type HuggingFaceProviderConfig, Insertable, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, LLMRequest, LLMRequestInsert, LLMRequestsDataLayer, LLMRequestsTable, MS, ManifestBuilder, ManifestConfig, ManifestEnvironment, ManifestGuardrail, ManifestProviderGuardrailOverride, ManifestRouter, ManifestService, ManifestTargetingRule, ManifestVariantVersion, MemoryCacheBackend, MemoryCacheConfig, MigrationOptions, MigrationResult, type MistralAIProviderConfig, ModelPricing, ModelsDevPricingProvider, type OpenAIProviderConfig, type OracleProviderConfig, Playground, PlaygroundColumn, PlaygroundResult, PlaygroundResultsDataLayer, PlaygroundResultsTable, PlaygroundRun, PlaygroundRunsDataLayer, PlaygroundRunsTable, PlaygroundsDataLayer, PlaygroundsTable, Prettify, PricingProvider, ProviderConfig, type ProviderConfigMap, ProviderConfigsDataLayer, ProviderConfigsTable, ProviderGuardrailOverride, ProviderGuardrailOverridesDataLayer, ProviderGuardrailOverridesTable, type ProvidersConfig, RoutingContext, RoutingResult, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, type StabilityAIProviderConfig, SupportedProviders, TableName, TargetingRule, TargetingRulesDataLayer, TargetingRulesTable, Updateable, UsageData, type ValidatedLLMOpsConfig, Variant, VariantJsonData, VariantVersion, VariantVersionsDataLayer, VariantVersionsTable, VariantsDataLayer, VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, WorkspaceSettings, WorkspaceSettingsDataLayer, WorkspaceSettingsTable, calculateCost, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createConfigDataLayer, createConfigVariantDataLayer, createDataLayer, createDatabase, createDatabaseFromConnection, createDatasetsDataLayer, createEnvironmentDataLayer, createEnvironmentSecretDataLayer, createGuardrailConfigsDataLayer, createLLMRequestsDataLayer, createNeonDialect, createPlaygroundDataLayer, createPlaygroundResultsDataLayer, createPlaygroundRunsDataLayer, createProviderConfigsDataLayer, createProviderGuardrailOverridesDataLayer, createTargetingRulesDataLayer, createVariantDataLayer, createVariantVersionsDataLayer, createWorkspaceSettingsDataLayer, datasetRecordsSchema, datasetVersionRecordsSchema, datasetVersionsSchema, datasetsSchema, detectDatabaseType, dollarsToMicroDollars, environmentSecretsSchema, environmentsSchema, executeWithSchema, formatCost, gateway, generateId, getAuthClientOptions, getDefaultPricingProvider, getMigrations, guardrailConfigsSchema, llmRequestsSchema, llmopsConfigSchema, logger, matchType, microDollarsToDollars, parsePartialTableData, parseTableData, playgroundColumnSchema, playgroundResultsSchema, playgroundRunsSchema, playgroundsSchema, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|