feat(server): add doc embedding switch for workspace (#11760)

fix AI-33
This commit is contained in:
darkskygit
2025-04-17 07:13:22 +00:00
parent ebf1d5476d
commit 38e8806787
11 changed files with 71 additions and 11 deletions

View File

@@ -1595,6 +1595,7 @@ export const getWorkspaceConfigQuery = {
workspace(id: $id) {
enableAi
enableUrlPreview
enableDocEmbedding
inviteLink {
link
expireTime
@@ -1613,6 +1614,16 @@ export const setEnableAiMutation = {
}`,
};
export const setEnableDocEmbeddingMutation = {
id: 'setEnableDocEmbeddingMutation' as const,
op: 'setEnableDocEmbedding',
query: `mutation setEnableDocEmbedding($id: ID!, $enableDocEmbedding: Boolean!) {
updateWorkspace(input: {id: $id, enableDocEmbedding: $enableDocEmbedding}) {
id
}
}`,
};
export const setEnableUrlPreviewMutation = {
id: 'setEnableUrlPreviewMutation' as const,
op: 'setEnableUrlPreview',

View File

@@ -2,6 +2,7 @@ query getWorkspaceConfig($id: String!) {
workspace(id: $id) {
enableAi
enableUrlPreview
enableDocEmbedding
inviteLink {
link
expireTime

View File

@@ -0,0 +1,5 @@
mutation setEnableDocEmbedding($id: ID!, $enableDocEmbedding: Boolean!) {
updateWorkspace(input: { id: $id, enableDocEmbedding: $enableDocEmbedding }) {
id
}
}

View File

@@ -2006,6 +2006,8 @@ export interface UpdateUserSettingsInput {
export interface UpdateWorkspaceInput {
/** Enable AI */
enableAi?: InputMaybe<Scalars['Boolean']['input']>;
/** Enable doc embedding */
enableDocEmbedding?: InputMaybe<Scalars['Boolean']['input']>;
/** Enable url previous when sharing */
enableUrlPreview?: InputMaybe<Scalars['Boolean']['input']>;
id: Scalars['ID']['input'];
@@ -2230,6 +2232,8 @@ export interface WorkspaceType {
doc: DocType;
/** Enable AI */
enableAi: Scalars['Boolean']['output'];
/** Enable doc embedding */
enableDocEmbedding: Scalars['Boolean']['output'];
/** Enable url previous when sharing */
enableUrlPreview: Scalars['Boolean']['output'];
histories: Array<DocHistoryType>;
@@ -4107,6 +4111,7 @@ export type GetWorkspaceConfigQuery = {
__typename?: 'WorkspaceType';
enableAi: boolean;
enableUrlPreview: boolean;
enableDocEmbedding: boolean;
inviteLink: {
__typename?: 'InviteLink';
link: string;
@@ -4125,6 +4130,16 @@ export type SetEnableAiMutation = {
updateWorkspace: { __typename?: 'WorkspaceType'; id: string };
};
export type SetEnableDocEmbeddingMutationVariables = Exact<{
id: Scalars['ID']['input'];
enableDocEmbedding: Scalars['Boolean']['input'];
}>;
export type SetEnableDocEmbeddingMutation = {
__typename?: 'Mutation';
updateWorkspace: { __typename?: 'WorkspaceType'; id: string };
};
export type SetEnableUrlPreviewMutationVariables = Exact<{
id: Scalars['ID']['input'];
enableUrlPreview: Scalars['Boolean']['input'];
@@ -4931,6 +4946,11 @@ export type Mutations =
variables: SetEnableAiMutationVariables;
response: SetEnableAiMutation;
}
| {
name: 'setEnableDocEmbeddingMutation';
variables: SetEnableDocEmbeddingMutationVariables;
response: SetEnableDocEmbeddingMutation;
}
| {
name: 'setEnableUrlPreviewMutation';
variables: SetEnableUrlPreviewMutationVariables;