feat(server): tag and collection record for context (#10926)

fix CLOUD-174
This commit is contained in:
darkskygit
2025-03-17 14:17:01 +00:00
parent 3dbeebd6ba
commit b0aa2c90fd
9 changed files with 262 additions and 4 deletions
@@ -0,0 +1,7 @@
mutation addContextCategory($options: AddRemoveContextCategoryInput!) {
addContextCategory(options: $options) {
id
createdAt
type
}
}
@@ -0,0 +1,3 @@
mutation removeContextCategory($options: AddRemoveContextCategoryInput!) {
removeContextCategory(options: $options)
}
@@ -134,6 +134,26 @@ export const changePasswordMutation = {
}`,
};
export const addContextCategoryMutation = {
id: 'addContextCategoryMutation' as const,
op: 'addContextCategory',
query: `mutation addContextCategory($options: AddRemoveContextCategoryInput!) {
addContextCategory(options: $options) {
id
createdAt
type
}
}`,
};
export const removeContextCategoryMutation = {
id: 'removeContextCategoryMutation' as const,
op: 'removeContextCategory',
query: `mutation removeContextCategory($options: AddRemoveContextCategoryInput!) {
removeContextCategory(options: $options)
}`,
};
export const createCopilotContextMutation = {
id: 'createCopilotContextMutation' as const,
op: 'createCopilotContext',
+63
View File
@@ -47,6 +47,12 @@ export interface AddContextFileInput {
contextId: Scalars['String']['input'];
}
export interface AddRemoveContextCategoryInput {
categoryId: Scalars['String']['input'];
contextId: Scalars['String']['input'];
type: ContextCategories;
}
export interface AlreadyInSpaceDataType {
__typename?: 'AlreadyInSpaceDataType';
spaceId: Scalars['String']['output'];
@@ -73,6 +79,11 @@ export interface ChatMessage {
role: Scalars['String']['output'];
}
export enum ContextCategories {
Collection = 'Collection',
Tag = 'Tag',
}
export enum ContextEmbedStatus {
failed = 'failed',
finished = 'finished',
@@ -163,6 +174,13 @@ export interface CopilotContextMatchWorkspaceContextArgs {
limit?: InputMaybe<Scalars['SafeInt']['input']>;
}
export interface CopilotContextCategory {
__typename?: 'CopilotContextCategory';
createdAt: Scalars['SafeInt']['output'];
id: Scalars['ID']['output'];
type: ContextCategories;
}
export interface CopilotContextDoc {
__typename?: 'CopilotContextDoc';
createdAt: Scalars['SafeInt']['output'];
@@ -938,6 +956,8 @@ export interface Mutation {
__typename?: 'Mutation';
acceptInviteById: Scalars['Boolean']['output'];
activateLicense: License;
/** add a category to context */
addContextCategory: CopilotContextCategory;
/** add a doc to context */
addContextDoc: CopilotContextDoc;
/** add a file to context */
@@ -1002,6 +1022,8 @@ export interface Mutation {
releaseDeletedBlobs: Scalars['Boolean']['output'];
/** Remove user avatar */
removeAvatar: RemoveAvatar;
/** remove a category from context */
removeContextCategory: Scalars['Boolean']['output'];
/** remove a doc from context */
removeContextDoc: Scalars['Boolean']['output'];
/** remove a file from context */
@@ -1054,6 +1076,10 @@ export interface MutationActivateLicenseArgs {
workspaceId: Scalars['String']['input'];
}
export interface MutationAddContextCategoryArgs {
options: AddRemoveContextCategoryInput;
}
export interface MutationAddContextDocArgs {
options: AddContextDocInput;
}
@@ -1240,6 +1266,10 @@ export interface MutationReleaseDeletedBlobsArgs {
workspaceId: Scalars['String']['input'];
}
export interface MutationRemoveContextCategoryArgs {
options: AddRemoveContextCategoryInput;
}
export interface MutationRemoveContextDocArgs {
options: RemoveContextDocInput;
}
@@ -2319,6 +2349,29 @@ export type ChangePasswordMutation = {
changePassword: boolean;
};
export type AddContextCategoryMutationVariables = Exact<{
options: AddRemoveContextCategoryInput;
}>;
export type AddContextCategoryMutation = {
__typename?: 'Mutation';
addContextCategory: {
__typename?: 'CopilotContextCategory';
id: string;
createdAt: number;
type: ContextCategories;
};
};
export type RemoveContextCategoryMutationVariables = Exact<{
options: AddRemoveContextCategoryInput;
}>;
export type RemoveContextCategoryMutation = {
__typename?: 'Mutation';
removeContextCategory: boolean;
};
export type CreateCopilotContextMutationVariables = Exact<{
workspaceId: Scalars['String']['input'];
sessionId: Scalars['String']['input'];
@@ -4308,6 +4361,16 @@ export type Mutations =
variables: ChangePasswordMutationVariables;
response: ChangePasswordMutation;
}
| {
name: 'addContextCategoryMutation';
variables: AddContextCategoryMutationVariables;
response: AddContextCategoryMutation;
}
| {
name: 'removeContextCategoryMutation';
variables: RemoveContextCategoryMutationVariables;
response: RemoveContextCategoryMutation;
}
| {
name: 'createCopilotContextMutation';
variables: CreateCopilotContextMutationVariables;