diff --git a/src/api/GraphQuery/index.ts b/src/api/GraphQuery/index.ts index 3393b020f..b700ae011 100644 --- a/src/api/GraphQuery/index.ts +++ b/src/api/GraphQuery/index.ts @@ -9,9 +9,11 @@ import {LkErrorKey} from '../../http/response'; import { CheckQueryResponse, + CypherGeneratorResponse, GraphQuery, ICheckQueryParams, ICreateQueryParams, + ICypherGeneratorParams, IDeleteQueryParams, IGetQueriesParams, IGetQueryParams, @@ -176,4 +178,17 @@ export class GraphQueryAPI extends Request { params: params }); } + + /** + * Get all the nodes and edges matching the given saved graph query by id. + * A subgraph made of all the nodes and the edges from each subgraph matching the graph query is returned. + */ + public aiCypher(this: Request, params: ICypherGeneratorParams) { + return this.request({ + errors: [UNAUTHORIZED], + url: '/:sourceKey/cypher', + method: 'POST', + params: params + }); + } } diff --git a/src/api/GraphQuery/types.ts b/src/api/GraphQuery/types.ts index 3fbca3c77..f7c1212d4 100644 --- a/src/api/GraphQuery/types.ts +++ b/src/api/GraphQuery/types.ts @@ -285,3 +285,12 @@ export interface ErrorHighlight { offset: number; length?: number; } + +export interface ICypherGeneratorParams extends IDataSourceParams { + question: string; +} + +export interface CypherGeneratorResponse { + cypherQuery: string; + isOk: boolean; +} diff --git a/src/api/Visualization/index.ts b/src/api/Visualization/index.ts index 51f31f3ff..469221875 100644 --- a/src/api/Visualization/index.ts +++ b/src/api/Visualization/index.ts @@ -41,7 +41,9 @@ import { VisualizationComment, CreateVisualizationCommentParams, GetVisualizationCommentsParams, - DeleteVisualizationCommentParams + DeleteVisualizationCommentParams, + IStylesGeneratorParams, + StylesGeneratorResponse } from './types'; export * from './types'; @@ -388,6 +390,21 @@ export class VisualizationAPI extends Request { }); } + /** + * Create a visualization ai answer comment. + */ + createVisualizationAiAnswerComment( + this: Request, + params: CreateVisualizationCommentParams + ) { + return this.request({ + errors: [UNAUTHORIZED, DATA_SOURCE_UNAVAILABLE, NOT_FOUND], + url: '/:sourceKey/visualizations/:visualizationId/commentsAi', + method: 'POST', + params: params + }); + } + /** * Get the visualization comment(s). */ @@ -414,4 +431,17 @@ export class VisualizationAPI extends Request { params: params }); } + + /** + * Get all the nodes and edges matching the given saved graph query by id. + * A subgraph made of all the nodes and the edges from each subgraph matching the graph query is returned. + */ + public aiStyles(this: Request, params: IStylesGeneratorParams) { + return this.request({ + errors: [UNAUTHORIZED], + url: '/:sourceKey/ai/styles', + method: 'POST', + params: params + }); + } } diff --git a/src/api/Visualization/types.ts b/src/api/Visualization/types.ts index 49d38ca53..707bc350e 100644 --- a/src/api/Visualization/types.ts +++ b/src/api/Visualization/types.ts @@ -23,7 +23,16 @@ import { IVizNodeGroupInfo } from '../graphItemTypes'; import {GraphQueryDialect} from '../GraphQuery'; -import {IRangeValues, ItemSelector, IStyles, IStyleIcon, IStyleImage} from '../displayTypes'; +import { + IRangeValues, + ItemSelector, + IStyles, + IStyleIcon, + IStyleImage, + INodeStyle, + IEdgeStyle, + IStyleRule +} from '../displayTypes'; import {User} from '../User'; import {IAlternativeIdSettings} from '../DataSource'; import {ILeafletConfig} from '../Config'; @@ -456,3 +465,12 @@ export interface GetVisualizationCommentsParams extends IDataSourceParams, Pagin export interface DeleteVisualizationCommentParams extends IDataSourceParams { commentId: number; } + +export interface IStylesGeneratorParams extends IDataSourceParams { + question: string; +} + +export interface StylesGeneratorResponse { + styles: IStyleRule; + isOk: boolean; +}