From 7192b4bacb7f7c49714a849c991fb47f643ef94d Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Thu, 23 Apr 2026 13:14:09 +0100 Subject: [PATCH] Revert "refactor(base): use uuid package validator in loader-sql" This reverts commit cfc50b7caeb27a4ce2656f4b284e553a9c0fb839. --- apps/server/src/core/base/query-cache/loader-sql.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/server/src/core/base/query-cache/loader-sql.ts b/apps/server/src/core/base/query-cache/loader-sql.ts index 8a5f6e2b..94c70d5b 100644 --- a/apps/server/src/core/base/query-cache/loader-sql.ts +++ b/apps/server/src/core/base/query-cache/loader-sql.ts @@ -1,5 +1,3 @@ -import { validate as isValidUUID } from 'uuid'; - import { ColumnSpec } from './query-cache.types'; /* @@ -42,10 +40,10 @@ export function buildLoaderSql( baseId: string, workspaceId: string, ): string { - if (!isValidUUID(baseId)) { + if (!UUID.test(baseId)) { throw new Error(`Invalid base id "${baseId}"`); } - if (!isValidUUID(workspaceId)) { + if (!UUID.test(workspaceId)) { throw new Error(`Invalid workspace id "${workspaceId}"`); } const projections = specs.map((spec) => projectionFor(spec)); @@ -118,8 +116,10 @@ function validateColumnName(name: string): void { } } +const UUID = + /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/; function validateUuid(s: string): void { - if (!isValidUUID(s)) { + if (!UUID.test(s)) { throw new Error(`Invalid property UUID "${s}"`); } }