chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/** 直接从 yargs-parser 导出会因为不支持浏览器环境而报错 */
|
||||
/** Exporting directly from yargs-parser will cause an error because the browser environment is not supported */
|
||||
import yargsParser from 'yargs-parser/browser';
|
||||
import multipart from 'parse-multipart';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
@@ -42,12 +42,12 @@ class CURLParser {
|
||||
if (!cURLStr.startsWith('curl')) {
|
||||
throw new Error('curl syntax error');
|
||||
}
|
||||
// 删除换行
|
||||
// Delete newline
|
||||
const newLineFound = /\r|\n/.exec(cURLStr);
|
||||
if (newLineFound) {
|
||||
cURLStr = cURLStr.replace(/\\\r|\\\n/g, '');
|
||||
}
|
||||
// 改成通用写法
|
||||
// Change to universal spelling
|
||||
cURLStr = cURLStr.replace(/ -XPOST/, ' -X POST');
|
||||
cURLStr = cURLStr.replace(/ -XGET/, ' -X GET');
|
||||
cURLStr = cURLStr.replace(/ -XPUT/, ' -X PUT');
|
||||
@@ -65,7 +65,7 @@ class CURLParser {
|
||||
cURLStr = cURLStr.replace(/^curl/, '');
|
||||
return cURLStr;
|
||||
}
|
||||
/** 如果有误写的两个相同参数,取最后一个 */
|
||||
/** If there are two identical arguments written by mistake, take the last one */
|
||||
getFirstItem(key: string) {
|
||||
const e = this.yargObj[key];
|
||||
if (!Array.isArray(e)) {
|
||||
@@ -153,20 +153,20 @@ class CURLParser {
|
||||
}
|
||||
if (Reflect.has(yargObj, 'F')) {
|
||||
if (!yargObj.F) {
|
||||
// 存在 -F 参数但为空,则为错误 curl
|
||||
// If there is a -F parameter but it is empty, it is an error curl.
|
||||
throw new Error('curl -F params syntax error');
|
||||
}
|
||||
return 'POST';
|
||||
}
|
||||
if (Reflect.has(yargObj, 'f')) {
|
||||
if (!yargObj.f) {
|
||||
// 存在 --form 参数但为空,则为错误 curl
|
||||
// If the --form parameter exists but is empty, it is an error curl.
|
||||
throw new Error('curl --form params syntax error');
|
||||
}
|
||||
return 'POST';
|
||||
}
|
||||
if (Reflect.has(yargObj, 'd')) {
|
||||
// 存在 --data 参数,但值为空的场景,默认是 GET 请求
|
||||
// Scenes where the --data parameter exists, but the value is empty, the default is a GET request
|
||||
me = !yargObj?.d ? 'GET' : 'POST';
|
||||
}
|
||||
return (me ?? ('GET' as string)).toUpperCase();
|
||||
@@ -229,7 +229,7 @@ class CURLParser {
|
||||
JSON.parse(paramsD);
|
||||
type = 'application/json';
|
||||
} catch (error) {
|
||||
// data 不是 json string 时 type 取 form-urlencoded
|
||||
// Type takes form-urlencoded when data is not a json string
|
||||
type = 'application/x-www-form-urlencoded';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,11 +45,11 @@ function getIsInitStartOuputs(
|
||||
|
||||
/**
|
||||
*
|
||||
* 判断当前工作流是否是初始状态
|
||||
* - 节点数量为 2
|
||||
* - 没有边
|
||||
* - 开始节点只有一个输入 或者 有两个输入,但第二个输入参数为默认状态
|
||||
* - 结束节点只有一个有效输出 或者 表单配置了多个输出变量,但都为默认状态
|
||||
* Determine whether the current workflow is in an initial state
|
||||
* The number of nodes is 2.
|
||||
* - no edge
|
||||
* - The start node has only one input, or, there are two inputs, but the second input parameter is the default state
|
||||
* - The end node has only one valid output, or the form has multiple output variables configured, but all are in the default state
|
||||
*/
|
||||
export const getIsInitWorkflow = (
|
||||
workflowShcmaJson: WorkflowJSON,
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
const workflowPath = 'work_flow';
|
||||
|
||||
/**
|
||||
* 获取 Workflow 页面 url
|
||||
* @param params 相关参数
|
||||
* @returns Workflow 页面 url
|
||||
* Get Workflow page url
|
||||
* @param params related parameters
|
||||
* @returns Workflow page url
|
||||
*/
|
||||
export const getWorkflowUrl = (params: {
|
||||
space_id: string;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import { PluginType } from '@coze-arch/bot-api/plugin_develop';
|
||||
import { PluginDevelopApi } from '@coze-arch/bot-api';
|
||||
/**
|
||||
* 根据 workflow 的 pluginId 获取 workflow 的版本号
|
||||
* Get the version number of the workflow according to the pluginId of the workflow.
|
||||
*/
|
||||
export const getWorkflowVersionByPluginId = async ({
|
||||
spaceId,
|
||||
@@ -42,7 +42,7 @@ export const getWorkflowVersionByPluginId = async ({
|
||||
},
|
||||
);
|
||||
|
||||
// 补全版本信息
|
||||
// Complete version information
|
||||
const versionName = resp.data?.plugin_list?.[0]?.version_name;
|
||||
return versionName;
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* 限制并发数
|
||||
* Limit concurrency
|
||||
*/
|
||||
export class PromiseLimiter<T> {
|
||||
private concurrency: number;
|
||||
|
||||
Reference in New Issue
Block a user