feat: manually mirror opencoze's code from bytedance
Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
55
frontend/packages/arch/web-context/src/const/app.ts
Normal file
55
frontend/packages/arch/web-context/src/const/app.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// extract from apps/bot/src/constant/app.ts
|
||||
export enum BaseEnum {
|
||||
Home = 'home', //首页
|
||||
Explore = 'explore', //探索
|
||||
Store = 'store', // 商店
|
||||
Model = 'model', //模型竞技场
|
||||
Space = 'space', //空间内
|
||||
Workflow = 'work_flow', //兼容 workflow 编辑页
|
||||
Invite = 'invite', // 邀请链接
|
||||
Token = 'token', // token
|
||||
Open = 'open', // 开放平台
|
||||
PluginMockSet = 'plugin_mock_set',
|
||||
Search = 'search', // 搜索
|
||||
Premium = 'premium', // 订阅服务
|
||||
User = 'user', // 个人主页
|
||||
Enterprise = 'enterprise', // 企业管理
|
||||
}
|
||||
|
||||
export enum SpaceAppEnum {
|
||||
BOT = 'bot',
|
||||
DOUYIN_BOT = 'douyin-bot',
|
||||
DEVELOP = 'develop',
|
||||
LIBRARY = 'library',
|
||||
MODEL = 'model',
|
||||
PLUGIN = 'plugin',
|
||||
OCEAN_PROJECT = 'ocean-project',
|
||||
WORKFLOW = 'workflow',
|
||||
KNOWLEDGE = 'knowledge',
|
||||
TEAM = 'team',
|
||||
PERSONAL = 'personal',
|
||||
WIDGET = 'widget',
|
||||
EVALUATION = 'evaluation',
|
||||
EVALUATE = 'evaluate',
|
||||
SOCIAL_SCENE = 'social-scene',
|
||||
IMAGEFLOW = 'imageflow',
|
||||
DATABASE = 'database',
|
||||
PROJECT_IDE = 'project-ide',
|
||||
PUBLISH = 'publish',
|
||||
}
|
||||
20
frontend/packages/arch/web-context/src/const/community.ts
Normal file
20
frontend/packages/arch/web-context/src/const/community.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { uniqueId } from 'lodash-es';
|
||||
|
||||
export const defaultConversationKey = -1;
|
||||
export const defaultConversationUniqId = uniqueId();
|
||||
30
frontend/packages/arch/web-context/src/const/custom.ts
Normal file
30
frontend/packages/arch/web-context/src/const/custom.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// extract from apps/bot/src/constant/custom.ts
|
||||
|
||||
const enum CozeTokenInsufficientErrorCode {
|
||||
WORKFLOW = '702095072',
|
||||
BOT = '702082020',
|
||||
}
|
||||
/**
|
||||
* Coze Token不足错误码
|
||||
* 当出现该错误码的时候,需要额外进行停止拉流操作
|
||||
*/
|
||||
export const COZE_TOKEN_INSUFFICIENT_ERROR_CODE = [
|
||||
CozeTokenInsufficientErrorCode.BOT,
|
||||
CozeTokenInsufficientErrorCode.WORKFLOW,
|
||||
];
|
||||
Reference in New Issue
Block a user