diff --git a/x-pack/packages/kbn-elastic-assistant-common/constants.ts b/x-pack/packages/kbn-elastic-assistant-common/constants.ts index 96af59095ab87..144bbcaeb0226 100755 --- a/x-pack/packages/kbn-elastic-assistant-common/constants.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/constants.ts @@ -10,20 +10,22 @@ export const ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION = '1'; export const ELASTIC_AI_ASSISTANT_URL = '/api/security_ai_assistant'; export const ELASTIC_AI_ASSISTANT_INTERNAL_URL = '/internal/elastic_assistant'; -export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL = `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/current_user/conversations`; +export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL = `${ELASTIC_AI_ASSISTANT_URL}/current_user/conversations`; export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID = `${ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL}/{id}`; -export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID_MESSAGES = `${ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID}/messages`; + +export const ELASTIC_AI_ASSISTANT_INTERNAL_CONVERSATIONS_URL = `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/current_user/conversations`; +export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID_MESSAGES = `${ELASTIC_AI_ASSISTANT_INTERNAL_CONVERSATIONS_URL}/{id}/messages`; export const ELASTIC_AI_ASSISTANT_CHAT_COMPLETE_URL = `${ELASTIC_AI_ASSISTANT_URL}/chat/complete`; -export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL}/_bulk_action`; +export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_INTERNAL_CONVERSATIONS_URL}/_bulk_action`; export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_FIND = `${ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL}/_find`; -export const ELASTIC_AI_ASSISTANT_PROMPTS_URL = `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/prompts`; +export const ELASTIC_AI_ASSISTANT_PROMPTS_URL = `${ELASTIC_AI_ASSISTANT_URL}/prompts`; export const ELASTIC_AI_ASSISTANT_PROMPTS_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_PROMPTS_URL}/_bulk_action`; export const ELASTIC_AI_ASSISTANT_PROMPTS_URL_FIND = `${ELASTIC_AI_ASSISTANT_PROMPTS_URL}/_find`; -export const ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL = `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/anonymization_fields`; +export const ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL = `${ELASTIC_AI_ASSISTANT_URL}/anonymization_fields`; export const ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL}/_bulk_action`; export const ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_FIND = `${ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL}/_find`; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.test.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.test.ts index 544c8c1606c3d..88e9c0febba13 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.test.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.test.ts @@ -48,7 +48,7 @@ describe('bulkUpdateAnonymizationFields', () => { ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_BULK_ACTION, { method: 'POST', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, body: JSON.stringify({ create: [], update: [], @@ -71,7 +71,7 @@ describe('bulkUpdateAnonymizationFields', () => { ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_BULK_ACTION, { method: 'POST', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, body: JSON.stringify({ create: [anonymizationField1, anonymizationField2], update: [], @@ -93,7 +93,7 @@ describe('bulkUpdateAnonymizationFields', () => { ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_BULK_ACTION, { method: 'POST', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, body: JSON.stringify({ update: [anonymizationField1, anonymizationField2], delete: { ids: [] }, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.ts index 72d73cc2a5929..9745e7ce38662 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.ts @@ -26,7 +26,7 @@ export const bulkUpdateAnonymizationFields = async ( ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_BULK_ACTION, { method: 'POST', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, body: JSON.stringify(anonymizationFieldsActions), } ); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.test.tsx index 7c10597eaed87..5352e60bcea45 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.test.tsx @@ -45,14 +45,14 @@ describe('useFetchAnonymizationFields', () => { const { waitForNextUpdate } = renderHook(() => useFetchAnonymizationFields()); await waitForNextUpdate(); expect(http.fetch).toHaveBeenCalledWith( - '/internal/elastic_assistant/anonymization_fields/_find', + '/api/security_ai_assistant/anonymization_fields/_find', { method: 'GET', query: { page: 1, per_page: 1000, }, - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, signal: undefined, } ); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.ts index d2f07124f04b0..657216b9079cd 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.ts @@ -36,7 +36,7 @@ export const CACHING_KEYS = [ ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_FIND, QUERY.page, QUERY.per_page, - API_VERSIONS.internal.v1, + API_VERSIONS.public.v1, ]; export const useFetchAnonymizationFields = (payload?: UseFetchAnonymizationFieldsParams) => { @@ -50,7 +50,7 @@ export const useFetchAnonymizationFields = (payload?: UseFetchAnonymizationField async () => http.fetch(ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_FIND, { method: 'GET', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, query: QUERY, signal: payload?.signal, }), diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.test.tsx index 5f7d7cefaf450..7e87ca79e88ab 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.test.tsx @@ -36,11 +36,11 @@ describe('conversations api', () => { await waitForNextUpdate(); expect(deleteProps.http.fetch).toHaveBeenCalledWith( - '/internal/elastic_assistant/current_user/conversations/test', + '/api/security_ai_assistant/current_user/conversations/test', { method: 'DELETE', signal: undefined, - version: '1', + version: '2023-10-31', } ); expect(toasts.addError).not.toHaveBeenCalled(); @@ -62,11 +62,11 @@ describe('conversations api', () => { await waitForNextUpdate(); expect(getProps.http.fetch).toHaveBeenCalledWith( - '/internal/elastic_assistant/current_user/conversations/test', + '/api/security_ai_assistant/current_user/conversations/test', { method: 'GET', signal: undefined, - version: '1', + version: '2023-10-31', } ); expect(toasts.addError).not.toHaveBeenCalled(); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.ts index e6c6b2925f337..54bac7e563acc 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.ts @@ -44,7 +44,7 @@ export const getConversationById = async ({ try { const response = await http.fetch(`${ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL}/${id}`, { method: 'GET', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, signal, }); @@ -84,7 +84,7 @@ export const getUserConversations = async ({ ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_FIND, { method: 'GET', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, signal, } ); @@ -125,7 +125,7 @@ export const createConversation = async ({ try { const response = await http.post(ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL, { body: JSON.stringify(conversation), - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, signal, }); @@ -168,7 +168,7 @@ export const deleteConversation = async ({ try { const response = await http.fetch(`${ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL}/${id}`, { method: 'DELETE', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, signal, }); @@ -237,7 +237,7 @@ export const updateConversation = async ({ headers: { 'Content-Type': 'application/json', }, - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, signal, } ); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.test.tsx index 2c6ed953b56f3..652764212e996 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.test.tsx @@ -47,14 +47,14 @@ describe('useFetchCurrentUserConversations', () => { ); await waitForNextUpdate(); expect(defaultProps.http.fetch).toHaveBeenCalledWith( - '/internal/elastic_assistant/current_user/conversations/_find', + '/api/security_ai_assistant/current_user/conversations/_find', { method: 'GET', query: { page: 1, perPage: 100, }, - version: '1', + version: '2023-10-31', signal: undefined, } ); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.ts index 58be08317d40c..68612e3e22397 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.ts @@ -47,7 +47,7 @@ export const CONVERSATIONS_QUERY_KEYS = [ ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_FIND, query.page, query.perPage, - API_VERSIONS.internal.v1, + API_VERSIONS.public.v1, ]; export const useFetchCurrentUserConversations = ({ @@ -62,7 +62,7 @@ export const useFetchCurrentUserConversations = ({ async () => http.fetch(ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_FIND, { method: 'GET', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, query, signal, }), diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.test.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.test.ts index d6ba2e726a76f..fef992bc14b26 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.test.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.test.ts @@ -49,7 +49,7 @@ describe('bulkUpdatePrompts', () => { expect(httpMock.fetch).toHaveBeenCalledWith(ELASTIC_AI_ASSISTANT_PROMPTS_URL_BULK_ACTION, { method: 'POST', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, body: JSON.stringify({ create: [], update: [], @@ -69,7 +69,7 @@ describe('bulkUpdatePrompts', () => { expect(httpMock.fetch).toHaveBeenCalledWith(ELASTIC_AI_ASSISTANT_PROMPTS_URL_BULK_ACTION, { method: 'POST', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, body: JSON.stringify({ create: [prompt1, prompt2], update: [], @@ -88,7 +88,7 @@ describe('bulkUpdatePrompts', () => { expect(httpMock.fetch).toHaveBeenCalledWith(ELASTIC_AI_ASSISTANT_PROMPTS_URL_BULK_ACTION, { method: 'POST', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, body: JSON.stringify({ update: [prompt1, prompt2], delete: { ids: [] }, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.ts index 2d7b053d7acbd..f9b470c46516c 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.ts @@ -26,7 +26,7 @@ export const bulkUpdatePrompts = async ( ELASTIC_AI_ASSISTANT_PROMPTS_URL_BULK_ACTION, { method: 'POST', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, body: JSON.stringify(prompts), } ); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.test.tsx index 3ec1586d6cb44..8e228d2787a36 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.test.tsx @@ -44,14 +44,14 @@ describe('useFetchPrompts', () => { await act(async () => { const { waitForNextUpdate } = renderHook(() => useFetchPrompts()); await waitForNextUpdate(); - expect(http.fetch).toHaveBeenCalledWith('/internal/elastic_assistant/prompts/_find', { + expect(http.fetch).toHaveBeenCalledWith('/api/security_ai_assistant/prompts/_find', { method: 'GET', query: { page: 1, per_page: 1000, filter: 'consumer:*', }, - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, signal: undefined, }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.ts index 18a229e524dc7..4c0ca9c0a9c89 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.ts @@ -44,7 +44,7 @@ export const useFetchPrompts = (payload?: UseFetchPromptsParams) => { QUERY.page, QUERY.per_page, QUERY.filter, - API_VERSIONS.internal.v1, + API_VERSIONS.public.v1, ]; return useQuery( @@ -52,7 +52,7 @@ export const useFetchPrompts = (payload?: UseFetchPromptsParams) => { async () => http.fetch(ELASTIC_AI_ASSISTANT_PROMPTS_URL_FIND, { method: 'GET', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, query: QUERY, signal: payload?.signal, }), @@ -87,7 +87,7 @@ export const getPrompts = async ({ try { return await http.fetch(ELASTIC_AI_ASSISTANT_PROMPTS_URL_FIND, { method: 'GET', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, signal, }); } catch (error) { diff --git a/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts b/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts index 47213cb0d278e..94788d2d1d926 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts @@ -118,7 +118,7 @@ export const bulkActionAnonymizationFieldsRoute = ( ) => { router.versioned .post({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_BULK_ACTION, options: { tags: ['access:securitySolution-updateAIAssistantAnonymization'], @@ -129,7 +129,7 @@ export const bulkActionAnonymizationFieldsRoute = ( }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { body: buildRouteValidationWithZod(PerformBulkActionRequestBody), diff --git a/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts b/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts index c0383b1b3b38c..904a80d6a3ea4 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts @@ -30,7 +30,7 @@ export const findAnonymizationFieldsRoute = ( ) => { router.versioned .get({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_FIND, options: { tags: ['access:elasticAssistant'], @@ -38,7 +38,7 @@ export const findAnonymizationFieldsRoute = ( }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { query: buildRouteValidationWithZod(FindAnonymizationFieldsRequestQuery), diff --git a/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts b/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts index cfcd6d8cc05d6..d90b01b78cfa7 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts @@ -112,7 +112,7 @@ const buildBulkResponse = ( export const bulkPromptsRoute = (router: ElasticAssistantPluginRouter, logger: Logger) => { router.versioned .post({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_PROMPTS_URL_BULK_ACTION, options: { tags: ['access:elasticAssistant'], @@ -123,7 +123,7 @@ export const bulkPromptsRoute = (router: ElasticAssistantPluginRouter, logger: L }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { body: buildRouteValidationWithZod(PerformBulkActionRequestBody), diff --git a/x-pack/plugins/elastic_assistant/server/routes/prompts/find_route.ts b/x-pack/plugins/elastic_assistant/server/routes/prompts/find_route.ts index 8838db3c44943..142b63a7d04b5 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/prompts/find_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/prompts/find_route.ts @@ -23,7 +23,7 @@ import { UPGRADE_LICENSE_MESSAGE, hasAIAssistantLicense } from '../helpers'; export const findPromptsRoute = (router: ElasticAssistantPluginRouter, logger: Logger) => { router.versioned .get({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_PROMPTS_URL_FIND, options: { tags: ['access:elasticAssistant'], @@ -31,7 +31,7 @@ export const findPromptsRoute = (router: ElasticAssistantPluginRouter, logger: L }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { query: buildRouteValidationWithZod(FindPromptsRequestQuery), diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts index 9c02586a60b88..f2f469da15966 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts @@ -21,7 +21,7 @@ import { performChecks } from '../helpers'; export const createConversationRoute = (router: ElasticAssistantPluginRouter): void => { router.versioned .post({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL, options: { @@ -30,7 +30,7 @@ export const createConversationRoute = (router: ElasticAssistantPluginRouter): v }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { body: buildRouteValidationWithZod(ConversationCreateProps), diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts index b39f898eaeaa1..5d761c09f682c 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts @@ -19,7 +19,7 @@ import { UPGRADE_LICENSE_MESSAGE, hasAIAssistantLicense } from '../helpers'; export const deleteConversationRoute = (router: ElasticAssistantPluginRouter) => { router.versioned .delete({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID, options: { tags: ['access:elasticAssistant'], @@ -27,7 +27,7 @@ export const deleteConversationRoute = (router: ElasticAssistantPluginRouter) => }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { params: buildRouteValidationWithZod(DeleteConversationRequestParams), diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts index 8db36466c9bad..6eda3e37645c5 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts @@ -26,7 +26,7 @@ import { UPGRADE_LICENSE_MESSAGE, hasAIAssistantLicense } from '../helpers'; export const findUserConversationsRoute = (router: ElasticAssistantPluginRouter) => { router.versioned .get({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_FIND, options: { tags: ['access:elasticAssistant'], @@ -34,7 +34,7 @@ export const findUserConversationsRoute = (router: ElasticAssistantPluginRouter) }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { query: buildRouteValidationWithZod(FindConversationsRequestQuery), diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts index 12020d7fa51d9..dd540897b0ece 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts @@ -21,7 +21,7 @@ import { UPGRADE_LICENSE_MESSAGE, hasAIAssistantLicense } from '../helpers'; export const readConversationRoute = (router: ElasticAssistantPluginRouter) => { router.versioned .get({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID, options: { tags: ['access:elasticAssistant'], @@ -29,7 +29,7 @@ export const readConversationRoute = (router: ElasticAssistantPluginRouter) => { }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { params: buildRouteValidationWithZod(ReadConversationRequestParams), diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts index 069c189609f23..4ad819ef0caa0 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts @@ -24,7 +24,7 @@ import { performChecks } from '../helpers'; export const updateConversationRoute = (router: ElasticAssistantPluginRouter) => { router.versioned .put({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID, options: { tags: ['access:elasticAssistant'], @@ -32,7 +32,7 @@ export const updateConversationRoute = (router: ElasticAssistantPluginRouter) => }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { body: buildRouteValidationWithZod(ConversationUpdateProps),