mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 03:26:47 +08:00
feat(server): get recently updated docs (#12861)
close AI-218 #### PR Dependency Tree * **PR #12861** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a "Recently Updated Documents" feature, allowing users to view a paginated list of the most recently updated documents within a workspace. - Document metadata now includes a "title" field for easier identification. - **Tests** - Introduced new end-to-end tests to verify the recently updated documents query and its pagination behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
query getRecentlyUpdatedDocs($workspaceId: String!, $pagination: PaginationInput!) {
|
||||
workspace(id: $workspaceId) {
|
||||
recentlyUpdatedDocs(pagination: $pagination) {
|
||||
totalCount
|
||||
pageInfo {
|
||||
endCursor
|
||||
hasNextPage
|
||||
}
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
title
|
||||
createdAt
|
||||
updatedAt
|
||||
creatorId
|
||||
lastUpdaterId
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1180,6 +1180,32 @@ export const getPublicUserByIdQuery = {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getRecentlyUpdatedDocsQuery = {
|
||||
id: 'getRecentlyUpdatedDocsQuery' as const,
|
||||
op: 'getRecentlyUpdatedDocs',
|
||||
query: `query getRecentlyUpdatedDocs($workspaceId: String!, $pagination: PaginationInput!) {
|
||||
workspace(id: $workspaceId) {
|
||||
recentlyUpdatedDocs(pagination: $pagination) {
|
||||
totalCount
|
||||
pageInfo {
|
||||
endCursor
|
||||
hasNextPage
|
||||
}
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
title
|
||||
createdAt
|
||||
updatedAt
|
||||
creatorId
|
||||
lastUpdaterId
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getUserFeaturesQuery = {
|
||||
id: 'getUserFeaturesQuery' as const,
|
||||
op: 'getUserFeatures',
|
||||
|
||||
@@ -630,6 +630,7 @@ export interface DocType {
|
||||
mode: PublicDocMode;
|
||||
permissions: DocPermissions;
|
||||
public: Scalars['Boolean']['output'];
|
||||
title: Maybe<Scalars['String']['output']>;
|
||||
updatedAt: Maybe<Scalars['DateTime']['output']>;
|
||||
workspaceId: Scalars['String']['output'];
|
||||
}
|
||||
@@ -2647,6 +2648,8 @@ export interface WorkspaceType {
|
||||
publicPages: Array<DocType>;
|
||||
/** quota of workspace */
|
||||
quota: WorkspaceQuotaType;
|
||||
/** Get recently updated docs of a workspace */
|
||||
recentlyUpdatedDocs: PaginatedDocType;
|
||||
/** Role of current signed in user in workspace */
|
||||
role: Permission;
|
||||
/** Search a specific table */
|
||||
@@ -2694,6 +2697,10 @@ export interface WorkspaceTypePublicPageArgs {
|
||||
pageId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface WorkspaceTypeRecentlyUpdatedDocsArgs {
|
||||
pagination: PaginationInput;
|
||||
}
|
||||
|
||||
export interface WorkspaceTypeSearchArgs {
|
||||
input: SearchInput;
|
||||
}
|
||||
@@ -4064,6 +4071,39 @@ export type GetPublicUserByIdQuery = {
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type GetRecentlyUpdatedDocsQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
pagination: PaginationInput;
|
||||
}>;
|
||||
|
||||
export type GetRecentlyUpdatedDocsQuery = {
|
||||
__typename?: 'Query';
|
||||
workspace: {
|
||||
__typename?: 'WorkspaceType';
|
||||
recentlyUpdatedDocs: {
|
||||
__typename?: 'PaginatedDocType';
|
||||
totalCount: number;
|
||||
pageInfo: {
|
||||
__typename?: 'PageInfo';
|
||||
endCursor: string | null;
|
||||
hasNextPage: boolean;
|
||||
};
|
||||
edges: Array<{
|
||||
__typename?: 'DocTypeEdge';
|
||||
node: {
|
||||
__typename?: 'DocType';
|
||||
id: string;
|
||||
title: string | null;
|
||||
createdAt: string | null;
|
||||
updatedAt: string | null;
|
||||
creatorId: string | null;
|
||||
lastUpdaterId: string | null;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
export type GetUserFeaturesQueryVariables = Exact<{ [key: string]: never }>;
|
||||
|
||||
export type GetUserFeaturesQuery = {
|
||||
@@ -5197,6 +5237,11 @@ export type Queries =
|
||||
variables: GetPublicUserByIdQueryVariables;
|
||||
response: GetPublicUserByIdQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getRecentlyUpdatedDocsQuery';
|
||||
variables: GetRecentlyUpdatedDocsQueryVariables;
|
||||
response: GetRecentlyUpdatedDocsQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getUserFeaturesQuery';
|
||||
variables: GetUserFeaturesQueryVariables;
|
||||
|
||||
Reference in New Issue
Block a user