refactor: IDL structure modification (#475)

This commit is contained in:
liuyunchao-1998
2025-08-07 15:59:51 +08:00
committed by GitHub
parent b25bf6728a
commit e7d25319ff
221 changed files with 8289 additions and 17471 deletions

View File

@@ -17,7 +17,7 @@
import OriginPkgRootWebpackPlugin from '@coze-arch/pkg-root-webpack-plugin-origin';
type PkgRootWebpackPluginOptions = Record<string, unknown>;
declare class PkgRootWebpackPlugin extends OriginPkgRootWebpackPlugin {
constructor(options?: Partial<PkgRootWebpackPluginOptions>);
constructor(options?: Partial<PkgRootWebpackPluginOptions>);
}
export default PkgRootWebpackPlugin;
export { PkgRootWebpackPlugin };

View File

@@ -1,3 +1,19 @@
/*
* 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.
*/
// apps/logistics/api.config.js
const path = require('path');
@@ -7,8 +23,7 @@ const config = [
idlRoot: path.resolve(__dirname, '../../../../'), // IDL root directory
entries: {
passport: './idl/passport/passport.thrift', // Entry service name and path
explore:
'./idl/flow/marketplace/flow_marketplace_product/public_api.thrift',
explore: './idl/marketplace/public_api.thrift',
},
commonCodePath: path.resolve(__dirname, './src/api/config.ts'), // custom profile
output: './src', // Product location

View File

@@ -8,7 +8,7 @@
"exports": {
".": "./src/index.ts",
"./passport": "./src/idl/passport/passport.ts",
"./marketplace": "./src/idl/flow/marketplace/flow_marketplace_product/public_api.ts"
"./marketplace": "./src/idl/marketplace/public_api.ts"
},
"main": "src/index.ts",
"typesVersions": {
@@ -17,7 +17,7 @@
"./src/idl/passport/passport.ts"
],
"marketplace": [
"./src/idl/flow/marketplace/flow_marketplace_product/public_api.ts"
"./src/idl/marketplace/public_api.ts"
]
}
},

View File

@@ -16,3 +16,4 @@
declare const _schemas: any[];
export default _schemas;

View File

@@ -15,32 +15,32 @@
*/
export interface TrafficEnv {
Open: boolean;
Env: string;
Open: boolean,
Env: string,
}
export interface Base {
LogID: string;
Caller: string;
Addr: string;
Client: string;
TrafficEnv?: TrafficEnv;
LogID: string,
Caller: string,
Addr: string,
Client: string,
TrafficEnv?: TrafficEnv,
Extra?: {
[key: string | number]: string;
};
[key: string | number]: string
},
}
export interface BaseResp {
StatusMessage: string;
StatusCode: number;
StatusMessage: string,
StatusCode: number,
Extra?: {
[key: string | number]: string;
};
[key: string | number]: string
},
}
export interface EmptyReq {}
export interface EmptyData {}
export interface EmptyResp {
code: number;
msg: string;
data: EmptyData;
code: number,
msg: string,
data: EmptyData,
}
export interface EmptyRpcReq {}
export interface EmptyRpcResp {}
export interface EmptyRpcResp {}

View File

