UNPKG

@redocly/theme

Version:

Shared UI components lib

41 lines 2.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SEARCH_DEBOUNCE_TIME_MS = exports.AI_SEARCH_ERROR_CONFIG = exports.AiSearchConversationRole = exports.AiSearchError = void 0; var AiSearchError; (function (AiSearchError) { AiSearchError["Unauthorized"] = "ai_search_unauthorized"; AiSearchError["Forbidden"] = "ai_search_forbidden"; AiSearchError["HttpRequestFailed"] = "http_request_in_failed_status"; AiSearchError["EmptyResponse"] = "empty_response"; AiSearchError["ErrorProcessingResponse"] = "error_processing_response"; })(AiSearchError || (exports.AiSearchError = AiSearchError = {})); var AiSearchConversationRole; (function (AiSearchConversationRole) { AiSearchConversationRole["USER"] = "user"; AiSearchConversationRole["ASSISTANT"] = "assistant"; })(AiSearchConversationRole || (exports.AiSearchConversationRole = AiSearchConversationRole = {})); const defaultErrorConfig = { headerKey: 'search.ai.error.header', headerDefault: 'Oops! Something went wrong.', messageKey: 'search.ai.error.description', messageDefault: 'We encountered an issue while processing your search. Try again later or refine your query. If the problem persists, please contact Redocly support.', }; exports.AI_SEARCH_ERROR_CONFIG = { [AiSearchError.Forbidden]: { headerKey: 'search.ai.error.header.forbidden', headerDefault: 'Feature Unavailable', messageKey: 'search.ai.error.description.forbidden', messageDefault: 'AI Search is currently unavailable.', }, [AiSearchError.Unauthorized]: { headerKey: 'search.ai.error.header.unauthorized', headerDefault: 'Authentication Required', messageKey: 'search.ai.error.description.unauthorized', messageDefault: 'You are not authorized to use AI Search.', }, [AiSearchError.HttpRequestFailed]: defaultErrorConfig, [AiSearchError.EmptyResponse]: defaultErrorConfig, [AiSearchError.ErrorProcessingResponse]: defaultErrorConfig, }; exports.SEARCH_DEBOUNCE_TIME_MS = 300; //# sourceMappingURL=search.js.map