feat(server): docs pagination (#12086)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added paginated document listing for workspaces, allowing users to browse documents with pagination controls.
  - Enhanced document details to display creation and update timestamps, as well as information about the creator and last updater.
- **Bug Fixes**
  - Updated deprecation notice for workspace document metadata fields to guide users to the latest recommended field.
- **Tests**
  - Added new tests to verify document info retrieval and pagination functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
forehalo
2025-04-30 10:39:00 +00:00
parent 8938da4c24
commit 3feea3dc6c
6 changed files with 271 additions and 8 deletions

View File

@@ -425,20 +425,35 @@ enum DocRole {
}
type DocType {
createdAt: DateTime
"""Doc create user"""
createdBy: PublicUserType
creatorId: String
defaultRole: DocRole!
"""paginated doc granted users list"""
grantedUsersList(pagination: PaginationInput!): PaginatedGrantedDocUserType!
id: String!
"""Doc last updated user"""
lastUpdatedBy: PublicUserType
lastUpdaterId: String
"""Doc metadata"""
meta: WorkspaceDocMeta!
mode: PublicDocMode!
permissions: DocPermissions!
public: Boolean!
updatedAt: DateTime
workspaceId: String!
}
type DocTypeEdge {
cursor: String!
node: DocType!
}
type DocUpdateBlockedDataType {
docId: String!
spaceId: String!
@@ -1189,6 +1204,12 @@ type PaginatedCopilotWorkspaceFileType {
totalCount: Int!
}
type PaginatedDocType {
edges: [DocTypeEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type PaginatedGrantedDocUserType {
edges: [GrantedDocUserTypeEdge!]!
pageInfo: PageInfo!
@@ -1781,6 +1802,7 @@ type WorkspaceType {
"""Get get with given id"""
doc(docId: String!): DocType!
docs(pagination: PaginationInput!): PaginatedDocType!
embedding: CopilotWorkspaceConfig!
"""Enable AI"""
@@ -1817,7 +1839,7 @@ type WorkspaceType {
owner: UserType!
"""Cloud page metadata of workspace"""
pageMeta(pageId: String!): WorkspaceDocMeta! @deprecated(reason: "use [WorkspaceType.doc.meta] instead")
pageMeta(pageId: String!): WorkspaceDocMeta! @deprecated(reason: "use [WorkspaceType.doc] instead")
"""map of action permissions"""
permissions: WorkspacePermissions!