Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore(eslint): enable no-deprecated (#13374)

Tobias Wochinger982f745c2f89
diff --git a/packages/config-eslint/base.js b/packages/config-eslint/base.js
index ad137e8be7..1214be0d70 100644
--- a/packages/config-eslint/base.js
+++ b/packages/config-eslint/base.js
@@ -59,6 +59,9 @@ export default tseslint.config(
},
languageOptions: {
parser: tseslint.parser,
+ parserOptions: {
+ projectService: true,
+ },
},
rules: {
"no-undef": "off", // TypeScript handles this
@@ -82,6 +85,7 @@ export default tseslint.config(
ignoreRestSiblings: true,
},
],
+ "@typescript-eslint/no-deprecated": "warn",
},
},
);
diff --git a/packages/config-eslint/next.js b/packages/config-eslint/next.js
index 06e563f358..e818bf9fe7 100644
--- a/packages/config-eslint/next.js
+++ b/packages/config-eslint/next.js
@@ -62,6 +62,9 @@ export default [
name: "langfuse/next/typescript",
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
+ parserOptions: {
+ projectService: true,
+ },
globals: {
React: "readonly",
JSX: "readonly",
@@ -94,6 +97,7 @@ export default [
ignoreRestSiblings: true,
},
],
+ "@typescript-eslint/no-deprecated": "warn",
"react/jsx-key": ["error", { warnOnDuplicates: true }],
"react/no-unused-prop-types": "warn",
},
diff --git a/packages/shared/scripts/seeder/load-seed-clickhouse.ts b/packages/shared/scripts/seeder/load-seed-clickhouse.ts
index b3ce82c604..ad50be03f0 100644
--- a/packages/shared/scripts/seeder/load-seed-clickhouse.ts
+++ b/packages/shared/scripts/seeder/load-seed-clickhouse.ts
@@ -49,13 +49,13 @@ const prepareProjectsAndApiKeys = async (
});
if (!apiKeyExists) {
const sk = await hashSecretKey(
- `sk-${Math.random().toString(36).substr(2, 9)}`,
+ `sk-${Math.random().toString(36).slice(2, 11)}`,
);
await prisma.apiKey.create({
data: {
id: apiKeyId,
note: `API Key for ${projectId}`,
- publicKey: `pk-${Math.random().toString(36).substr(2, 9)}`,
+ publicKey: `pk-${Math.random().toString(36).slice(2, 11)}`,
hashedSecretKey: sk,
displaySecretKey: getDisplaySecretKey(sk),
scope: "PROJECT",
diff --git a/packages/shared/src/domain/automations.ts b/packages/shared/src/domain/automations.ts
index ca4b049c9a..396459efca 100644
--- a/packages/shared/src/domain/automations.ts
+++ b/packages/shared/src/domain/automations.ts
@@ -106,7 +106,7 @@ export type SafeGitHubDispatchActionConfig = z.infer<
export const GitHubDispatchActionCreateSchema = z.object({
type: z.literal("GITHUB_DISPATCH"),
- url: z.string().url().optional(), // Optional for updates, validated in helper
+ url: z.url().optional(), // Optional for updates, validated in helper
eventType: z.string().min(1).max(100).optional(), // Optional for updates, validated in helper
githubToken: z.string().optional(), // Optional for updates, validated in helper
});
diff --git a/packages/shared/src/domain/score-configs.ts b/packages/shared/src/domain/score-configs.ts
index 801b54f17f..59b62e69f5 100644
--- a/packages/shared/src/domain/score-configs.ts
+++ b/packages/shared/src/domain/score-configs.ts
@@ -54,7 +54,7 @@ export const validateCategories = (
for (const category of categories) {
if (uniqueNames.has(category.label)) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: `Duplicate category label: ${category.label}, category labels must be unique`,
});
return;
@@ -63,7 +63,7 @@ export const validateCategories = (
if (uniqueValues.has(category.value)) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: `Duplicate category value: ${category.value}, category values must be unique`,
});
return;
@@ -107,7 +107,7 @@ export const validateNumericRangeFields = (
data.maxValue <= data.minValue
) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: "Maximum value must be greater than Minimum value",
});
}
diff --git a/packages/shared/src/env.ts b/packages/shared/src/env.ts
index 7e452113d5..4acad41860 100644
--- a/packages/shared/src/env.ts
+++ b/packages/shared/src/env.ts
@@ -6,7 +6,7 @@ const EnvSchema = z.object({
NODE_ENV: z
.enum(["development", "test", "production"])
.default("development"),
- NEXTAUTH_URL: z.string().url().optional(),
+ NEXTAUTH_URL: z.url().optional(),
EMAIL_FROM_ADDRESS: z.string().optional(),
SMTP_CONNECTION_URL: z.string().optional(),
CLOUD_CRM_EMAIL: z.string().optional(),
@@ -71,9 +71,9 @@ const EnvSchema = z.object({
.default(20_000),
LANGFUSE_CACHE_PROMPT_ENABLED: z.enum(["true", "false"]).default("true"),
LANGFUSE_CACHE_PROMPT_TTL_SECONDS: z.coerce.number().default(3600), // 1h
- CLICKHOUSE_URL: z.string().url(),
- CLICKHOUSE_READ_ONLY_URL: z.string().url().optional(),
- CLICKHOUSE_EVENTS_READ_ONLY_URL: z.string().url().optional(),
+ CLICKHOUSE_URL: z.url(),
+ CLICKHOUSE_READ_ONLY_URL: z.url().optional(),
+ CLICKHOUSE_EVENTS_READ_ONLY_URL: z.url().optional(),
CLICKHOUSE_CLUSTER_NAME: z.string().default("default"),
CLICKHOUSE_DB: z.string().default("default"),
CLICKHOUSE_USER: z.string(),
@@ -382,7 +382,7 @@ const EnvSchema = z.object({
LANGFUSE_EE_LICENSE_KEY: z.string().optional(),
// Ingestion Masking (EE feature)
- LANGFUSE_INGESTION_MASKING_CALLBACK_URL: z.string().url().optional(),
+ LANGFUSE_INGESTION_MASKING_CALLBACK_URL: z.url().optional(),
LANGFUSE_INGESTION_MASKING_CALLBACK_TIMEOUT_MS: z.coerce
.number()
.positive()
diff --git a/packages/shared/src/features/batchAction/types.ts b/packages/shared/src/features/batchAction/types.ts
index 2be4a011f3..ab134e913c 100644
--- a/packages/shared/src/features/batchAction/types.ts
+++ b/packages/shared/src/features/batchAction/types.ts
@@ -28,7 +28,7 @@ export enum ActionId {
ExperimentCompare = "experiment-compare",
}
-const ActionIdSchema = z.nativeEnum(ActionId);
+const ActionIdSchema = z.enum(ActionId);
export const BatchActionQuerySchema = z.object({
filter: z.array(singleFilter).nullable(),
diff --git a/packages/shared/src/features/evals/outputDefinition.ts b/packages/shared/src/features/evals/outputDefinition.ts
index 5068c77d94..6af2de4c1b 100644
--- a/packages/shared/src/features/evals/outputDefinition.ts
+++ b/packages/shared/src/features/evals/outputDefinition.ts
@@ -106,14 +106,14 @@ export const CategoricalEvalOutputDefinitionV2Schema = z
switch (violation.type) {
case "minimum_count":
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: getMinimumCategoricalCategoriesMessage(),
path: ["score", "categories"],
});
return;
case "duplicate_value":
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: "Categories must be unique",
path: ["score", "categories", violation.index],
});
@@ -293,7 +293,7 @@ function buildResultSchemaForResolvedOutputDefinition(
.superRefine((categories, ctx) => {
if (new Set(categories).size !== categories.length) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: "Score categories must be unique",
});
}
diff --git a/packages/shared/src/features/prompts/types.ts b/packages/shared/src/features/prompts/types.ts
index ea5228ef20..b440fae2ed 100644
--- a/packages/shared/src/features/prompts/types.ts
+++ b/packages/shared/src/features/prompts/types.ts
@@ -83,8 +83,8 @@ export const GetPromptsMetaSchema = z.object({
tag: z.string().optional(),
page: z.coerce.number().int().min(1).default(1),
limit: z.coerce.number().int().min(1).max(100).default(10),
- fromUpdatedAt: z.string().datetime({ offset: true }).nullish(),
- toUpdatedAt: z.string().datetime({ offset: true }).nullish(),
+ fromUpdatedAt: z.iso.datetime({ offset: true }).nullish(),
+ toUpdatedAt: z.iso.datetime({ offset: true }).nullish(),
});
export type GetPromptsMetaType = z.infer<typeof GetPromptsMetaSchema>;
diff --git a/packages/shared/src/features/scores/interfaces/api/v1/validation.ts b/packages/shared/src/features/scores/interfaces/api/v1/validation.ts
index 556f588514..9ea441ae50 100644
--- a/packages/shared/src/features/scores/interfaces/api/v1/validation.ts
+++ b/packages/shared/src/features/scores/interfaces/api/v1/validation.ts
@@ -1,15 +1,7 @@
import z from "zod";
import { GetScoreResponseDataV1 } from "./endpoints";
-/**
- * @deprecated
- * Use `filterAndValidateV2GetScoreList` instead. This function is only used for the legacy v1 API where scores were only associated with traces.
- * Use this function when pulling a list of scores from the database before returning to the public API to ensure type safety.
- * All scores are expected to pass the validation. If a score fails validation, it will be logged to Otel.
- * @param scores
- * @returns list of validated scores with trace information
- */
-export const filterAndValidateV1GetScoreList = (
+export const filterAndValidateLegacyV1GetScoreList = (
scores: unknown[],
onParseError?: (error: z.ZodError) => void,
@@ -27,3 +19,14 @@ export const filterAndValidateV1GetScoreList = (
},
[] as z.infer<typeof GetScoreResponseDataV1>[],
);
+
+/**
+ * @deprecated
+ * Use `filterAndValidateV2GetScoreList` instead. This function is only used for the legacy v1 API where scores were only associated with traces.
+ * Use this function when pulling a list of scores from the database before returning to the public API to ensure type safety.
+ * All scores are expected to pass the validation. If a score fails validation, it will be logged to Otel.
+ * @param scores
+ * @returns list of validated scores with trace information
+ */
+export const filterAndValidateV1GetScoreList =
+ filterAndValidateLegacyV1GetScoreList;
diff --git a/packages/shared/src/features/scores/interfaces/application/validation.ts b/packages/shared/src/features/scores/interfaces/application/validation.ts
index 0e027f29ff..3fa6f6fe72 100644
--- a/packages/shared/src/features/scores/interfaces/application/validation.ts
+++ b/packages/shared/src/features/scores/interfaces/application/validation.ts
@@ -79,15 +79,7 @@ type ValidatedAPITraceScore<IncludeHasMetadata extends boolean> = APIScoreV1 & {
hasMetadata: IncludeHasMetadata extends true ? boolean : never;
};
-/**
- * @deprecated
- * Use `filterAndValidateDbScoreList` instead. This function is only used for the legacy v1 API where scores were only associated with traces.
- * Use this function when pulling a list of scores from the database before using in the application to ensure type safety.
- * All scores are expected to pass the validation. If a score fails validation, it will be logged to Otel.
- * @param scores
- * @returns list of validated scores
- */
-export const filterAndValidateDbTraceScoreList = <
+export const filterAndValidateDbLegacyTraceScoreList = <
IncludeHasMetadata extends boolean,
>({
scores,
@@ -114,3 +106,14 @@ export const filterAndValidateDbTraceScoreList = <
return acc;
}, [] as ValidatedAPITraceScore<IncludeHasMetadata>[]);
};
+
+/**
+ * @deprecated
+ * Use `filterAndValidateDbScoreList` instead. This function is only used for the legacy v1 API where scores were only associated with traces.
+ * Use this function when pulling a list of scores from the database before using in the application to ensure type safety.
+ * All scores are expected to pass the validation. If a score fails validation, it will be logged to Otel.
+ * @param scores
+ * @returns list of validated scores
+ */
+export const filterAndValidateDbTraceScoreList =
+ filterAndValidateDbLegacyTraceScoreList;
diff --git a/packages/shared/src/features/scores/interfaces/ingestion/validation.ts b/packages/shared/src/features/scores/interfaces/ingestion/validation.ts
index 737992e79a..e3e9223e95 100644
--- a/packages/shared/src/features/scores/interfaces/ingestion/validation.ts
+++ b/packages/shared/src/features/scores/interfaces/ingestion/validation.ts
@@ -52,13 +52,13 @@ const ScorePropsAgainstConfigNumeric = z
.superRefine((data, ctx) => {
if (isPresent(data.maxValue) && data.value > data.maxValue) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: `Value exceeds maximum value of ${data.maxValue} defined in config`,
});
}
if (isPresent(data.minValue) && data.value < data.minValue) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: `Value is below minimum value of ${data.minValue} defined in config`,
});
}
@@ -73,7 +73,7 @@ const ScorePropsAgainstConfigCategorical = z
.superRefine((data, ctx) => {
if (!data.categories.some(({ label }) => label === data.value)) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: `Value ${data.value} does not map to a valid category. Pass a valid category value.`,
});
}
diff --git a/packages/shared/src/interfaces/filters.ts b/packages/shared/src/interfaces/filters.ts
index f1a713264d..fa2be0df55 100644
--- a/packages/shared/src/interfaces/filters.ts
+++ b/packages/shared/src/interfaces/filters.ts
@@ -95,7 +95,7 @@ export const positionInTraceFilter = z
const needsValue = data.key === "nthFromEnd" || data.key === "nthFromStart";
if (needsValue && (!data.value || data.value < 1)) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: "Position must be >= 1 for nth selection",
path: ["value"],
});
diff --git a/packages/shared/src/server/auth/types.ts b/packages/shared/src/server/auth/types.ts
index 3f67ba09d3..6c7535f1eb 100644
--- a/packages/shared/src/server/auth/types.ts
+++ b/packages/shared/src/server/auth/types.ts
@@ -8,9 +8,9 @@ const ApiKeyBaseSchema = z.object({
note: z.string().nullable(),
publicKey: z.string(),
displaySecretKey: z.string(),
- createdAt: z.string().datetime().nullable(),
- lastUsedAt: z.string().datetime().nullable(),
- expiresAt: z.string().datetime().nullable(),
+ createdAt: z.iso.datetime().nullable(),
+ lastUsedAt: z.iso.datetime().nullable(),
+ expiresAt: z.iso.datetime().nullable(),
fastHashedSecretKey: z.string(),
hashedSecretKey: z.string(),
orgId: z.string(),
diff --git a/packages/shared/src/server/ingestion/types.ts b/packages/shared/src/server/ingestion/types.ts
index 132c60623a..c8aaf77506 100644
--- a/packages/shared/src/server/ingestion/types.ts
+++ b/packages/shared/src/server/ingestion/types.ts
@@ -40,7 +40,7 @@ const MixedUsage = z.object({
totalCost: z.number().nullish(),
});
-export const stringDateTime = z.string().datetime({ offset: true }).nullish();
+export const stringDateTime = z.iso.datetime({ offset: true }).nullish();
export const usage = MixedUsage.nullish()
// transform mixed usage model input to new one
@@ -596,7 +596,7 @@ const createAllIngestionSchemas = ({
// Event schemas
const base = z.object({
id: idSchema,
- timestamp: z.string().datetime({ offset: true }),
+ timestamp: z.iso.datetime({ offset: true }),
metadata: jsonSchema.nullish(),
});
@@ -806,6 +806,7 @@ export const ingestionEvent = publicSchemas.ingestionEvent;
* since the factory patterns only differ in environment validation rules, not in the actual TypeScript types.
* The environment field remains `string` in all cases - only the validation logic differs.
*/
+// eslint-disable-next-line @typescript-eslint/no-deprecated -- Internal backwards-compatible ingestion schema alias.
export type IngestionEventType = z.infer<typeof ingestionEvent>;
export type TraceEventType = z.infer<typeof traceEvent>;
export type ScoreEventType = z.infer<typeof scoreEvent>;
diff --git a/packages/shared/src/server/llm/fetchLLMCompletion.ts b/packages/shared/src/server/llm/fetchLLMCompletion.ts
index a2fdb59149..630459c99e 100644
--- a/packages/shared/src/server/llm/fetchLLMCompletion.ts
+++ b/packages/shared/src/server/llm/fetchLLMCompletion.ts
@@ -1,4 +1,4 @@
-import { type ZodSchema, z } from "zod";
+import { type ZodType, z } from "zod";
import { ChatAnthropic, ChatAnthropicInput } from "@langchain/anthropic";
import { ChatVertexAI } from "@langchain/google-vertexai";
@@ -156,7 +156,7 @@ type LLMCompletionParams = {
baseURL?: string | null;
config?: Record<string, string> | null;
};
- structuredOutputSchema?: ZodSchema | LLMJSONSchema;
+ structuredOutputSchema?: ZodType | LLMJSONSchema;
callbacks?: BaseCallbackHandler[];
maxRetries?: number;
traceSinkParams?: TraceSinkParams;
@@ -183,7 +183,7 @@ export async function fetchLLMCompletion(
export async function fetchLLMCompletion(
params: LLMCompletionParams & {
streaming: false;
- structuredOutputSchema: ZodSchema;
+ structuredOutputSchema: ZodType;
},
): Promise<Record<string, unknown>>;
diff --git a/packages/shared/src/server/llm/types.ts b/packages/shared/src/server/llm/types.ts
index e95cdf7fda..a6935a24d1 100644
--- a/packages/shared/src/server/llm/types.ts
+++ b/packages/shared/src/server/llm/types.ts
@@ -23,7 +23,7 @@ export const JSONSchemaFormSchema = z
return parsed;
} catch {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: "Parameters must be valid JSON",
});
return z.NEVER;
@@ -37,7 +37,7 @@ export const JSONSchemaFormSchema = z
required: z.array(z.string()).optional(),
additionalProperties: z.boolean().optional(),
})
- .passthrough()
+ .loose()
.transform((data) => JSON.stringify(data, null, 2)),
);
@@ -504,7 +504,7 @@ export const supportedModels = {
export type LLMFunctionCall = {
name: string;
description: string;
- parameters: z.ZodTypeAny; // this has to be a json schema for OpenAI
+ parameters: z.ZodType; // this has to be a json schema for OpenAI
};
export const LLMApiKeySchema = z
diff --git a/packages/shared/src/server/redis/blobStorageIntegrationQueue.ts b/packages/shared/src/server/redis/blobStorageIntegrationQueue.ts
index 6d22ee360f..ece20fd7fc 100644
--- a/packages/shared/src/server/redis/blobStorageIntegrationQueue.ts
+++ b/packages/shared/src/server/redis/blobStorageIntegrationQueue.ts
@@ -42,10 +42,11 @@ export class BlobStorageIntegrationQueue {
if (BlobStorageIntegrationQueue.instance) {
logger.debug("Scheduling jobs for BlobStorageIntegrationQueue");
- // Remove the old hourly cron pattern — BullMQ keys repeatable jobs by
+ // Remove the old hourly cron pattern - BullMQ keys repeatable jobs by
// name + pattern, so changing the pattern creates a second schedule
// while the old one keeps firing.
BlobStorageIntegrationQueue.instance
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- Existing repeatable-job cleanup; job scheduler migration should be handled separately.
.removeRepeatable(QueueJobs.BlobStorageIntegrationJob, {
pattern: "20 * * * *",
})
diff --git a/packages/shared/src/server/repositories/definitions.ts b/packages/shared/src/server/repositories/definitions.ts
index 839280562a..1fd329e5c6 100644
--- a/packages/shared/src/server/repositories/definitions.ts
+++ b/packages/shared/src/server/repositories/definitions.ts
@@ -6,7 +6,7 @@ export const clickhouseStringDateSchema = z
// clickhouse stores UTC like '2024-05-23 18:33:41.602000'
// we need to convert it to '2024-05-23T18:33:41.602000Z'
.transform((str) => str.replace(" ", "T") + "Z")
- .pipe(z.string().datetime());
+ .pipe(z.iso.datetime());
//https://clickhouse.com/docs/en/integrations/javascript#integral-types-int64-int128-int256-uint64-uint128-uint256
// clickhouse returns int64 as string
@@ -19,7 +19,7 @@ export const UsageCostSchema = z
const parsed = Number(val[key]);
if (isNaN(parsed)) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: `Key ${key} is not a number`,
});
} else {
diff --git a/packages/shared/src/server/services/email/blobStorageExportFailed/sendBlobStorageExportFailedEmail.ts b/packages/shared/src/server/services/email/blobStorageExportFailed/sendBlobStorageExportFailedEmail.ts
index 02499b896c..4672496604 100644
--- a/packages/shared/src/server/services/email/blobStorageExportFailed/sendBlobStorageExportFailedEmail.ts
+++ b/packages/shared/src/server/services/email/blobStorageExportFailed/sendBlobStorageExportFailedEmail.ts
@@ -61,7 +61,7 @@ export const sendBlobStorageExportFailedEmail = async ({
};
if (env.CLOUD_CRM_EMAIL) {
- const emailSchema = z.string().email();
+ const emailSchema = z.email();
const validationResult = emailSchema.safeParse(env.CLOUD_CRM_EMAIL);
if (validationResult.success) {
diff --git a/packages/shared/src/server/services/email/evaluatorBlocked/sendEvaluatorBlockedEmail.ts b/packages/shared/src/server/services/email/evaluatorBlocked/sendEvaluatorBlockedEmail.ts
index bd3e6f04e5..70217e2764 100644
--- a/packages/shared/src/server/services/email/evaluatorBlocked/sendEvaluatorBlockedEmail.ts
+++ b/packages/shared/src/server/services/email/evaluatorBlocked/sendEvaluatorBlockedEmail.ts
@@ -69,7 +69,7 @@ export const sendEvaluatorBlockedEmail = async ({
};
if (env.CLOUD_CRM_EMAIL) {
- const emailSchema = z.string().email();
+ const emailSchema = z.email();
const validationResult = emailSchema.safeParse(env.CLOUD_CRM_EMAIL);
if (validationResult.success) {
diff --git a/packages/shared/src/server/services/email/usageThresholdSuspension/sendUsageThresholdSuspensionEmail.ts b/packages/shared/src/server/services/email/usageThresholdSuspension/sendUsageThresholdSuspensionEmail.ts
index e299d27a43..27ff85ce08 100644
--- a/packages/shared/src/server/services/email/usageThresholdSuspension/sendUsageThresholdSuspensionEmail.ts
+++ b/packages/shared/src/server/services/email/usageThresholdSuspension/sendUsageThresholdSuspensionEmail.ts
@@ -70,7 +70,7 @@ export const sendUsageThresholdSuspensionEmail = async ({
// Add BCC if configured (optional, for CRM integration)
if (env.CLOUD_CRM_EMAIL) {
// Validate email format to prevent email header injection
- const emailSchema = z.string().email();
+ const emailSchema = z.email();
const validationResult = emailSchema.safeParse(env.CLOUD_CRM_EMAIL);
if (validationResult.success) {
diff --git a/packages/shared/src/server/services/email/usageThresholdWarning/sendUsageThresholdWarningEmail.ts b/packages/shared/src/server/services/email/usageThresholdWarning/sendUsageThresholdWarningEmail.ts
index fd92288924..e4a22ad60a 100644
--- a/packages/shared/src/server/services/email/usageThresholdWarning/sendUsageThresholdWarningEmail.ts
+++ b/packages/shared/src/server/services/email/usageThresholdWarning/sendUsageThresholdWarningEmail.ts
@@ -68,7 +68,7 @@ export const sendUsageThresholdWarningEmail = async ({
// Add BCC if configured (optional, for CRM integration)
if (env.CLOUD_CRM_EMAIL) {
// Validate email format to prevent email header injection
- const emailSchema = z.string().email();
+ const emailSchema = z.email();
const validationResult = emailSchema.safeParse(env.CLOUD_CRM_EMAIL);
if (validationResult.success) {
diff --git a/packages/shared/src/utils/IORepresentation/chatML/types.ts b/packages/shared/src/utils/IORepresentation/chatML/types.ts
index 18e24fb96c..22089500e4 100644
--- a/packages/shared/src/utils/IORepresentation/chatML/types.ts
+++ b/packages/shared/src/utils/IORepresentation/chatML/types.ts
@@ -52,7 +52,7 @@ export const MediaReferenceStringSchema = z
const match = str.match(magicStringPattern);
if (!match) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: "Invalid langfuseMedia magic string format",
});
return z.NEVER;
@@ -71,7 +71,7 @@ export const MediaReferenceStringSchema = z
metadata[key.trim()] = value.trim();
} else {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: `Invalid key-value pair: ${part}`,
});
return z.NEVER;
@@ -240,7 +240,7 @@ export const BaseChatMlMessageSchema = z
thinking: z.array(ThinkingContentPartSchema).optional(),
redacted_thinking: z.array(RedactedThinkingContentPartSchema).optional(),
})
- .passthrough();
+ .loose();
/**
* Minimal ChatML message schema for backend content extraction.
diff --git a/packages/shared/src/utils/typeChecks.ts b/packages/shared/src/utils/typeChecks.ts
index c4cc71bc0b..81331f818a 100644
--- a/packages/shared/src/utils/typeChecks.ts
+++ b/packages/shared/src/utils/typeChecks.ts
@@ -3,4 +3,4 @@ import { z } from "zod";
export const isPresent = <T>(value: T | null | undefined): value is T =>
value !== null && value !== undefined && value !== "";
-export const stringDateTime = z.string().datetime({ offset: true }).nullish();
+export const stringDateTime = z.iso.datetime({ offset: true }).nullish();
diff --git a/packages/shared/src/utils/zod.ts b/packages/shared/src/utils/zod.ts
index 0e986adb1e..0e8333e1ef 100644
--- a/packages/shared/src/utils/zod.ts
+++ b/packages/shared/src/utils/zod.ts
@@ -106,7 +106,7 @@ export const StringNoHTMLNonEmpty = z
* @param object - The object to be validated.
* @returns The parsed object if validation is successful.
*/
-export const validateZodSchema = <T extends z.ZodTypeAny>(
+export const validateZodSchema = <T extends z.ZodType>(
schema: T,
object: z.infer<T>,
): z.infer<T> => {
@@ -116,7 +116,7 @@ export const validateZodSchema = <T extends z.ZodTypeAny>(
// JSON Schema validation
export const JSONPrimitiveValueSchema = z.union([
z.string(),
- z.number().finite(),
+ z.number(),
z.boolean(),
]);
diff --git a/web/eslint.config.mjs b/web/eslint.config.mjs
index 765fa4bbb2..7373a9fb91 100644
--- a/web/eslint.config.mjs
+++ b/web/eslint.config.mjs
@@ -12,11 +12,12 @@ export default [
{
patterns: [
{
- group: [
- "react-icons",
- "react-icons/!(si|tb)",
- "react-icons/!(si|tb)/*",
- ],
+ regex: "^react-icons$",
+ message:
+ "Only react-icons/si and react-icons/tb are allowed. Please use lucide-react for other icons.",
+ },
+ {
+ regex: "^react-icons/(?!si(?:/|$)|tb(?:/|$)).*",
message:
"Only react-icons/si and react-icons/tb are allowed. Please use lucide-react for other icons.",
},
@@ -25,16 +26,4 @@ export default [
],
},
},
-
- // Exceptions for specific files
- {
- name: "langfuse/web/react-icons-exceptions",
- files: [
- "src/components/nav/support-menu-dropdown.tsx",
- "src/pages/auth/sign-in.tsx",
- ],
- rules: {
- "no-restricted-imports": "off",
- },
- },
];
diff --git a/web/src/__tests__/server/llm-connections-api.servertest.ts b/web/src/__tests__/server/llm-connections-api.servertest.ts
index 1c9039146f..68d2d93f0f 100644
--- a/web/src/__tests__/server/llm-connections-api.servertest.ts
+++ b/web/src/__tests__/server/llm-connections-api.servertest.ts
@@ -14,7 +14,7 @@ import { encrypt } from "@langfuse/shared/encryption";
// Generate truly unique provider names for tests to avoid conflicts
const generateUniqueProvider = (baseName: string) =>
- `${baseName}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
+ `${baseName}-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
describe("/api/public/llm-connections API Endpoints", () => {
let auth: string;
diff --git a/web/src/__tests__/server/memberships-api.servertest.ts b/web/src/__tests__/server/memberships-api.servertest.ts
index 7ca2e7fea7..8adfab47de 100644
--- a/web/src/__tests__/server/memberships-api.servertest.ts
+++ b/web/src/__tests__/server/memberships-api.servertest.ts
@@ -15,7 +15,7 @@ import {
const MembershipResponseSchema = z.object({
userId: z.string(),
role: z.enum(Role),
- email: z.string().email(),
+ email: z.email(),
name: z.string().nullable(),
});
diff --git a/web/src/__tests__/server/organizations-api.servertest.ts b/web/src/__tests__/server/organizations-api.servertest.ts
index 9740cce152..c14ee433fd 100644
--- a/web/src/__tests__/server/organizations-api.servertest.ts
+++ b/web/src/__tests__/server/organizations-api.servertest.ts
@@ -15,15 +15,15 @@ const OrganizationProjectSchema = z.object({
id: z.string(),
name: z.string(),
metadata: z.record(z.string(), z.unknown()).nullable(),
- createdAt: z.string().datetime(),
- updatedAt: z.string().datetime(),
+ createdAt: z.iso.datetime(),
+ updatedAt: z.iso.datetime(),
});
// Schema for organization response
const OrganizationResponseSchema = z.object({
id: z.string(),
name: z.string(),
- createdAt: z.string().datetime(),
+ createdAt: z.iso.datetime(),
metadata: z.object({}),
projects: z.array(OrganizationProjectSchema),
});
@@ -41,7 +41,7 @@ const DeleteResponseSchema = z.object({
// Schema for API key response
const ApiKeyResponseSchema = z.object({
id: z.string(),
- createdAt: z.string().datetime(),
+ createdAt: z.iso.datetime(),
publicKey: z.string(),
secretKey: z.string(),
displaySecretKey: z.string(),
@@ -53,9 +53,9 @@ const ApiKeyListSchema = z.object({
apiKeys: z.array(
z.object({
id: z.string(),
- createdAt: z.string().datetime(),
- expiresAt: z.string().datetime().nullable(),
- lastUsedAt: z.string().datetime().nullable(),
+ createdAt: z.iso.datetime(),
+ expiresAt: z.iso.datetime().nullable(),
+ lastUsedAt: z.iso.datetime().nullable(),
note: z.string().nullable(),
publicKey: z.string(),
displaySecretKey: z.string(),
diff --git a/web/src/__tests__/test-utils.ts b/web/src/__tests__/test-utils.ts
index 7602121532..2f40d497e0 100644
--- a/web/src/__tests__/test-utils.ts
+++ b/web/src/__tests__/test-utils.ts
@@ -225,7 +225,7 @@ export async function makeAPICall<T = IngestionAPIResponse>(
}
}
-export async function makeZodVerifiedAPICall<T extends z.ZodTypeAny>(
+export async function makeZodVerifiedAPICall<T extends z.ZodType>(
responseZodSchema: T,
method: "POST" | "GET" | "PUT" | "DELETE" | "PATCH",
url: string,
@@ -249,7 +249,7 @@ export async function makeZodVerifiedAPICall<T extends z.ZodTypeAny>(
return { body: resBody, status };
}
-export async function makeZodVerifiedAPICallSilent<T extends z.ZodTypeAny>(
+export async function makeZodVerifiedAPICallSilent<T extends z.ZodType>(
responseZodSchema: T,
method: "POST" | "GET" | "PUT" | "DELETE" | "PATCH",
url: string,
diff --git a/web/src/components/VersionLabel.tsx b/web/src/components/VersionLabel.tsx
index f777d43841..6e17f80e1b 100644
--- a/web/src/components/VersionLabel.tsx
+++ b/web/src/components/VersionLabel.tsx
@@ -1,12 +1,12 @@
import {
ArrowUp10,
BadgeCheck,
- Github,
HardDriveDownload,
Info,
Map,
Newspaper,
} from "lucide-react";
+import { SiGithub } from "react-icons/si";
import { VERSION } from "@/src/constants";
import Link from "next/link";
import {
@@ -132,7 +132,7 @@ export const VersionLabel = ({ className }: { className?: string }) => {
href="https://github.com/langfuse/langfuse/releases"
target="_blank"
>
- <Github size={16} className="mr-2" />
+ <SiGithub size={16} className="mr-2" />
Releases
</Link>
</DropdownMenuItem>
diff --git a/web/src/components/date-picker.tsx b/web/src/components/date-picker.tsx
index 6eb485554f..b80cd6631e 100644
--- a/web/src/components/date-picker.tsx
+++ b/web/src/components/date-picker.tsx
@@ -212,7 +212,7 @@ export function DatePickerWithRange({
</PopoverTrigger>
<PopoverContent className="w-auto p-0" align="start">
<Calendar
- initialFocus={true}
+ autoFocus={true}
mode="range"
defaultMonth={internalDateRange?.from}
selected={internalDateRange}
diff --git a/web/src/components/editor/CodeMirrorEditor.tsx b/web/src/components/editor/CodeMirrorEditor.tsx
index 43137c42f7..bf33a6c939 100644
--- a/web/src/components/editor/CodeMirrorEditor.tsx
+++ b/web/src/components/editor/CodeMirrorEditor.tsx
@@ -17,12 +17,7 @@ import { json, jsonParseLinter } from "@codemirror/lang-json";
import { linter, type Diagnostic } from "@codemirror/lint";
import { useTheme } from "next-themes";
import { cn } from "@/src/utils/tailwind";
-import {
- useState,
- useCallback,
- type MutableRefObject,
- type RefObject,
-} from "react";
+import { useState, useCallback, type RefObject } from "react";
import { LanguageSupport, StreamLanguage } from "@codemirror/language";
import type { StringStream } from "@codemirror/language";
import {
@@ -408,8 +403,7 @@ export function CodeMirrorEditor({
const handleEditorRef = useCallback(
(instance: ReactCodeMirrorRef | null) => {
if (editorRef) {
- (editorRef as MutableRefObject<ReactCodeMirrorRef | null>).current =
- instance;
+ (editorRef as RefObject<ReactCodeMirrorRef | null>).current = instance;
}
if (instance) {
diff --git a/web/src/components/layouts/overview-panel.tsx b/web/src/components/layouts/overview-panel.tsx
index aad3109a33..5b625e9b3b 100644
--- a/web/src/components/layouts/overview-panel.tsx
+++ b/web/src/components/layouts/overview-panel.tsx
@@ -18,7 +18,7 @@ interface OverviewPanelToggleProps extends React.ComponentPropsWithoutRef<
}
const OverviewPanelToggle = React.forwardRef<
- React.ElementRef<typeof Button>,
+ React.ComponentRef<typeof Button>,
OverviewPanelToggleProps
>(({ open, onOpenChange, className, ...props }, ref) => (
<Button
diff --git a/web/src/components/ui/PrettyJsonView.tsx b/web/src/components/ui/PrettyJsonView.tsx
index af9b387fb1..9e1a25ebd9 100644
--- a/web/src/components/ui/PrettyJsonView.tsx
+++ b/web/src/components/ui/PrettyJsonView.tsx
@@ -543,7 +543,7 @@ function JsonPrettyTable({
showObservationTypeBadge = false,
}: {
data: JsonTableRow[];
- expandAllRef?: React.MutableRefObject<(() => void) | null>;
+ expandAllRef?: React.RefObject<(() => void) | null>;
onExpandStateChange?: (allExpanded: boolean) => void;
noBorder?: boolean;
expanded: ExpandedState;
diff --git a/web/src/components/ui/accordion.tsx b/web/src/components/ui/accordion.tsx
index e737b442ed..01a5c0784e 100644
--- a/web/src/components/ui/accordion.tsx
+++ b/web/src/components/ui/accordion.tsx
@@ -9,7 +9,7 @@ import { cn } from "@/src/utils/tailwind";
const Accordion = AccordionPrimitive.Root;
const AccordionItem = React.forwardRef<
- React.ElementRef<typeof AccordionPrimitive.Item>,
+ React.ComponentRef<typeof AccordionPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
>(({ className, ...props }, ref) => (
<AccordionPrimitive.Item
@@ -21,7 +21,7 @@ const AccordionItem = React.forwardRef<
AccordionItem.displayName = "AccordionItem";
const AccordionTrigger = React.forwardRef<
- React.ElementRef<typeof AccordionPrimitive.Trigger>,
+ React.ComponentRef<typeof AccordionPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
>(({ className, children, ...props }, ref) => (
<AccordionPrimitive.Header className="flex">
@@ -41,7 +41,7 @@ const AccordionTrigger = React.forwardRef<
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
const AccordionContent = React.forwardRef<
- React.ElementRef<typeof AccordionPrimitive.Content>,
+ React.ComponentRef<typeof AccordionPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
>(({ className, children, ...props }, ref) => (
<AccordionPrimitive.Content
diff --git a/web/src/components/ui/alert-dialog.tsx b/web/src/components/ui/alert-dialog.tsx
index 815cd6e8d1..4600e2225a 100644
--- a/web/src/components/ui/alert-dialog.tsx
+++ b/web/src/components/ui/alert-dialog.tsx
@@ -13,7 +13,7 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
const AlertDialogPortal = AlertDialogPrimitive.Portal;
const AlertDialogOverlay = React.forwardRef<
- React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
+ React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
>(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Overlay
@@ -28,7 +28,7 @@ const AlertDialogOverlay = React.forwardRef<
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
const AlertDialogContent = React.forwardRef<
- React.ElementRef<typeof AlertDialogPrimitive.Content>,
+ React.ComponentRef<typeof AlertDialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
>(({ className, ...props }, ref) => (
<AlertDialogPortal>
@@ -74,7 +74,7 @@ const AlertDialogFooter = ({
AlertDialogFooter.displayName = "AlertDialogFooter";
const AlertDialogTitle = React.forwardRef<
- React.ElementRef<typeof AlertDialogPrimitive.Title>,
+ React.ComponentRef<typeof AlertDialogPrimitive.Title>,
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
>(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Title
@@ -86,7 +86,7 @@ const AlertDialogTitle = React.forwardRef<
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
const AlertDialogDescription = React.forwardRef<
- React.ElementRef<typeof AlertDialogPrimitive.Description>,
+ React.ComponentRef<typeof AlertDialogPrimitive.Description>,
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
>(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Description
@@ -99,7 +99,7 @@ AlertDialogDescription.displayName =
AlertDialogPrimitive.Description.displayName;
const AlertDialogAction = React.forwardRef<
- React.ElementRef<typeof AlertDialogPrimitive.Action>,
+ React.ComponentRef<typeof AlertDialogPrimitive.Action>,
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
>(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Action
@@ -111,7 +111,7 @@ const AlertDialogAction = React.forwardRef<
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
const AlertDialogCancel = React.forwardRef<
- React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
+ React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
>(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Cancel
diff --git a/web/src/components/ui/avatar.tsx b/web/src/components/ui/avatar.tsx
index aa90b84bab..5cdf32f2d3 100644
--- a/web/src/components/ui/avatar.tsx
+++ b/web/src/components/ui/avatar.tsx
@@ -6,7 +6,7 @@ import * as AvatarPrimitive from "@radix-ui/react-avatar";
import { cn } from "@/src/utils/tailwind";
const Avatar = React.forwardRef<
- React.ElementRef<typeof AvatarPrimitive.Root>,
+ React.ComponentRef<typeof AvatarPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Root
@@ -21,7 +21,7 @@ const Avatar = React.forwardRef<
Avatar.displayName = AvatarPrimitive.Root.displayName;
const AvatarImage = React.forwardRef<
- React.ElementRef<typeof AvatarPrimitive.Image>,
+ React.ComponentRef<typeof AvatarPrimitive.Image>,
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Image
@@ -33,7 +33,7 @@ const AvatarImage = React.forwardRef<
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
const AvatarFallback = React.forwardRef<
- React.ElementRef<typeof AvatarPrimitive.Fallback>,
+ React.ComponentRef<typeof AvatarPrimitive.Fallback>,
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Fallback
diff --git a/web/src/components/ui/checkbox.tsx b/web/src/components/ui/checkbox.tsx
index 45b579105c..8bc1d0fcc6 100644
--- a/web/src/components/ui/checkbox.tsx
+++ b/web/src/components/ui/checkbox.tsx
@@ -7,7 +7,7 @@ import { Check } from "lucide-react";
import { cn } from "@/src/utils/tailwind";
const Checkbox = React.forwardRef<
- React.ElementRef<typeof CheckboxPrimitive.Root>,
+ React.ComponentRef<typeof CheckboxPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
>(({ className, ...props }, ref) => (
<CheckboxPrimitive.Root
diff --git a/web/src/components/ui/command.tsx b/web/src/components/ui/command.tsx
index 7a71f3d3ff..6623a269c8 100644
--- a/web/src/components/ui/command.tsx
+++ b/web/src/components/ui/command.tsx
@@ -14,7 +14,7 @@ import {
} from "@/src/components/ui/dialog";
const Command = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive>,
+ React.ComponentRef<typeof CommandPrimitive>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive>
>(({ className, ...props }, ref) => (
<CommandPrimitive
@@ -58,7 +58,7 @@ const CommandDialog = ({
};
const CommandInput = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.Input>,
+ React.ComponentRef<typeof CommandPrimitive.Input>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & {
showBorder?: boolean;
}
@@ -85,7 +85,7 @@ const CommandInput = React.forwardRef<
CommandInput.displayName = CommandPrimitive.Input.displayName;
const CommandList = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.List>,
+ React.ComponentRef<typeof CommandPrimitive.List>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
>(({ className, ...props }, ref) => (
<CommandPrimitive.List
@@ -98,7 +98,7 @@ const CommandList = React.forwardRef<
CommandList.displayName = CommandPrimitive.List.displayName;
const CommandEmpty = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.Empty>,
+ React.ComponentRef<typeof CommandPrimitive.Empty>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
>((props, ref) => (
<CommandPrimitive.Empty
@@ -111,7 +111,7 @@ const CommandEmpty = React.forwardRef<
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
const CommandGroup = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.Group>,
+ React.ComponentRef<typeof CommandPrimitive.Group>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
>(({ className, ...props }, ref) => (
<CommandPrimitive.Group
@@ -127,7 +127,7 @@ const CommandGroup = React.forwardRef<
CommandGroup.displayName = CommandPrimitive.Group.displayName;
const CommandSeparator = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.Separator>,
+ React.ComponentRef<typeof CommandPrimitive.Separator>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
>(({ className, ...props }, ref) => (
<CommandPrimitive.Separator
@@ -139,7 +139,7 @@ const CommandSeparator = React.forwardRef<
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
const CommandItem = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.Item>,
+ React.ComponentRef<typeof CommandPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
>(({ className, ...props }, ref) => (
<CommandPrimitive.Item
diff --git a/web/src/components/ui/dialog.tsx b/web/src/components/ui/dialog.tsx
index 87fbac0892..d3bda134e8 100644
--- a/web/src/components/ui/dialog.tsx
+++ b/web/src/components/ui/dialog.tsx
@@ -16,7 +16,7 @@ const DialogPortal = DialogPrimitive.Portal;
const DialogClose = DialogPrimitive.Close;
const DialogOverlay = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Overlay>,
+ React.ComponentRef<typeof DialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Overlay
@@ -48,7 +48,7 @@ const dialogContentVariants = cva(
);
const DialogContent = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Content>,
+ React.ComponentRef<typeof DialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
closeOnInteractionOutside?: boolean;
stopPropagationOnEnterSpace?: boolean;
@@ -160,7 +160,7 @@ const DialogFooter = ({
DialogFooter.displayName = "DialogFooter";
const DialogTitle = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Title>,
+ React.ComponentRef<typeof DialogPrimitive.Title>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Title
@@ -175,7 +175,7 @@ const DialogTitle = React.forwardRef<
DialogTitle.displayName = DialogPrimitive.Title.displayName;
const DialogDescription = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Description>,
+ React.ComponentRef<typeof DialogPrimitive.Description>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Description
diff --git a/web/src/components/ui/drawer.tsx b/web/src/components/ui/drawer.tsx
index 13745bd10a..5414a2a44e 100644
--- a/web/src/components/ui/drawer.tsx
+++ b/web/src/components/ui/drawer.tsx
@@ -114,7 +114,7 @@ const DrawerPortal = DrawerPrimitive.Portal;
const DrawerClose = DrawerPrimitive.Close;
const DrawerOverlay = React.forwardRef<
- React.ElementRef<typeof DrawerPrimitive.Overlay>,
+ React.ComponentRef<typeof DrawerPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
>(({ className, ...props }, ref) => (
<DrawerPrimitive.Overlay
@@ -126,7 +126,7 @@ const DrawerOverlay = React.forwardRef<
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
const DrawerContent = React.forwardRef<
- React.ElementRef<typeof DrawerPrimitive.Content>,
+ React.ComponentRef<typeof DrawerPrimitive.Content>,
DrawerContentProps
>(
(
@@ -181,7 +181,7 @@ const DrawerFooter = ({
DrawerFooter.displayName = "DrawerFooter";
const DrawerTitle = React.forwardRef<
- React.ElementRef<typeof DrawerPrimitive.Title>,
+ React.ComponentRef<typeof DrawerPrimitive.Title>,
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
>(({ className, ...props }, ref) => (
<DrawerPrimitive.Title
@@ -196,7 +196,7 @@ const DrawerTitle = React.forwardRef<
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
const DrawerDescription = React.forwardRef<
- React.ElementRef<typeof DrawerPrimitive.Description>,
+ React.ComponentRef<typeof DrawerPrimitive.Description>,
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
>(({ className, ...props }, ref) => (
<DrawerPrimitive.Description
diff --git a/web/src/components/ui/dropdown-menu.tsx b/web/src/components/ui/dropdown-menu.tsx
index 4d5fb5d869..c614568d52 100644
--- a/web/src/components/ui/dropdown-menu.tsx
+++ b/web/src/components/ui/dropdown-menu.tsx
@@ -19,7 +19,7 @@ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
const DropdownMenuSubTrigger = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
+ React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
inset?: boolean;
hasCustomIcon?: boolean;
@@ -42,7 +42,7 @@ DropdownMenuSubTrigger.displayName =
DropdownMenuPrimitive.SubTrigger.displayName;
const DropdownMenuSubContent = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
+ React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
>(({ className, ...props }, ref) => (
<DropdownMenuPrimitive.SubContent
@@ -58,7 +58,7 @@ DropdownMenuSubContent.displayName =
DropdownMenuPrimitive.SubContent.displayName;
const DropdownMenuContent = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.Content>,
+ React.ComponentRef<typeof DropdownMenuPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
>(({ className, sideOffset = 4, ...props }, ref) => (
<DropdownMenuPrimitive.Portal>
@@ -76,7 +76,7 @@ const DropdownMenuContent = React.forwardRef<
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
const DropdownMenuItem = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.Item>,
+ React.ComponentRef<typeof DropdownMenuPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
inset?: boolean;
}
@@ -94,7 +94,7 @@ const DropdownMenuItem = React.forwardRef<
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
const DropdownMenuCheckboxItem = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
+ React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
>(({ className, children, checked, ...props }, ref) => (
<DropdownMenuPrimitive.CheckboxItem
@@ -119,7 +119,7 @@ DropdownMenuCheckboxItem.displayName =
DropdownMenuPrimitive.CheckboxItem.displayName;
const DropdownMenuRadioItem = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
+ React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
>(({ className, children, ...props }, ref) => (
<DropdownMenuPrimitive.RadioItem
@@ -141,7 +141,7 @@ const DropdownMenuRadioItem = React.forwardRef<
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
const DropdownMenuLabel = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.Label>,
+ React.ComponentRef<typeof DropdownMenuPrimitive.Label>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
inset?: boolean;
}
@@ -159,7 +159,7 @@ const DropdownMenuLabel = React.forwardRef<
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
const DropdownMenuSeparator = React.forwardRef<
- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
+ React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
>(({ className, ...props }, ref) => (
<DropdownMenuPrimitive.Separator
diff --git a/web/src/components/ui/form.tsx b/web/src/components/ui/form.tsx
index ed77f488e7..1acb0513ca 100644
--- a/web/src/components/ui/form.tsx
+++ b/web/src/components/ui/form.tsx
@@ -85,7 +85,7 @@ const FormItem = React.forwardRef<
FormItem.displayName = "FormItem";
const FormLabel = React.forwardRef<
- React.ElementRef<typeof LabelPrimitive.Root>,
+ React.ComponentRef<typeof LabelPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
>(({ className, ...props }, ref) => {
const { error, formItemId } = useFormField();
@@ -102,7 +102,7 @@ const FormLabel = React.forwardRef<
FormLabel.displayName = "FormLabel";
const FormControl = React.forwardRef<
- React.ElementRef<typeof Slot>,
+ React.ComponentRef<typeof Slot>,
React.ComponentPropsWithoutRef<typeof Slot>
>(({ ...props }, ref) => {
const { error, formItemId, formDescriptionId, formMessageId } =
diff --git a/web/src/components/ui/hover-card.tsx b/web/src/components/ui/hover-card.tsx
index bccdbc7200..e635ae5b21 100644
--- a/web/src/components/ui/hover-card.tsx
+++ b/web/src/components/ui/hover-card.tsx
@@ -10,7 +10,7 @@ const HoverCard = HoverCardPrimitive.Root;
const HoverCardTrigger = HoverCardPrimitive.Trigger;
const HoverCardContent = React.forwardRef<
- React.ElementRef<typeof HoverCardPrimitive.Content>,
+ React.ComponentRef<typeof HoverCardPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
<HoverCardPrimitive.Portal>
diff --git a/web/src/components/ui/input-command.tsx b/web/src/components/ui/input-command.tsx
index 3d2077e232..7fb57a45b2 100644
--- a/web/src/components/ui/input-command.tsx
+++ b/web/src/components/ui/input-command.tsx
@@ -12,7 +12,7 @@ import { Dialog, DialogBody, DialogContent } from "@/src/components/ui/dialog";
import { cn } from "@/src/utils/tailwind";
const InputCommand = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive>,
+ React.ComponentRef<typeof CommandPrimitive>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive>
>(({ className, ...props }, ref) => (
<CommandPrimitive
@@ -46,7 +46,7 @@ const InputCommandDialog = ({
};
const InputCommandInput = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.Input>,
+ React.ComponentRef<typeof CommandPrimitive.Input>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & {
variant?: "default" | "bottom";
}
@@ -74,7 +74,7 @@ const InputCommandInput = React.forwardRef<
InputCommandInput.displayName = CommandPrimitive.Input.displayName;
const InputCommandList = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.List>,
+ React.ComponentRef<typeof CommandPrimitive.List>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
>(({ className, ...props }, ref) => (
<CommandPrimitive.List
@@ -87,7 +87,7 @@ const InputCommandList = React.forwardRef<
InputCommandList.displayName = CommandPrimitive.List.displayName;
const InputCommandEmpty = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.Empty>,
+ React.ComponentRef<typeof CommandPrimitive.Empty>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
>((props, ref) => (
<CommandPrimitive.Empty
@@ -100,7 +100,7 @@ const InputCommandEmpty = React.forwardRef<
InputCommandEmpty.displayName = CommandPrimitive.Empty.displayName;
const InputCommandGroup = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.Group>,
+ React.ComponentRef<typeof CommandPrimitive.Group>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
>(({ className, ...props }, ref) => (
<CommandPrimitive.Group
@@ -116,7 +116,7 @@ const InputCommandGroup = React.forwardRef<
InputCommandGroup.displayName = CommandPrimitive.Group.displayName;
const InputCommandSeparator = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.Separator>,
+ React.ComponentRef<typeof CommandPrimitive.Separator>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
>(({ className, ...props }, ref) => (
<CommandPrimitive.Separator
@@ -128,7 +128,7 @@ const InputCommandSeparator = React.forwardRef<
InputCommandSeparator.displayName = CommandPrimitive.Separator.displayName;
const InputCommandItem = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.Item>,
+ React.ComponentRef<typeof CommandPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
>(({ className, ...props }, ref) => (
<CommandPrimitive.Item
diff --git a/web/src/components/ui/label.tsx b/web/src/components/ui/label.tsx
index 75a5f3f7bf..a62229cdff 100644
--- a/web/src/components/ui/label.tsx
+++ b/web/src/components/ui/label.tsx
@@ -11,7 +11,7 @@ const labelVariants = cva(
);
const Label = React.forwardRef<
- React.ElementRef<typeof LabelPrimitive.Root>,
+ React.ComponentRef<typeof LabelPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
VariantProps<typeof labelVariants>
>(({ className, ...props }, ref) => (
diff --git a/web/src/components/ui/popover.tsx b/web/src/components/ui/popover.tsx
index 4f8481e317..7e132455a7 100644
--- a/web/src/components/ui/popover.tsx
+++ b/web/src/components/ui/popover.tsx
@@ -10,7 +10,7 @@ const Popover = PopoverPrimitive.Root;
const PopoverTrigger = PopoverPrimitive.Trigger;
const PopoverContent = React.forwardRef<
- React.ElementRef<typeof PopoverPrimitive.Content>,
+ React.ComponentRef<typeof PopoverPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
<PopoverPrimitive.Portal>
diff --git a/web/src/components/ui/progress.tsx b/web/src/components/ui/progress.tsx
index 3f535e789f..c8cf572f93 100644
--- a/web/src/components/ui/progress.tsx
+++ b/web/src/components/ui/progress.tsx
@@ -6,7 +6,7 @@ import * as ProgressPrimitive from "@radix-ui/react-progress";
import { cn } from "@/src/utils/tailwind";
const Progress = React.forwardRef<
- React.ElementRef<typeof ProgressPrimitive.Root>,
+ React.ComponentRef<typeof ProgressPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
>(({ className, value, ...props }, ref) => (
<ProgressPrimitive.Root
diff --git a/web/src/components/ui/radio-group.tsx b/web/src/components/ui/radio-group.tsx
index ab61c5904a..e57d8f0d74 100644
--- a/web/src/components/ui/radio-group.tsx
+++ b/web/src/components/ui/radio-group.tsx
@@ -5,7 +5,7 @@ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
import { cn } from "@/src/utils/tailwind";
const RadioGroup = React.forwardRef<
- React.ElementRef<typeof RadioGroupPrimitive.Root>,
+ React.ComponentRef<typeof RadioGroupPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
>(({ className, ...props }, ref) => {
return (
@@ -19,7 +19,7 @@ const RadioGroup = React.forwardRef<
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
const RadioGroupItem = React.forwardRef<
- React.ElementRef<typeof RadioGroupPrimitive.Item>,
+ React.ComponentRef<typeof RadioGroupPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
>(({ className, ...props }, ref) => {
return (
diff --git a/web/src/components/ui/scroll-area.tsx b/web/src/components/ui/scroll-area.tsx
index edf47a65a8..9a5e2ca1a6 100644
--- a/web/src/components/ui/scroll-area.tsx
+++ b/web/src/components/ui/scroll-area.tsx
@@ -6,7 +6,7 @@ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
import { cn } from "@/src/utils/tailwind";
const ScrollArea = React.forwardRef<
- React.ElementRef<typeof ScrollAreaPrimitive.Root>,
+ React.ComponentRef<typeof ScrollAreaPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
>(({ className, children, ...props }, ref) => (
<ScrollAreaPrimitive.Root
@@ -24,7 +24,7 @@ const ScrollArea = React.forwardRef<
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
const ScrollBar = React.forwardRef<
- React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
+ React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
>(({ className, orientation = "vertical", ...props }, ref) => (
<ScrollAreaPrimitive.ScrollAreaScrollbar
diff --git a/web/src/components/ui/select.tsx b/web/src/components/ui/select.tsx
index dae4cf5831..825ad00b53 100644
--- a/web/src/components/ui/select.tsx
+++ b/web/src/components/ui/select.tsx
@@ -13,7 +13,7 @@ const SelectGroup = SelectPrimitive.Group;
const SelectValue = SelectPrimitive.Value;
const SelectTrigger = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.Trigger>,
+ React.ComponentRef<typeof SelectPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> & {
hideDownIcon?: boolean;
}
@@ -37,7 +37,7 @@ const SelectTrigger = React.forwardRef<
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
const SelectScrollUpButton = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
+ React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
>(({ className, ...props }, ref) => (
<SelectPrimitive.ScrollUpButton
@@ -54,7 +54,7 @@ const SelectScrollUpButton = React.forwardRef<
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
const SelectScrollDownButton = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
+ React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
>(({ className, ...props }, ref) => (
<SelectPrimitive.ScrollDownButton
@@ -72,7 +72,7 @@ SelectScrollDownButton.displayName =
SelectPrimitive.ScrollDownButton.displayName;
const SelectContent = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.Content>,
+ React.ComponentRef<typeof SelectPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
>(({ className, children, position = "popper", ...props }, ref) => (
<SelectPrimitive.Portal>
@@ -104,7 +104,7 @@ const SelectContent = React.forwardRef<
SelectContent.displayName = SelectPrimitive.Content.displayName;
const SelectLabel = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.Label>,
+ React.ComponentRef<typeof SelectPrimitive.Label>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
>(({ className, ...props }, ref) => (
<SelectPrimitive.Label
@@ -116,7 +116,7 @@ const SelectLabel = React.forwardRef<
SelectLabel.displayName = SelectPrimitive.Label.displayName;
const SelectItem = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.Item>,
+ React.ComponentRef<typeof SelectPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
>(({ className, children, ...props }, ref) => (
<SelectPrimitive.Item
@@ -142,7 +142,7 @@ const SelectItem = React.forwardRef<
SelectItem.displayName = SelectPrimitive.Item.displayName;
const SelectSeparator = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.Separator>,
+ React.ComponentRef<typeof SelectPrimitive.Separator>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
>(({ className, ...props }, ref) => (
<SelectPrimitive.Separator
diff --git a/web/src/components/ui/separator.tsx b/web/src/components/ui/separator.tsx
index 8586c5cc43..a40546474c 100644
--- a/web/src/components/ui/separator.tsx
+++ b/web/src/components/ui/separator.tsx
@@ -6,7 +6,7 @@ import * as SeparatorPrimitive from "@radix-ui/react-separator";
import { cn } from "@/src/utils/tailwind";
const Separator = React.forwardRef<
- React.ElementRef<typeof SeparatorPrimitive.Root>,
+ React.ComponentRef<typeof SeparatorPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
>(
(
diff --git a/web/src/components/ui/sheet.tsx b/web/src/components/ui/sheet.tsx
index 9437e4e30d..35ba94ebf9 100644
--- a/web/src/components/ui/sheet.tsx
+++ b/web/src/components/ui/sheet.tsx
@@ -16,7 +16,7 @@ const SheetClose = SheetPrimitive.Close;
const SheetPortal = SheetPrimitive.Portal;
const SheetOverlay = React.forwardRef<
- React.ElementRef<typeof SheetPrimitive.Overlay>,
+ React.ComponentRef<typeof SheetPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
>(({ className, ...props }, ref) => (
<SheetPrimitive.Overlay
@@ -55,7 +55,7 @@ interface SheetContentProps
VariantProps<typeof sheetVariants> {}
const SheetContent = React.forwardRef<
- React.ElementRef<typeof SheetPrimitive.Content>,
+ React.ComponentRef<typeof SheetPrimitive.Content>,
SheetContentProps
>(({ side = "right", className, children, ...props }, ref) => (
<SheetPortal>
@@ -104,7 +104,7 @@ const SheetFooter = ({
SheetFooter.displayName = "SheetFooter";
const SheetTitle = React.forwardRef<
- React.ElementRef<typeof SheetPrimitive.Title>,
+ React.ComponentRef<typeof SheetPrimitive.Title>,
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
>(({ className, ...props }, ref) => (
<SheetPrimitive.Title
@@ -116,7 +116,7 @@ const SheetTitle = React.forwardRef<
SheetTitle.displayName = SheetPrimitive.Title.displayName;
const SheetDescription = React.forwardRef<
- React.ElementRef<typeof SheetPrimitive.Description>,
+ React.ComponentRef<typeof SheetPrimitive.Description>,
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
>(({ className, ...props }, ref) => (
<SheetPrimitive.Description
diff --git a/web/src/components/ui/sidebar.tsx b/web/src/components/ui/sidebar.tsx
index df1d79cc8d..ce57879c84 100644
--- a/web/src/components/ui/sidebar.tsx
+++ b/web/src/components/ui/sidebar.tsx
@@ -274,7 +274,7 @@ const Sidebar = React.forwardRef<
Sidebar.displayName = "Sidebar";
const SidebarTrigger = React.forwardRef<
- React.ElementRef<typeof Button>,
+ React.ComponentRef<typeof Button>,
React.ComponentProps<typeof Button>
>(({ className, onClick, ...props }, ref) => {
const { toggleSidebar } = useSidebar();
@@ -343,7 +343,7 @@ const SidebarInset = React.forwardRef<
SidebarInset.displayName = "SidebarInset";
const SidebarInput = React.forwardRef<
- React.ElementRef<typeof Input>,
+ React.ComponentRef<typeof Input>,
React.ComponentProps<typeof Input>
>(({ className, ...props }, ref) => {
return (
@@ -395,7 +395,7 @@ const SidebarFooter = React.forwardRef<
SidebarFooter.displayName = "SidebarFooter";
const SidebarSeparator = React.forwardRef<
- React.ElementRef<typeof Separator>,
+ React.ComponentRef<typeof Separator>,
React.ComponentProps<typeof Separator>
>(({ className, ...props }, ref) => {
return (
diff --git a/web/src/components/ui/slider.tsx b/web/src/components/ui/slider.tsx
index 7e6658040b..c81441a80f 100644
--- a/web/src/components/ui/slider.tsx
+++ b/web/src/components/ui/slider.tsx
@@ -16,7 +16,7 @@ export interface SliderProps extends React.ComponentPropsWithoutRef<
}
const Slider = React.forwardRef<
- React.ElementRef<typeof SliderPrimitive.Root>,
+ React.ComponentRef<typeof SliderPrimitive.Root>,
SliderProps
>(
(
diff --git a/web/src/components/ui/switch.tsx b/web/src/components/ui/switch.tsx
index 2f4ca8659d..4b4b01aacd 100644
--- a/web/src/components/ui/switch.tsx
+++ b/web/src/components/ui/switch.tsx
@@ -42,7 +42,7 @@ interface SwitchProps
VariantProps<typeof switchVariants> {}
const Switch = React.forwardRef<
- React.ElementRef<typeof SwitchPrimitives.Root>,
+ React.ComponentRef<typeof SwitchPrimitives.Root>,
SwitchProps
>(({ className, size, ...props }, ref) => (
<SwitchPrimitives.Root
diff --git a/web/src/components/ui/tabs-bar.tsx b/web/src/components/ui/tabs-bar.tsx
index fbccb30851..2f91971c47 100644
--- a/web/src/components/ui/tabs-bar.tsx
+++ b/web/src/components/ui/tabs-bar.tsx
@@ -6,7 +6,7 @@ import * as TabsPrimitive from "@radix-ui/react-tabs";
import { cn } from "@/src/utils/tailwind";
const TabsBar = React.forwardRef<
- React.ElementRef<typeof TabsPrimitive.Root>,
+ React.ComponentRef<typeof TabsPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Root
@@ -18,7 +18,7 @@ const TabsBar = React.forwardRef<
TabsBar.displayName = TabsPrimitive.Root.displayName;
const TabsBarList = React.forwardRef<
- React.ElementRef<typeof TabsPrimitive.List>,
+ React.ComponentRef<typeof TabsPrimitive.List>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
>(({ className, ...props }, ref) => (
<TabsPrimitive.List
@@ -33,7 +33,7 @@ const TabsBarList = React.forwardRef<
TabsBarList.displayName = TabsPrimitive.List.displayName;
const TabsBarTrigger = React.forwardRef<
- React.ElementRef<typeof TabsPrimitive.Trigger>,
+ React.ComponentRef<typeof TabsPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Trigger
@@ -48,7 +48,7 @@ const TabsBarTrigger = React.forwardRef<
TabsBarTrigger.displayName = TabsPrimitive.Trigger.displayName;
const TabsBarContent = React.forwardRef<
- React.ElementRef<typeof TabsPrimitive.Content>,
+ React.ComponentRef<typeof TabsPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Content
diff --git a/web/src/components/ui/tabs.tsx b/web/src/components/ui/tabs.tsx
index dea2fccba3..4b1535ac79 100644
--- a/web/src/components/ui/tabs.tsx
+++ b/web/src/components/ui/tabs.tsx
@@ -8,7 +8,7 @@ import { cn } from "@/src/utils/tailwind";
const Tabs = TabsPrimitive.Root;
const TabsList = React.forwardRef<
- React.ElementRef<typeof TabsPrimitive.List>,
+ React.ComponentRef<typeof TabsPrimitive.List>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
>(({ className, ...props }, ref) => (
<TabsPrimitive.List
@@ -23,7 +23,7 @@ const TabsList = React.forwardRef<
TabsList.displayName = TabsPrimitive.List.displayName;
const TabsTrigger = React.forwardRef<
- React.ElementRef<typeof TabsPrimitive.Trigger>,
+ React.ComponentRef<typeof TabsPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Trigger
@@ -38,7 +38,7 @@ const TabsTrigger = React.forwardRef<
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
const TabsContent = React.forwardRef<
- React.ElementRef<typeof TabsPrimitive.Content>,
+ React.ComponentRef<typeof TabsPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Content
diff --git a/web/src/components/ui/toggle-group.tsx b/web/src/components/ui/toggle-group.tsx
index 38a347cb86..331b9a0ca9 100644
--- a/web/src/components/ui/toggle-group.tsx
+++ b/web/src/components/ui/toggle-group.tsx
@@ -14,7 +14,7 @@ const ToggleGroupContext = React.createContext<
});
const ToggleGroup = React.forwardRef<
- React.ElementRef<typeof ToggleGroupPrimitive.Root>,
+ React.ComponentRef<typeof ToggleGroupPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
VariantProps<typeof toggleVariants>
>(({ className, variant, size, children, ...props }, ref) => (
@@ -32,7 +32,7 @@ const ToggleGroup = React.forwardRef<
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
const ToggleGroupItem = React.forwardRef<
- React.ElementRef<typeof ToggleGroupPrimitive.Item>,
+ React.ComponentRef<typeof ToggleGroupPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
VariantProps<typeof toggleVariants>
>(({ className, children, variant, size, ...props }, ref) => {
diff --git a/web/src/components/ui/toggle.tsx b/web/src/components/ui/toggle.tsx
index b2939e0dce..1aed1ad1a1 100644
--- a/web/src/components/ui/toggle.tsx
+++ b/web/src/components/ui/toggle.tsx
@@ -30,7 +30,7 @@ const toggleVariants = cva(
);
const Toggle = React.forwardRef<
- React.ElementRef<typeof TogglePrimitive.Root>,
+ React.ComponentRef<typeof TogglePrimitive.Root>,
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
VariantProps<typeof toggleVariants>
>(({ className, variant, size, ...props }, ref) => (
diff --git a/web/src/components/ui/tooltip.tsx b/web/src/components/ui/tooltip.tsx
index 9e2ddff51d..a52fa400b1 100644
--- a/web/src/components/ui/tooltip.tsx
+++ b/web/src/components/ui/tooltip.tsx
@@ -12,7 +12,7 @@ const Tooltip = TooltipPrimitive.Root;
const TooltipTrigger = TooltipPrimitive.Trigger;
const TooltipContent = React.forwardRef<
- React.ElementRef<typeof TooltipPrimitive.Content>,
+ React.ComponentRef<typeof TooltipPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
>(({ className, sideOffset = 4, ...props }, ref) => (
<TooltipPrimitive.Portal>
diff --git a/web/src/ee/features/admin-api/server/organizations/apiKeys/index.ts b/web/src/ee/features/admin-api/server/organizations/apiKeys/index.ts
index 50f0c7bf39..aee00b5a6b 100644
--- a/web/src/ee/features/admin-api/server/organizations/apiKeys/index.ts
+++ b/web/src/ee/features/admin-api/server/organizations/apiKeys/index.ts
@@ -58,7 +58,7 @@ export async function handleCreateApiKey(
if (!validationResult.success) {
return res.status(400).json({
error: "Invalid request body",
- details: validationResult.error.format(),
+ details: z.formatError(validationResult.error),
});
}
diff --git a/web/src/ee/features/admin-api/server/organizations/index.ts b/web/src/ee/features/admin-api/server/organizations/index.ts
index 65e3ab8ebe..e4fa334614 100644
--- a/web/src/ee/features/admin-api/server/organizations/index.ts
+++ b/web/src/ee/features/admin-api/server/organizations/index.ts
@@ -3,6 +3,7 @@ import { logger } from "@langfuse/shared/src/server";
import { organizationNameSchema } from "@/src/features/organizations/utils/organizationNameSchema";
import { auditLog } from "@/src/features/audit-logs/auditLog";
import { type NextApiRequest, type NextApiResponse } from "next";
+import { z } from "zod";
export async function handleGetOrganizations(
req: NextApiRequest,
@@ -47,7 +48,7 @@ export async function handleCreateOrganization(
if (!validationResult.success) {
res.status(400).json({
error: "Invalid request body",
- details: validationResult.error.format(),
+ details: z.formatError(validationResult.error),
});
return;
}
diff --git a/web/src/ee/features/admin-api/server/organizations/organizationById.ts b/web/src/ee/features/admin-api/server/organizations/organizationById.ts
index f100fd1abd..2b5377790c 100644
--- a/web/src/ee/features/admin-api/server/organizations/organizationById.ts
+++ b/web/src/ee/features/admin-api/server/organizations/organizationById.ts
@@ -72,7 +72,7 @@ export async function handleUpdateOrganization(
if (!validationResult.success) {
return res.status(400).json({
error: "Invalid request body",
- details: validationResult.error.format(),
+ details: z.formatError(validationResult.error),
});
}
diff --git a/web/src/ee/features/admin-api/server/projects/projectById/apiKeys/index.ts b/web/src/ee/features/admin-api/server/projects/projectById/apiKeys/index.ts
index f52597059e..a4110535ee 100644
--- a/web/src/ee/features/admin-api/server/projects/projectById/apiKeys/index.ts
+++ b/web/src/ee/features/admin-api/server/projects/projectById/apiKeys/index.ts
@@ -61,7 +61,7 @@ export async function handleCreateApiKey(
if (!validationResult.success) {
return res.status(400).json({
message: "Invalid request body",
- details: validationResult.error.format(),
+ details: z.formatError(validationResult.error),
});
}
diff --git a/web/src/ee/features/multi-tenant-sso/types.ts b/web/src/ee/features/multi-tenant-sso/types.ts
index 76e710ffce..37785a973b 100644
--- a/web/src/ee/features/multi-tenant-sso/types.ts
+++ b/web/src/ee/features/multi-tenant-sso/types.ts
@@ -67,7 +67,7 @@ export const GithubEnterpriseProviderSchema = base.extend({
clientId: z.string(),
clientSecret: z.string(),
enterprise: z.object({
- baseUrl: z.string().url(),
+ baseUrl: z.url(),
}),
allowDangerousEmailAccountLinking: z.boolean().optional().default(false),
tokenEndpointAuthMethod: tokenEndpointAuthMethod,
diff --git a/web/src/env.mjs b/web/src/env.mjs
index 70dbce1c38..142aae09a2 100644
--- a/web/src/env.mjs
+++ b/web/src/env.mjs
@@ -43,7 +43,7 @@ export const env = createEnv({
* isn't built with invalid env vars.
*/
server: {
- DATABASE_URL: z.string().url(),
+ DATABASE_URL: z.url(),
NODE_ENV: z.enum(["development", "test", "production"]),
BUILD_ID: z.string().optional(),
NEXTAUTH_SECRET:
@@ -59,12 +59,12 @@ export const env = createEnv({
? process.env.VERCEL_URL
: str,
// VERCEL_URL doesn't include `https` so it can't be validated as a URL
- process.env.VERCEL ? z.string().min(1) : z.string().url(),
+ process.env.VERCEL ? z.string().min(1) : z.url(),
),
NEXTAUTH_COOKIE_DOMAIN: z.string().optional(),
- LANGFUSE_TEAM_SLACK_WEBHOOK: z.string().url().optional(),
- LANGFUSE_NEW_USER_SIGNUP_WEBHOOK: z.string().url().optional(),
- LANGFUSE_ADMIN_ACCESS_WEBHOOK: z.string().url().optional(),
+ LANGFUSE_TEAM_SLACK_WEBHOOK: z.url().optional(),
+ LANGFUSE_NEW_USER_SIGNUP_WEBHOOK: z.url().optional(),
+ LANGFUSE_ADMIN_ACCESS_WEBHOOK: z.url().optional(),
// Add `.min(1) on ID and SECRET if you want to make sure they're not empty
LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES: z.enum(["true", "false"]).optional(),
SALT: z.string({
@@ -124,7 +124,7 @@ export const env = createEnv({
AUTH_GITHUB_CHECKS: zAuthChecks,
AUTH_GITHUB_ENTERPRISE_CLIENT_ID: z.string().optional(),
AUTH_GITHUB_ENTERPRISE_CLIENT_SECRET: z.string().optional(),
- AUTH_GITHUB_ENTERPRISE_BASE_URL: z.string().url().optional(),
+ AUTH_GITHUB_ENTERPRISE_BASE_URL: z.url().optional(),
AUTH_GITHUB_ENTERPRISE_ALLOW_ACCOUNT_LINKING: z
.enum(["true", "false"])
.optional(),
@@ -137,7 +137,7 @@ export const env = createEnv({
AUTH_GITLAB_CLIENT_AUTH_METHOD: zAuthMethod,
AUTH_GITLAB_CHECKS: zAuthChecks,
AUTH_GITLAB_ID_TOKEN_SIGNED_RESPONSE_ALG: zIdTokenAlg,
- AUTH_GITLAB_URL: z.string().url().optional().default("https://gitlab.com"),
+ AUTH_GITLAB_URL: z.url().optional().default("https://gitlab.com"),
AUTH_AZURE_AD_CLIENT_ID: z.string().optional(),
AUTH_AZURE_AD_CLIENT_SECRET: z.string().optional(),
AUTH_AZURE_AD_TENANT_ID: z.string().optional(),
@@ -165,7 +165,7 @@ export const env = createEnv({
AUTH_AUTHENTIK_CHECKS: zAuthChecks,
AUTH_AUTHENTIK_CLIENT_AUTH_METHOD: zAuthMethod,
AUTH_AUTHENTIK_ID_TOKEN_SIGNED_RESPONSE_ALG: zIdTokenAlg,
- AUTH_AUTHENTIK_AUTHORIZATION_URL: z.string().url().optional(),
+ AUTH_AUTHENTIK_AUTHORIZATION_URL: z.url().optional(),
AUTH_ONELOGIN_CLIENT_ID: z.string().optional(),
AUTH_ONELOGIN_CLIENT_SECRET: z.string().optional(),
AUTH_ONELOGIN_ISSUER: z.string().optional(),
@@ -175,7 +175,7 @@ export const env = createEnv({
AUTH_ONELOGIN_ID_TOKEN_SIGNED_RESPONSE_ALG: zIdTokenAlg,
AUTH_AUTH0_CLIENT_ID: z.string().optional(),
AUTH_AUTH0_CLIENT_SECRET: z.string().optional(),
- AUTH_AUTH0_ISSUER: z.string().url().optional(),
+ AUTH_AUTH0_ISSUER: z.url().optional(),
AUTH_AUTH0_ALLOW_ACCOUNT_LINKING: z.enum(["true", "false"]).optional(),
AUTH_AUTH0_CLIENT_AUTH_METHOD: zAuthMethod,
AUTH_AUTH0_CHECKS: zAuthChecks,
@@ -184,7 +184,7 @@ export const env = createEnv({
// NOT intended for self-hosted Langfuse — use AUTH_AUTH0_* instead.
AUTH_CLICKHOUSE_CLOUD_CLIENT_ID: z.string().optional(),
AUTH_CLICKHOUSE_CLOUD_CLIENT_SECRET: z.string().optional(),
- AUTH_CLICKHOUSE_CLOUD_ISSUER: z.string().url().optional(),
+ AUTH_CLICKHOUSE_CLOUD_ISSUER: z.url().optional(),
AUTH_CLICKHOUSE_CLOUD_ALLOW_ACCOUNT_LINKING: z
.enum(["true", "false"])
.optional(),
@@ -193,7 +193,7 @@ export const env = createEnv({
AUTH_CLICKHOUSE_CLOUD_ID_TOKEN_SIGNED_RESPONSE_ALG: zIdTokenAlg,
AUTH_COGNITO_CLIENT_ID: z.string().optional(),
AUTH_COGNITO_CLIENT_SECRET: z.string().optional(),
- AUTH_COGNITO_ISSUER: z.string().url().optional(),
+ AUTH_COGNITO_ISSUER: z.url().optional(),
AUTH_COGNITO_ALLOW_ACCOUNT_LINKING: z.enum(["true", "false"]).optional(),
AUTH_COGNITO_CLIENT_AUTH_METHOD: zAuthMethod,
AUTH_COGNITO_CHECKS: zAuthChecks,
@@ -213,7 +213,7 @@ export const env = createEnv({
AUTH_KEYCLOAK_NAME: z.string().optional(),
AUTH_JUMPCLOUD_CLIENT_ID: z.string().optional(),
AUTH_JUMPCLOUD_CLIENT_SECRET: z.string().optional(),
- AUTH_JUMPCLOUD_ISSUER: z.string().url().optional(),
+ AUTH_JUMPCLOUD_ISSUER: z.url().optional(),
AUTH_JUMPCLOUD_ALLOW_ACCOUNT_LINKING: z.enum(["true", "false"]).optional(),
AUTH_JUMPCLOUD_CLIENT_AUTH_METHOD: zAuthMethod,
AUTH_JUMPCLOUD_CHECKS: zAuthChecks,
@@ -221,7 +221,7 @@ export const env = createEnv({
AUTH_JUMPCLOUD_SCOPE: z.string().optional(),
AUTH_CUSTOM_CLIENT_ID: z.string().optional(),
AUTH_CUSTOM_CLIENT_SECRET: z.string().optional(),
- AUTH_CUSTOM_ISSUER: z.string().url().optional(),
+ AUTH_CUSTOM_ISSUER: z.url().optional(),
AUTH_CUSTOM_NAME: z.string().optional(),
AUTH_CUSTOM_SCOPE: z.string().optional(),
AUTH_CUSTOM_CLIENT_AUTH_METHOD: zAuthMethod,
@@ -253,8 +253,8 @@ export const env = createEnv({
)
.optional()
.default(30 * 24 * 60), // default to 30 days
- AUTH_HTTP_PROXY: z.string().url().optional(),
- AUTH_HTTPS_PROXY: z.string().url().optional(),
+ AUTH_HTTP_PROXY: z.url().optional(),
+ AUTH_HTTPS_PROXY: z.url().optional(),
AUTH_SSO_TIMEOUT: z.coerce.number().int().positive().optional(),
// EMAIL
EMAIL_FROM_ADDRESS: z.string().optional(),
@@ -274,7 +274,7 @@ export const env = createEnv({
),
// clickhouse
- CLICKHOUSE_URL: z.string().url(),
+ CLICKHOUSE_URL: z.url(),
CLICKHOUSE_CLUSTER_NAME: z.string().default("default"),
CLICKHOUSE_DB: z.string().default("default"),
CLICKHOUSE_USER: z.string(),
@@ -297,17 +297,17 @@ export const env = createEnv({
// EE ui customization
LANGFUSE_UI_API_HOST: z.string().optional(),
- LANGFUSE_UI_DOCUMENTATION_HREF: z.string().url().optional(),
- LANGFUSE_UI_SUPPORT_HREF: z.string().url().optional(),
- LANGFUSE_UI_FEEDBACK_HREF: z.string().url().optional(),
- LANGFUSE_UI_LOGO_LIGHT_MODE_HREF: z.string().url().optional(),
- LANGFUSE_UI_LOGO_DARK_MODE_HREF: z.string().url().optional(),
+ LANGFUSE_UI_DOCUMENTATION_HREF: z.url().optional(),
+ LANGFUSE_UI_SUPPORT_HREF: z.url().optional(),
+ LANGFUSE_UI_FEEDBACK_HREF: z.url().optional(),
+ LANGFUSE_UI_LOGO_LIGHT_MODE_HREF: z.url().optional(),
+ LANGFUSE_UI_LOGO_DARK_MODE_HREF: z.url().optional(),
LANGFUSE_UI_DEFAULT_MODEL_ADAPTER: z
.enum(["OpenAI", "Anthropic", "Azure"])
.optional(),
- LANGFUSE_UI_DEFAULT_BASE_URL_OPENAI: z.string().url().optional(),
- LANGFUSE_UI_DEFAULT_BASE_URL_ANTHROPIC: z.string().url().optional(),
- LANGFUSE_UI_DEFAULT_BASE_URL_AZURE: z.string().url().optional(),
+ LANGFUSE_UI_DEFAULT_BASE_URL_OPENAI: z.url().optional(),
+ LANGFUSE_UI_DEFAULT_BASE_URL_ANTHROPIC: z.url().optional(),
+ LANGFUSE_UI_DEFAULT_BASE_URL_AZURE: z.url().optional(),
// EE License
LANGFUSE_EE_LICENSE_KEY: z.string().optional(),
@@ -352,7 +352,7 @@ export const env = createEnv({
.refine((value) => {
if (!value) return true;
const creators = value.split(",");
- const emailSchema = z.string().email();
+ const emailSchema = z.email();
return creators.every(
(creator) => emailSchema.safeParse(creator).success,
);
@@ -373,7 +373,7 @@ export const env = createEnv({
LANGFUSE_INIT_PROJECT_PUBLIC_KEY: z.string().optional(),
LANGFUSE_INIT_PROJECT_SECRET_KEY: z.string().optional(),
LANGFUSE_INIT_USER_EMAIL: z
- .union([z.string().email(), z.string().length(0)])
+ .union([z.email(), z.string().length(0)])
.optional(),
LANGFUSE_INIT_USER_NAME: z.string().optional(),
LANGFUSE_INIT_USER_PASSWORD: z.string().optional(),
diff --git a/web/src/features/auth-credentials/components/ResetPasswordButton.tsx b/web/src/features/auth-credentials/components/ResetPasswordButton.tsx
index 76043ffd7a..90b327cb7e 100644
--- a/web/src/features/auth-credentials/components/ResetPasswordButton.tsx
+++ b/web/src/features/auth-credentials/components/ResetPasswordButton.tsx
@@ -24,7 +24,7 @@ export function RequestResetPasswordEmailButton({
const capture = usePostHogClientCapture();
useEffect(() => {
- const isValidEmail = z.string().email().safeParse(email).success;
+ const isValidEmail = z.email().safeParse(email).success;
setIsValidEmail(isValidEmail);
}, [email]);
diff --git a/web/src/features/auth-credentials/components/ResetPasswordPage.tsx b/web/src/features/auth-credentials/components/ResetPasswordPage.tsx
index 107ae48f5f..b04b2f9955 100644
--- a/web/src/features/auth-credentials/components/ResetPasswordPage.tsx
+++ b/web/src/features/auth-credentials/components/ResetPasswordPage.tsx
@@ -29,7 +29,7 @@ import { passwordSchema } from "@/src/features/auth/lib/signupSchema";
const resetPasswordSchema = z
.object({
- email: z.string().email(),
+ email: z.email(),
password: passwordSchema,
confirmPassword: passwordSchema,
})
diff --git a/web/src/features/auth-credentials/lib/credentialsUtils.ts b/web/src/features/auth-credentials/lib/credentialsUtils.ts
index f24a1c3630..8b18213115 100644
--- a/web/src/features/auth-credentials/lib/credentialsUtils.ts
+++ b/web/src/features/auth-credentials/lib/credentialsUtils.ts
@@ -19,7 +19,7 @@ export function isEmailVerifiedWithinCutoff(
if (!emailVerifiedDateTime)
return { verified: false, reason: "not_verified" };
- const typed = z.string().datetime().safeParse(emailVerifiedDateTime);
+ const typed = z.iso.datetime().safeParse(emailVerifiedDateTime);
if (!typed.success) {
throw new Error("Invalid date string provided for emailVerifiedDateTime");
}
diff --git a/web/src/features/auth/lib/signupSchema.ts b/web/src/features/auth/lib/signupSchema.ts
index 749d33d4a9..e85dec43ac 100644
--- a/web/src/features/auth/lib/signupSchema.ts
+++ b/web/src/features/auth/lib/signupSchema.ts
@@ -32,7 +32,7 @@ export const nameSchema = StringNoHTMLNonEmpty.max(
export const signupSchema = z.object({
name: nameSchema,
- email: z.string().email(),
+ email: z.email(),
password: passwordSchema,
referralSource: z.string().optional(),
});
diff --git a/web/src/features/automations/components/actions/GitHubDispatchActionHandler.tsx b/web/src/features/automations/components/actions/GitHubDispatchActionHandler.tsx
index aac2a190bb..0771d63992 100644
--- a/web/src/features/automations/components/actions/GitHubDispatchActionHandler.tsx
+++ b/web/src/features/automations/components/actions/GitHubDispatchActionHandler.tsx
@@ -12,7 +12,7 @@ import { z } from "zod";
// Define the form schema for GitHub dispatch actions
export const GitHubDispatchActionFormSchema = z.object({
githubDispatch: z.object({
- url: z.string().url("Invalid URL"),
+ url: z.url("Invalid URL"),
eventType: z.string().min(1, "Event type is required").max(100),
githubToken: z.string(),
displayGitHubToken: z.string().optional(), // Display value for existing token
diff --git a/web/src/features/automations/components/actions/WebhookActionHandler.tsx b/web/src/features/automations/components/actions/WebhookActionHandler.tsx
index 80daa099a3..f71e283460 100644
--- a/web/src/features/automations/components/actions/WebhookActionHandler.tsx
+++ b/web/src/features/automations/components/actions/WebhookActionHandler.tsx
@@ -16,7 +16,7 @@ import { z } from "zod";
// (used for type extraction via z.infer<typeof>, which is a legitimate pattern)
export const WebhookActionFormSchema = z.object({
webhook: z.object({
- url: z.string().url("Invalid URL"),
+ url: z.url("Invalid URL"),
headers: z
.array(
z.object({
diff --git a/web/src/features/automations/components/automationForm.tsx b/web/src/features/automations/components/automationForm.tsx
index ccdbb12083..2f3bb5d772 100644
--- a/web/src/features/automations/components/automationForm.tsx
+++ b/web/src/features/automations/components/automationForm.tsx
@@ -55,7 +55,7 @@ const slackSchema = z.object({
// Define GitHub Dispatch action schema
const githubDispatchSchema = z.object({
- url: z.string().url("Invalid URL"),
+ url: z.url("Invalid URL"),
eventType: z.string().min(1, "Event type is required").max(100),
githubToken: z.string(),
displayGitHubToken: z.string().optional(),
diff --git a/web/src/features/blobstorage-integration/types.ts b/web/src/features/blobstorage-integration/types.ts
index 8fabad6062..8d5f453dea 100644
--- a/web/src/features/blobstorage-integration/types.ts
+++ b/web/src/features/blobstorage-integration/types.ts
@@ -10,7 +10,7 @@ import { validateAzureContainerName } from "@/src/features/blobstorage-integrati
export const blobStorageIntegrationFormSchemaBase = z.object({
type: z.enum(BlobStorageIntegrationType),
bucketName: z.string().min(1, { message: "Bucket name is required" }),
- endpoint: z.string().url().optional().nullable(),
+ endpoint: z.url().optional().nullable(),
region: z.string().default("auto"),
accessKeyId: z.string().optional(),
secretAccessKey: z.string().nullable().optional(),
diff --git a/web/src/features/blobstorage-integration/validation.ts b/web/src/features/blobstorage-integration/validation.ts
index 14b9b7b8b9..7b5e460480 100644
--- a/web/src/features/blobstorage-integration/validation.ts
+++ b/web/src/features/blobstorage-integration/validation.ts
@@ -1,4 +1,4 @@
-import { z } from "zod";
+import type { z } from "zod";
/**
* Azure container names must be 3-63 characters, lowercase letters, numbers,
@@ -23,7 +23,7 @@ export function validateAzureContainerName(
!AZURE_CONTAINER_NAME_REGEX.test(data.bucketName)
) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: AZURE_CONTAINER_NAME_ERROR,
path: ["bucketName"],
});
diff --git a/web/src/features/comments/CommentList.tsx b/web/src/features/comments/CommentList.tsx
index bef7cb5d5f..212e8f7f1c 100644
--- a/web/src/features/comments/CommentList.tsx
+++ b/web/src/features/comments/CommentList.tsx
@@ -525,7 +525,7 @@ export function CommentList({
{!searchQuery && (
<kbd className="bg-muted text-muted-foreground pointer-events-none absolute top-1/2 right-1 h-5 -translate-y-1/2 items-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium opacity-50 select-none sm:inline-flex">
{typeof navigator !== "undefined" &&
- navigator.platform.toLowerCase().includes("mac") ? (
+ navigator.userAgent.includes("Macintosh") ? (
<>
<span className="text-xs">⌘</span>F
</>
diff --git a/web/src/features/datasets/components/DatasetForm.tsx b/web/src/features/datasets/components/DatasetForm.tsx
index 9d43a0e9dd..d7bdf7e28d 100644
--- a/web/src/features/datasets/components/DatasetForm.tsx
+++ b/web/src/features/datasets/components/DatasetForm.tsx
@@ -333,7 +333,7 @@ export const DatasetForm = forwardRef<DatasetFormRef, DatasetFormProps>(
}
}
- const handleDelete = (e: React.FormEvent) => {
+ const handleDelete = (e: React.SyntheticEvent) => {
e.preventDefault();
// helps with type safety
diff --git a/web/src/features/evals/components/template-form.tsx b/web/src/features/evals/components/template-form.tsx
index d22be84056..7471b0a7c7 100644
--- a/web/src/features/evals/components/template-form.tsx
+++ b/web/src/features/evals/components/template-form.tsx
@@ -168,14 +168,14 @@ const formSchema = z
switch (violation.type) {
case "minimum_count":
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: getMinimumCategoricalCategoriesMessage(),
path: ["categories"],
});
return;
case "duplicate_value":
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message: "Categories must be unique",
path: ["categories", violation.index, "value"],
});
diff --git a/web/src/features/llm-api-key/types.ts b/web/src/features/llm-api-key/types.ts
index 62c7f4ba10..46b7eedb93 100644
--- a/web/src/features/llm-api-key/types.ts
+++ b/web/src/features/llm-api-key/types.ts
@@ -13,7 +13,7 @@ export const LlmApiKeySchema = z.object({
.min(1)
.regex(/^[^:]+$/, "Provider name cannot contain colons"),
adapter: z.enum(LLMAdapter),
- baseURL: z.string().url().optional(),
+ baseURL: z.url().optional(),
withDefaultModels: z.boolean().optional(),
customModels: z.array(z.string().min(1)).optional(),
config: z.union([VertexAIConfigSchema, BedrockConfigSchema]).optional(),
diff --git a/web/src/features/mcp/server/mcpServer.ts b/web/src/features/mcp/server/mcpServer.ts
index fd81df59b6..9870b95853 100644
--- a/web/src/features/mcp/server/mcpServer.ts
+++ b/web/src/features/mcp/server/mcpServer.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/no-deprecated -- Keep the MCP low-level Server API for now; migration to McpServer needs endpoint-level coverage. */
/**
* MCP Server Instance
*
diff --git a/web/src/features/mcp/server/transport.ts b/web/src/features/mcp/server/transport.ts
index 22763f0807..b628a41ac9 100644
--- a/web/src/features/mcp/server/transport.ts
+++ b/web/src/features/mcp/server/transport.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/no-deprecated -- Keep the MCP low-level Server API for now; migration to McpServer needs endpoint-level coverage. */
/**
* MCP Streamable HTTP Transport
*
diff --git a/web/src/features/models/components/test-match/TestModelMatchDialog.tsx b/web/src/features/models/components/test-match/TestModelMatchDialog.tsx
index dd46d2bf7e..4611acbe96 100644
--- a/web/src/features/models/components/test-match/TestModelMatchDialog.tsx
+++ b/web/src/features/models/components/test-match/TestModelMatchDialog.tsx
@@ -47,7 +47,7 @@ export function TestModelMatchDialog({
);
// Handle form submission
- const handleSubmit = (e: React.FormEvent) => {
+ const handleSubmit = (e: React.SyntheticEvent) => {
e.preventDefault();
if (modelName.trim()) {
setHasSubmitted(true);
diff --git a/web/src/features/organizations/utils/organizationNameSchema.ts b/web/src/features/organizations/utils/organizationNameSchema.ts
index 8c58a54b30..289b62c36a 100644
--- a/web/src/features/organizations/utils/organizationNameSchema.ts
+++ b/web/src/features/organizations/utils/organizationNameSchema.ts
@@ -43,7 +43,7 @@ export const organizationFormSchema = organizationNameSchema
const { type, size } = ctx.value;
if ((type === "Company" || type === "Agency") && !size) {
ctx.issues.push({
- code: z.ZodIssueCode.custom,
+ code: "custom",
path: ["size"],
input: ctx.value.size,
message: "Please specify the size of your organization",
diff --git a/web/src/features/posthog-integration/types.ts b/web/src/features/posthog-integration/types.ts
index b277cf90ef..6b55c16e2e 100644
--- a/web/src/features/posthog-integration/types.ts
+++ b/web/src/features/posthog-integration/types.ts
@@ -2,10 +2,7 @@ import { AnalyticsIntegrationExportSource } from "@langfuse/shared";
import { z } from "zod";
export const posthogIntegrationFormSchema = z.object({
- posthogHostname: z
- .string()
- .url()
- .transform((v) => new URL(v).href),
+ posthogHostname: z.url().transform((v) => new URL(v).href),
posthogProjectApiKey: z.string().refine((v) => v.startsWith("phc_"), {
message:
"PostHog 'Project API Key' must start with 'phc_'. You can find it in the PostHog project settings.",
diff --git a/web/src/features/prompts/components/prompt-detail.tsx b/web/src/features/prompts/components/prompt-detail.tsx
index 524ecaa2bb..08ea9f4da5 100644
--- a/web/src/features/prompts/components/prompt-detail.tsx
+++ b/web/src/features/prompts/components/prompt-detail.tsx
@@ -538,6 +538,7 @@ export const PromptDetail = ({
<PromptReferenceProvider projectId={projectId}>
{prompt.type === PromptType.Chat && chatMessages ? (
<div className="w-full">
+ {/* eslint-disable-next-line @typescript-eslint/no-deprecated -- Internal backwards-compatible component alias. */}
<OpenAiMessageView
messages={chatMessages}
shouldRenderMarkdown={true}
diff --git a/web/src/features/prompts/components/prompt-new.tsx b/web/src/features/prompts/components/prompt-new.tsx
index 8d523f87ef..908762d985 100644
--- a/web/src/features/prompts/components/prompt-new.tsx
+++ b/web/src/features/prompts/components/prompt-new.tsx
@@ -8,7 +8,7 @@ export const NewPrompt = () => {
const projectId = useProjectIdFromURL();
const [initialPromptId] = useQueryParam("promptId", StringParam);
- const { data: initialPrompt, isInitialLoading } = api.prompts.byId.useQuery(
+ const { data: initialPrompt, isLoading } = api.prompts.byId.useQuery(
{
projectId: projectId as string, // Typecast as query is enabled only when projectId is present
id: initialPromptId ?? "",
@@ -20,7 +20,7 @@ export const NewPrompt = () => {
},
);
- if (isInitialLoading) {
+ if (isLoading) {
return <div className="p-3">Loading...</div>;
}
diff --git a/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx b/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
index d5a43579a3..fb17af6aad 100644
--- a/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
+++ b/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
@@ -96,7 +96,7 @@ const createFormSchema = (params: {
/^[^:]+$/,
"Provider name cannot contain colons. Use a format like 'OpenRouter_Mistral' instead.",
),
- adapter: z.nativeEnum(LLMAdapter),
+ adapter: z.enum(LLMAdapter),
baseURL: z.union([z.literal(""), z.url()]),
withDefaultModels: z.boolean(),
customModels: z.array(z.object({ value: z.string().min(1) })),
diff --git a/web/src/features/public-api/shared/unstable-public-api-error-schema.ts b/web/src/features/public-api/shared/unstable-public-api-error-schema.ts
index d37cd7a047..21e7f3542f 100644
--- a/web/src/features/public-api/shared/unstable-public-api-error-schema.ts
+++ b/web/src/features/public-api/shared/unstable-public-api-error-schema.ts
@@ -30,7 +30,7 @@ const UnstablePublicApiValidationIssue = z
message: z.string(),
path: z.array(z.union([z.string(), z.number()])),
})
- .passthrough();
+ .loose();
export const UnstablePublicApiErrorDetails = z
.object({
diff --git a/web/src/features/public-api/types/llm-connections.ts b/web/src/features/public-api/types/llm-connections.ts
index 6bd16bf7cc..56a8b35766 100644
--- a/web/src/features/public-api/types/llm-connections.ts
+++ b/web/src/features/public-api/types/llm-connections.ts
@@ -49,9 +49,9 @@ export const GetLlmConnectionsV1Response = z
// Base request schema (before adapter-specific validation)
const PutLlmConnectionV1BodyBase = z.object({
provider: z.string().min(1),
- adapter: z.nativeEnum(LLMAdapter),
+ adapter: z.enum(LLMAdapter),
secretKey: z.string().min(1),
- baseURL: z.string().url().nullable().optional(),
+ baseURL: z.url().nullable().optional(),
customModels: z.array(z.string().min(1)).optional(),
withDefaultModels: z.boolean().optional().default(true),
extraHeaders: z.record(z.string(), z.string()).optional(),
diff --git a/web/src/features/public-api/types/metrics.ts b/web/src/features/public-api/types/metrics.ts
index 05b3d6c655..b83077b3e5 100644
--- a/web/src/features/public-api/types/metrics.ts
+++ b/web/src/features/public-api/types/metrics.ts
@@ -35,8 +35,8 @@ export const MetricsQueryObject = z
.nullable()
.optional()
.default(null),
- fromTimestamp: z.string().datetime({ offset: true }),
- toTimestamp: z.string().datetime({ offset: true }),
+ fromTimestamp: z.iso.datetime({ offset: true }),
+ toTimestamp: z.iso.datetime({ offset: true }),
orderBy: z
.array(
z.object({
@@ -103,8 +103,8 @@ export const MetricsQueryObjectV2 = z
.nullable()
.optional()
.default(null),
- fromTimestamp: z.string().datetime({ offset: true }),
- toTimestamp: z.string().datetime({ offset: true }),
+ fromTimestamp: z.iso.datetime({ offset: true }),
+ toTimestamp: z.iso.datetime({ offset: true }),
orderBy: z
.array(
z.object({
@@ -162,7 +162,7 @@ export const GetMetricsDailyV1Response = z
data: z.array(
z
.object({
- date: z.string().date(),
+ date: z.iso.date(),
countTraces: z.number(),
countObservations: z.number(),
totalCost: z.number(),
diff --git a/web/src/features/public-api/types/models.ts b/web/src/features/public-api/types/models.ts
index b97a43d347..2d18991b24 100644
--- a/web/src/features/public-api/types/models.ts
+++ b/web/src/features/public-api/types/models.ts
@@ -165,7 +165,7 @@ export const PostModelsV1Body = z
// Validation 1: Must provide either flat prices OR pricing tiers (not both, not neither)
if (hasFlatPrices && hasTiers) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message:
"Must provide either flat prices (inputPrice/outputPrice/totalPrice) OR pricingTiers, not both",
});
@@ -174,7 +174,7 @@ export const PostModelsV1Body = z
if (!hasFlatPrices && !hasTiers) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
message:
"Must provide either flat prices (inputPrice/outputPrice/totalPrice) OR pricingTiers",
});
@@ -185,7 +185,7 @@ export const PostModelsV1Body = z
if (hasFlatPrices) {
if ((data.inputPrice || data.outputPrice) && data.totalPrice) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
path: ["totalPrice"],
message:
"If input and/or output price is set, total price must be null",
@@ -198,7 +198,7 @@ export const PostModelsV1Body = z
const result = validatePricingTiers(data.pricingTiers!);
if (!result.valid) {
ctx.addIssue({
- code: z.ZodIssueCode.custom,
+ code: "custom",
path: ["pricingTiers"],
message: result.error,
});
diff --git a/web/src/features/public-api/types/observations.ts b/web/src/features/public-api/types/observations.ts
index e12277966b..81f16eb333 100644
--- a/web/src/features/public-api/types/observations.ts
+++ b/web/src/features/public-api/types/observations.ts
@@ -374,7 +374,7 @@ export const GetObservationsV2Query = z.object({
/**
* Typed observation schema for v2 API responses.
* Core fields are always present; other fields are optional depending on requested field groups.
- * Uses .passthrough() to allow server enrichment fields not explicitly listed.
+ * Uses .loose() to allow server enrichment fields not explicitly listed.
*/
const APIObservationV2 = z
.object({
@@ -432,7 +432,7 @@ const APIObservationV2 = z
// Enrichment fields
modelId: z.string().nullable().optional(),
})
- .passthrough();
+ .loose();
export const GetObservationsV2Response = z
.object({
diff --git a/web/src/features/query/types.ts b/web/src/features/query/types.ts
index 4d15091a15..d52252be79 100644
--- a/web/src/features/query/types.ts
+++ b/web/src/features/query/types.ts
@@ -80,7 +80,7 @@ export const viewDeclaration = z.object({
.optional(),
});
-export const stringDateTime = z.string().datetime({ offset: true });
+export const stringDateTime = z.iso.datetime({ offset: true });
export const views = z.enum([
"traces",
diff --git a/web/src/features/rbac/components/CreateProjectMemberButton.tsx b/web/src/features/rbac/components/CreateProjectMemberButton.tsx
index 4acaf787df..87d0ffee50 100644
--- a/web/src/features/rbac/components/CreateProjectMemberButton.tsx
+++ b/web/src/features/rbac/components/CreateProjectMemberButton.tsx
@@ -42,7 +42,7 @@ import { RoleSelectItem } from "@/src/features/rbac/components/RoleSelectItem";
import { ActionButton } from "@/src/components/ActionButton";
const formSchema = z.object({
- email: z.string().trim().email(),
+ email: z.string().trim().pipe(z.email()),
orgRole: z.enum(Role),
projectRole: z.enum(Role),
});
diff --git a/web/src/features/rbac/server/membersRouter.ts b/web/src/features/rbac/server/membersRouter.ts
index 0bd432be47..9c5579a84b 100644
--- a/web/src/features/rbac/server/membersRouter.ts
+++ b/web/src/features/rbac/server/membersRouter.ts
@@ -113,7 +113,7 @@ export const membersRouter = createTRPCRouter({
.input(
z.object({
orgId: z.string(),
- email: z.string().email(),
+ email: z.email(),
orgRole: z.enum(Role),
// in case a projectRole should be set for a specific project
projectId: z.string().optional(),
diff --git a/web/src/features/slack/components/SlackConnectButton.tsx b/web/src/features/slack/components/SlackConnectButton.tsx
index b8fcb22a9d..ee925f327f 100644
--- a/web/src/features/slack/components/SlackConnectButton.tsx
+++ b/web/src/features/slack/components/SlackConnectButton.tsx
@@ -1,6 +1,6 @@
import React, { useState, useEffect, useRef } from "react";
import { Button, type ButtonProps } from "@/src/components/ui/button";
-import { Slack } from "lucide-react";
+import { SiSlack } from "react-icons/si";
import { api } from "@/src/utils/api";
import { showSuccessToast } from "@/src/features/notifications/showSuccessToast";
import { showErrorToast } from "@/src/features/notifications/showErrorToast";
@@ -183,7 +183,7 @@ export const SlackConnectButton: React.FC<SlackConnectButtonProps> = ({
size={size}
className="flex items-center gap-2"
>
- <Slack className="h-4 w-4" />
+ <SiSlack className="h-4 w-4" />
{showText && <span>{isConnecting ? "Connecting..." : buttonText}</span>}
</Button>
);
diff --git a/web/src/features/support-chat/IntroSection.tsx b/web/src/features/support-chat/IntroSection.tsx
index 7f2015519e..e7e52ffbe6 100644
--- a/web/src/features/support-chat/IntroSection.tsx
+++ b/web/src/features/support-chat/IntroSection.tsx
@@ -1,7 +1,6 @@
import { useMemo } from "react";
import { Button } from "@/src/components/ui/button";
import {
- Github,
Bug,
Lightbulb,
Sparkles,
@@ -10,8 +9,7 @@ import {
Radio,
Calendar,
} from "lucide-react";
-//eslint-disable-next-line no-restricted-imports
-import { SiDiscord } from "react-icons/si";
+import { SiDiscord, SiGithub } from "react-icons/si";
import { RainbowButton } from "@/src/components/magicui/rainbow-button";
import { Separator } from "@/src/components/ui/separator";
import { usePlan } from "@/src/features/entitlements/hooks";
@@ -191,7 +189,7 @@ export function IntroSection({ onStartForm }: { onStartForm: () => void }) {
target="_blank"
rel="noopener"
>
- <Github className="mr-2 h-4 w-4" /> Get Help ↗
+ <SiGithub className="mr-2 h-4 w-4" /> Get Help ↗
</a>
</Button>
<Button variant="outline" asChild>
@@ -221,7 +219,7 @@ export function IntroSection({ onStartForm }: { onStartForm: () => void }) {
{supportType !== "custom" && (
<div>
<div className="flex items-center gap-2 text-base font-semibold">
- <Github className="h-4 w-4" /> Community & Resources
+ <SiGithub className="h-4 w-4" /> Community & Resources
</div>
<p className="text-muted-foreground mt-1 text-sm">
Join the conversation and connect with the Langfuse community.
@@ -233,7 +231,7 @@ export function IntroSection({ onStartForm }: { onStartForm: () => void }) {
target="_blank"
rel="noopener"
>
- <Github className="mr-2 h-4 w-4" /> GitHub ↗
+ <SiGithub className="mr-2 h-4 w-4" /> GitHub ↗
</a>
</Button>
<Button asChild variant="ghost" className="justify-start px-1.5">
diff --git a/web/src/features/support-chat/SupportFormSection.tsx b/web/src/features/support-chat/SupportFormSection.tsx
index 559cb0c8bc..3007e70519 100644
--- a/web/src/features/support-chat/SupportFormSection.tsx
+++ b/web/src/features/support-chat/SupportFormSection.tsx
@@ -343,7 +343,12 @@ export function SupportFormSection({
projectId: project?.id,
browserMetadata: {
userAgent: navigator.userAgent,
- platform: navigator.platform,
+ platform:
+ (
+ navigator as Navigator & {
+ userAgentData?: { platform?: string };
+ }
+ ).userAgentData?.platform ?? undefined,
language: navigator.language,
viewport: { w: window.innerWidth, h: window.innerHeight },
},
diff --git a/web/src/features/support-chat/trpc/plainRouter.ts b/web/src/features/support-chat/trpc/plainRouter.ts
index 942b7d3c33..29a5a3483e 100644
--- a/web/src/features/support-chat/trpc/plainRouter.ts
+++ b/web/src/features/support-chat/trpc/plainRouter.ts
@@ -51,7 +51,7 @@ const CreateSupportThreadInput = z.object({
severity: SeveritySchema,
topic: TopicSchema,
message: z.string().trim().min(1),
- url: z.string().url().optional(),
+ url: z.url().optional(),
organizationId: z.string().optional(),
projectId: z.string().optional(),
browserMetadata: z.record(z.string(), z.any()).optional(),
@@ -59,7 +59,7 @@ const CreateSupportThreadInput = z.object({
/** IDs of attachments already uploaded via prepareAttachmentUploads (Plain) */
attachmentIds: z.array(z.string()).optional(),
/** URLs of attachments already uploaded to Pylon */
- pylonAttachmentUrls: z.array(z.string().url()).optional(),
+ pylonAttachmentUrls: z.array(z.url()).optional(),
});
const PrepareAttachmentUploadsInput = z.object({
diff --git a/web/src/features/tag/components/TagInput.tsx b/web/src/features/tag/components/TagInput.tsx
index 046cc70b70..f2d2f8e87e 100644
--- a/web/src/features/tag/components/TagInput.tsx
+++ b/web/src/features/tag/components/TagInput.tsx
@@ -14,7 +14,7 @@ type TagInputProps = React.ComponentPropsWithoutRef<
};
export const TagInput = React.forwardRef<
- React.ElementRef<typeof CommandPrimitive.Input>,
+ React.ComponentRef<typeof CommandPrimitive.Input>,
TagInputProps
>(
(
diff --git a/web/src/pages/api/public/scores/index.ts b/web/src/pages/api/public/scores/index.ts
index 1dbebe4fac..f8d9e2114a 100644
--- a/web/src/pages/api/public/scores/index.ts
+++ b/web/src/pages/api/public/scores/index.ts
@@ -5,7 +5,7 @@ import { withMiddlewares } from "@/src/features/public-api/server/withMiddleware
import {
GetScoresQueryV1,
GetScoresResponseV1,
- filterAndValidateV1GetScoreList,
+ filterAndValidateLegacyV1GetScoreList,
PostScoresBodyV1,
PostScoresResponseV1,
} from "@langfuse/shared";
@@ -90,7 +90,7 @@ export default withMiddlewares({
return {
// As these are traces scores, we expect all scores to have a traceId set
// For type consistency, we validate the scores against the v1 schema which requires a traceId
- data: filterAndValidateV1GetScoreList(items),
+ data: filterAndValidateLegacyV1GetScoreList(items),
meta: {
page: query.page,
limit: query.limit,
diff --git a/web/src/pages/api/public/traces/[traceId].ts b/web/src/pages/api/public/traces/[traceId].ts
index c663d0faf8..eae2460176 100644
--- a/web/src/pages/api/public/traces/[traceId].ts
+++ b/web/src/pages/api/public/traces/[traceId].ts
@@ -11,7 +11,7 @@ import {
} from "@/src/features/public-api/types/traces";
import { env } from "@/src/env.mjs";
import {
- filterAndValidateDbTraceScoreList,
+ filterAndValidateDbLegacyTraceScoreList,
LangfuseNotFoundError,
} from "@langfuse/shared";
import { prisma } from "@langfuse/shared/src/db";
@@ -131,7 +131,7 @@ export default withMiddlewares({
const outObservations = observationsView.map(transformDbToApiObservation);
// As these are traces scores, we expect all scores to have a traceId set
// For type consistency, we validate the scores against the v1 schema which requires a traceId
- const validatedScores = filterAndValidateDbTraceScoreList({
+ const validatedScores = filterAndValidateDbLegacyTraceScoreList({
scores,
onParseError: traceException,
});
diff --git a/web/src/pages/auth/enterprise-sso-required.tsx b/web/src/pages/auth/enterprise-sso-required.tsx
index f03bf06107..d02588c66e 100644
--- a/web/src/pages/auth/enterprise-sso-required.tsx
+++ b/web/src/pages/auth/enterprise-sso-required.tsx
@@ -21,7 +21,7 @@ import { env } from "@/src/env.mjs";
import { captureException } from "@sentry/nextjs";
const enterpriseSsoFormSchema = z.object({
- email: z.string().email(),
+ email: z.email(),
});
const PROVIDER_LABELS: Record<string, string> = {
diff --git a/web/src/pages/auth/sign-in.tsx b/web/src/pages/auth/sign-in.tsx
index b80d29d134..d28ce5dc06 100644
--- a/web/src/pages/auth/sign-in.tsx
+++ b/web/src/pages/auth/sign-in.tsx
@@ -46,7 +46,7 @@ import { useLangfuseCloudRegion } from "@/src/features/organizations/hooks";
import { getSafeRedirectPath } from "@/src/utils/redirect";
const credentialAuthForm = z.object({
- email: z.string().email(),
+ email: z.email(),
password: z.string().min(8, {
message: "Password must be at least 8 characters long",
}),
@@ -657,7 +657,7 @@ export default function SignIn({
credentialsForm.clearErrors();
// Ensure email is valid before hitting the API
- const emailSchema = z.string().email();
+ const emailSchema = z.email();
const email = emailSchema.safeParse(credentialsForm.getValues("email"));
if (!email.success) {
credentialsForm.setError("email", {
diff --git a/web/src/pages/auth/sign-up.tsx b/web/src/pages/auth/sign-up.tsx
index 7688c0dfd2..7b2d376400 100644
--- a/web/src/pages/auth/sign-up.tsx
+++ b/web/src/pages/auth/sign-up.tsx
@@ -84,7 +84,7 @@ export default function SignIn({
form.clearErrors();
// Ensure email is valid before hitting the API
- // We use z.string().email() manually because we don't use the full schema resolver in the first step
+ // We use z.email() manually because we don't use the full schema resolver in the first step
// or we could just trigger validation for the email field only
const emailValue = form.getValues("email");
// Basic check using zod directly or trigger
@@ -95,7 +95,7 @@ export default function SignIn({
// Manual email validation to match sign-in behavior
// Although signupSchema.shape.email is ZodString, let's just use a new Zod check for simplicity and robustness
- const emailSchema = z.string().email();
+ const emailSchema = z.email();
const emailResult = emailSchema.safeParse(emailValue);
if (!emailResult.success) {
diff --git a/web/src/pages/project/[projectId]/settings/index.tsx b/web/src/pages/project/[projectId]/settings/index.tsx
index 8a75f346dd..6b912b8b15 100644
--- a/web/src/pages/project/[projectId]/settings/index.tsx
+++ b/web/src/pages/project/[projectId]/settings/index.tsx
@@ -27,7 +27,7 @@ import { ModelsSettings } from "@/src/features/models/components/ModelSettings";
import ConfigureRetention from "@/src/features/projects/components/ConfigureRetention";
import ContainerPage from "@/src/components/layouts/container-page";
import ProtectedLabelsSettings from "@/src/features/prompts/components/ProtectedLabelsSettings";
-import { Slack } from "lucide-react";
+import { SiSlack } from "react-icons/si";
import { ScoreConfigSettings } from "@/src/features/score-configs/components/ScoreConfigSettings";
import { env } from "@/src/env.mjs";
import { NotificationSettings } from "@/src/features/notifications/components/NotificationSettings";
@@ -355,7 +355,7 @@ const Integrations = (props: { projectId: string }) => {
<Card className="p-3">
<div className="mb-4 flex items-center gap-2">
- <Slack className="text-foreground h-5 w-5" />
+ <SiSlack className="text-foreground h-5 w-5" />
<span className="font-semibold">Slack</span>
</div>
<p className="text-primary mb-4 text-sm">
diff --git a/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx b/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx
index d2f3fc6d63..64a0d542e7 100644
--- a/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx
+++ b/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx
@@ -75,7 +75,7 @@ export default function BlobStorageIntegrationSettings() {
);
const syncStatus =
- state.isInitialLoading || !hasAccess || !state.data
+ state.isLoading || !hasAccess || !state.data
? undefined
: deriveSyncStatus({
enabled: state.data.enabled,
diff --git a/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx b/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx
index 8d61e890c9..e20162ca2a 100644
--- a/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx
+++ b/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx
@@ -65,7 +65,7 @@ export default function MixpanelIntegrationSettings() {
);
const status =
- state.isInitialLoading || !hasAccess
+ state.isLoading || !hasAccess
? undefined
: state.data?.enabled
? "active"
diff --git a/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx b/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx
index 8c164796ff..828ba6500f 100644
--- a/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx
+++ b/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx
@@ -62,7 +62,7 @@ export default function PosthogIntegrationSettings() {
);
const status =
- state.isInitialLoading || !hasAccess
+ state.isLoading || !hasAccess
? undefined
: state.data?.enabled
? "active"
diff --git a/web/src/pages/project/[projectId]/settings/integrations/slack.tsx b/web/src/pages/project/[projectId]/settings/integrations/slack.tsx
index 591a83cee8..4984d83cdc 100644
--- a/web/src/pages/project/[projectId]/settings/integrations/slack.tsx
+++ b/web/src/pages/project/[projectId]/settings/integrations/slack.tsx
@@ -64,13 +64,13 @@ export default function SlackIntegrationSettings() {
}
}, [router.query]);
- const { data: integrationStatus, isInitialLoading } =
+ const { data: integrationStatus, isLoading } =
api.slack.getIntegrationStatus.useQuery(
{ projectId },
{ enabled: !!projectId },
);
- const status = isInitialLoading
+ const status = isLoading
? undefined
: integrationStatus?.isConnected
? "active"
diff --git a/web/src/server/api/routers/public.ts b/web/src/server/api/routers/public.ts
index 3c21731e0d..4bda36667c 100644
--- a/web/src/server/api/routers/public.ts
+++ b/web/src/server/api/routers/public.ts
@@ -8,8 +8,8 @@ const ReleaseApiRes = z.array(
z.object({
repo: z.string(),
latestRelease: z.string(),
- publishedAt: z.string().datetime(),
- url: z.string().url(),
+ publishedAt: z.iso.datetime(),
+ url: z.url(),
}),
);
diff --git a/web/src/server/api/routers/surveys.ts b/web/src/server/api/routers/surveys.ts
index 68d149202a..3ed0491d0f 100644
--- a/web/src/server/api/routers/surveys.ts
+++ b/web/src/server/api/routers/surveys.ts
@@ -8,7 +8,7 @@ import { SurveyName } from "@prisma/client";
import { logger } from "@langfuse/shared/src/server";
const surveyResponseSchema = z.object({
- surveyName: z.nativeEnum(SurveyName),
+ surveyName: z.enum(SurveyName),
response: z.record(z.string(), z.string()),
orgId: z.string().optional(),
});
diff --git a/web/src/server/api/trpc.ts b/web/src/server/api/trpc.ts
index 2c5b8599e4..69d8a0fa12 100644
--- a/web/src/server/api/trpc.ts
+++ b/web/src/server/api/trpc.ts
@@ -107,7 +107,7 @@ const t = initTRPC.context<typeof createTRPCContext>().create({
data: {
...shape.data,
zodError:
- error.cause instanceof ZodError ? error.cause.flatten() : null,
+ error.cause instanceof ZodError ? z.flattenError(error.cause) : null,
},
};
},
diff --git a/web/src/server/auth.ts b/web/src/server/auth.ts
index 8d23ab0dd4..0cc257ff16 100644
--- a/web/src/server/auth.ts
+++ b/web/src/server/auth.ts
@@ -917,7 +917,7 @@ export async function getAuthOptions(): Promise<NextAuthOptions> {
logger.error("No email found in user object");
throw new Error("No email found in user object");
}
- if (z.string().email().safeParse(email).success === false) {
+ if (z.email().safeParse(email).success === false) {
logger.error("Invalid email found in user object");
throw new Error("Invalid email found in user object");
}
diff --git a/web/src/utils/chatml/jumptoplayground.clienttest.ts b/web/src/utils/chatml/jumptoplayground.clienttest.ts
index 1a59c4357e..d5e231cda4 100644
--- a/web/src/utils/chatml/jumptoplayground.clienttest.ts
+++ b/web/src/utils/chatml/jumptoplayground.clienttest.ts
@@ -62,7 +62,7 @@ vi.mock("@langfuse/shared", async () => {
tool_calls: z.array(z.any()).optional(),
tool_call_id: z.string().optional(),
})
- .passthrough(),
+ .loose(),
isOpenAITextContentPart: (content: any) => {
return OpenAITextContentPart.safeParse(content).success;
},
diff --git a/web/src/utils/clipboard.ts b/web/src/utils/clipboard.ts
index 6a96c7f77e..090b938793 100644
--- a/web/src/utils/clipboard.ts
+++ b/web/src/utils/clipboard.ts
@@ -24,6 +24,7 @@ const _unsafeNonSecureCopyToClipboard = (text: string) => {
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- Fallback for non-secure contexts where the Clipboard API is unavailable.
document.execCommand("copy");
document.body.removeChild(textArea);
} catch (error) {
diff --git a/worker/src/env.ts b/worker/src/env.ts
index 8a4260b640..dd5dbf9956 100644
--- a/worker/src/env.ts
+++ b/worker/src/env.ts
@@ -95,7 +95,7 @@ const EnvSchema = z.object({
LANGFUSE_USE_AZURE_BLOB: z.enum(["true", "false"]).default("false"),
- CLICKHOUSE_URL: z.string().url(),
+ CLICKHOUSE_URL: z.url(),
CLICKHOUSE_USER: z.string(),
CLICKHOUSE_CLUSTER_NAME: z.string().default("default"),
CLICKHOUSE_DB: z.string().default("default"),
@@ -143,8 +143,7 @@ const EnvSchema = z.object({
LANGFUSE_SKIP_INGESTION_CLICKHOUSE_READ_PROJECT_IDS: z.string().default(""),
// Set a date after which S3 was active. Projects created after this date do
// perform a ClickHouse read as part of the ingestion pipeline.
- LANGFUSE_SKIP_INGESTION_CLICKHOUSE_READ_MIN_PROJECT_CREATE_DATE: z
- .string()
+ LANGFUSE_SKIP_INGESTION_CLICKHOUSE_READ_MIN_PROJECT_CREATE_DATE: z.iso
.date()
.optional(),