mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(server): add all ignored docs endpoint (#11953)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added the ability to view a complete list of ignored documents for a workspace without pagination. - Introduced separate options to add or remove ignored documents from workspace embeddings. - Added a new query to fetch all ignored documents for a workspace, including document IDs and creation timestamps. - **Refactor** - Reorganized and clarified GraphQL mutations and queries related to managing ignored documents in workspace embeddings. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -31,6 +31,7 @@ import { MAX_EMBEDDABLE_SIZE } from '../types';
|
||||
import { CopilotWorkspaceService } from './service';
|
||||
import {
|
||||
CopilotWorkspaceFileType,
|
||||
CopilotWorkspaceIgnoredDocType,
|
||||
PaginatedCopilotWorkspaceFileType,
|
||||
PaginatedIgnoredDocsType,
|
||||
} from './types';
|
||||
@@ -90,6 +91,18 @@ export class CopilotWorkspaceEmbeddingConfigResolver {
|
||||
return paginate(ignoredDocs, 'createdAt', pagination, totalCount);
|
||||
}
|
||||
|
||||
@ResolveField(() => [CopilotWorkspaceIgnoredDocType], {
|
||||
complexity: 2,
|
||||
})
|
||||
async allIgnoredDocs(
|
||||
@Parent() config: CopilotWorkspaceConfigType
|
||||
): Promise<CopilotWorkspaceIgnoredDocType[]> {
|
||||
const [ignoredDocs] = await this.copilotWorkspace.listIgnoredDocs(
|
||||
config.workspaceId
|
||||
);
|
||||
|
||||
return ignoredDocs;
|
||||
}
|
||||
@Mutation(() => Number, {
|
||||
name: 'updateWorkspaceEmbeddingIgnoredDocs',
|
||||
complexity: 2,
|
||||
|
||||
@@ -273,6 +273,7 @@ type CopilotSessionType {
|
||||
}
|
||||
|
||||
type CopilotWorkspaceConfig {
|
||||
allIgnoredDocs: [CopilotWorkspaceIgnoredDoc!]!
|
||||
files(pagination: PaginationInput!): PaginatedCopilotWorkspaceFileType!
|
||||
ignoredDocs(pagination: PaginationInput!): PaginatedIgnoredDocsType!
|
||||
workspaceId: String!
|
||||
|
||||
Reference in New Issue
Block a user