chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -16,29 +16,29 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
export enum CommonError {
|
||||
/** webpack chunk load 失败 */
|
||||
/** Webpack chunk load failed */
|
||||
ChunkLoadError = 'chunk_load_error',
|
||||
/** 参数校验类错误 */
|
||||
/** Parameter validation class error */
|
||||
parmasValidation = 'parmas_validation',
|
||||
/** 返回结果 校验错误的 */
|
||||
/** Return the result, check the error */
|
||||
responseValidation = 'response_validation',
|
||||
/** 错误 path */
|
||||
/** Wrong path */
|
||||
errorPath = 'error_path',
|
||||
/** fws 抛出的错误 */
|
||||
/** Error thrown by fws */
|
||||
fwsError = 'fws_error',
|
||||
/** get tokens 初始化 */
|
||||
/** Get tokens initialized */
|
||||
getTokenInit = 'get_token_init',
|
||||
/** get tokens get encode */
|
||||
getTokenEncode = 'get_token_encode',
|
||||
/** get tokens 错误 */
|
||||
/** Error getting tokens */
|
||||
getTokenError = 'get_token_error',
|
||||
/** 表单校验 error */
|
||||
/** Form validation error */
|
||||
formValidation = 'form_validation',
|
||||
/** 第三方登录失败 */
|
||||
/** Third-party login failed */
|
||||
thirdPartyAuth = 'third_party_auth',
|
||||
/** 用于常规的 Error */
|
||||
/** Errors for general use */
|
||||
normalError = 'normal_error',
|
||||
/** 获取 bot diff error */
|
||||
/** Get bot diff error */
|
||||
getBotDiffError = 'get_bot_diff_error',
|
||||
/** merge bot diff error */
|
||||
mergeBotDiffError = 'merge_bot_diff_error',
|
||||
|
||||
@@ -19,12 +19,12 @@ export enum FeatureEvents {
|
||||
/**
|
||||
* space event
|
||||
*/
|
||||
createSpace = 'create_space', // 创建空间
|
||||
updateSpace = 'update_space', // 更新空间
|
||||
createSpace = 'create_space', // Create space
|
||||
updateSpace = 'update_space', // update space
|
||||
transferSpace = 'transfer_space',
|
||||
spaceMemberSearch = 'space_member_search',
|
||||
spaceMemberDetail = 'space_member_detail', // 获取空间成员
|
||||
spaceMemberAdd = 'space_member_add', // 空间添加成员
|
||||
spaceMemberDetail = 'space_member_detail', // Get space member
|
||||
spaceMemberAdd = 'space_member_add', // Space Add Member
|
||||
deleteSpace = 'delete_space',
|
||||
leaveSpace = 'leave_space',
|
||||
spaceParseMemberCsv = 'space_parse_member_csv',
|
||||
@@ -36,7 +36,7 @@ export enum FeatureEvents {
|
||||
updateUserProfileCheck = 'update_user_profile_check',
|
||||
getUserAuthList = 'user_auth_list',
|
||||
/**
|
||||
* http 图片转化测试用
|
||||
* HTTP image conversion test
|
||||
*/
|
||||
convertHttpImg = 'convert_http_img',
|
||||
|
||||
@@ -52,21 +52,21 @@ export enum FeatureEvents {
|
||||
/**
|
||||
* passport
|
||||
*/
|
||||
passportService = 'passport_service', // passport相关的全部请求
|
||||
passportHttpRequestFail = 'passport_http_request_fail', // passport 请求失败(非业务失败)
|
||||
passportService = 'passport_service', // All passport related requests
|
||||
passportHttpRequestFail = 'passport_http_request_fail', // Passport request failed (non-business failure)
|
||||
InviteLinkCopySuccess = 'invite_link_copy_success',
|
||||
JoinSpaceSuccess = 'join_space_success',
|
||||
unhandledrejection = 'unhandledrejection',
|
||||
oauthLogin = 'oauth_login',
|
||||
/**
|
||||
* 消息链路事件
|
||||
* Message Link Event
|
||||
*/
|
||||
botDebugMessageSubmit = 'bot_debug_message_submit', // Bot执行调试(发送消息)
|
||||
botDebugMessageSubmit = 'bot_debug_message_submit', // Bot to perform debugging (send messages)
|
||||
receiveMessage = 'receive_message',
|
||||
emptyReceiveMessage = 'empty_receive_message',
|
||||
messageReceiveSuggests = 'message_receive_suggests',
|
||||
receiveTotalMessages = 'receive_total_messages',
|
||||
getCategoryList = 'get_category_list', // explore获取分类列表
|
||||
getCategoryList = 'get_category_list', // Explore Get Category List
|
||||
/**
|
||||
* coze token
|
||||
*/
|
||||
@@ -80,13 +80,13 @@ export enum FeatureEvents {
|
||||
openGetPatList = 'open_get_pat_list',
|
||||
openPatAction = 'open_pat_action',
|
||||
/**
|
||||
* 协作模式长链接
|
||||
* Collaboration Mode Long Link
|
||||
*/
|
||||
editWebSocketInit = 'edit_web_socket_init',
|
||||
pluginIdeInit = 'plugin_ide_init', // plugin ide初始化监控
|
||||
pluginIdeInitTrace = 'plugin_ide_init_trace', // plugin ide初始化性能监控
|
||||
pluginIdeInit = 'plugin_ide_init', // Plugin ide initialization monitoring
|
||||
pluginIdeInitTrace = 'plugin_ide_init_trace', // Plugin ide initialization performance monitoring
|
||||
pluginIdeDispose = 'plugin_ide_dispose', // plugin ide dispose
|
||||
|
||||
// 路由重定向
|
||||
// route redirection
|
||||
pathFallbackRedirect = 'path_fallback_redirect',
|
||||
}
|
||||
|
||||
@@ -28,12 +28,12 @@ export enum InteractionEvents {
|
||||
updateOcean = 'update_ocean',
|
||||
// clickBotCard = 'click_bot_card', -- deprecated
|
||||
getHistoryInfo = 'get_history_info',
|
||||
publishBot = 'publish_bot', // Bot发布
|
||||
publishBot = 'publish_bot', // Bot release
|
||||
// offlineBot = 'offline_bot', -- deprecated
|
||||
botDebugMessageReploy = 'bot_debug_message_reploy', // Bot调试内容返回
|
||||
getDatasetList = 'get_dataset_list', // 获取dataset列表
|
||||
createDataSet = 'create_dataset', // 创建dataset
|
||||
updateDataset = 'update_dataset', // 更新dataset
|
||||
botDebugMessageReploy = 'bot_debug_message_reploy', // Bot debug content return
|
||||
getDatasetList = 'get_dataset_list', // Get dataset list
|
||||
createDataSet = 'create_dataset', // Create dataset
|
||||
updateDataset = 'update_dataset', // Update dataset
|
||||
deleteDataset = 'delete_dataset',
|
||||
submitDatasetUrl = 'submit_dataset_url',
|
||||
uploadDatasetFile = 'upload_dataset_file',
|
||||
@@ -51,9 +51,9 @@ export enum InteractionEvents {
|
||||
botDebugShareBotGetLink = 'bot_debug_share_bot_get_link',
|
||||
// botDebugShareBotOpen = 'bot_debug_share_bot_open', -- deprecated
|
||||
// botDebugShareBotClose = 'bot_debug_share_bot_close', -- deprecated
|
||||
botDebugGetRecord = 'bot_debug_get_record', // Bot详情页初始化
|
||||
botDebugGetRecord = 'bot_debug_get_record', // Bot details page initialization
|
||||
// botDebugCheckItemId = 'bot_debug_check_item_id', -- deprecated
|
||||
botDebugAutosaveItem = 'bot_debug_autosave_item', // Bot自动保存
|
||||
botDebugAutosaveItem = 'bot_debug_autosave_item', // Bot auto save
|
||||
botDebugGetPluginList = 'bot_debug_get_plugin_list',
|
||||
pluginPageGetPluginList = 'plugin_page_get_plugin_list',
|
||||
botDebugUploadImage = 'bot_debug_upload_image',
|
||||
@@ -61,7 +61,7 @@ export enum InteractionEvents {
|
||||
botRevert = 'bot_revert',
|
||||
botSubmit = 'bot_submit',
|
||||
botMergeToDraft = 'bot_merge_to_draft',
|
||||
botGetDraftBotInfo = 'bot_get_draft_bot_info', // bot获取详情
|
||||
botGetDraftBotInfo = 'bot_get_draft_bot_info', // Bot Get Details
|
||||
copy = 'copy',
|
||||
botDuplicate = 'bot_duplicate',
|
||||
botExperience = 'bot_experience',
|
||||
@@ -71,7 +71,7 @@ export enum InteractionEvents {
|
||||
botGetScheduleTasks = 'bot_get_schedule_tasks',
|
||||
botRemoveScheduleTask = 'bot_remove_schedule_task',
|
||||
parseJSON = 'parse_json_error',
|
||||
botGetAiGenerateAvatar = 'bot_get_ai_generate_avatar', // AI生成头像
|
||||
botGetAiGenerateAvatar = 'bot_get_ai_generate_avatar', // AI-generated avatar
|
||||
ttsVoiceConfig = 'tts_voice_config',
|
||||
ttsVoiceToken = 'tts_voice_token',
|
||||
ttsVoiceWs = 'tts_voice_ws',
|
||||
|
||||
@@ -101,10 +101,10 @@ export enum KnowledgeEvents {
|
||||
KnowledgeSearchFeishuDocument = 'knowledge_search_feishu_document',
|
||||
KnowledgeGetFeishuDocumentTreeList = 'knowledge_get_feishu_document_tree_list',
|
||||
|
||||
// bot页面中的知识库
|
||||
// Knowledge base in bot page
|
||||
KnowledgeGetDataSetList = 'knowledge_get_dataset_list',
|
||||
|
||||
// 新版知识库交互
|
||||
// New Knowledge Base Interaction
|
||||
KnowledgeGetDataSetDeatil = 'knowledge_get_dataset_detail',
|
||||
|
||||
KnowledgeRefreshDocument = 'knowledge_refresh_document',
|
||||
|
||||
@@ -19,27 +19,27 @@ import { logger as globalLogger, type Logger } from '@coze-arch/logger';
|
||||
|
||||
import { type EventNames } from './events';
|
||||
|
||||
/** 描述用于计算 duration 的点位 */
|
||||
/** Describes the points used to calculate duration */
|
||||
export interface DurationPoint {
|
||||
/** 点位名,一般是某个行为 */
|
||||
/** A point name, usually an action */
|
||||
pointName: string;
|
||||
/** 当前时间戳,用于计算 duration */
|
||||
/** Current timestamp, used to calculate duration */
|
||||
time: number;
|
||||
}
|
||||
|
||||
export interface ReportEvent {
|
||||
/**
|
||||
* 事件开始。记录 startTime,后续用于计算 duration
|
||||
* 注:创建事件时会自动执行,一般不需要调用
|
||||
* Event start. Logging of gastTime for subsequent use to calculate duration
|
||||
* Note: Events are created automatically and generally do not require a call
|
||||
*/
|
||||
start: () => void;
|
||||
/**
|
||||
* 上报成功事件。携带 success=1、duration 参数
|
||||
* Report a success event. Carry success = 1, duration parameter
|
||||
*/
|
||||
success: (payload?: { meta?: Record<string, unknown> }) => void;
|
||||
/**
|
||||
* 上报失败事件。携带 success=0、error、reason 参数
|
||||
* - reason: 有限枚举,导致失败的原因
|
||||
* Report a failure event. Carry success = 0, error, reason parameters
|
||||
* - reason: finite enumeration, causes of failure
|
||||
*/
|
||||
error: (payload: {
|
||||
reason: string;
|
||||
@@ -47,9 +47,9 @@ export interface ReportEvent {
|
||||
meta?: Record<string, unknown>;
|
||||
}) => void;
|
||||
/**
|
||||
* 添加一个名为 @param pointName 的点位,用于计算 duration
|
||||
* Add a point named @param pointName to calculate duration
|
||||
*
|
||||
* 假设有 [a、b、c] 三个点位,最终上报的 duration 是
|
||||
* Assuming there are three points [a, b, c], the final reported duration is
|
||||
* duration: {
|
||||
* a: aTime - startTime,
|
||||
* b: bTime - startTime,
|
||||
@@ -63,22 +63,22 @@ export interface ReportEvent {
|
||||
*/
|
||||
addDurationPoint: (pointName: string) => void;
|
||||
/**
|
||||
* 获取耗时
|
||||
* acquisition time
|
||||
*/
|
||||
getDuration: () => Record<string, number> | undefined;
|
||||
/** 获取 Meta,一般用于获取创建时设置的 meta 字段 */
|
||||
/** Get Meta, typically used to get the meta field set at creation time */
|
||||
getMeta: () => Record<string, unknown>;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
/**
|
||||
* 创建一个标准的上报事件
|
||||
* - 成功:success=1,duration={...}
|
||||
* - 失败:success=0, reason, error
|
||||
* Create a standard reporting event
|
||||
* - Success: success = 1, duration = {...}
|
||||
* - Failure: success = 0, reason, error
|
||||
*/
|
||||
/**
|
||||
* @deprecated 该方法已废弃,请统一使用`import { reporter } from '@coze-arch/logger'的`reporter.tracer`替换,具体请查看:
|
||||
* @Deprecated This method is deprecated, please replace it with'reporter .tracer 'of'import {reporter} from' @code-arch/logger '. For details, please check:
|
||||
*/
|
||||
export const createReportEvent = ({
|
||||
eventName,
|
||||
@@ -102,7 +102,7 @@ export const createReportEvent = ({
|
||||
...metaInCtx,
|
||||
...(isFinished
|
||||
? {
|
||||
event_has_finished: true, // 标记事件已 success/error 过,提示可能存在问题
|
||||
event_has_finished: true, // Marks that the event has had success/error, indicating that there may be a problem
|
||||
}
|
||||
: {}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user