@llmops/core 0.2.13 → 0.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bun-sqlite-dialect-Bxz4B97L.cjs → bun-sqlite-dialect-BNaQHMpk.cjs} +1 -1
- package/dist/db/index.cjs +2 -2
- package/dist/db/index.d.cts +1 -1
- package/dist/db/index.d.mts +1 -1
- package/dist/db/index.mjs +1 -1
- package/dist/{db-DohlAqJU.mjs → db-B-EsQtOz.mjs} +5 -0
- package/dist/{db-BOe6mM51.cjs → db-Du2xmkGS.cjs} +8 -3
- package/dist/{index-C5xtb4gO.d.cts → index-COkIT6TH.d.mts} +15 -1
- package/dist/{index-BO5Rse5J.d.mts → index-DX05tkNg.d.cts} +15 -1
- package/dist/index.cjs +386 -15
- package/dist/index.d.cts +214 -2
- package/dist/index.d.mts +214 -2
- package/dist/index.mjs +382 -15
- package/dist/{neon-dialect-C0GZuGot.cjs → neon-dialect-B-Q6mmbI.cjs} +1 -1
- package/dist/{neon-dialect-BQey5lUw.cjs → neon-dialect-BR1nZmKX.cjs} +1 -1
- package/dist/{node-sqlite-dialect-N8j5UsT-.cjs → node-sqlite-dialect-DpdAEbyp.cjs} +1 -1
- package/package.json +4 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as variantsSchema, A as ProviderConfig, B as VariantVersionsTable, C as Environment, D as Insertable, E as EnvironmentsTable, F as TargetingRule, G as configsSchema, H as WorkspaceSettings, I as TargetingRulesTable, J as llmRequestsSchema, K as environmentSecretsSchema, L as Updateable, M as SCHEMA_METADATA, N as Selectable, O as LLMRequest, P as TableName, Q as variantVersionsSchema, R as Variant, S as Database, T as EnvironmentSecretsTable, U as WorkspaceSettingsTable, V as VariantsTable, W as configVariantsSchema, X as schemas, Y as providerConfigsSchema, Z as targetingRulesSchema, _ as validateTableData, a as createDatabaseFromConnection, b as ConfigVariantsTable, c as executeWithSchema, d as getMigrations, et as workspaceSettingsSchema, f as matchType, g as validatePartialTableData, h as parseTableData, i as createDatabase, j as ProviderConfigsTable, k as LLMRequestsTable, l as MigrationOptions, m as parsePartialTableData, n as DatabaseOptions, o as detectDatabaseType, p as runAutoMigrations, q as environmentsSchema, r as DatabaseType, s as createNeonDialect, t as DatabaseConnection, u as MigrationResult, v as Config, w as EnvironmentSecret, x as ConfigsTable, y as ConfigVariant, z as VariantVersion } from "./index-
|
|
1
|
+
import { $ as variantsSchema, A as ProviderConfig, B as VariantVersionsTable, C as Environment, D as Insertable, E as EnvironmentsTable, F as TargetingRule, G as configsSchema, H as WorkspaceSettings, I as TargetingRulesTable, J as llmRequestsSchema, K as environmentSecretsSchema, L as Updateable, M as SCHEMA_METADATA, N as Selectable, O as LLMRequest, P as TableName, Q as variantVersionsSchema, R as Variant, S as Database, T as EnvironmentSecretsTable, U as WorkspaceSettingsTable, V as VariantsTable, W as configVariantsSchema, X as schemas, Y as providerConfigsSchema, Z as targetingRulesSchema, _ as validateTableData, a as createDatabaseFromConnection, b as ConfigVariantsTable, c as executeWithSchema, d as getMigrations, et as workspaceSettingsSchema, f as matchType, g as validatePartialTableData, h as parseTableData, i as createDatabase, j as ProviderConfigsTable, k as LLMRequestsTable, l as MigrationOptions, m as parsePartialTableData, n as DatabaseOptions, o as detectDatabaseType, p as runAutoMigrations, q as environmentsSchema, r as DatabaseType, s as createNeonDialect, t as DatabaseConnection, u as MigrationResult, v as Config, w as EnvironmentSecret, x as ConfigsTable, y as ConfigVariant, z as VariantVersion } from "./index-DX05tkNg.cjs";
|
|
2
2
|
import { Kysely } from "kysely";
|
|
3
3
|
import * as zod33 from "zod";
|
|
4
4
|
import z$1, { z } from "zod";
|
|
@@ -6,6 +6,7 @@ import gateway from "@llmops/gateway";
|
|
|
6
6
|
import pino from "pino";
|
|
7
7
|
import * as better_auth0 from "better-auth";
|
|
8
8
|
import { BetterAuthOptions } from "better-auth";
|
|
9
|
+
import { RulesLogic } from "json-logic-js";
|
|
9
10
|
|
|
10
11
|
//#region src/schemas/config.d.ts
|
|
11
12
|
declare const llmopsConfigSchema: z.ZodObject<{
|
|
@@ -1374,12 +1375,14 @@ declare const createWorkspaceSettingsDataLayer: (db: Kysely<Database>) => {
|
|
|
1374
1375
|
//#region src/datalayer/providerConfigs.d.ts
|
|
1375
1376
|
declare const createProviderConfig: z$1.ZodObject<{
|
|
1376
1377
|
providerId: z$1.ZodString;
|
|
1378
|
+
slug: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1377
1379
|
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1378
1380
|
config: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
1379
1381
|
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1380
1382
|
}, z$1.core.$strip>;
|
|
1381
1383
|
declare const updateProviderConfig: z$1.ZodObject<{
|
|
1382
1384
|
id: z$1.ZodUUID;
|
|
1385
|
+
slug: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1383
1386
|
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1384
1387
|
config: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1385
1388
|
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
@@ -1390,6 +1393,9 @@ declare const getProviderConfigById: z$1.ZodObject<{
|
|
|
1390
1393
|
declare const getProviderConfigByProviderId: z$1.ZodObject<{
|
|
1391
1394
|
providerId: z$1.ZodString;
|
|
1392
1395
|
}, z$1.core.$strip>;
|
|
1396
|
+
declare const getProviderConfigBySlug: z$1.ZodObject<{
|
|
1397
|
+
slug: z$1.ZodString;
|
|
1398
|
+
}, z$1.core.$strip>;
|
|
1393
1399
|
declare const deleteProviderConfig: z$1.ZodObject<{
|
|
1394
1400
|
id: z$1.ZodUUID;
|
|
1395
1401
|
}, z$1.core.$strip>;
|
|
@@ -1399,6 +1405,7 @@ declare const listProviderConfigs: z$1.ZodObject<{
|
|
|
1399
1405
|
}, z$1.core.$strip>;
|
|
1400
1406
|
declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
1401
1407
|
createProviderConfig: (params: z$1.infer<typeof createProviderConfig>) => Promise<{
|
|
1408
|
+
slug: string | null;
|
|
1402
1409
|
name: string | null;
|
|
1403
1410
|
id: string;
|
|
1404
1411
|
createdAt: Date;
|
|
@@ -1408,6 +1415,7 @@ declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
|
1408
1415
|
config: Record<string, unknown>;
|
|
1409
1416
|
} | undefined>;
|
|
1410
1417
|
updateProviderConfig: (params: z$1.infer<typeof updateProviderConfig>) => Promise<{
|
|
1418
|
+
slug: string | null;
|
|
1411
1419
|
name: string | null;
|
|
1412
1420
|
id: string;
|
|
1413
1421
|
createdAt: Date;
|
|
@@ -1417,6 +1425,7 @@ declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
|
1417
1425
|
config: Record<string, unknown>;
|
|
1418
1426
|
} | undefined>;
|
|
1419
1427
|
getProviderConfigById: (params: z$1.infer<typeof getProviderConfigById>) => Promise<{
|
|
1428
|
+
slug: string | null;
|
|
1420
1429
|
name: string | null;
|
|
1421
1430
|
id: string;
|
|
1422
1431
|
createdAt: Date;
|
|
@@ -1426,6 +1435,17 @@ declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
|
1426
1435
|
config: Record<string, unknown>;
|
|
1427
1436
|
} | undefined>;
|
|
1428
1437
|
getProviderConfigByProviderId: (params: z$1.infer<typeof getProviderConfigByProviderId>) => Promise<{
|
|
1438
|
+
slug: string | null;
|
|
1439
|
+
name: string | null;
|
|
1440
|
+
id: string;
|
|
1441
|
+
createdAt: Date;
|
|
1442
|
+
updatedAt: Date;
|
|
1443
|
+
enabled: boolean;
|
|
1444
|
+
providerId: string;
|
|
1445
|
+
config: Record<string, unknown>;
|
|
1446
|
+
} | undefined>;
|
|
1447
|
+
getProviderConfigBySlug: (params: z$1.infer<typeof getProviderConfigBySlug>) => Promise<{
|
|
1448
|
+
slug: string | null;
|
|
1429
1449
|
name: string | null;
|
|
1430
1450
|
id: string;
|
|
1431
1451
|
createdAt: Date;
|
|
@@ -1435,6 +1455,7 @@ declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
|
1435
1455
|
config: Record<string, unknown>;
|
|
1436
1456
|
} | undefined>;
|
|
1437
1457
|
deleteProviderConfig: (params: z$1.infer<typeof deleteProviderConfig>) => Promise<{
|
|
1458
|
+
slug: string | null;
|
|
1438
1459
|
name: string | null;
|
|
1439
1460
|
id: string;
|
|
1440
1461
|
createdAt: Date;
|
|
@@ -1444,6 +1465,7 @@ declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
|
1444
1465
|
config: Record<string, unknown>;
|
|
1445
1466
|
} | undefined>;
|
|
1446
1467
|
listProviderConfigs: (params?: z$1.infer<typeof listProviderConfigs>) => Promise<{
|
|
1468
|
+
slug: string | null;
|
|
1447
1469
|
name: string | null;
|
|
1448
1470
|
id: string;
|
|
1449
1471
|
createdAt: Date;
|
|
@@ -1458,6 +1480,7 @@ declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
|
1458
1480
|
* Useful for the dashboard UI where you want to set/update a provider config
|
|
1459
1481
|
*/
|
|
1460
1482
|
upsertProviderConfig: (params: z$1.infer<typeof createProviderConfig>) => Promise<{
|
|
1483
|
+
slug: string | null;
|
|
1461
1484
|
name: string | null;
|
|
1462
1485
|
id: string;
|
|
1463
1486
|
createdAt: Date;
|
|
@@ -1911,10 +1934,12 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1911
1934
|
} | undefined>;
|
|
1912
1935
|
createProviderConfig: (params: zod33.infer<zod33.ZodObject<{
|
|
1913
1936
|
providerId: zod33.ZodString;
|
|
1937
|
+
slug: zod33.ZodOptional<zod33.ZodNullable<zod33.ZodString>>;
|
|
1914
1938
|
name: zod33.ZodOptional<zod33.ZodNullable<zod33.ZodString>>;
|
|
1915
1939
|
config: zod33.ZodRecord<zod33.ZodString, zod33.ZodUnknown>;
|
|
1916
1940
|
enabled: zod33.ZodDefault<zod33.ZodOptional<zod33.ZodBoolean>>;
|
|
1917
1941
|
}, better_auth0.$strip>>) => Promise<{
|
|
1942
|
+
slug: string | null;
|
|
1918
1943
|
name: string | null;
|
|
1919
1944
|
id: string;
|
|
1920
1945
|
createdAt: Date;
|
|
@@ -1925,10 +1950,12 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1925
1950
|
} | undefined>;
|
|
1926
1951
|
updateProviderConfig: (params: zod33.infer<zod33.ZodObject<{
|
|
1927
1952
|
id: zod33.ZodUUID;
|
|
1953
|
+
slug: zod33.ZodOptional<zod33.ZodNullable<zod33.ZodString>>;
|
|
1928
1954
|
name: zod33.ZodOptional<zod33.ZodNullable<zod33.ZodString>>;
|
|
1929
1955
|
config: zod33.ZodOptional<zod33.ZodRecord<zod33.ZodString, zod33.ZodUnknown>>;
|
|
1930
1956
|
enabled: zod33.ZodOptional<zod33.ZodBoolean>;
|
|
1931
1957
|
}, better_auth0.$strip>>) => Promise<{
|
|
1958
|
+
slug: string | null;
|
|
1932
1959
|
name: string | null;
|
|
1933
1960
|
id: string;
|
|
1934
1961
|
createdAt: Date;
|
|
@@ -1940,6 +1967,7 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1940
1967
|
getProviderConfigById: (params: zod33.infer<zod33.ZodObject<{
|
|
1941
1968
|
id: zod33.ZodUUID;
|
|
1942
1969
|
}, better_auth0.$strip>>) => Promise<{
|
|
1970
|
+
slug: string | null;
|
|
1943
1971
|
name: string | null;
|
|
1944
1972
|
id: string;
|
|
1945
1973
|
createdAt: Date;
|
|
@@ -1951,6 +1979,19 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1951
1979
|
getProviderConfigByProviderId: (params: zod33.infer<zod33.ZodObject<{
|
|
1952
1980
|
providerId: zod33.ZodString;
|
|
1953
1981
|
}, better_auth0.$strip>>) => Promise<{
|
|
1982
|
+
slug: string | null;
|
|
1983
|
+
name: string | null;
|
|
1984
|
+
id: string;
|
|
1985
|
+
createdAt: Date;
|
|
1986
|
+
updatedAt: Date;
|
|
1987
|
+
enabled: boolean;
|
|
1988
|
+
providerId: string;
|
|
1989
|
+
config: Record<string, unknown>;
|
|
1990
|
+
} | undefined>;
|
|
1991
|
+
getProviderConfigBySlug: (params: zod33.infer<zod33.ZodObject<{
|
|
1992
|
+
slug: zod33.ZodString;
|
|
1993
|
+
}, better_auth0.$strip>>) => Promise<{
|
|
1994
|
+
slug: string | null;
|
|
1954
1995
|
name: string | null;
|
|
1955
1996
|
id: string;
|
|
1956
1997
|
createdAt: Date;
|
|
@@ -1962,6 +2003,7 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1962
2003
|
deleteProviderConfig: (params: zod33.infer<zod33.ZodObject<{
|
|
1963
2004
|
id: zod33.ZodUUID;
|
|
1964
2005
|
}, better_auth0.$strip>>) => Promise<{
|
|
2006
|
+
slug: string | null;
|
|
1965
2007
|
name: string | null;
|
|
1966
2008
|
id: string;
|
|
1967
2009
|
createdAt: Date;
|
|
@@ -1974,6 +2016,7 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1974
2016
|
limit: zod33.ZodOptional<zod33.ZodNumber>;
|
|
1975
2017
|
offset: zod33.ZodOptional<zod33.ZodNumber>;
|
|
1976
2018
|
}, better_auth0.$strip>>) => Promise<{
|
|
2019
|
+
slug: string | null;
|
|
1977
2020
|
name: string | null;
|
|
1978
2021
|
id: string;
|
|
1979
2022
|
createdAt: Date;
|
|
@@ -1985,10 +2028,12 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
1985
2028
|
countProviderConfigs: () => Promise<number>;
|
|
1986
2029
|
upsertProviderConfig: (params: zod33.infer<zod33.ZodObject<{
|
|
1987
2030
|
providerId: zod33.ZodString;
|
|
2031
|
+
slug: zod33.ZodOptional<zod33.ZodNullable<zod33.ZodString>>;
|
|
1988
2032
|
name: zod33.ZodOptional<zod33.ZodNullable<zod33.ZodString>>;
|
|
1989
2033
|
config: zod33.ZodRecord<zod33.ZodString, zod33.ZodUnknown>;
|
|
1990
2034
|
enabled: zod33.ZodDefault<zod33.ZodOptional<zod33.ZodBoolean>>;
|
|
1991
2035
|
}, better_auth0.$strip>>) => Promise<{
|
|
2036
|
+
slug: string | null;
|
|
1992
2037
|
name: string | null;
|
|
1993
2038
|
id: string;
|
|
1994
2039
|
createdAt: Date;
|
|
@@ -2798,4 +2843,171 @@ interface AuthClientOptions {
|
|
|
2798
2843
|
*/
|
|
2799
2844
|
declare const getAuthClientOptions: (options: AuthClientOptions) => BetterAuthOptions;
|
|
2800
2845
|
//#endregion
|
|
2801
|
-
|
|
2846
|
+
//#region src/manifest/types.d.ts
|
|
2847
|
+
/**
|
|
2848
|
+
* Pre-computed variant version data needed for routing
|
|
2849
|
+
*/
|
|
2850
|
+
interface ManifestVariantVersion {
|
|
2851
|
+
id: string;
|
|
2852
|
+
variantId: string;
|
|
2853
|
+
version: number;
|
|
2854
|
+
provider: string;
|
|
2855
|
+
providerConfigId: string | null;
|
|
2856
|
+
modelName: string;
|
|
2857
|
+
jsonData: Record<string, unknown>;
|
|
2858
|
+
}
|
|
2859
|
+
/**
|
|
2860
|
+
* A targeting rule entry in the manifest
|
|
2861
|
+
* Pre-resolved with all necessary data for routing
|
|
2862
|
+
*/
|
|
2863
|
+
interface ManifestTargetingRule {
|
|
2864
|
+
id: string;
|
|
2865
|
+
configVariantId: string;
|
|
2866
|
+
variantVersionId: string | null;
|
|
2867
|
+
weight: number;
|
|
2868
|
+
priority: number;
|
|
2869
|
+
enabled: boolean;
|
|
2870
|
+
conditions: RulesLogic | null;
|
|
2871
|
+
resolvedVersion: ManifestVariantVersion;
|
|
2872
|
+
}
|
|
2873
|
+
/**
|
|
2874
|
+
* Config entry in the manifest
|
|
2875
|
+
*/
|
|
2876
|
+
interface ManifestConfig {
|
|
2877
|
+
id: string;
|
|
2878
|
+
slug: string;
|
|
2879
|
+
name: string | null;
|
|
2880
|
+
}
|
|
2881
|
+
/**
|
|
2882
|
+
* Environment entry in the manifest
|
|
2883
|
+
*/
|
|
2884
|
+
interface ManifestEnvironment {
|
|
2885
|
+
id: string;
|
|
2886
|
+
slug: string;
|
|
2887
|
+
name: string;
|
|
2888
|
+
isProd: boolean;
|
|
2889
|
+
}
|
|
2890
|
+
/**
|
|
2891
|
+
* The complete routing manifest
|
|
2892
|
+
* Stored in cache under key: "gateway:manifest"
|
|
2893
|
+
*/
|
|
2894
|
+
interface GatewayManifest {
|
|
2895
|
+
version: number;
|
|
2896
|
+
builtAt: string;
|
|
2897
|
+
configs: Record<string, ManifestConfig>;
|
|
2898
|
+
configsBySlug: Record<string, string>;
|
|
2899
|
+
environments: Record<string, ManifestEnvironment>;
|
|
2900
|
+
environmentsBySlug: Record<string, string>;
|
|
2901
|
+
routingTable: Record<string, Record<string, ManifestTargetingRule[]>>;
|
|
2902
|
+
secretToEnvironment: Record<string, string>;
|
|
2903
|
+
}
|
|
2904
|
+
/**
|
|
2905
|
+
* Context passed to JSONLogic for condition evaluation
|
|
2906
|
+
*/
|
|
2907
|
+
interface RoutingContext {
|
|
2908
|
+
headers?: Record<string, string>;
|
|
2909
|
+
user?: {
|
|
2910
|
+
id?: string;
|
|
2911
|
+
email?: string;
|
|
2912
|
+
groups?: string[];
|
|
2913
|
+
[key: string]: unknown;
|
|
2914
|
+
};
|
|
2915
|
+
request?: {
|
|
2916
|
+
path?: string;
|
|
2917
|
+
method?: string;
|
|
2918
|
+
ip?: string;
|
|
2919
|
+
};
|
|
2920
|
+
custom?: Record<string, unknown>;
|
|
2921
|
+
timestamp?: number;
|
|
2922
|
+
}
|
|
2923
|
+
/**
|
|
2924
|
+
* Result of routing a request
|
|
2925
|
+
*/
|
|
2926
|
+
interface RoutingResult {
|
|
2927
|
+
configId: string;
|
|
2928
|
+
environmentId: string;
|
|
2929
|
+
variantId: string;
|
|
2930
|
+
version: ManifestVariantVersion;
|
|
2931
|
+
rule: ManifestTargetingRule;
|
|
2932
|
+
}
|
|
2933
|
+
//#endregion
|
|
2934
|
+
//#region src/manifest/builder.d.ts
|
|
2935
|
+
/**
|
|
2936
|
+
* Builds the gateway routing manifest from database
|
|
2937
|
+
*/
|
|
2938
|
+
declare class ManifestBuilder {
|
|
2939
|
+
private db;
|
|
2940
|
+
constructor(db: Kysely<Database>);
|
|
2941
|
+
/**
|
|
2942
|
+
* Build the complete routing manifest from database
|
|
2943
|
+
*/
|
|
2944
|
+
build(): Promise<GatewayManifest>;
|
|
2945
|
+
}
|
|
2946
|
+
//#endregion
|
|
2947
|
+
//#region src/manifest/service.d.ts
|
|
2948
|
+
declare class ManifestService {
|
|
2949
|
+
private cache;
|
|
2950
|
+
private ttlMs;
|
|
2951
|
+
private builder;
|
|
2952
|
+
constructor(cache: CacheService, db: Kysely<Database>, ttlMs?: number);
|
|
2953
|
+
/**
|
|
2954
|
+
* Get the current manifest, building if necessary
|
|
2955
|
+
*/
|
|
2956
|
+
getManifest(): Promise<GatewayManifest>;
|
|
2957
|
+
/**
|
|
2958
|
+
* Force invalidate the manifest (called on mutations)
|
|
2959
|
+
*/
|
|
2960
|
+
invalidate(): Promise<void>;
|
|
2961
|
+
/**
|
|
2962
|
+
* Invalidate and immediately rebuild (atomic refresh)
|
|
2963
|
+
*/
|
|
2964
|
+
refresh(): Promise<GatewayManifest>;
|
|
2965
|
+
/**
|
|
2966
|
+
* Get manifest version without fetching full manifest
|
|
2967
|
+
* Useful for checking if manifest is stale
|
|
2968
|
+
*/
|
|
2969
|
+
getVersion(): Promise<number | null>;
|
|
2970
|
+
/**
|
|
2971
|
+
* Check if manifest exists in cache
|
|
2972
|
+
*/
|
|
2973
|
+
hasManifest(): Promise<boolean>;
|
|
2974
|
+
}
|
|
2975
|
+
//#endregion
|
|
2976
|
+
//#region src/manifest/router.d.ts
|
|
2977
|
+
/**
|
|
2978
|
+
* Router for evaluating the gateway manifest and selecting variants
|
|
2979
|
+
*/
|
|
2980
|
+
declare class ManifestRouter {
|
|
2981
|
+
private manifest;
|
|
2982
|
+
constructor(manifest: GatewayManifest);
|
|
2983
|
+
/**
|
|
2984
|
+
* Resolve a config identifier (UUID or slug) to config ID
|
|
2985
|
+
*/
|
|
2986
|
+
resolveConfigId(configIdOrSlug: string): string | null;
|
|
2987
|
+
/**
|
|
2988
|
+
* Resolve environment from secret value
|
|
2989
|
+
*/
|
|
2990
|
+
resolveEnvironmentFromSecret(secretValue: string): string | null;
|
|
2991
|
+
/**
|
|
2992
|
+
* Get production environment ID
|
|
2993
|
+
*/
|
|
2994
|
+
getProductionEnvironmentId(): string | null;
|
|
2995
|
+
/**
|
|
2996
|
+
* Get environment by ID
|
|
2997
|
+
*/
|
|
2998
|
+
getEnvironment(environmentId: string): ManifestEnvironment;
|
|
2999
|
+
/**
|
|
3000
|
+
* Get config by ID
|
|
3001
|
+
*/
|
|
3002
|
+
getConfig(configId: string): ManifestConfig;
|
|
3003
|
+
/**
|
|
3004
|
+
* Route a request to the appropriate variant version (first match wins)
|
|
3005
|
+
*/
|
|
3006
|
+
route(configIdOrSlug: string, environmentId: string, context?: RoutingContext): RoutingResult | null;
|
|
3007
|
+
/**
|
|
3008
|
+
* Route with weighted random selection among matching rules of same priority
|
|
3009
|
+
*/
|
|
3010
|
+
routeWithWeights(configIdOrSlug: string, environmentId: string, context?: RoutingContext): RoutingResult | null;
|
|
3011
|
+
}
|
|
3012
|
+
//#endregion
|
|
3013
|
+
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, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, FileCacheBackend, FileCacheConfig, type FireworksAIProviderConfig, GatewayManifest, type GoogleProviderConfig, type HuggingFaceProviderConfig, Insertable, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, LLMRequest, type LLMRequestInsert, LLMRequestsTable, MS, ManifestBuilder, ManifestConfig, ManifestEnvironment, ManifestRouter, ManifestService, ManifestTargetingRule, ManifestVariantVersion, MemoryCacheBackend, MemoryCacheConfig, MigrationOptions, MigrationResult, type MistralAIProviderConfig, ModelPricing, ModelsDevPricingProvider, type OpenAIProviderConfig, type OracleProviderConfig, Prettify, PricingProvider, ProviderConfig, type ProviderConfigMap, ProviderConfigsTable, type ProvidersConfig, RoutingContext, RoutingResult, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, type StabilityAIProviderConfig, SupportedProviders, TableName, TargetingRule, TargetingRulesTable, Updateable, UsageData, type ValidatedLLMOpsConfig, Variant, VariantJsonData, VariantVersion, VariantVersionsTable, VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, WorkspaceSettings, WorkspaceSettingsTable, calculateCost, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, createLLMRequestsDataLayer, createNeonDialect, createProviderConfigsDataLayer, createWorkspaceSettingsDataLayer, detectDatabaseType, dollarsToMicroDollars, environmentSecretsSchema, environmentsSchema, executeWithSchema, formatCost, gateway, generateId, getAuthClientOptions, getDefaultPricingProvider, getMigrations, llmRequestsSchema, llmopsConfigSchema, logger, matchType, microDollarsToDollars, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|