@@ -1,782 +0,0 @@
/*
* 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 * as marketplace_common from './../marketplace_common';
export { marketplace_common };
import * as product_common from './product_common';
export { product_common };
import * as base from './../../../base';
export { base };
import { createAPI } from './../../../../api/config';
export const PublicGetProductList = /*#__PURE__*/ createAPI<
GetProductListRequest,
GetProductListResponse
>({
url: '/api/marketplace/product/list',
method: 'GET',
name: 'PublicGetProductList',
reqType: 'GetProductListRequest',
reqMapping: {
body: [
'entity_type',
'sort_type',
'page_num',
'page_size',
'keyword',
'publish_mode',
'source',
'current_entity_type',
'preview_topic_id',
'is_official',
'need_extra',
'entity_types',
'is_free',
'plugin_type',
],
query: [
'category_id',
'publish_platform_ids',
'current_entity_id',
'current_entity_version',
'topic_id',
],
header: ['Tt-Agw-Client-Ip'],
},
resType: 'GetProductListResponse',
schemaRoot:
'api://schemas/idl_flow_marketplace_flow_marketplace_product_public_api',
service: 'explore',
});
export const PublicGetProductDetail = /*#__PURE__*/ createAPI<
GetProductDetailRequest,
GetProductDetailResponse
>({
url: '/api/marketplace/product/detail',
method: 'GET',
name: 'PublicGetProductDetail',
reqType: 'GetProductDetailRequest',
reqMapping: {
query: ['product_id', 'entity_id'],
body: ['entity_type', 'need_audit_failed'],
header: ['Tt-Agw-Client-Ip'],
},
resType: 'GetProductDetailResponse',
schemaRoot:
'api://schemas/idl_flow_marketplace_flow_marketplace_product_public_api',
service: 'explore',
});
export const PublicFavoriteProduct = /*#__PURE__*/ createAPI<
FavoriteProductRequest,
FavoriteProductResponse
>({
url: '/api/marketplace/product/favorite',
method: 'POST',
name: 'PublicFavoriteProduct',
reqType: 'FavoriteProductRequest',
reqMapping: {
body: ['product_id', 'entity_type', 'is_cancel', 'entity_id', 'topic_id'],
header: ['Cookie'],
},
resType: 'FavoriteProductResponse',
schemaRoot:
'api://schemas/idl_flow_marketplace_flow_marketplace_product_public_api',
service: 'explore',
});
export const PublicGetUserFavoriteListV2 = /*#__PURE__*/ createAPI<
GetUserFavoriteListV2Request,
GetUserFavoriteListV2Response
>({
url: '/api/marketplace/product/favorite/list.v2',
method: 'GET',
name: 'PublicGetUserFavoriteListV2',
reqType: 'GetUserFavoriteListV2Request',
reqMapping: {
query: [
'cursor_id',
'page_size',
'entity_type',
'sort_type',
'keyword',
'source',
'need_user_trigger_config',
'begin_at',
'end_at',
'entity_types',
'organization_id',
],
},
resType: 'GetUserFavoriteListV2Response',
schemaRoot:
'api://schemas/idl_flow_marketplace_flow_marketplace_product_public_api',
service: 'explore',
});
export const PublicDuplicateProduct = /*#__PURE__*/ createAPI<
DuplicateProductRequest,
DuplicateProductResponse
>({
url: '/api/marketplace/product/duplicate',
method: 'POST',
name: 'PublicDuplicateProduct',
reqType: 'DuplicateProductRequest',
reqMapping: {
body: ['product_id', 'entity_type', 'space_id', 'name'],
header: ['Cookie'],
},
resType: 'DuplicateProductResponse',
schemaRoot:
'api://schemas/idl_flow_marketplace_flow_marketplace_product_public_api',
service: 'explore',
});
export interface FavoriteProductResponse {
code: number;
message: string;
is_first_favorite?: boolean;
}
export interface FavoriteProductRequest {
product_id?: string;
entity_type: product_common.ProductEntityType;
is_cancel?: boolean;
entity_id?: string;
topic_id?: string;
Cookie?: string;
}
export interface GetProductListRequest {
entity_type?: product_common.ProductEntityType;
category_id?: string;
sort_type: product_common.SortType;
page_num: number;
page_size: number;
/** 不为空则搜索 */
keyword?: string;
/** 公开方式1-开源2-闭源 , // 公开方式 */
publish_mode?: product_common.ProductPublishMode;
/** 发布渠道 */
publish_platform_ids?: string[];
/** 列表页 tab; 1-运营推荐 */
source?: product_common.ProductListSource;
/**
* 个性化推荐场景, 传入当前的实体信息, 获取推荐的商品
* 当前实体类型
*/
current_entity_type?: product_common.ProductEntityType;
/** 当前实体 ID */
current_entity_id?: string;
/** 当前实体版本 */
current_entity_version?: string;
/** 专题场景 */
topic_id?: string;
preview_topic_id?: string;
/** 是否需要过滤出官方商品 */
is_official?: boolean;
/** 是否需要返回额外信息 */
need_extra?: boolean;
/** 商品类型列表, 优先使用该参数,其次使用 EntityType */
entity_types?: product_common.ProductEntityType[];
/** true = 筛选免费的false = 筛选付费的;不传则不区分免费和付费 */
is_free?: boolean;
/** 插件类型 */
plugin_type?: product_common.PluginType;
'Tt-Agw-Client-Ip'?: string;
}
export interface GetProductListResponse {
code: number;
message: string;
data: GetProductListData;
}
export interface GetProductListData {
products?: ProductInfo[];
has_more: boolean;
total: number;
}
export interface ProductInfo {
meta_info: ProductMetaInfo;
user_behavior?: UserBehaviorInfo;
commercial_setting?: product_common.CommercialSetting;
plugin_extra?: PluginExtraInfo;
bot_extra?: BotExtraInfo;
workflow_extra?: WorkflowExtraInfo;
social_scene_extra?: SocialSceneExtraInfo;
project_extra?: ProjectExtraInfo;
}
export interface SellerInfo {
id: string;
name: string;
avatar_url: string;
}
export interface ProductCategory {
id: string;
name: string;
icon_url: string;
active_icon_url: string;
index: number;
count: number;
}
export interface ProductLabel {
name: string;
}
export interface ProductMetaInfo {
id: string;
/** 商品/模板名称 */
name: string;
/** 素材 ID由 entity_type 来决定是 bot/plugin 的ID */
entity_id: string;
/** 商品素材类型 */
entity_type: product_common.ProductEntityType;
/** 商品/模板头像 */
icon_url: string;
/** 热度:模板热度=复制量(用于卡片展示/排序);商品热度=不同商品有独立的计算逻辑(仅用于排序)—— heat的计算有一定延迟 */
heat: number;
favorite_count: number;
/** 废弃,使用UserInfo代替 */
seller: SellerInfo;
/** 商品描述 */
description: string;
listed_at: string;
status: product_common.ProductStatus;
/** 商品/模板分类信息 */
category?: ProductCategory;
/** 是否收藏 */
is_favorited: boolean;
is_free: boolean;
/** 模板介绍/插件介绍(目前是富文本格式) */
readme: string;
entity_version?: string;
labels?: ProductLabel[];
user_info: product_common.UserInfo;
medium_icon_url: string;
origin_icon_url: string;
/** 模板封面 */
covers?: product_common.ImageInfo[];
/** 是否专业版特供 */
is_professional?: boolean;
/** 是否为模板 */
is_template: boolean;
/** 是否官方商品 */
is_official: boolean;
/** 价格,当前只有模板有 */
price?: marketplace_common.Price;
}
export interface UserBehaviorInfo {
/**
* 用户主页需要返回最近浏览/使用商品的时间
* 最近浏览时间戳
*/
viewed_at?: string;
/** 最近使用时间戳 */
used_at?: string;
}
export enum PluginAuthMode {
/** 不需要授权 */
NoAuth = 0,
/** 需要授权,但无授权配置 */
Required = 1,
/** 需要授权,且已经配置 */
Configured = 2,
/** 需要授权,但授权配置可能是用户级别,可由用户自己配置 */
Supported = 3,
}
export interface PluginExtraInfo {
tools?: PluginToolInfo[];
total_api_count: number;
bots_use_count: number;
/** 是否有隐私声明, 目前只有 PublicGetProductDetail 会取数据 */
has_private_statement?: boolean;
/** 隐私声明, 目前只有 PublicGetProductDetail 会取数据 */
private_statement?: string;
associated_bots_use_count: number;
is_premium: boolean;
is_official: boolean;
/** 调用量 */
call_amount?: number;
/** 成功率 */
success_rate?: number;
/** 平均执行时长 */
avg_exec_time?: number;
is_default_icon?: boolean;
space_id?: string;
material_id?: string;
connectors: PluginConnectorInfo[];
plugin_type?: product_common.PluginType;
/** for opencoze */
auth_mode?: PluginAuthMode;
}
export interface ToolParameter {
name: string;
required: boolean;
description: string;
type: string;
sub_params: ToolParameter[];
}
export interface CardInfo {
card_url: string;
/** 以下只有详情页返回 */
card_id: string;
mapping_rule: string;
max_display_rows: string;
card_version: string;
}
export interface PluginToolExample {
req_example: string;
resp_example: string;
}
export enum PluginRunMode {
DefaultToSync = 0,
Sync = 1,
Async = 2,
Streaming = 3,
}
export interface PluginToolInfo {
id: string;
name: string;
description: string;
parameters?: ToolParameter[];
card_info?: CardInfo;
example?: PluginToolExample;
/** 调用量 */
call_amount?: number;
/** 成功率 */
success_rate?: number;
/** 平均执行时长 */
avg_exec_time?: number;
/** tool 被bot引用数 */
bots_use_count?: number;
/** 运行模式 */
run_mode?: PluginRunMode;
}
export interface PluginConnectorInfo {
id: string;
name: string;
icon: string;
}
export interface BotPublishPlatform {
id: string;
icon_url: string;
url: string;
name: string;
}
export interface ProductMaterial {
name: string;
icon_url: string;
}
export interface BotVoiceInfo {
id: string;
language_code: string;
language_name: string;
name: string;
style_id: string;
is_support_voice_call: boolean;
}
export enum TimeCapsuleMode {
Off = 0,
On = 1,
}
export enum FileboxInfoMode {
Off = 0,
On = 1,
}
export interface UserQueryCollectConf {
/**
* bot用户query收集配置
* 是否开启收集开关
*/
is_collected: boolean;
/** 隐私协议链接 */
private_policy: string;
}
export interface BotConfig {
/** 模型 */
models?: ProductMaterial[];
/** 插件 */
plugins?: ProductMaterial[];
/** 知识库 */
knowledges?: ProductMaterial[];
/** 工作流 */
workflows?: ProductMaterial[];
/** 私有插件数量 */
private_plugins_count?: number;
/** 私有知识库数量 */
private_knowledges_count?: number;
/** 私有工作流数量 */
private_workflows_count?: number;
/** 判断 multiagent 是否有 bot 节点 */
has_bot_agent?: boolean;
/** bot 配置的声音列表 */
bot_voices?: BotVoiceInfo[];
/** 所有插件数量 */
total_plugins_count?: number;
/** 所有知识库数量 */
total_knowledges_count?: number;
/** 所有工作流数量 */
total_workflows_count?: number;
/** 时间胶囊模式 */
time_capsule_mode?: TimeCapsuleMode;
/** 文件盒模式 */
filebox_mode?: FileboxInfoMode;
/** 私有图片工作流数量 */
private_image_workflow_count?: number;
/** 用户qeury收集配置 */
user_query_collect_conf?: UserQueryCollectConf;
/** 是否关闭语音通话(默认是打开) */
is_close_voice_call?: boolean;
}
/** 消息涉及的bot信息,在home分享场景,消息属于多个bot */
export interface ConversationRelateBot {
id: string;
name: string;
description: string;
icon_url: string;
}
/** 消息涉及的user信息,在home分享场景,消息属于多个user */
export interface ConversationRelateUser {
user_info?: product_common.UserInfo;
}
export interface Conversation {
/** 对话示例 */
snippets?: string[];
/** 对话标题 */
title?: string;
/** 对话IDidGen生成 */
id?: string;
/** 是否需要生成对话 */
gen_title?: boolean;
/** 对话审核状态 */
audit_status?: product_common.AuditStatus;
/** 开场白 */
opening_dialog?: product_common.OpeningDialog;
/** 消息涉及的bot信息,key bot_id */
relate_bots?: {
[key: string | number]: ConversationRelateBot;
};
/** 消息涉及的user信息,key user_id */
relate_users?: {
[key: string | number]: ConversationRelateUser;
};
}
export interface BotExtraInfo {
/** 发布渠道 */
publish_platforms: BotPublishPlatform[];
/** 用户数 */
user_count: number;
/** 公开方式 */
publish_mode: product_common.ProductPublishMode;
/**
* 详情页特有
* 对话示例, 废弃
*/
conversation_snippets?: string[][];
/** 配置 */
config?: BotConfig;
/** 白名单 */
is_inhouse_user?: boolean;
/** 复制创建 bot 数量 */
duplicate_bot_count?: number;
/** 分享对话 */
conversations?: Conversation[];
/** 与 Bot 聊天的对话数 */
chat_conversation_count?: string;
/** 关联商品数 */
related_product_count?: string;
}
export interface WorkflowParameter {
name: string;
desc: string;
is_required: boolean;
input_type: product_common.InputType;
sub_parameters: WorkflowParameter[];
/** 如果Type是数组则有subtype */
sub_type: product_common.InputType;
/** 如果入参是用户手输 就放这里 */
value?: string;
format?: product_common.PluginParamTypeFormat;
from_node_id?: string;
from_output?: string[];
/** InputType (+ AssistType) 定义一个变量的最终类型,仅需透传 */
assist_type?: number;
/** 展示名称( store 独有的,用于详情页 GUI 展示参数) */
show_name?: string;
/** 如果InputType是数组则有subassisttype */
sub_assist_type?: number;
/** 组件配置,由前端解析并渲染 */
component_config?: string;
/** 组件配置类型,前端展示需要 */
component_type?: string;
}
export interface WorkflowTerminatePlan {
/** 对应 workflow 结束节点的回答模式1-返回变量由Bot生成回答2-使用设定的内容直接回答 */
terminate_plan_type: number;
/** 对应 terminate_plan_type = 2 的场景配置的返回内容 */
content: string;
}
export interface WorkflowNodeParam {
input_parameters?: WorkflowParameter[];
terminate_plan?: WorkflowTerminatePlan;
output_parameters?: WorkflowParameter[];
}
export interface WorkflowNodeInfo {
node_id: string;
node_type: product_common.WorkflowNodeType;
node_param?: WorkflowNodeParam;
/** 节点icon */
node_icon_url: string;
/** 展示名称( store 独有的,用于详情页 GUI 展示消息节点的名称) */
show_name?: string;
}
export interface WorkflowEntity {
/** 商品ID */
product_id: string;
name: string;
entity_id: string;
entity_type: product_common.ProductEntityType;
entity_version: string;
icon_url: string;
entity_name: string;
readme: string;
category: ProductCategory;
/** 推荐分类 , */
recommended_category?: ProductCategory;
nodes?: WorkflowNodeInfo[];
desc: string;
/** 入参 图片icon */
case_input_icon_url?: string;
/** 出参 图片icon */
case_output_icon_url?: string;
latest_publish_commit_id?: string;
}
export interface WorkflowGUIConfig {
/** 用于将 workflow 的输入/输出/中间消息节点节点转为用户可视化配置 */
start_node: WorkflowNodeInfo;
end_node: WorkflowNodeInfo;
/** 消息节点会输出中间过程,也需要展示 */
message_nodes?: WorkflowNodeInfo[];
}
export interface WorkflowExtraInfo {
related_workflows: WorkflowEntity[];
duplicate_count?: number;
/** workflow画布信息 */
workflow_schema?: string;
/**
* api/workflowV2/query schema_json
* 推荐分类
*/
recommended_category?: ProductCategory;
nodes?: WorkflowNodeInfo[];
start_node?: WorkflowNodeInfo;
/** 实体名称(用于展示) */
entity_name?: string;
/** 用例图入参 */
case_input_icon_url?: string;
/** 用例图出参 */
case_output_icon_url?: string;
/** 案例执行ID */
case_execute_id?: string;
hover_text?: string;
latest_publish_commit_id?: string;
/** 试运行次数,从数仓取 */
used_count?: number;
/** 用于将 workflow 的输入/输出/中间消息节点节点转为用户可视化配置 */
gui_config?: WorkflowGUIConfig;
}
export interface SocialScenePlayerInfo {
id: string;
name: string;
role_type: product_common.SocialSceneRoleType;
}
export interface SocialSceneExtraInfo {
/** 角色 */
players?: SocialScenePlayerInfo[];
/** 使用过的人数 */
used_count: string;
/** 开始过的次数 */
started_count: string;
/** 开闭源 */
publish_mode: product_common.ProductPublishMode;
}
export interface ProjectConfig {
/** 插件数量 */
plugin_count: number;
/** 工作流数量 */
workflow_count: number;
/** 知识库数量 */
knowledge_count: number;
/** 数据库数量 */
database_count: number;
}
export interface ProjectExtraInfo {
/** Project 上架为模板前生成一个模板副本,使用或者复制模板,需要用 TemplateProjectID 和 TemplateProjectVersion */
template_project_id: string;
template_project_version: string;
/** Project 绑定的 UI 支持的预览类型 */
preview_types: product_common.UIPreviewType[];
/** 用户数 */
user_count: number;
/** 运行数 */
execute_count: number;
/** 发布渠道 */
publish_platforms: BotPublishPlatform[];
/** 近实时复制量,从数仓接口获取(复制 - 上报埋点 - 数仓计算落库) */
duplicate_count: number;
/** 配置 */
config?: ProjectConfig;
}
export interface GetProductDetailRequest {
product_id?: string;
entity_type?: product_common.ProductEntityType;
entity_id?: string;
/** 是否查看最新的审核失败草稿 */
need_audit_failed?: boolean;
'Tt-Agw-Client-Ip'?: string;
}
export interface GetProductDetailResponse {
code: number;
message: string;
data: GetProductDetailData;
}
export interface Price {
value: number;
currency: string;
display_price: string;
}
export interface SKUInfo {
id: string;
/** 待废弃 */
price: Price[];
description: string;
price_v2: marketplace_common.Price[];
charge_sku_info?: product_common.ChargeSKUExtra;
}
export interface SellAttrValue {
id: string;
value: string;
}
export interface SellAttr {
display_name: string;
key: string;
values: SellAttrValue[];
}
export interface SellInfo {
skus: {
[key: string | number]: SKUInfo;
};
attr: SellAttr[];
/** Key 是 attrkey:attrvalue 路径value 是 skuID */
sku_attr_ref: {
[key: string | number]: string;
};
}
export interface Topic {
id: string;
name: string;
description: string;
banner_url: string;
/** 背景小图,前端优先加载 */
banner_url_small: string;
reason: string;
/** 运营提供的专题介绍文档,用户可见 */
introduction_url: string;
/** 用户是否收藏专题 */
is_favorite: boolean;
}
export interface ProductDataIndicator {
/**
* 数据分析指标,来源数仓,比如模板购买量、复制量等
* 购买量
*/
purchase_count?: number;
}
export interface GetProductDetailData {
/** 下架的商品只返回非 optional 字段 */
meta_info: ProductMetaInfo;
/** 用以区分主/客态 */
is_owner: boolean;
/** 审核状态,主态下返回需要关注,如果主态且审核中,需要展示审核中状态 */
audit_status: product_common.ProductDraftStatus;
sell_info?: SellInfo;
space_id?: string;
/** 详情页返回 */
topic?: Topic;
/** 详情页返回 */
can_duplicate?: boolean;
commercial_setting?: product_common.CommercialSetting;
plugin_extra?: PluginExtraInfo;
bot_extra?: BotExtraInfo;
workflow_extra?: WorkflowExtraInfo;
social_scene_extra?: SocialSceneExtraInfo;
project_extra?: ProjectExtraInfo;
data_indicator?: ProductDataIndicator;
}
export interface GetUserFavoriteListV2Request {
/** 第一页不传后续调用时传上一次返回的cursor_id */
cursor_id?: string;
page_size: number;
entity_type?: product_common.ProductEntityType;
sort_type: product_common.SortType;
/** 不为空则搜索 */
keyword?: string;
/** 列表页 tab */
source?: product_common.FavoriteListSource;
/** 是否需要查询用户对Bot的触发器配置为true时才会返回EntityUserTriggerConfig */
need_user_trigger_config?: boolean;
/** 筛选收藏时间 */
begin_at?: string;
/** 筛选收藏时间 */
end_at?: string;
entity_types?: product_common.ProductEntityType[];
/** 组织ID企业版想获取用户收藏的所有内容时需传递 */
organization_id?: string;
}
export interface GetUserFavoriteListV2Response {
code: number;
message: string;
data?: GetUserFavoriteListDataV2;
}
export interface GetUserFavoriteListDataV2 {
favorite_entities: product_common.FavoriteEntity[];
cursor_id: string;
has_more: boolean;
/**
* 用户定时任务配置对应flow.bot.task服务的TriggerEnabled
* key: entity_id; value: UserTriggerConfig
*/
entity_user_trigger_config: {
[key: string | number]: UserTriggerConfig;
};
}
export interface UserTriggerConfig {
trigger_enabled: TriggerEnable;
}
export enum TriggerEnable {
Init = 0,
Open = 1,
Close = 2,
}
export interface DuplicateProductRequest {
product_id: string;
entity_type: product_common.ProductEntityType;
space_id?: string;
name?: string;
Cookie?: string;
}
export interface DuplicateProductResponse {
code: number;
message: string;
data: DuplicateProductData;
}
export interface DuplicateProductData {
/** 复制后的新id */
new_entity_id: string;
/** workflow对应的插件id */
new_plugin_id?: string;
}

