feat(core): add doc grant feature to share menu (#9672)

This commit is contained in:
JimmFly
2025-02-07 13:05:58 +00:00
parent 459972fe6c
commit 5ae5fd88f1
57 changed files with 3188 additions and 697 deletions

View File

@@ -348,6 +348,7 @@ export enum ErrorNames {
CANNOT_DELETE_ALL_ADMIN_ACCOUNT = 'CANNOT_DELETE_ALL_ADMIN_ACCOUNT',
CANNOT_DELETE_OWN_ACCOUNT = 'CANNOT_DELETE_OWN_ACCOUNT',
CANT_UPDATE_ONETIME_PAYMENT_SUBSCRIPTION = 'CANT_UPDATE_ONETIME_PAYMENT_SUBSCRIPTION',
CAN_NOT_BATCH_GRANT_DOC_OWNER_PERMISSIONS = 'CAN_NOT_BATCH_GRANT_DOC_OWNER_PERMISSIONS',
CAPTCHA_VERIFICATION_FAILED = 'CAPTCHA_VERIFICATION_FAILED',
COPILOT_ACTION_TAKEN = 'COPILOT_ACTION_TAKEN',
COPILOT_FAILED_TO_CREATE_MESSAGE = 'COPILOT_FAILED_TO_CREATE_MESSAGE',
@@ -925,7 +926,7 @@ export interface MutationRevokeArgs {
}
export interface MutationRevokeDocUserRolesArgs {
input: RevokeDocUserRolesInput;
input: RevokeDocUserRoleInput;
}
export interface MutationRevokeInviteLinkArgs {
@@ -1202,9 +1203,9 @@ export interface RemoveAvatar {
success: Scalars['Boolean']['output'];
}
export interface RevokeDocUserRolesInput {
export interface RevokeDocUserRoleInput {
docId: Scalars['String']['input'];
userIds: Array<Scalars['String']['input']>;
userId: Scalars['String']['input'];
workspaceId: Scalars['String']['input'];
}
@@ -2160,8 +2161,9 @@ export type GetMemberCountByWorkspaceIdQuery = {
export type GetMembersByWorkspaceIdQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
skip: Scalars['Int']['input'];
take: Scalars['Int']['input'];
skip?: InputMaybe<Scalars['Int']['input']>;
take?: InputMaybe<Scalars['Int']['input']>;
query?: InputMaybe<Scalars['String']['input']>;
}>;
export type GetMembersByWorkspaceIdQuery = {
@@ -2193,6 +2195,45 @@ export type OauthProvidersQuery = {
};
};
export type GetPageGrantedUsersListQueryVariables = Exact<{
pagination: PaginationInput;
docId: Scalars['String']['input'];
workspaceId: Scalars['String']['input'];
}>;
export type GetPageGrantedUsersListQuery = {
__typename?: 'Query';
workspace: {
__typename?: 'WorkspaceType';
doc: {
__typename?: 'DocType';
grantedUsersList: {
__typename?: 'PaginatedGrantedDocUserType';
totalCount: number;
pageInfo: {
__typename?: 'PageInfo';
endCursor: string | null;
hasNextPage: boolean;
};
edges: Array<{
__typename?: 'GrantedDocUserTypeEdge';
node: {
__typename?: 'GrantedDocUserType';
role: DocRole;
user: {
__typename?: 'PublicUserType';
id: string;
name: string;
email: string;
avatarUrl: string | null;
};
};
}>;
};
};
};
};
export type GetPromptsQueryVariables = Exact<{ [key: string]: never }>;
export type GetPromptsQuery = {
@@ -2442,6 +2483,15 @@ export type GetWorkspacesQuery = {
}>;
};
export type GrantDocUserRolesMutationVariables = Exact<{
input: GrantDocUserRolesInput;
}>;
export type GrantDocUserRolesMutation = {
__typename?: 'Mutation';
grantDocUserRoles: boolean;
};
export type ListHistoryQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
pageDocId: Scalars['String']['input'];
@@ -2613,6 +2663,15 @@ export type ResumeSubscriptionMutation = {
};
};
export type RevokeDocUserRolesMutationVariables = Exact<{
input: RevokeDocUserRoleInput;
}>;
export type RevokeDocUserRolesMutation = {
__typename?: 'Mutation';
revokeDocUserRoles: boolean;
};
export type RevokeMemberPermissionMutationVariables = Exact<{
workspaceId: Scalars['String']['input'];
userId: Scalars['String']['input'];
@@ -2774,6 +2833,15 @@ export type UpdateCopilotSessionMutation = {
updateCopilotSession: string;
};
export type UpdateDocUserRoleMutationVariables = Exact<{
input: UpdateDocUserRoleInput;
}>;
export type UpdateDocUserRoleMutation = {
__typename?: 'Mutation';
updateDocUserRole: boolean;
};
export type UpdatePromptMutationVariables = Exact<{
name: Scalars['String']['input'];
messages: Array<CopilotPromptMessageInput> | CopilotPromptMessageInput;
@@ -3129,6 +3197,11 @@ export type Queries =
variables: OauthProvidersQueryVariables;
response: OauthProvidersQuery;
}
| {
name: 'getPageGrantedUsersListQuery';
variables: GetPageGrantedUsersListQueryVariables;
response: GetPageGrantedUsersListQuery;
}
| {
name: 'getPromptsQuery';
variables: GetPromptsQueryVariables;
@@ -3371,6 +3444,11 @@ export type Mutations =
variables: GenerateLicenseKeyMutationVariables;
response: GenerateLicenseKeyMutation;
}
| {
name: 'grantDocUserRolesMutation';
variables: GrantDocUserRolesMutationVariables;
response: GrantDocUserRolesMutation;
}
| {
name: 'leaveWorkspaceMutation';
variables: LeaveWorkspaceMutationVariables;
@@ -3396,6 +3474,11 @@ export type Mutations =
variables: ResumeSubscriptionMutationVariables;
response: ResumeSubscriptionMutation;
}
| {
name: 'revokeDocUserRolesMutation';
variables: RevokeDocUserRolesMutationVariables;
response: RevokeDocUserRolesMutation;
}
| {
name: 'revokeMemberPermissionMutation';
variables: RevokeMemberPermissionMutationVariables;
@@ -3451,6 +3534,11 @@ export type Mutations =
variables: UpdateCopilotSessionMutationVariables;
response: UpdateCopilotSessionMutation;
}
| {
name: 'updateDocUserRoleMutation';
variables: UpdateDocUserRoleMutationVariables;
response: UpdateDocUserRoleMutation;
}
| {
name: 'updatePromptMutation';
variables: UpdatePromptMutationVariables;