@llmops/core 0.3.1 → 0.3.2-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-BNaQHMpk.cjs → bun-sqlite-dialect-B5rfiYIH.cjs} +1 -1
- package/dist/db/index.cjs +4 -2
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +2 -2
- package/dist/{db-B-EsQtOz.mjs → db-Bkg85wso.mjs} +125 -3
- package/dist/{db-Du2xmkGS.cjs → db-CCKBHjuz.cjs} +139 -5
- package/dist/{index-COkIT6TH.d.mts → index-BMN3ZSTf.d.mts} +398 -2
- package/dist/{index-CunWjFE4.d.cts → index-nsx8vXII.d.cts} +433 -37
- package/dist/index.cjs +249 -5
- package/dist/index.d.cts +765 -205
- package/dist/index.d.mts +1026 -466
- package/dist/index.mjs +245 -5
- package/dist/{neon-dialect-BR1nZmKX.cjs → neon-dialect-DmI-frVR.cjs} +1 -1
- package/dist/{neon-dialect-B-Q6mmbI.cjs → neon-dialect-q-8lApt2.cjs} +1 -1
- package/dist/{node-sqlite-dialect-DpdAEbyp.cjs → node-sqlite-dialect-uTc3IyPv.cjs} +1 -1
- package/package.json +2 -2
|
@@ -81,6 +81,62 @@ declare const providerConfigsSchema: z.ZodObject<{
|
|
|
81
81
|
createdAt: z.ZodDate;
|
|
82
82
|
updatedAt: z.ZodDate;
|
|
83
83
|
}, z.core.$strip>;
|
|
84
|
+
declare const guardrailConfigsSchema: z.ZodObject<{
|
|
85
|
+
name: z.ZodString;
|
|
86
|
+
pluginId: z.ZodString;
|
|
87
|
+
functionId: z.ZodString;
|
|
88
|
+
hookType: z.ZodEnum<{
|
|
89
|
+
beforeRequestHook: "beforeRequestHook";
|
|
90
|
+
afterRequestHook: "afterRequestHook";
|
|
91
|
+
}>;
|
|
92
|
+
parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
93
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
94
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
95
|
+
onFail: z.ZodDefault<z.ZodEnum<{
|
|
96
|
+
block: "block";
|
|
97
|
+
log: "log";
|
|
98
|
+
}>>;
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
createdAt: z.ZodDate;
|
|
101
|
+
updatedAt: z.ZodDate;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
declare const providerGuardrailOverridesSchema: z.ZodObject<{
|
|
104
|
+
providerConfigId: z.ZodString;
|
|
105
|
+
guardrailConfigId: z.ZodString;
|
|
106
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
107
|
+
parameters: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
108
|
+
id: z.ZodString;
|
|
109
|
+
createdAt: z.ZodDate;
|
|
110
|
+
updatedAt: z.ZodDate;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
declare const guardrailResultSchema: z.ZodObject<{
|
|
113
|
+
configId: z.ZodString;
|
|
114
|
+
functionId: z.ZodString;
|
|
115
|
+
hookType: z.ZodEnum<{
|
|
116
|
+
beforeRequestHook: "beforeRequestHook";
|
|
117
|
+
afterRequestHook: "afterRequestHook";
|
|
118
|
+
}>;
|
|
119
|
+
verdict: z.ZodBoolean;
|
|
120
|
+
latencyMs: z.ZodNumber;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
declare const guardrailResultsSchema: z.ZodObject<{
|
|
123
|
+
results: z.ZodArray<z.ZodObject<{
|
|
124
|
+
configId: z.ZodString;
|
|
125
|
+
functionId: z.ZodString;
|
|
126
|
+
hookType: z.ZodEnum<{
|
|
127
|
+
beforeRequestHook: "beforeRequestHook";
|
|
128
|
+
afterRequestHook: "afterRequestHook";
|
|
129
|
+
}>;
|
|
130
|
+
verdict: z.ZodBoolean;
|
|
131
|
+
latencyMs: z.ZodNumber;
|
|
132
|
+
}, z.core.$strip>>;
|
|
133
|
+
action: z.ZodEnum<{
|
|
134
|
+
allowed: "allowed";
|
|
135
|
+
blocked: "blocked";
|
|
136
|
+
logged: "logged";
|
|
137
|
+
}>;
|
|
138
|
+
totalLatencyMs: z.ZodNumber;
|
|
139
|
+
}, z.core.$strip>;
|
|
84
140
|
declare const llmRequestsSchema: z.ZodObject<{
|
|
85
141
|
requestId: z.ZodString;
|
|
86
142
|
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -102,6 +158,24 @@ declare const llmRequestsSchema: z.ZodObject<{
|
|
|
102
158
|
isStreaming: z.ZodDefault<z.ZodBoolean>;
|
|
103
159
|
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
160
|
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
161
|
+
guardrailResults: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
162
|
+
results: z.ZodArray<z.ZodObject<{
|
|
163
|
+
configId: z.ZodString;
|
|
164
|
+
functionId: z.ZodString;
|
|
165
|
+
hookType: z.ZodEnum<{
|
|
166
|
+
beforeRequestHook: "beforeRequestHook";
|
|
167
|
+
afterRequestHook: "afterRequestHook";
|
|
168
|
+
}>;
|
|
169
|
+
verdict: z.ZodBoolean;
|
|
170
|
+
latencyMs: z.ZodNumber;
|
|
171
|
+
}, z.core.$strip>>;
|
|
172
|
+
action: z.ZodEnum<{
|
|
173
|
+
allowed: "allowed";
|
|
174
|
+
blocked: "blocked";
|
|
175
|
+
logged: "logged";
|
|
176
|
+
}>;
|
|
177
|
+
totalLatencyMs: z.ZodNumber;
|
|
178
|
+
}, z.core.$strip>>>;
|
|
105
179
|
id: z.ZodString;
|
|
106
180
|
createdAt: z.ZodDate;
|
|
107
181
|
updatedAt: z.ZodDate;
|
|
@@ -118,6 +192,10 @@ type ConfigVariant = z.infer<typeof configVariantsSchema>;
|
|
|
118
192
|
type TargetingRule = z.infer<typeof targetingRulesSchema>;
|
|
119
193
|
type WorkspaceSettings = z.infer<typeof workspaceSettingsSchema>;
|
|
120
194
|
type ProviderConfig = z.infer<typeof providerConfigsSchema>;
|
|
195
|
+
type GuardrailConfig = z.infer<typeof guardrailConfigsSchema>;
|
|
196
|
+
type ProviderGuardrailOverride = z.infer<typeof providerGuardrailOverridesSchema>;
|
|
197
|
+
type GuardrailResult = z.infer<typeof guardrailResultSchema>;
|
|
198
|
+
type GuardrailResults = z.infer<typeof guardrailResultsSchema>;
|
|
121
199
|
type LLMRequest = z.infer<typeof llmRequestsSchema>;
|
|
122
200
|
/**
|
|
123
201
|
* Kysely Table Interfaces
|
|
@@ -178,6 +256,22 @@ interface ProviderConfigsTable extends BaseTable {
|
|
|
178
256
|
config: ColumnType<Record<string, unknown>, string, string>;
|
|
179
257
|
enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
180
258
|
}
|
|
259
|
+
interface GuardrailConfigsTable extends BaseTable {
|
|
260
|
+
name: string;
|
|
261
|
+
pluginId: string;
|
|
262
|
+
functionId: string;
|
|
263
|
+
hookType: string;
|
|
264
|
+
parameters: ColumnType<Record<string, unknown>, string, string>;
|
|
265
|
+
enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
266
|
+
priority: ColumnType<number, number | undefined, number | undefined>;
|
|
267
|
+
onFail: ColumnType<string, string | undefined, string | undefined>;
|
|
268
|
+
}
|
|
269
|
+
interface ProviderGuardrailOverridesTable extends BaseTable {
|
|
270
|
+
providerConfigId: string;
|
|
271
|
+
guardrailConfigId: string;
|
|
272
|
+
enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
273
|
+
parameters: ColumnType<Record<string, unknown> | null, string | null, string | null>;
|
|
274
|
+
}
|
|
181
275
|
interface LLMRequestsTable extends BaseTable {
|
|
182
276
|
requestId: string;
|
|
183
277
|
configId: string | null;
|
|
@@ -199,6 +293,7 @@ interface LLMRequestsTable extends BaseTable {
|
|
|
199
293
|
isStreaming: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
200
294
|
userId: string | null;
|
|
201
295
|
tags: ColumnType<Record<string, string>, string, string>;
|
|
296
|
+
guardrailResults: ColumnType<GuardrailResults | null, string | null, string | null>;
|
|
202
297
|
}
|
|
203
298
|
/**
|
|
204
299
|
* Main Kysely Database interface
|
|
@@ -213,6 +308,8 @@ interface Database {
|
|
|
213
308
|
targeting_rules: TargetingRulesTable;
|
|
214
309
|
workspace_settings: WorkspaceSettingsTable;
|
|
215
310
|
provider_configs: ProviderConfigsTable;
|
|
311
|
+
guardrail_configs: GuardrailConfigsTable;
|
|
312
|
+
provider_guardrail_overrides: ProviderGuardrailOverridesTable;
|
|
216
313
|
llm_requests: LLMRequestsTable;
|
|
217
314
|
}
|
|
218
315
|
/**
|
|
@@ -617,8 +714,125 @@ declare const SCHEMA_METADATA: {
|
|
|
617
714
|
};
|
|
618
715
|
};
|
|
619
716
|
};
|
|
620
|
-
readonly
|
|
717
|
+
readonly guardrail_configs: {
|
|
621
718
|
readonly order: 10;
|
|
719
|
+
readonly schema: z.ZodObject<{
|
|
720
|
+
name: z.ZodString;
|
|
721
|
+
pluginId: z.ZodString;
|
|
722
|
+
functionId: z.ZodString;
|
|
723
|
+
hookType: z.ZodEnum<{
|
|
724
|
+
beforeRequestHook: "beforeRequestHook";
|
|
725
|
+
afterRequestHook: "afterRequestHook";
|
|
726
|
+
}>;
|
|
727
|
+
parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
728
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
729
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
730
|
+
onFail: z.ZodDefault<z.ZodEnum<{
|
|
731
|
+
block: "block";
|
|
732
|
+
log: "log";
|
|
733
|
+
}>>;
|
|
734
|
+
id: z.ZodString;
|
|
735
|
+
createdAt: z.ZodDate;
|
|
736
|
+
updatedAt: z.ZodDate;
|
|
737
|
+
}, z.core.$strip>;
|
|
738
|
+
readonly fields: {
|
|
739
|
+
readonly id: {
|
|
740
|
+
readonly type: "uuid";
|
|
741
|
+
readonly primaryKey: true;
|
|
742
|
+
};
|
|
743
|
+
readonly name: {
|
|
744
|
+
readonly type: "text";
|
|
745
|
+
};
|
|
746
|
+
readonly pluginId: {
|
|
747
|
+
readonly type: "text";
|
|
748
|
+
};
|
|
749
|
+
readonly functionId: {
|
|
750
|
+
readonly type: "text";
|
|
751
|
+
};
|
|
752
|
+
readonly hookType: {
|
|
753
|
+
readonly type: "text";
|
|
754
|
+
};
|
|
755
|
+
readonly parameters: {
|
|
756
|
+
readonly type: "jsonb";
|
|
757
|
+
readonly default: "{}";
|
|
758
|
+
};
|
|
759
|
+
readonly enabled: {
|
|
760
|
+
readonly type: "boolean";
|
|
761
|
+
readonly default: true;
|
|
762
|
+
};
|
|
763
|
+
readonly priority: {
|
|
764
|
+
readonly type: "integer";
|
|
765
|
+
readonly default: 0;
|
|
766
|
+
};
|
|
767
|
+
readonly onFail: {
|
|
768
|
+
readonly type: "text";
|
|
769
|
+
readonly default: "block";
|
|
770
|
+
};
|
|
771
|
+
readonly createdAt: {
|
|
772
|
+
readonly type: "timestamp";
|
|
773
|
+
readonly default: "now()";
|
|
774
|
+
};
|
|
775
|
+
readonly updatedAt: {
|
|
776
|
+
readonly type: "timestamp";
|
|
777
|
+
readonly default: "now()";
|
|
778
|
+
readonly onUpdate: "now()";
|
|
779
|
+
};
|
|
780
|
+
};
|
|
781
|
+
};
|
|
782
|
+
readonly provider_guardrail_overrides: {
|
|
783
|
+
readonly order: 11;
|
|
784
|
+
readonly schema: z.ZodObject<{
|
|
785
|
+
providerConfigId: z.ZodString;
|
|
786
|
+
guardrailConfigId: z.ZodString;
|
|
787
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
788
|
+
parameters: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
789
|
+
id: z.ZodString;
|
|
790
|
+
createdAt: z.ZodDate;
|
|
791
|
+
updatedAt: z.ZodDate;
|
|
792
|
+
}, z.core.$strip>;
|
|
793
|
+
readonly fields: {
|
|
794
|
+
readonly id: {
|
|
795
|
+
readonly type: "uuid";
|
|
796
|
+
readonly primaryKey: true;
|
|
797
|
+
};
|
|
798
|
+
readonly providerConfigId: {
|
|
799
|
+
readonly type: "uuid";
|
|
800
|
+
readonly references: {
|
|
801
|
+
readonly table: "provider_configs";
|
|
802
|
+
readonly column: "id";
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
readonly guardrailConfigId: {
|
|
806
|
+
readonly type: "uuid";
|
|
807
|
+
readonly references: {
|
|
808
|
+
readonly table: "guardrail_configs";
|
|
809
|
+
readonly column: "id";
|
|
810
|
+
};
|
|
811
|
+
};
|
|
812
|
+
readonly enabled: {
|
|
813
|
+
readonly type: "boolean";
|
|
814
|
+
readonly default: true;
|
|
815
|
+
};
|
|
816
|
+
readonly parameters: {
|
|
817
|
+
readonly type: "jsonb";
|
|
818
|
+
readonly nullable: true;
|
|
819
|
+
};
|
|
820
|
+
readonly createdAt: {
|
|
821
|
+
readonly type: "timestamp";
|
|
822
|
+
readonly default: "now()";
|
|
823
|
+
};
|
|
824
|
+
readonly updatedAt: {
|
|
825
|
+
readonly type: "timestamp";
|
|
826
|
+
readonly default: "now()";
|
|
827
|
+
readonly onUpdate: "now()";
|
|
828
|
+
};
|
|
829
|
+
};
|
|
830
|
+
readonly uniqueConstraints: readonly [{
|
|
831
|
+
readonly columns: readonly ["providerConfigId", "guardrailConfigId"];
|
|
832
|
+
}];
|
|
833
|
+
};
|
|
834
|
+
readonly llm_requests: {
|
|
835
|
+
readonly order: 12;
|
|
622
836
|
readonly schema: z.ZodObject<{
|
|
623
837
|
requestId: z.ZodString;
|
|
624
838
|
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -640,6 +854,24 @@ declare const SCHEMA_METADATA: {
|
|
|
640
854
|
isStreaming: z.ZodDefault<z.ZodBoolean>;
|
|
641
855
|
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
642
856
|
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
857
|
+
guardrailResults: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
858
|
+
results: z.ZodArray<z.ZodObject<{
|
|
859
|
+
configId: z.ZodString;
|
|
860
|
+
functionId: z.ZodString;
|
|
861
|
+
hookType: z.ZodEnum<{
|
|
862
|
+
beforeRequestHook: "beforeRequestHook";
|
|
863
|
+
afterRequestHook: "afterRequestHook";
|
|
864
|
+
}>;
|
|
865
|
+
verdict: z.ZodBoolean;
|
|
866
|
+
latencyMs: z.ZodNumber;
|
|
867
|
+
}, z.core.$strip>>;
|
|
868
|
+
action: z.ZodEnum<{
|
|
869
|
+
allowed: "allowed";
|
|
870
|
+
blocked: "blocked";
|
|
871
|
+
logged: "logged";
|
|
872
|
+
}>;
|
|
873
|
+
totalLatencyMs: z.ZodNumber;
|
|
874
|
+
}, z.core.$strip>>>;
|
|
643
875
|
id: z.ZodString;
|
|
644
876
|
createdAt: z.ZodDate;
|
|
645
877
|
updatedAt: z.ZodDate;
|
|
@@ -740,6 +972,10 @@ declare const SCHEMA_METADATA: {
|
|
|
740
972
|
readonly type: "jsonb";
|
|
741
973
|
readonly default: "{}";
|
|
742
974
|
};
|
|
975
|
+
readonly guardrailResults: {
|
|
976
|
+
readonly type: "jsonb";
|
|
977
|
+
readonly nullable: true;
|
|
978
|
+
};
|
|
743
979
|
readonly createdAt: {
|
|
744
980
|
readonly type: "timestamp";
|
|
745
981
|
readonly default: "now()";
|
|
@@ -834,6 +1070,34 @@ declare const schemas: {
|
|
|
834
1070
|
createdAt: z.ZodDate;
|
|
835
1071
|
updatedAt: z.ZodDate;
|
|
836
1072
|
}, z.core.$strip>;
|
|
1073
|
+
readonly guardrail_configs: z.ZodObject<{
|
|
1074
|
+
name: z.ZodString;
|
|
1075
|
+
pluginId: z.ZodString;
|
|
1076
|
+
functionId: z.ZodString;
|
|
1077
|
+
hookType: z.ZodEnum<{
|
|
1078
|
+
beforeRequestHook: "beforeRequestHook";
|
|
1079
|
+
afterRequestHook: "afterRequestHook";
|
|
1080
|
+
}>;
|
|
1081
|
+
parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1082
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1083
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
1084
|
+
onFail: z.ZodDefault<z.ZodEnum<{
|
|
1085
|
+
block: "block";
|
|
1086
|
+
log: "log";
|
|
1087
|
+
}>>;
|
|
1088
|
+
id: z.ZodString;
|
|
1089
|
+
createdAt: z.ZodDate;
|
|
1090
|
+
updatedAt: z.ZodDate;
|
|
1091
|
+
}, z.core.$strip>;
|
|
1092
|
+
readonly provider_guardrail_overrides: z.ZodObject<{
|
|
1093
|
+
providerConfigId: z.ZodString;
|
|
1094
|
+
guardrailConfigId: z.ZodString;
|
|
1095
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1096
|
+
parameters: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1097
|
+
id: z.ZodString;
|
|
1098
|
+
createdAt: z.ZodDate;
|
|
1099
|
+
updatedAt: z.ZodDate;
|
|
1100
|
+
}, z.core.$strip>;
|
|
837
1101
|
readonly llm_requests: z.ZodObject<{
|
|
838
1102
|
requestId: z.ZodString;
|
|
839
1103
|
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -855,6 +1119,24 @@ declare const schemas: {
|
|
|
855
1119
|
isStreaming: z.ZodDefault<z.ZodBoolean>;
|
|
856
1120
|
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
857
1121
|
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1122
|
+
guardrailResults: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1123
|
+
results: z.ZodArray<z.ZodObject<{
|
|
1124
|
+
configId: z.ZodString;
|
|
1125
|
+
functionId: z.ZodString;
|
|
1126
|
+
hookType: z.ZodEnum<{
|
|
1127
|
+
beforeRequestHook: "beforeRequestHook";
|
|
1128
|
+
afterRequestHook: "afterRequestHook";
|
|
1129
|
+
}>;
|
|
1130
|
+
verdict: z.ZodBoolean;
|
|
1131
|
+
latencyMs: z.ZodNumber;
|
|
1132
|
+
}, z.core.$strip>>;
|
|
1133
|
+
action: z.ZodEnum<{
|
|
1134
|
+
allowed: "allowed";
|
|
1135
|
+
blocked: "blocked";
|
|
1136
|
+
logged: "logged";
|
|
1137
|
+
}>;
|
|
1138
|
+
totalLatencyMs: z.ZodNumber;
|
|
1139
|
+
}, z.core.$strip>>>;
|
|
858
1140
|
id: z.ZodString;
|
|
859
1141
|
createdAt: z.ZodDate;
|
|
860
1142
|
updatedAt: z.ZodDate;
|
|
@@ -988,6 +1270,22 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
988
1270
|
updatedAt: Date;
|
|
989
1271
|
slug?: string | null | undefined;
|
|
990
1272
|
name?: string | null | undefined;
|
|
1273
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
1274
|
+
providerConfigId: string;
|
|
1275
|
+
guardrailConfigId: string;
|
|
1276
|
+
enabled: boolean;
|
|
1277
|
+
id: string;
|
|
1278
|
+
createdAt: Date;
|
|
1279
|
+
updatedAt: Date;
|
|
1280
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
1281
|
+
}> | zod0.ZodSafeParseError<{
|
|
1282
|
+
providerConfigId: string;
|
|
1283
|
+
guardrailConfigId: string;
|
|
1284
|
+
enabled: boolean;
|
|
1285
|
+
id: string;
|
|
1286
|
+
createdAt: Date;
|
|
1287
|
+
updatedAt: Date;
|
|
1288
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
991
1289
|
}> | zod0.ZodSafeParseSuccess<{
|
|
992
1290
|
requestId: string;
|
|
993
1291
|
provider: string;
|
|
@@ -1012,6 +1310,17 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
1012
1310
|
environmentId?: string | null | undefined;
|
|
1013
1311
|
providerConfigId?: string | null | undefined;
|
|
1014
1312
|
userId?: string | null | undefined;
|
|
1313
|
+
guardrailResults?: {
|
|
1314
|
+
results: {
|
|
1315
|
+
configId: string;
|
|
1316
|
+
functionId: string;
|
|
1317
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1318
|
+
verdict: boolean;
|
|
1319
|
+
latencyMs: number;
|
|
1320
|
+
}[];
|
|
1321
|
+
action: "allowed" | "blocked" | "logged";
|
|
1322
|
+
totalLatencyMs: number;
|
|
1323
|
+
} | null | undefined;
|
|
1015
1324
|
}> | zod0.ZodSafeParseError<{
|
|
1016
1325
|
requestId: string;
|
|
1017
1326
|
provider: string;
|
|
@@ -1036,6 +1345,17 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
1036
1345
|
environmentId?: string | null | undefined;
|
|
1037
1346
|
providerConfigId?: string | null | undefined;
|
|
1038
1347
|
userId?: string | null | undefined;
|
|
1348
|
+
guardrailResults?: {
|
|
1349
|
+
results: {
|
|
1350
|
+
configId: string;
|
|
1351
|
+
functionId: string;
|
|
1352
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1353
|
+
verdict: boolean;
|
|
1354
|
+
latencyMs: number;
|
|
1355
|
+
}[];
|
|
1356
|
+
action: "allowed" | "blocked" | "logged";
|
|
1357
|
+
totalLatencyMs: number;
|
|
1358
|
+
} | null | undefined;
|
|
1039
1359
|
}>;
|
|
1040
1360
|
/**
|
|
1041
1361
|
* Validate partial data (for updates)
|
|
@@ -1150,6 +1470,22 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1150
1470
|
id?: string | undefined;
|
|
1151
1471
|
createdAt?: Date | undefined;
|
|
1152
1472
|
updatedAt?: Date | undefined;
|
|
1473
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
1474
|
+
providerConfigId?: string | undefined;
|
|
1475
|
+
guardrailConfigId?: string | undefined;
|
|
1476
|
+
enabled?: boolean | undefined;
|
|
1477
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
1478
|
+
id?: string | undefined;
|
|
1479
|
+
createdAt?: Date | undefined;
|
|
1480
|
+
updatedAt?: Date | undefined;
|
|
1481
|
+
}> | zod0.ZodSafeParseError<{
|
|
1482
|
+
providerConfigId?: string | undefined;
|
|
1483
|
+
guardrailConfigId?: string | undefined;
|
|
1484
|
+
enabled?: boolean | undefined;
|
|
1485
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
1486
|
+
id?: string | undefined;
|
|
1487
|
+
createdAt?: Date | undefined;
|
|
1488
|
+
updatedAt?: Date | undefined;
|
|
1153
1489
|
}> | zod0.ZodSafeParseSuccess<{
|
|
1154
1490
|
requestId?: string | undefined;
|
|
1155
1491
|
configId?: string | null | undefined;
|
|
@@ -1171,6 +1507,17 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1171
1507
|
isStreaming?: boolean | undefined;
|
|
1172
1508
|
userId?: string | null | undefined;
|
|
1173
1509
|
tags?: Record<string, string> | undefined;
|
|
1510
|
+
guardrailResults?: {
|
|
1511
|
+
results: {
|
|
1512
|
+
configId: string;
|
|
1513
|
+
functionId: string;
|
|
1514
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1515
|
+
verdict: boolean;
|
|
1516
|
+
latencyMs: number;
|
|
1517
|
+
}[];
|
|
1518
|
+
action: "allowed" | "blocked" | "logged";
|
|
1519
|
+
totalLatencyMs: number;
|
|
1520
|
+
} | null | undefined;
|
|
1174
1521
|
id?: string | undefined;
|
|
1175
1522
|
createdAt?: Date | undefined;
|
|
1176
1523
|
updatedAt?: Date | undefined;
|
|
@@ -1195,6 +1542,17 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1195
1542
|
isStreaming?: boolean | undefined;
|
|
1196
1543
|
userId?: string | null | undefined;
|
|
1197
1544
|
tags?: Record<string, string> | undefined;
|
|
1545
|
+
guardrailResults?: {
|
|
1546
|
+
results: {
|
|
1547
|
+
configId: string;
|
|
1548
|
+
functionId: string;
|
|
1549
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1550
|
+
verdict: boolean;
|
|
1551
|
+
latencyMs: number;
|
|
1552
|
+
}[];
|
|
1553
|
+
action: "allowed" | "blocked" | "logged";
|
|
1554
|
+
totalLatencyMs: number;
|
|
1555
|
+
} | null | undefined;
|
|
1198
1556
|
id?: string | undefined;
|
|
1199
1557
|
createdAt?: Date | undefined;
|
|
1200
1558
|
updatedAt?: Date | undefined;
|
|
@@ -1263,6 +1621,14 @@ declare function parseTableData<T extends TableName>(table: T, data: unknown): {
|
|
|
1263
1621
|
updatedAt: Date;
|
|
1264
1622
|
slug?: string | null | undefined;
|
|
1265
1623
|
name?: string | null | undefined;
|
|
1624
|
+
} | {
|
|
1625
|
+
providerConfigId: string;
|
|
1626
|
+
guardrailConfigId: string;
|
|
1627
|
+
enabled: boolean;
|
|
1628
|
+
id: string;
|
|
1629
|
+
createdAt: Date;
|
|
1630
|
+
updatedAt: Date;
|
|
1631
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
1266
1632
|
} | {
|
|
1267
1633
|
requestId: string;
|
|
1268
1634
|
provider: string;
|
|
@@ -1287,6 +1653,17 @@ declare function parseTableData<T extends TableName>(table: T, data: unknown): {
|
|
|
1287
1653
|
environmentId?: string | null | undefined;
|
|
1288
1654
|
providerConfigId?: string | null | undefined;
|
|
1289
1655
|
userId?: string | null | undefined;
|
|
1656
|
+
guardrailResults?: {
|
|
1657
|
+
results: {
|
|
1658
|
+
configId: string;
|
|
1659
|
+
functionId: string;
|
|
1660
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1661
|
+
verdict: boolean;
|
|
1662
|
+
latencyMs: number;
|
|
1663
|
+
}[];
|
|
1664
|
+
action: "allowed" | "blocked" | "logged";
|
|
1665
|
+
totalLatencyMs: number;
|
|
1666
|
+
} | null | undefined;
|
|
1290
1667
|
};
|
|
1291
1668
|
/**
|
|
1292
1669
|
* Parse partial data, throws on error
|
|
@@ -1346,6 +1723,14 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
1346
1723
|
id?: string | undefined;
|
|
1347
1724
|
createdAt?: Date | undefined;
|
|
1348
1725
|
updatedAt?: Date | undefined;
|
|
1726
|
+
} | {
|
|
1727
|
+
providerConfigId?: string | undefined;
|
|
1728
|
+
guardrailConfigId?: string | undefined;
|
|
1729
|
+
enabled?: boolean | undefined;
|
|
1730
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
1731
|
+
id?: string | undefined;
|
|
1732
|
+
createdAt?: Date | undefined;
|
|
1733
|
+
updatedAt?: Date | undefined;
|
|
1349
1734
|
} | {
|
|
1350
1735
|
requestId?: string | undefined;
|
|
1351
1736
|
configId?: string | null | undefined;
|
|
@@ -1367,6 +1752,17 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
1367
1752
|
isStreaming?: boolean | undefined;
|
|
1368
1753
|
userId?: string | null | undefined;
|
|
1369
1754
|
tags?: Record<string, string> | undefined;
|
|
1755
|
+
guardrailResults?: {
|
|
1756
|
+
results: {
|
|
1757
|
+
configId: string;
|
|
1758
|
+
functionId: string;
|
|
1759
|
+
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1760
|
+
verdict: boolean;
|
|
1761
|
+
latencyMs: number;
|
|
1762
|
+
}[];
|
|
1763
|
+
action: "allowed" | "blocked" | "logged";
|
|
1764
|
+
totalLatencyMs: number;
|
|
1765
|
+
} | null | undefined;
|
|
1370
1766
|
id?: string | undefined;
|
|
1371
1767
|
createdAt?: Date | undefined;
|
|
1372
1768
|
updatedAt?: Date | undefined;
|
|
@@ -1486,4 +1882,4 @@ declare function detectDatabaseType(db: unknown): DatabaseType | null;
|
|
|
1486
1882
|
*/
|
|
1487
1883
|
declare function createDatabaseFromConnection(rawConnection: any, options?: DatabaseOptions): Promise<Kysely<Database> | null>;
|
|
1488
1884
|
//#endregion
|
|
1489
|
-
export {
|
|
1885
|
+
export { environmentsSchema as $, GuardrailResults as A, TableName as B, Environment as C, GuardrailConfig as D, EnvironmentsTable as E, ProviderConfigsTable as F, VariantVersion as G, TargetingRulesTable as H, ProviderGuardrailOverride as I, WorkspaceSettings as J, VariantVersionsTable as K, ProviderGuardrailOverridesTable as L, LLMRequest as M, LLMRequestsTable as N, GuardrailConfigsTable as O, ProviderConfig as P, environmentSecretsSchema as Q, SCHEMA_METADATA as R, Database as S, EnvironmentSecretsTable as T, Updateable as U, TargetingRule as V, Variant as W, configVariantsSchema as X, WorkspaceSettingsTable as Y, configsSchema as Z, validateTableData as _, createDatabaseFromConnection as a, targetingRulesSchema as at, ConfigVariantsTable as b, executeWithSchema as c, workspaceSettingsSchema as ct, getMigrations as d, guardrailConfigsSchema as et, matchType as f, validatePartialTableData as g, parseTableData as h, createDatabase as i, schemas as it, Insertable as j, GuardrailResult as k, MigrationOptions as l, parsePartialTableData as m, DatabaseOptions as n, providerConfigsSchema as nt, detectDatabaseType as o, variantVersionsSchema as ot, runAutoMigrations as p, VariantsTable as q, DatabaseType as r, providerGuardrailOverridesSchema as rt, createNeonDialect as s, variantsSchema as st, DatabaseConnection as t, llmRequestsSchema as tt, MigrationResult as u, Config as v, EnvironmentSecret as w, ConfigsTable as x, ConfigVariant as y, Selectable as z };
|