View File

@@ -14,23 +14,23 @@
* limitations under the License.
*/
import * as base from './../../base';
import * as base from './../base';
export { base };
export interface Price {
/** 金额 */
amount: string;
/** 币种如USD、CNY */
currency: string;
/** 小数位数 */
decimal_num: number;
/** amount */
amount: string,
/** Currencies such as USD and CNY */
currency: string,
/** decimal places */
decimal_num: number,
}
export enum FollowType {
/** 无关系 */
/** Unknown */
Unknown = 0,
/** 关注 */
/** followee */
Followee = 1,
/** 粉丝 */
/** follower */
Follower = 2,
/** 互相关注 */
/** MutualFollow */
MutualFollow = 3,
}
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
import * as marketplace_common from './../marketplace_common';
import * as marketplace_common from './marketplace_common';
export { marketplace_common };
export enum ProductEntityType {
Bot = 1,
@@ -22,36 +22,36 @@ export enum ProductEntityType {
/** Workflow = 3 , */
SocialScene = 4,
Project = 6,
/** 历史工作流,后续不会再有(废弃) */
/** History workflow, no more in the future (abandoned) */
WorkflowTemplate = 13,
/** 历史图像流模板,后续不会再有(废弃) */
/** Historical image stream template, no more in the future (obsolete) */
ImageflowTemplate = 15,
/** 模板通用标识,仅用于绑定模板相关的配置,不绑定商品 */
/** Template universal identification, only used to bind template-related configurations, not bind products */
TemplateCommon = 20,
/** Bot 模板 */
/** Bot template */
BotTemplate = 21,
/** 工作流模板 */
/** workflow template */
WorkflowTemplateV2 = 23,
/** 图像流模板(该类型已下线,合并入 workflow但历史数据会保留前端视作 workflow 展示) */
/** Image stream template (this type has been offline and merged into workflow, but historical data will be preserved, and the front end will be treated as workflow display) */
ImageflowTemplateV2 = 25,
/** 项目模板 */
/** project template */
ProjectTemplate = 26,
/** coze token 类商品,理论上只会有一个 */
/** Coze token products, theoretically there will only be one */
CozeToken = 50,
/** 订阅 credit 的流量包,理论上只会有一个 */
/** Subscribe to the traffic package of credit, theoretically there will only be one */
MsgCredit = 55,
/** 消息订阅类商品,理论上只有一个 */
/** There is only one subscription product in theory */
SubsMsgCredit = 60,
Common = 99,
/** 专题(兼容之前的设计) */
/** Special Topics (Compatible with previous designs) */
Topic = 101,
}
export enum SortType {
Heat = 1,
Newest = 2,
/** 收藏时间 */
/** collection time */
FavoriteTime = 3,
/** 相关性,只用于搜索场景 */
/** Correlation, only for search scenarios */
Relative = 4,
}
export enum ProductPublishMode {
@@ -59,9 +59,9 @@ export enum ProductPublishMode {
ClosedSource = 2,
}
export enum ProductListSource {
/** 推荐列表页 */
/** recommended list page */
Recommend = 1,
/** 个性化推荐 */
/** personalized recommendation */
CustomizedRecommend = 2,
}
export enum PluginType {
@@ -74,50 +74,50 @@ export enum ProductPaidType {
Paid = 1,
}
export interface CommercialSetting {
commercial_type: ProductPaidType;
commercial_type: ProductPaidType
}
export enum ProductStatus {
/** 从未上架 */
/** NeverListed */
NeverListed = 0,
Listed = 1,
Unlisted = 2,
Banned = 3,
}
export interface UserLabel {
label_id: string;
label_name: string;
icon_uri: string;
icon_url: string;
jump_link: string;
label_id: string,
label_name: string,
icon_uri: string,
icon_url: string,
jump_link: string,
}
export interface UserInfo {
user_id: string;
user_name: string;
name: string;
avatar_url: string;
user_label?: UserLabel;
follow_type?: marketplace_common.FollowType;
user_id: string,
user_name: string,
name: string,
avatar_url: string,
user_label?: UserLabel,
follow_type?: marketplace_common.FollowType,
}
export interface ImageInfo {
uri: string;
url: string;
uri: string,
url: string,
}
export enum ProductDraftStatus {
/** 默认 */
/** default */
Default = 0,
/** 审核中 */
/** Under review. */
Pending = 1,
/** 审核通过 */
/** approved */
Approved = 2,
/** 审核不通过 */
/** The review failed. */
Rejected = 3,
/** 已废弃 */
/** Abandoned */
Abandoned = 4,
}
export type AuditStatus = ProductDraftStatus;
export interface OpeningDialog {
/** Bot开场白 */
content: string;
/** Bot OpeningDialog */
content: string
}
export enum InputType {
String = 1,
@@ -131,27 +131,27 @@ export enum PluginParamTypeFormat {
ImageUrl = 1,
}
export enum WorkflowNodeType {
/** 开始 */
/** start */
Start = 1,
/** 结束 */
/** end */
End = 2,
/** 大模型 */
/** Large model */
LLM = 3,
/** 插件 */
/** plugin */
Api = 4,
/** 代码 */
/** code */
Code = 5,
/** 知识库 */
/** Knowledge Base */
Dataset = 6,
/** 选择器 */
/** selector */
If = 8,
/** 工作流 */
/** Workflow */
SubWorkflow = 9,
/** 变量 */
/** variable */
Variable = 11,
/** 数据库 */
/** database */
Database = 12,
/** 消息 */
/** message */
Message = 13,
}
export enum SocialSceneRoleType {
@@ -161,53 +161,53 @@ export enum SocialSceneRoleType {
}
export enum UIPreviewType {
/**
* UI UI Builder Project
*
*/
* UI preview type, defining alignment UI Builder, currently used in Project
* web page
*/
Web = 1,
/** 移动端 */
/** mobile end */
Client = 2,
}
export interface ChargeSKUExtra {
quantity: string;
is_self_define: boolean;
quantity: string,
is_self_define: boolean,
}
export enum FavoriteListSource {
/** 用户自己创建的 */
/** Created by users themselves */
CreatedByMe = 1,
}
export interface FavoriteEntity {
entity_id: string;
entity_type: ProductEntityType;
name: string;
icon_url: string;
description: string;
/** 废弃,使用UserInfo */
seller: SellerInfo;
/** 用于跳转到Bot编辑页 */
space_id: string;
/** 用户是否有该实体所在Space的权限 */
has_space_permission: boolean;
/** 收藏时间 */
favorite_at: string;
product_extra?: FavoriteProductExtra;
user_info: UserInfo;
plugin_extra?: FavoritePluginExtra;
entity_id: string,
entity_type: ProductEntityType,
name: string,
icon_url: string,
description: string,
/** Abandoned, using UserInfo */
seller: SellerInfo,
/** Use to jump to the bot edit page */
space_id: string,
/** Does the user have permissions to the space where the entity is located? */
has_space_permission: boolean,
/** collection time */
favorite_at: string,
product_extra?: FavoriteProductExtra,
user_info: UserInfo,
plugin_extra?: FavoritePluginExtra,
}
export interface SellerInfo {
user_id: string;
user_name: string;
avatar_url: string;
user_id: string,
user_name: string,
avatar_url: string,
}
export interface FavoriteProductExtra {
product_id: string;
product_status: ProductStatus;
product_id: string,
product_status: ProductStatus,
}
export interface FavoritePluginExtra {
tools: PluginTool[];
tools: PluginTool[]
}
export interface PluginTool {
id: string;
name: string;
description: string;
}
id: string,
name: string,
description: string,
}

View File

@@ -0,0 +1,729 @@
/*
* 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 * as marketplace_common from './marketplace_common';
export { marketplace_common };
import * as product_common from './product_common';
export { product_common };
import * as base from './../base';
export { base };
import { createAPI } from './../../api/config';
export const PublicGetProductList = /*#__PURE__*/createAPI<GetProductListRequest, GetProductListResponse>({
"url": "/api/marketplace/product/list",
"method": "GET",
"name": "PublicGetProductList",
"reqType": "GetProductListRequest",
"reqMapping": {
"body": ["entity_type", "sort_type", "page_num", "page_size", "keyword", "publish_mode", "source", "current_entity_type", "preview_topic_id", "is_official", "need_extra", "entity_types", "is_free", "plugin_type"],
"query": ["category_id", "publish_platform_ids", "current_entity_id", "current_entity_version", "topic_id"],
"header": ["Tt-Agw-Client-Ip"]
},
"resType": "GetProductListResponse",
"schemaRoot": "api://schemas/idl_marketplace_public_api",
"service": "explore"
});
export const PublicGetProductDetail = /*#__PURE__*/createAPI<GetProductDetailRequest, GetProductDetailResponse>({
"url": "/api/marketplace/product/detail",
"method": "GET",
"name": "PublicGetProductDetail",
"reqType": "GetProductDetailRequest",
"reqMapping": {
"query": ["product_id", "entity_id"],
"body": ["entity_type", "need_audit_failed"],
"header": ["Tt-Agw-Client-Ip"]
},
"resType": "GetProductDetailResponse",
"schemaRoot": "api://schemas/idl_marketplace_public_api",
"service": "explore"
});
export const PublicFavoriteProduct = /*#__PURE__*/createAPI<FavoriteProductRequest, FavoriteProductResponse>({
"url": "/api/marketplace/product/favorite",
"method": "POST",
"name": "PublicFavoriteProduct",
"reqType": "FavoriteProductRequest",
"reqMapping": {
"body": ["product_id", "entity_type", "is_cancel", "entity_id", "topic_id"],
"header": ["Cookie"]
},
"resType": "FavoriteProductResponse",
"schemaRoot": "api://schemas/idl_marketplace_public_api",
"service": "explore"
});
export const PublicGetUserFavoriteListV2 = /*#__PURE__*/createAPI<GetUserFavoriteListV2Request, GetUserFavoriteListV2Response>({
"url": "/api/marketplace/product/favorite/list.v2",
"method": "GET",
"name": "PublicGetUserFavoriteListV2",
"reqType": "GetUserFavoriteListV2Request",
"reqMapping": {
"query": ["cursor_id", "page_size", "entity_type", "sort_type", "keyword", "source", "need_user_trigger_config", "begin_at", "end_at", "entity_types", "organization_id"]
},
"resType": "GetUserFavoriteListV2Response",
"schemaRoot": "api://schemas/idl_marketplace_public_api",
"service": "explore"
});
export const PublicDuplicateProduct = /*#__PURE__*/createAPI<DuplicateProductRequest, DuplicateProductResponse>({
"url": "/api/marketplace/product/duplicate",
"method": "POST",
"name": "PublicDuplicateProduct",
"reqType": "DuplicateProductRequest",
"reqMapping": {
"body": ["product_id", "entity_type", "space_id", "name"],
"header": ["Cookie"]
},
"resType": "DuplicateProductResponse",
"schemaRoot": "api://schemas/idl_marketplace_public_api",
"service": "explore"
});
export interface FavoriteProductResponse {
code: number,
message: string,
is_first_favorite?: boolean,
}
export interface FavoriteProductRequest {
product_id?: string,
entity_type: product_common.ProductEntityType,
is_cancel?: boolean,
entity_id?: string,
topic_id?: string,
Cookie?: string,
}
export interface GetProductListRequest {
entity_type?: product_common.ProductEntityType,
category_id?: string,
sort_type: product_common.SortType,
page_num: number,
page_size: number,
/** non-empty search */
keyword?: string,
/** Open mode: 1-open source; 2-closed source,//open mode */
publish_mode?: product_common.ProductPublishMode,
/** publish platforms */
publish_platform_ids?: string[],
/** List tab; 1 - Operational recommendations */
source?: product_common.ProductListSource,
/**
* Personalized recommendation scenarios, enter current entity information, and obtain recommended products
* Current entity type
*/
current_entity_type?: product_common.ProductEntityType,
/** Current entity ID */
current_entity_id?: string,
/** Current entity version */
current_entity_version?: string,
/** thematic scenario */
topic_id?: string,
preview_topic_id?: string,
/** Do you need to filter out official products? */
is_official?: boolean,
/** Do you need to return additional information? */
need_extra?: boolean,
/** List of product types, use this parameter first, followed by EntityType */
entity_types?: product_common.ProductEntityType[],
/** True = filter for free; false = filter for paid; if you don't pass it, you won't distinguish between free and paid. */
is_free?: boolean,
/** plugin type */
plugin_type?: product_common.PluginType,
"Tt-Agw-Client-Ip"?: string,
}
export interface GetProductListResponse {
code: number,
message: string,
data: GetProductListData,
}
export interface GetProductListData {
products?: ProductInfo[],
has_more: boolean,
total: number,
}
export interface ProductInfo {
meta_info: ProductMetaInfo,
user_behavior?: UserBehaviorInfo,
commercial_setting?: product_common.CommercialSetting,
plugin_extra?: PluginExtraInfo,
bot_extra?: BotExtraInfo,
workflow_extra?: WorkflowExtraInfo,
social_scene_extra?: SocialSceneExtraInfo,
project_extra?: ProjectExtraInfo,
}
export interface SellerInfo {
id: string,
name: string,
avatar_url: string,
}
export interface ProductCategory {
id: string,
name: string,
icon_url: string,
active_icon_url: string,
index: number,
count: number,
}
export interface ProductLabel {
name: string
}
export interface ProductMetaInfo {
id: string,
/** Product/Template Name */
name: string,
/** Creature ID, determined by entity_type is the ID of the bot/plugin */
entity_id: string,
/** Product material type */
entity_type: product_common.ProductEntityType,
/** Product/template avatar */
icon_url: string,
/** Heat: Template heat = copy volume (used for card display/sorting); product heat = different products have independent calculation logic (only used for sorting) - the calculation of heat has a certain delay */
heat: number,
favorite_count: number,
/** Obsolete, use UserInfo instead */
seller: SellerInfo,
/** Product description */
description: string,
listed_at: string,
status: product_common.ProductStatus,
/** Product/template classification information */
category?: ProductCategory,
/** Whether to collect */
is_favorited: boolean,
is_free: boolean,
/** Template introduction/plugin introduction (currently in rich text format) */
readme: string,
entity_version?: string,
labels?: ProductLabel[],
user_info: product_common.UserInfo,
medium_icon_url: string,
origin_icon_url: string,
/** Template cover */
covers?: product_common.ImageInfo[],
/** Is the professional version specially available? */
is_professional?: boolean,
/** Is it a template? */
is_template: boolean,
/** Is it an official product? */
is_official: boolean,
/** Price, currently only available in the template. */
price?: marketplace_common.Price,
}
export interface UserBehaviorInfo {
/**
* The user homepage needs to return the most recently viewed/used product time.
* Latest Viewtimestamp
*/
viewed_at?: string,
/** Recently used timestamp */
used_at?: string,
}
export enum PluginAuthMode {
/** No authorization required. */
NoAuth = 0,
/** Authorization required, but no authorization configuration */
Required = 1,
/** Authorization is required and has been configured */
Configured = 2,
/** Authorization is required, but the authorization configuration may be user-level and can be configured by the user himself */
Supported = 3,
}
export interface PluginExtraInfo {
tools?: PluginToolInfo[],
total_api_count: number,
bots_use_count: number,
/** Is there a privacy statement, currently only PublicGetProductDetail will take the data */
has_private_statement?: boolean,
/** Privacy statement, currently only PublicGetProductDetail will access data */
private_statement?: string,
associated_bots_use_count: number,
is_premium: boolean,
is_official: boolean,
/** call amount */
call_amount?: number,
/** success rate */
success_rate?: number,
/** average execution time */
avg_exec_time?: number,
is_default_icon?: boolean,
space_id?: string,
material_id?: string,
connectors: PluginConnectorInfo[],
plugin_type?: product_common.PluginType,
/** for opencoze */
auth_mode?: PluginAuthMode,
}
export interface ToolParameter {
name: string,
required: boolean,
description: string,
type: string,
sub_params: ToolParameter[],
}
export interface CardInfo {
card_url: string,
/** Only the details page returns */
card_id: string,
mapping_rule: string,
max_display_rows: string,
card_version: string,
}
export interface PluginToolExample {
req_example: string,
resp_example: string,
}
export enum PluginRunMode {
DefaultToSync = 0,
Sync = 1,
Async = 2,
Streaming = 3,
}
export interface PluginToolInfo {
id: string,
name: string,
description: string,
parameters?: ToolParameter[],
card_info?: CardInfo,
example?: PluginToolExample,
/** call amount */
call_amount?: number,
/** success rate */
success_rate?: number,
/** average execution time */
avg_exec_time?: number,
/** Number of tool bot references */
bots_use_count?: number,
/** operating mode */
run_mode?: PluginRunMode,
}
export interface PluginConnectorInfo {
id: string,
name: string,
icon: string,
}
export interface BotPublishPlatform {
id: string,
icon_url: string,
url: string,
name: string,
}
export interface ProductMaterial {
name: string,
icon_url: string,
}
export interface BotVoiceInfo {
id: string,
language_code: string,
language_name: string,
name: string,
style_id: string,
is_support_voice_call: boolean,
}
export enum TimeCapsuleMode {
Off = 0,
On = 1,
}
export enum FileboxInfoMode {
Off = 0,
On = 1,
}
export interface UserQueryCollectConf {
/**
* Bot user query collection configuration
* Whether to turn on the collection switch
*/
is_collected: boolean,
/** Privacy Policy Link */
private_policy: string,
}
export interface BotConfig {
/** model */
models?: ProductMaterial[],
/** plugin */
plugins?: ProductMaterial[],
/** Knowledge Base */
knowledges?: ProductMaterial[],
/** Workflow */
workflows?: ProductMaterial[],
/** number of private plugins */
private_plugins_count?: number,
/** Number of private repositories */
private_knowledges_count?: number,
/** number of private workflows */
private_workflows_count?: number,
/** Determine if the multiagent has a bot node */
has_bot_agent?: boolean,
/** List of sounds configured by bot */
bot_voices?: BotVoiceInfo[],
/** Number of all plugins */
total_plugins_count?: number,
/** Number of all knowledge bases */
total_knowledges_count?: number,
/** Number of all workflows */
total_workflows_count?: number,
/** Time Capsule Mode */
time_capsule_mode?: TimeCapsuleMode,
/** File box mode */
filebox_mode?: FileboxInfoMode,
/** Number of private image workflows */
private_image_workflow_count?: number,
/** User qeury collection configuration */
user_query_collect_conf?: UserQueryCollectConf,
/** Whether to turn off voice calls (the default is on) */
is_close_voice_call?: boolean,
}
/** The bot information involved in the message, sharing the scene in the home, the message belongs to multiple bots */
export interface ConversationRelateBot {
id: string,
name: string,
description: string,
icon_url: string,
}
/** The user information involved in the message, sharing the scene in the home, the message belongs to multiple users */
export interface ConversationRelateUser {
user_info?: product_common.UserInfo
}
export interface Conversation {
/** conversation example */
snippets?: string[],
/** conversation title */
title?: string,
/** Conversation ID, generated by idGen */
id?: string,
/** Do you need to generate a conversation? */
gen_title?: boolean,
/** conversation moderation status */
audit_status?: product_common.AuditStatus,
/** opening statement */
opening_dialog?: product_common.OpeningDialog,
/** The bot information involved in the message, key bot_id */
relate_bots?: {
[key: string | number]: ConversationRelateBot
},
/** The user information involved in the message, key user_id */
relate_users?: {
[key: string | number]: ConversationRelateUser
},
}
export interface BotExtraInfo {
/** publish platforms */
publish_platforms: BotPublishPlatform[],
/** user count */
user_count: number,
/** public method */
publish_mode: product_common.ProductPublishMode,
/**
* Details page unique
* Dialogue example, abandoned
*/
conversation_snippets?: string[][],
/** configuration */
config?: BotConfig,
/** whitelist */
is_inhouse_user?: boolean,
/** Number of copy-created bots */
duplicate_bot_count?: number,
/** Share the conversation */
conversations?: Conversation[],
/** Number of conversations with Bot */
chat_conversation_count?: string,
/** number of related products */
related_product_count?: string,
}
export interface WorkflowParameter {
name: string,
desc: string,
is_required: boolean,
input_type: product_common.InputType,
sub_parameters: WorkflowParameter[],
/** If Type is an array, there is a subtype */
sub_type: product_common.InputType,
/** If the imported parameter is the user's hand input, put it here */
value?: string,
format?: product_common.PluginParamTypeFormat,
from_node_id?: string,
from_output?: string[],
/** InputType (+ AssistType) defines the final type of a variable, which only needs to be passed through */
assist_type?: number,
/** Display name (unique to the store, used for details page GUI display parameters) */
show_name?: string,
/** If the InputType is an array, there is a subassistant type */
sub_assist_type?: number,
/** Component configuration, parsed and rendered by the front end */
component_config?: string,
/** Component configuration type, required for front-end display */
component_type?: string,
}
export interface WorkflowTerminatePlan {
/** The answer mode corresponding to the end node of the workflow: 1 - Return the variable, and the Bot generates the answer; 2 - Use the set content to answer directly */
terminate_plan_type: number,
/** Return content of scene configuration corresponding to terminate_plan_type = 2 */
content: string,
}
export interface WorkflowNodeParam {
input_parameters?: WorkflowParameter[],
terminate_plan?: WorkflowTerminatePlan,
output_parameters?: WorkflowParameter[],
}
export interface WorkflowNodeInfo {
node_id: string,
node_type: product_common.WorkflowNodeType,
node_param?: WorkflowNodeParam,
/** Node icon */
node_icon_url: string,
/** Presentation name (unique to the store, the name used for the details page GUI display message node) */
show_name?: string,
}
export interface WorkflowEntity {
/** Product ID */
product_id: string,
name: string,
entity_id: string,
entity_type: product_common.ProductEntityType,
entity_version: string,
icon_url: string,
entity_name: string,
readme: string,
category: ProductCategory,
/** Recommended categories, */
recommended_category?: ProductCategory,
nodes?: WorkflowNodeInfo[],
desc: string,
/** Imported parameters Picture icon */
case_input_icon_url?: string,
/** Exported parameters Image icon */
case_output_icon_url?: string,
latest_publish_commit_id?: string,
}
export interface WorkflowGUIConfig {
/** Used to convert the input/output/intermediate message node of a workflow into a user visual configuration */
start_node: WorkflowNodeInfo,
end_node: WorkflowNodeInfo,
/** The message node will output the intermediate process, which also needs to be displayed. */
message_nodes?: WorkflowNodeInfo[],
}
export interface WorkflowExtraInfo {
related_workflows: WorkflowEntity[],
duplicate_count?: number,
/** Workflow canvas information */
workflow_schema?: string,
/**
* api/workflowV2/query schema_json
* recommended classification
*/
recommended_category?: ProductCategory,
nodes?: WorkflowNodeInfo[],
start_node?: WorkflowNodeInfo,
/** Entity name (for presentation) */
entity_name?: string,
/** Use case diagrams imported parameters */
case_input_icon_url?: string,
/** Use case diagram exported parameters */
case_output_icon_url?: string,
/** case execution ID */
case_execute_id?: string,
hover_text?: string,
latest_publish_commit_id?: string,
/** Practice running times, take from the number of warehouses */
used_count?: number,
/** Used to convert the input/output/intermediate message node of a workflow into a user visual configuration */
gui_config?: WorkflowGUIConfig,
}
export interface SocialScenePlayerInfo {
id: string,
name: string,
role_type: product_common.SocialSceneRoleType,
}
export interface SocialSceneExtraInfo {
/** role */
players?: SocialScenePlayerInfo[],
/** Number of people used */
used_count: string,
/** number of times started */
started_count: string,
/** publish_mode */
publish_mode: product_common.ProductPublishMode,
}
export interface ProjectConfig {
/** number of plugins */
plugin_count: number,
/** number of workflows */
workflow_count: number,
/** Number of knowledge bases */
knowledge_count: number,
/** Number of databases */
database_count: number,
}
export interface ProjectExtraInfo {
/** Generate a copy of the template before Project is put on the shelves. To use or copy the template, you need to use TemplateProjectID and TemplateProjectVersion */
template_project_id: string,
template_project_version: string,
/** Project-bound UI supported preview types */
preview_types: product_common.UIPreviewType[],
/** user count */
user_count: number,
/** number of runs */
execute_count: number,
/** publish platforms */
publish_platforms: BotPublishPlatform[],
/** Near real-time copy volume, obtained from the data warehouse interface (copy-report event tracking-data warehouse calculation drop library) */
duplicate_count: number,
/** configuration */
config?: ProjectConfig,
}
export interface GetProductDetailRequest {
product_id?: string,
entity_type?: product_common.ProductEntityType,
entity_id?: string,
/** Whether to check the latest audit failure draft */
need_audit_failed?: boolean,
"Tt-Agw-Client-Ip"?: string,
}
export interface GetProductDetailResponse {
code: number,
message: string,
data: GetProductDetailData,
}
export interface Price {
value: number,
currency: string,
display_price: string,
}
export interface SKUInfo {
id: string,
/** to be abandoned */
price: Price[],
description: string,
price_v2: marketplace_common.Price[],
charge_sku_info?: product_common.ChargeSKUExtra,
}
export interface SellAttrValue {
id: string,
value: string,
}
export interface SellAttr {
display_name: string,
key: string,
values: SellAttrValue[],
}
export interface SellInfo {
skus: {
[key: string | number]: SKUInfo
},
attr: SellAttr[],
/** Key is attrkey: attrvalue path, value is skuID */
sku_attr_ref: {
[key: string | number]: string
},
}
export interface Topic {
id: string,
name: string,
description: string,
banner_url: string,
/** Small background image, front-end priority loading */
banner_url_small: string,
reason: string,
/** The presentation document provided by the operation is visible to users */
introduction_url: string,
/** Does the user collect the topic? */
is_favorite: boolean,
}
export interface ProductDataIndicator {
/**
* Data analytics metrics, source number, such as template purchases, replicas, etc
* purchase volume
*/
purchase_count?: number
}
export interface GetProductDetailData {
/** Products removed from the shelves only return non-optional fields */
meta_info: ProductMetaInfo,
/** To distinguish between host and guest states */
is_owner: boolean,
/** Audit status, return in the main state, you need to pay attention. If the main state is under review, you need to show the status under review. */
audit_status: product_common.ProductDraftStatus,
sell_info?: SellInfo,
space_id?: string,
/** Details page Back */
topic?: Topic,
/** Details page Back */
can_duplicate?: boolean,
commercial_setting?: product_common.CommercialSetting,
plugin_extra?: PluginExtraInfo,
bot_extra?: BotExtraInfo,
workflow_extra?: WorkflowExtraInfo,
social_scene_extra?: SocialSceneExtraInfo,
project_extra?: ProjectExtraInfo,
data_indicator?: ProductDataIndicator,
}
export interface GetUserFavoriteListV2Request {
/** The first page is not passed, and the last returned cursor_id is passed when subsequent calls are made */
cursor_id?: string,
page_size: number,
entity_type?: product_common.ProductEntityType,
sort_type: product_common.SortType,
/** Search keyword,optional */
keyword?: string,
/** List page tab */
source?: product_common.FavoriteListSource,
/** Whether you need to query the user's trigger configuration for the Bot, when true, it will return EntityUserTriggerConfig */
need_user_trigger_config?: boolean,
/** Filter collection time */
begin_at?: string,
/** Filter collection time */
end_at?: string,
entity_types?: product_common.ProductEntityType[],
/** Organization ID, Enterprise Edition needs to be passed when you want to get all the content in the user's collection */
organization_id?: string,
}
export interface GetUserFavoriteListV2Response {
code: number,
message: string,
data?: GetUserFavoriteListDataV2,
}
export interface GetUserFavoriteListDataV2 {
favorite_entities: product_common.FavoriteEntity[],
cursor_id: string,
has_more: boolean,
/**
* User timed task configuration, corresponding to flow.bot TriggerEnabled of the task service
* key: entity_id; value: UserTriggerConfig
*/
entity_user_trigger_config: {
[key: string | number]: UserTriggerConfig
},
}
export interface UserTriggerConfig {
trigger_enabled: TriggerEnable
}
export enum TriggerEnable {
Init = 0,
Open = 1,
Close = 2,
}
export interface DuplicateProductRequest {
product_id: string,
entity_type: product_common.ProductEntityType,
space_id?: string,
name?: string,
Cookie?: string,
}
export interface DuplicateProductResponse {
code: number,
message: string,
data: DuplicateProductData,
}
export interface DuplicateProductData {
/** New ID after copy */
new_entity_id: string,
/** Plugin ID for workflow */
new_plugin_id?: string,
}

View File

@@ -16,186 +16,165 @@
import { createAPI } from './../../api/config';
export interface AppUserInfo {
user_unique_name: string;
user_unique_name: string
}
export interface User {
/** 与原接口字段名对齐 */
user_id_str: string;
name: string;
user_unique_name: string;
email: string;
description: string;
avatar_url: string;
screen_name?: string;
app_user_info?: AppUserInfo;
locale?: string;
/** Align with the original interface field name */
user_id_str: string,
name: string,
user_unique_name: string,
email: string,
description: string,
avatar_url: string,
screen_name?: string,
app_user_info?: AppUserInfo,
locale?: string,
/** unix timestamp in seconds */
user_create_time: number;
user_create_time: number,
}
export interface PassportWebEmailRegisterV2PostRequest {
password: string;
email: string;
password: string,
email: string,
}
export interface PassportWebEmailRegisterV2PostResponse {
data: User;
code: number;
msg: string;
data: User,
code: number,
msg: string,
}
export interface PassportWebLogoutGetRequest {}
export interface PassportWebLogoutGetResponse {
redirect_url: string;
code: number;
msg: string;
redirect_url: string,
code: number,
msg: string,
}
export interface PassportWebEmailLoginPostRequest {
email: string;
password: string;
email: string,
password: string,
}
export interface PassportWebEmailLoginPostResponse {
data: User;
code: number;
msg: string;
data: User,
code: number,
msg: string,
}
export interface PassportWebEmailPasswordResetGetRequest {
password: string;
code: string;
email: string;
password: string,
code: string,
email: string,
}
export interface PassportWebEmailPasswordResetGetResponse {
code: number;
msg: string;
code: number,
msg: string,
}
export interface PassportAccountInfoV2Request {}
export interface PassportAccountInfoV2Response {
data: User;
code: number;
msg: string;
data: User,
code: number,
msg: string,
}
export interface UserUpdateAvatarRequest {
avatar: Blob;
avatar: Blob
}
export interface UserUpdateAvatarResponseData {
web_uri: string;
web_uri: string
}
export interface UserUpdateAvatarResponse {
data: UserUpdateAvatarResponseData;
code: number;
msg: string;
data: UserUpdateAvatarResponseData,
code: number,
msg: string,
}
export interface UserUpdateProfileRequest {
name?: string;
user_unique_name?: string;
description?: string;
locale?: string;
name?: string,
user_unique_name?: string,
description?: string,
locale?: string,
}
export interface UserUpdateProfileResponse {
code: number;
msg: string;
code: number,
msg: string,
}
/** 邮箱密码注册 */
export const PassportWebEmailRegisterV2Post = /*#__PURE__*/ createAPI<
PassportWebEmailRegisterV2PostRequest,
PassportWebEmailRegisterV2PostResponse
>({
url: '/api/passport/web/email/register/v2/',
method: 'POST',
name: 'PassportWebEmailRegisterV2Post',
reqType: 'PassportWebEmailRegisterV2PostRequest',
reqMapping: {
body: ['password', 'email'],
/** Email password registration */
export const PassportWebEmailRegisterV2Post = /*#__PURE__*/createAPI<PassportWebEmailRegisterV2PostRequest, PassportWebEmailRegisterV2PostResponse>({
"url": "/api/passport/web/email/register/v2/",
"method": "POST",
"name": "PassportWebEmailRegisterV2Post",
"reqType": "PassportWebEmailRegisterV2PostRequest",
"reqMapping": {
"body": ["password", "email"]
},
resType: 'PassportWebEmailRegisterV2PostResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
"resType": "PassportWebEmailRegisterV2PostResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
});
/** 退出登录 */
export const PassportWebLogoutGet = /*#__PURE__*/ createAPI<
PassportWebLogoutGetRequest,
PassportWebLogoutGetResponse
>({
url: '/api/passport/web/logout/',
method: 'GET',
name: 'PassportWebLogoutGet',
reqType: 'PassportWebLogoutGetRequest',
reqMapping: {},
resType: 'PassportWebLogoutGetResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
/** log out */
export const PassportWebLogoutGet = /*#__PURE__*/createAPI<PassportWebLogoutGetRequest, PassportWebLogoutGetResponse>({
"url": "/api/passport/web/logout/",
"method": "GET",
"name": "PassportWebLogoutGet",
"reqType": "PassportWebLogoutGetRequest",
"reqMapping": {},
"resType": "PassportWebLogoutGetResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
});
/** 邮箱帐密登录 */
export const PassportWebEmailLoginPost = /*#__PURE__*/ createAPI<
PassportWebEmailLoginPostRequest,
PassportWebEmailLoginPostResponse
>({
url: '/api/passport/web/email/login/',
method: 'POST',
name: 'PassportWebEmailLoginPost',
reqType: 'PassportWebEmailLoginPostRequest',
reqMapping: {
body: ['email', 'password'],
/** Email account password login */
export const PassportWebEmailLoginPost = /*#__PURE__*/createAPI<PassportWebEmailLoginPostRequest, PassportWebEmailLoginPostResponse>({
"url": "/api/passport/web/email/login/",
"method": "POST",
"name": "PassportWebEmailLoginPost",
"reqType": "PassportWebEmailLoginPostRequest",
"reqMapping": {
"body": ["email", "password"]
},
resType: 'PassportWebEmailLoginPostResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
"resType": "PassportWebEmailLoginPostResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
});
/** 通过邮箱重置密码 */
export const PassportWebEmailPasswordResetGet = /*#__PURE__*/ createAPI<
PassportWebEmailPasswordResetGetRequest,
PassportWebEmailPasswordResetGetResponse
>({
url: '/api/passport/web/email/password/reset/',
method: 'GET',
name: 'PassportWebEmailPasswordResetGet',
reqType: 'PassportWebEmailPasswordResetGetRequest',
reqMapping: {
query: ['password', 'code', 'email'],
/** Reset password via email */
export const PassportWebEmailPasswordResetGet = /*#__PURE__*/createAPI<PassportWebEmailPasswordResetGetRequest, PassportWebEmailPasswordResetGetResponse>({
"url": "/api/passport/web/email/password/reset/",
"method": "GET",
"name": "PassportWebEmailPasswordResetGet",
"reqType": "PassportWebEmailPasswordResetGetRequest",
"reqMapping": {
"query": ["password", "code", "email"]
},
resType: 'PassportWebEmailPasswordResetGetResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
"resType": "PassportWebEmailPasswordResetGetResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
});
/** 账号信息 */
export const PassportAccountInfoV2 = /*#__PURE__*/ createAPI<
PassportAccountInfoV2Request,
PassportAccountInfoV2Response
>({
url: '/api/passport/account/info/v2/',
method: 'POST',
name: 'PassportAccountInfoV2',
reqType: 'PassportAccountInfoV2Request',
reqMapping: {},
resType: 'PassportAccountInfoV2Response',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
/** account information */
export const PassportAccountInfoV2 = /*#__PURE__*/createAPI<PassportAccountInfoV2Request, PassportAccountInfoV2Response>({
"url": "/api/passport/account/info/v2/",
"method": "POST",
"name": "PassportAccountInfoV2",
"reqType": "PassportAccountInfoV2Request",
"reqMapping": {},
"resType": "PassportAccountInfoV2Response",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
});
export const UserUpdateAvatar = /*#__PURE__*/ createAPI<
UserUpdateAvatarRequest,
UserUpdateAvatarResponse
>({
url: '/api/web/user/update/upload_avatar/',
method: 'POST',
name: 'UserUpdateAvatar',
reqType: 'UserUpdateAvatarRequest',
reqMapping: {
body: ['avatar'],
export const UserUpdateAvatar = /*#__PURE__*/createAPI<UserUpdateAvatarRequest, UserUpdateAvatarResponse>({
"url": "/api/web/user/update/upload_avatar/",
"method": "POST",
"name": "UserUpdateAvatar",
"reqType": "UserUpdateAvatarRequest",
"reqMapping": {
"body": ["avatar"]
},
resType: 'UserUpdateAvatarResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
serializer: 'form',
"resType": "UserUpdateAvatarResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport",
"serializer": "form"
});
export const UserUpdateProfile = /*#__PURE__*/ createAPI<
UserUpdateProfileRequest,
UserUpdateProfileResponse
>({
url: '/api/user/update_profile',
method: 'POST',
name: 'UserUpdateProfile',
reqType: 'UserUpdateProfileRequest',
reqMapping: {
body: ['name', 'user_unique_name', 'description', 'locale'],
export const UserUpdateProfile = /*#__PURE__*/createAPI<UserUpdateProfileRequest, UserUpdateProfileResponse>({
"url": "/api/user/update_profile",
"method": "POST",
"name": "UserUpdateProfile",
"reqType": "UserUpdateProfileRequest",
"reqMapping": {
"body": ["name", "user_unique_name", "description", "locale"]
},
resType: 'UserUpdateProfileResponse',
schemaRoot: 'api://schemas/idl_passport_passport',
service: 'passport',
});
"resType": "UserUpdateProfileResponse",
"schemaRoot": "api://schemas/idl_passport_passport",
"service": "passport"
});

View File

@@ -15,4 +15,4 @@
*/
export * as passport from './idl/passport/passport';
export * as explore from './idl/flow/marketplace/flow_marketplace_product/public_api';
export * as explore from './idl/marketplace/public_api';

View File

@@ -15,7 +15,7 @@
*/
/* eslint-disable */
/* prettier-ignore */
// Automatically generated based on src/index.ts, do not modify manually
// Automatically generated based on src/index.ts, do not modify manually
declare const APP_ID: number;
declare const APP_KEY: string;
declare const AWEME_ORIGIN: string;
@@ -24,15 +24,7 @@ declare const AWEME_PLATFORM_ID: number;
declare const BOT_BRAND_NAME: string;
declare const BUILD_BRANCH: string;
declare const BUILD_TYPE: 'local' | 'online' | 'offline' | 'test';
declare const BYTE_UPLOADER_REGION:
| 'cn-north-1'
| 'us-east-1'
| 'ap-singapore-1'
| 'us-east-red'
| 'boe'
| 'boei18n'
| 'US-TTP'
| 'gcp';
declare const BYTE_UPLOADER_REGION: 'cn-north-1' | 'us-east-1' | 'ap-singapore-1' | 'us-east-red' | 'boe' | 'boei18n' | 'US-TTP' | 'gcp';
declare const CARD_BUILDER_ENV_STR: string;
declare const CDN: string | undefined;
declare const CDN_PATH_PREFIX: string;
@@ -116,3 +108,4 @@ declare const VOLCANO_PLATFORM_APP_KEY: string | null;
declare const VOLCANO_PLATFORM_ID: number | null;
declare const VOLC_PRIVATE_POLICY: string;
declare const VOLC_TERMS_OF_SERVICE: string;