mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 05:14:54 +00:00
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:
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user