Move Knowledge Constants and Fix Inverted Ownership Filters

- Add XAiKnowledgeScope enum (Conversation=0, Project=1, Global=2, User=3) with StringValue prefixes;
- Add Knowledge constants, scope prefixes, metadata keys and XAiErrorRoute to XAiModelsConstants;
- Fix inverted ownerId condition in QueryProjects / QueryConversations / QueryMessages
  (ownership filter was skipped for real owners -> cross-user data exposure);
- Fix inverted HasChild() validation in HasDefaultProject / HasDefaultConversation;
- LoadConversations: ignore soft-deleted conversations;
- CreateProject / CreateConversation: set isDefaultLanguageHandled = true;
- GetDefaultConversation: use projectId instead of unloaded project.Id.
This commit is contained in:
2026-10-29 19:58:47 +03:30
parent 093fc08e14
commit ef1421def4
4 changed files with 68 additions and 10 deletions
+2 -2
View File
@@ -267,7 +267,7 @@ namespace xAiModels.Extensions
{
//
// Validate Args ...
if (source.HasChild() ||
if (!source.HasChild() ||
ownerId.IsNullOrEmpty())
{
XException.InvalidArgs.Throw();
@@ -306,7 +306,7 @@ namespace xAiModels.Extensions
{
//
// Validate Args ...
if (source.HasChild() ||
if (!source.HasChild() ||
projectId.IsDefaultGuid())
{
XException.InvalidArgs.Throw();