feat: manually mirror opencoze's code from bytedance

Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
fanlv
2025-07-20 17:36:12 +08:00
commit 890153324f
14811 changed files with 1923430 additions and 0 deletions

View File

@@ -0,0 +1 @@
!bam.log.json

View File

@@ -0,0 +1,227 @@
# @coze-arch/bot-api
> RPC wrapper for bot studio application
## Project Overview
This package provides a comprehensive API client library for the Coze Bot Studio platform. It offers TypeScript-first RPC wrappers for all bot studio services, including developer APIs, playground functionality, knowledge management, workflow orchestration, and more. The package centralizes API interactions and provides type-safe interfaces for seamless integration across the platform.
## Features
- **Comprehensive API Coverage**: Complete wrapper for all bot studio services including:
- Developer APIs for bot management and development
- Playground APIs for testing and experimentation
- Knowledge management and memory systems
- Workflow and connector APIs
- Plugin development and marketplace interactions
- Authentication and permission management
- Payment and trading functionality
- Multimedia and resource management
- **TypeScript-First**: Full type safety with auto-generated IDL definitions
- **Modular Architecture**: Import only the APIs you need with tree-shaking support
- **Error Handling**: Built-in error handling with customizable toast notifications
- **Request Interceptors**: Global request/response interceptors for logging and monitoring
- **Axios Integration**: Built on top of axios with custom configuration support
## Get Started
### Installation
Add this package to your `package.json` dependencies and set it to `workspace:*` version:
```json
{
"dependencies": {
"@coze-arch/bot-api": "workspace:*"
}
}
```
Then run:
```bash
rush update
```
### Basic Usage
#### Import Main API Services
```typescript
import {
DeveloperApi,
PlaygroundApi,
KnowledgeApi,
workflowApi
} from '@coze-arch/bot-api';
// Use developer API
const bots = await DeveloperApi.getBotList({
page: 1,
page_size: 20
});
// Use playground API
const result = await PlaygroundApi.chat({
bot_id: 'bot_123',
message: 'Hello world'
});
```
#### Import Specific API Modules
```typescript
// Import specific IDL definitions
import { BotInfo } from '@coze-arch/bot-api/developer_api';
import { ChatMessage } from '@coze-arch/bot-api/playground_api';
import { KnowledgeBase } from '@coze-arch/bot-api/knowledge';
// Import specific service implementations
import DeveloperApiService from '@coze-arch/bot-api/developer_api';
import PlaygroundApiService from '@coze-arch/bot-api/playground_api';
```
#### Error Handling
```typescript
import {
APIErrorEvent,
handleAPIErrorEvent,
addGlobalRequestInterceptor
} from '@coze-arch/bot-api';
// Add global error handler
handleAPIErrorEvent((error) => {
console.error('API Error:', error);
});
// Add request interceptor for authentication
addGlobalRequestInterceptor((config) => {
config.headers.Authorization = `Bearer ${getAuthToken()}`;
return config;
});
```
#### Custom Request Configuration
```typescript
import type { BotAPIRequestConfig } from '@coze-arch/bot-api';
// Disable error toast for specific request
const result = await DeveloperApi.getBotInfo(
{ bot_id: 'bot_123' },
{ __disableErrorToast: true } as BotAPIRequestConfig
);
```
## API Reference
### Core Services
#### Developer API (`DeveloperApi`)
- Bot management and configuration
- Agent development and deployment
- Plugin management and publishing
#### Playground API (`PlaygroundApi`)
- Bot testing and conversation simulation
- Chat message handling
- Debug and monitoring capabilities
#### Knowledge API (`KnowledgeApi`)
- Knowledge base management
- Document upload and processing
- Semantic search and retrieval
#### Workflow API (`workflowApi`)
- Workflow definition and execution
- Task orchestration and scheduling
- Integration with external services
### Specialized Services
#### Memory & Context
- `MemoryApi` - Conversation memory management
- `xMemoryApi` - Extended memory functionality
- `webContext` - Web-based context handling
#### Marketplace & Plugins
- `PluginDevelopApi` - Plugin development tools
- `connectorApi` - Third-party integrations
- `marketInteractionApi` - Marketplace interactions
#### Authentication & Permissions
- `permissionAuthzApi` - Authorization management
- `permissionOAuth2Api` - OAuth2 integration
- `patPermissionApi` - Personal access tokens
#### Commerce & Trading
- `tradeApi` - Payment and billing
- `benefitApi` - User benefits and rewards
- `incentiveApi` - Incentive programs
### Configuration Types
```typescript
interface BotAPIRequestConfig extends AxiosRequestConfig {
__disableErrorToast?: boolean; // Disable automatic error toasts
}
```
## Available Exports
The package provides both high-level service instances and low-level IDL access:
### Service Instances
```typescript
DeveloperApi, PlaygroundApi, ProductApi, NotifyApi,
MemoryApi, KnowledgeApi, cardApi, appBuilderApi,
workflowApi, debuggerApi, tradeApi, benefitApi,
incentiveApi, fulfillApi, hubApi, SocialApi
```
### IDL Types & Services
```typescript
// Access via subpath imports
'@coze-arch/bot-api/developer_api'
'@coze-arch/bot-api/playground_api'
'@coze-arch/bot-api/knowledge'
'@coze-arch/bot-api/workflow_api'
// ... and many more
```
## Development
### Available Scripts
- `npm run build` - Build the package (no-op, source-only package)
- `npm run lint` - Run ESLint
- `npm run test` - Run tests with Vitest
- `npm run test:cov` - Run tests with coverage
### Project Structure
```
src/
├── idl/ # Auto-generated IDL definitions
│ ├── developer_api.ts # Developer service types
│ ├── playground_api.ts # Playground service types
│ └── ... # Other service definitions
├── developer-api.ts # Developer API service implementation
├── playground-api.ts # Playground API service implementation
├── axios.ts # Custom axios configuration
└── index.ts # Main exports
```
## Dependencies
This package depends on:
- `@coze-arch/bot-http` - HTTP client utilities and interceptors
- `@coze-arch/bot-semi` - UI components for error handling
- `@coze-arch/idl` - Interface definition language utilities
- `axios` - HTTP client library
- `query-string` - URL query string utilities
## License
Apache-2.0

View File

@@ -0,0 +1,193 @@
/*
* 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 { vi, describe, it, expect, beforeAll, beforeEach } from 'vitest';
import { Toast } from '@coze-arch/bot-semi';
import { axiosInstance, isApiError, ApiError } from '@coze-arch/bot-http';
// 导入 axios 配置以触发 Toast 配置
import '../src/axios';
vi.mock('@coze-arch/bot-semi', () => ({
Toast: {
config: vi.fn(),
error: vi.fn(),
},
}));
// 模拟 isApiError 函数
vi.mock('@coze-arch/bot-http', () => {
// 保存原始的 axiosInstance.interceptors.response.use 方法
const originalUse = vi.fn();
return {
axiosInstance: {
interceptors: {
response: {
use: originalUse,
},
},
},
isApiError: vi.fn(),
ApiError: vi.fn().mockImplementation(function (
this: any,
code: string,
msg: string,
) {
this.code = code;
this.msg = msg;
this.config = {};
this.name = 'ApiError';
}),
};
});
describe('axios configuration', () => {
let onFulfilled: Function;
let onRejected: Function;
beforeAll(async () => {
// 导入 axios 配置以触发 Toast 配置和拦截器注册
await import('../src/axios');
// 验证 Toast.config 被调用
expect(Toast.config).toHaveBeenCalledWith({ top: 80 });
// 获取注册的拦截器函数
const useArgs = (axiosInstance.interceptors.response.use as any).mock
.calls[0];
onFulfilled = useArgs[0];
onRejected = useArgs[1];
});
beforeEach(() => {
vi.clearAllMocks();
});
describe('response interceptor', () => {
it('should return response data directly on success', () => {
const mockData = { foo: 'bar' };
const mockResponse = { data: mockData };
const result = onFulfilled(mockResponse);
expect(result).toEqual(mockData);
});
it('should show error toast when API error occurs', () => {
// 创建一个 API 错误
const apiError = new (ApiError as any)('500', 'API Error');
// 模拟 isApiError 返回 true
(isApiError as any).mockReturnValue(true);
try {
onRejected(apiError);
// 如果没有抛出错误,测试应该失败
expect(true).toBe(false);
} catch (error) {
expect(isApiError).toHaveBeenCalledWith(apiError);
expect(Toast.error).toHaveBeenCalledWith({
content: apiError.msg,
showClose: false,
});
expect(error).toBe(apiError);
}
});
it('should not show error toast when __disableErrorToast is true', () => {
// 创建一个 API 错误,并设置 __disableErrorToast 为 true
const apiError = new (ApiError as any)('401', 'Unauthorized');
apiError.config.__disableErrorToast = true;
// 模拟 isApiError 返回 true
(isApiError as any).mockReturnValue(true);
try {
onRejected(apiError);
// 如果没有抛出错误,测试应该失败
expect(true).toBe(false);
} catch (error) {
expect(isApiError).toHaveBeenCalledWith(apiError);
expect(Toast.error).not.toHaveBeenCalled();
expect(error).toBe(apiError);
}
});
it('should not show error toast when error has no message', () => {
// 创建一个没有消息的 API 错误
const apiError = new (ApiError as any)('403', undefined);
// 模拟 isApiError 返回 true
(isApiError as any).mockReturnValue(true);
try {
onRejected(apiError);
// 如果没有抛出错误,测试应该失败
expect(true).toBe(false);
} catch (error) {
expect(isApiError).toHaveBeenCalledWith(apiError);
expect(Toast.error).not.toHaveBeenCalled();
expect(error).toBe(apiError);
}
});
it('should not show error toast when isApiError returns false', () => {
// 创建一个普通错误
const regularError = new Error('Regular Error');
(regularError as any).msg = 'Error message';
// 模拟 isApiError 返回 false
(isApiError as any).mockReturnValue(false);
try {
onRejected(regularError);
// 如果没有抛出错误,测试应该失败
expect(true).toBe(false);
} catch (error) {
expect(isApiError).toHaveBeenCalledWith(regularError);
expect(Toast.error).not.toHaveBeenCalled();
expect(error).toBe(regularError);
}
});
it('should handle null or undefined error', () => {
// 测试 null 错误
try {
onRejected(null);
// 如果没有抛出错误,测试应该失败
expect(true).toBe(false);
} catch (error) {
expect(isApiError).toHaveBeenCalledWith(null);
expect(Toast.error).not.toHaveBeenCalled();
expect(error).toBe(null);
}
vi.clearAllMocks();
// 测试 undefined 错误
try {
onRejected(undefined);
// 如果没有抛出错误,测试应该失败
expect(true).toBe(false);
} catch (error) {
expect(isApiError).toHaveBeenCalledWith(undefined);
expect(Toast.error).not.toHaveBeenCalled();
expect(error).toBe(undefined);
}
});
});
});

View File

@@ -0,0 +1,111 @@
/*
* 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 { vi } from 'vitest';
import { basicApi } from '../src/basic-api';
import { axiosInstance } from '../src/axios';
vi.mock('@coze-arch/idl/basic_api', () => ({
default: vi.fn().mockImplementation(r => r),
}));
vi.mock('../src/axios', () => ({
axiosInstance: {
request: vi.fn(),
},
}));
describe('basic-api', () => {
beforeEach(() => {
vi.clearAllMocks();
});
it('should be properly instantiated', () => {
expect(basicApi).toBeDefined();
});
describe('API methods', () => {
it('should make request with correct headers', async () => {
const mockResponse = { data: 'test data' };
(axiosInstance.request as any).mockResolvedValue(mockResponse);
const mockParams = {
url: '/test',
method: 'GET',
headers: { 'Custom-Header': 'value' },
};
const mockConfig = {
headers: { 'Another-Header': 'another-value' },
};
// @ts-expect-error - 我们知道这是一个有效的方法调用
await basicApi.request(mockParams, mockConfig);
expect(axiosInstance.request).toHaveBeenCalledWith({
...mockParams,
...mockConfig,
headers: {
'Custom-Header': 'value',
'Another-Header': 'another-value',
'Agw-Js-Conv': 'str',
},
});
});
it('should make request with default empty config', async () => {
const mockResponse = { data: 'test data' };
(axiosInstance.request as any).mockResolvedValue(mockResponse);
const mockParams = {
url: '/test',
method: 'GET',
headers: { 'Custom-Header': 'value' },
};
// @ts-expect-error - 我们知道这是一个有效的方法调用
await basicApi.request(mockParams);
expect(axiosInstance.request).toHaveBeenCalledWith({
...mockParams,
headers: {
'Custom-Header': 'value',
'Agw-Js-Conv': 'str',
},
});
});
it('should handle request without headers', async () => {
const mockResponse = { data: 'test data' };
(axiosInstance.request as any).mockResolvedValue(mockResponse);
const mockParams = {
url: '/test',
method: 'GET',
};
// @ts-expect-error - 我们知道这是一个有效的方法调用
await basicApi.request(mockParams);
expect(axiosInstance.request).toHaveBeenCalledWith({
...mockParams,
headers: {
'Agw-Js-Conv': 'str',
},
});
});
});
});

View File

@@ -0,0 +1,12 @@
{
"operationSettings": [
{
"operationName": "test:cov",
"outputFolderNames": ["coverage"]
},
{
"operationName": "ts-check",
"outputFolderNames": ["./dist"]
}
]
}

View File

@@ -0,0 +1,17 @@
const { defineConfig } = require('@coze-arch/eslint-config');
module.exports = defineConfig({
packageRoot: __dirname,
preset: 'node',
rules: {
'unicorn/filename-case': 0,
},
overrides: [
{
files: ['src/idl/*.ts'],
rules: {
'@coze-arch/no-batch-import-or-export': 0,
},
},
],
});

View File

@@ -0,0 +1,178 @@
{
"name": "@coze-arch/bot-api",
"version": "0.0.1",
"description": "RPC wrapper for bot studio application",
"author": "fanwenjie.fe@bytedance.com",
"exports": {
".": "./src/index.ts",
"./developer_api": "./src/idl/developer_api.ts",
"./connector_api": "./src/idl/connector_api.ts",
"./dp_manage_api": "./src/idl/dp_manage.ts",
"./playground_api": "./src/idl/playground_api.ts",
"./plugin_impl_api": "./src/idl/plugin_impl_api.ts",
"./memory": "./src/idl/memory.ts",
"./product_api": "./src/idl/product_api.ts",
"./permission_authz": "./src/idl/permission_authz.ts",
"./market_interaction_api": "./src/idl/market_interaction_api.ts",
"./plugin_develop": "./src/idl/plugin_develop.ts",
"./debugger_api": "./src/idl/debugger_api.ts",
"./workflow_api": "./src/idl/workflow_api.ts",
"./knowledge": "./src/idl/knowledge.ts",
"./card": "./src/idl/card.ts",
"./trade": "./src/idl/trade.ts",
"./benefit": "./src/idl/benefit.ts",
"./fulfill": "./src/idl/fulfill.ts",
"./filebox": "./src/idl/filebox.ts",
"./incentive": "./src/idl/incentive.ts",
"./ob_query_api": "./src/idl/ob_query_api.ts",
"./ob_data": "./src/idl/ob_data.ts",
"./devops_evaluation": "./src/idl/devops_evaluation.ts",
"./social_api": "./src/idl/social_api.ts",
"./pat_permission_api": "./src/idl/pat_permission_api.ts",
"./developer_backend": "./src/idl/developer_backend.ts",
"./permission_oauth2": "./src/idl/permission_oauth2.ts",
"./basic_api": "./src/idl/basic_api.ts",
"./multimedia_api": "./src/idl/multimedia_api.ts",
"./evaluation_lite_api": "./src/idl/evaluation_lite_api.ts",
"./resource": "./src/idl/resource.ts",
"./app_builder": "./src/idl/app_builder.ts",
"./ui-builder": "./src/idl/ui-builder",
"./intelligence_api": "./src/idl/intelligence_api.ts",
"./hub_api": "./src/idl/hub_api.ts"
},
"main": "./src/index.ts",
"typesVersions": {
"*": {
"developer_api": [
"./src/idl/developer_api.ts"
],
"connector_api": [
"./src/idl/connector_api.ts"
],
"dp_manage_api": [
"./src/idl/dp_manage.ts"
],
"playground_api": [
"./src/idl/playground_api.ts"
],
"intelligence_api": [
"./src/idl/intelligence_api.ts"
],
"plugin_impl_api": [
"./src/idl/plugin_impl_api.ts"
],
"product_api": [
"./src/idl/product_api.ts"
],
"memory": [
"./src/idl/memory.ts"
],
"knowledge": [
"./src/idl/knowledge.ts"
],
"permission_authz": [
"./src/idl/permission_authz.ts"
],
"card": [
"./src/idl/card.ts"
],
"market_interaction_api": [
"./src/idl/market_interaction_api.ts"
],
"plugin_develop": [
"./src/idl/plugin_develop.ts"
],
"debugger_api": [
"./src/idl/debugger_api.ts"
],
"ob_query_api": [
"./src/idl/ob_query_api.ts"
],
"trade": [
"./src/idl/trade.ts"
],
"benefit": [
"./src/idl/benefit.ts"
],
"filebox": [
"./src/idl/filebox.ts"
],
"fulfill": [
"./src/idl/fulfill.ts"
],
"incentive": [
"./src/idl/incentive.ts"
],
"devops_evaluation": [
"./src/idl/devops_evaluation.ts"
],
"workflow_api": [
"./src/idl/workflow_api.ts"
],
"social_api": [
"./src/idl/social_api.ts"
],
"ob_data": [
"./src/idl/ob_data.ts"
],
"pat_permission_api": [
"./src/idl/pat_permission_api.ts"
],
"developer_backend": [
"./src/idl/developer_backend.ts"
],
"permission_oauth2": [
"./src/idl/permission_oauth2.ts"
],
"basic_api": [
"./src/idl/basic_api.ts"
],
"evaluation_lite_api": [
"./src/idl/evaluation_lite_api.ts"
],
"resource": [
"./src/idl/resource.ts"
],
"app_builder": [
"./src/idl/app_builder.ts"
],
"ui-builder": [
"./src/idl/ui-builder.ts"
],
"hub_api": [
"./src/idl/hub_api.ts"
],
"multimedia_api": [
"./src/idl/multimedia_api.ts"
]
}
},
"scripts": {
"build": "exit 0",
"lint": "eslint ./ --cache",
"test": "vitest --run --passWithNoTests",
"test:cov": "npm run test -- --coverage"
},
"dependencies": {
"@coze-arch/bot-http": "workspace:*",
"@coze-arch/bot-semi": "workspace:*",
"@coze-arch/idl": "workspace:*",
"axios": "^1.4.0",
"query-string": "^8.1.0"
},
"devDependencies": {
"@coze-arch/eslint-config": "workspace:*",
"@coze-arch/fs-enhance": "workspace:*",
"@coze-arch/logger": "workspace:*",
"@coze-arch/ts-config": "workspace:*",
"@coze-arch/vitest-config": "workspace:*",
"@types/node": "^18",
"@vitest/coverage-v8": "~3.0.5",
"debug": "^4.3.4",
"sucrase": "^3.32.0",
"tsconfig-paths": "4.1.0",
"vitest": "~3.0.5"
},
"// deps": "debug@^4.3.4 为脚本自动补齐,请勿改动"
}

View File

@@ -0,0 +1,29 @@
/*
* 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 AppBuilderApiService from './idl/app_builder';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const appBuilderApi = new AppBuilderApiService<BotAPIRequestConfig>({
request: (params, config = {}) => {
const reqHeaders = {
...config.headers,
...params.headers,
'Agw-Js-Conv': 'str',
};
return axiosInstance.request({ ...params, ...config, headers: reqHeaders });
},
});

View File

@@ -0,0 +1,59 @@
/*
* 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 { Toast } from '@coze-arch/bot-semi';
import {
axiosInstance,
isApiError,
type AxiosRequestConfig,
} from '@coze-arch/bot-http';
// Toast展示位置离top 80px
Toast.config({
top: 80,
});
interface CustomAxiosConfig {
// eslint-disable-next-line @typescript-eslint/naming-convention
__disableErrorToast?: boolean;
}
/**
* 业务自定义 axios 配置
* @param __disableErrorToast default: false
*/
export type BotAPIRequestConfig = AxiosRequestConfig & CustomAxiosConfig;
axiosInstance.interceptors.response.use(
response => response.data,
error => {
// 业务逻辑
if (
isApiError(error) &&
error.msg &&
!(error.config as CustomAxiosConfig).__disableErrorToast
) {
Toast.error({
content: error.msg,
showClose: false,
});
}
throw error;
},
);
export { axiosInstance };

View File

@@ -0,0 +1,28 @@
/*
* 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 BasicApiService from '@coze-arch/idl/basic_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const basicApi = new BasicApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, 'Agw-Js-Conv': 'str' },
}),
});

View File

@@ -0,0 +1,27 @@
/*
* 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 BenefitApiService from './idl/benefit';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const benefitApi = new BenefitApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, ['Agw-Js-Conv']: 'str' },
}),
});

View File

@@ -0,0 +1,29 @@
/*
* 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 CardApiService from './idl/card';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const cardApi = new CardApiService<BotAPIRequestConfig>({
request: (params, config = {}) => {
const reqHeaders = {
...config.headers,
...params.headers,
'Agw-Js-Conv': 'str',
};
return axiosInstance.request({ ...params, ...config, headers: reqHeaders });
},
});

View File

@@ -0,0 +1,29 @@
/*
* 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 queryString from 'query-string';
import ConnectorApiService from './idl/connector_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const connectorApi = new ConnectorApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
paramsSerializer: p => queryString.stringify(p, { arrayFormat: 'comma' }),
...params,
...config,
}),
});

View 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.
*/
import CozeSpaceApiService from '@coze-arch/idl/stone_coze_space';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const cozeSpaceApi = new CozeSpaceApiService<BotAPIRequestConfig>({
request: (params, config = {}) => {
const reqHeaders = {
...config.headers,
...params.headers,
'Agw-Js-Conv': 'str',
};
return axiosInstance.request({ ...params, ...config, headers: reqHeaders });
},
});

View File

@@ -0,0 +1,29 @@
/*
* 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 DebuggerApiService from './idl/debugger_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const debuggerApi = new DebuggerApiService<BotAPIRequestConfig>({
request: (params, config = {}) => {
const { headers } = config;
const reqHeaders = {
...headers,
'Agw-Js-Conv': 'str',
};
return axiosInstance.request({ ...params, ...config, headers: reqHeaders });
},
});

View File

@@ -0,0 +1,24 @@
/*
* 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 DeveloperApiService from './idl/developer_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
// eslint-disable-next-line @typescript-eslint/naming-convention
export const DeveloperApi = new DeveloperApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({ ...params, ...config }),
});

View File

@@ -0,0 +1,24 @@
/*
* 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 DeveloperBackendApiService from './idl/developer_backend';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const developerBackendApi =
new DeveloperBackendApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({ ...params, ...config }),
});

View File

@@ -0,0 +1,34 @@
/*
* 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 DevopsEvaluationService from './idl/devops_evaluation';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const devopsEvaluationApi =
new DevopsEvaluationService<BotAPIRequestConfig>({
request: (params, config = {}) => {
const reqHeaders = {
...config.headers,
...params.headers,
'Agw-Js-Conv': 'str',
};
return axiosInstance.request({
...params,
...config,
headers: reqHeaders,
});
},
});

View File

@@ -0,0 +1,27 @@
/*
* 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 DpManageService from './idl/dp_manage';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const dpManageApi = new DpManageService<BotAPIRequestConfig>({
request: (params, config = {}) => {
config.headers = Object.assign(config.headers || {}, {
'Agw-Js-Conv': 'str',
});
return axiosInstance.request({ ...params, ...config });
},
});

View File

@@ -0,0 +1,29 @@
/*
* 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 EvaluationLiteService from './idl/evaluation_lite';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const evaluationLiteApi = new EvaluationLiteService<BotAPIRequestConfig>(
{
request: (params, config = {}) => {
const headers = {
'Agw-Js-Conv': 'str',
};
return axiosInstance.request({ ...params, ...config, headers });
},
},
);

View File

@@ -0,0 +1,31 @@
/*
* 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 FileboxService from './idl/filebox';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const fileboxApi = new FileboxService<BotAPIRequestConfig>({
request: (params, config = {}) => {
const { headers } = config;
const reqHeaders = {
...headers,
'Agw-Js-Conv': 'str',
};
return axiosInstance.request({ ...params, ...config, headers: reqHeaders });
},
});
export { ObjType } from './idl/filebox';

View File

@@ -0,0 +1,28 @@
/*
* 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 FornaxApiService from '@coze-arch/idl/fornax_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const fornaxApi = new FornaxApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, ['Agw-Js-Conv']: 'str' },
}),
});

View File

@@ -0,0 +1,28 @@
/*
* 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 EvaluationApiService from '@coze-arch/idl/evaluation_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const evaluationApi = new EvaluationApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, ['Agw-Js-Conv']: 'str' },
}),
});

View File

@@ -0,0 +1,28 @@
/*
* 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 FornaxMlFlowService from '@coze-arch/idl/fornax_ml_flow';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const fornaxMlFlowApi = new FornaxMlFlowService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, ['Agw-Js-Conv']: 'str' },
}),
});

View File

@@ -0,0 +1,28 @@
/*
* 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 FornaxObApiService from '@coze-arch/idl/fornax_ob_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const fornaxObApi = new FornaxObApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, ['Agw-Js-Conv']: 'str' },
}),
});

View File

@@ -0,0 +1,28 @@
/*
* 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 FornaxPromptService from '@coze-arch/idl/prompt_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const fornaxPromptApi = new FornaxPromptService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, ['Agw-Js-Conv']: 'str' },
}),
});

View File

@@ -0,0 +1,27 @@
/*
* 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 FulfillApiService from './idl/fulfill';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const fulfillApi = new FulfillApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, ['Agw-Js-Conv']: 'str' },
}),
});

View File

@@ -0,0 +1,27 @@
/*
* 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 HubApiService from './idl/hub_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const hubApi = new HubApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, 'Agw-Js-Conv': 'str' },
}),
});

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/app_builder';
export { default as default } from '@coze-arch/idl/app_builder';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/basic_api';
export { default as default } from '@coze-arch/idl/basic_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/benefit';
export { default as default } from '@coze-arch/idl/benefit';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/card';
export { default as default } from '@coze-arch/idl/card';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/connector_api';
export { default as default } from '@coze-arch/idl/connector_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/debugger_api';
export { default as default } from '@coze-arch/idl/debugger_api';

View File

@@ -0,0 +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.
*/
export * from '@coze-arch/idl/developer_api';
export { default as default } from '@coze-arch/idl/developer_api';
export { SuggestReplyMode } from '@coze-arch/idl';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/developer_backend';
export { default as default } from '@coze-arch/idl/developer_backend';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/devops_evaluation';
export { default as default } from '@coze-arch/idl/devops_evaluation';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/dp_manage';
export { default as default } from '@coze-arch/idl/dp_manage';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/evaluation_lite';
export { default as default } from '@coze-arch/idl/evaluation_lite';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/filebox';
export { default as default } from '@coze-arch/idl/filebox';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/fornax_api';
export { default as default } from '@coze-arch/idl/fornax_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/fulfill';
export { default as default } from '@coze-arch/idl/fulfill';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/hub_api';
export { default as default } from '@coze-arch/idl/hub_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/incentive';
export { default as default } from '@coze-arch/idl/incentive';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/intelligence_api';
export { default as default } from '@coze-arch/idl/intelligence_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/knowledge';
export { default as default } from '@coze-arch/idl/knowledge';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/market_interaction_api';
export { default as default } from '@coze-arch/idl/market_interaction_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/memory';
export { default as default } from '@coze-arch/idl/memory';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/multimedia_api';
export { default as default } from '@coze-arch/idl/multimedia_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/notify_api';
export { default as default } from '@coze-arch/idl/notify_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/ob_data';
export { default as default } from '@coze-arch/idl/ob_data';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/ob_query_api';
export { default as default } from '@coze-arch/idl/ob_query_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/pat_permission_api';
export { default as default } from '@coze-arch/idl/pat_permission_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/permission_authz';
export { default as default } from '@coze-arch/idl/permission_authz';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/permission_oauth2';
export { default as default } from '@coze-arch/idl/permission_oauth2';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/playground_api';
export { default as default } from '@coze-arch/idl/playground_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/plugin_develop';
export { default as default } from '@coze-arch/idl/plugin_develop';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/plugin_impl_api';
export { default as default } from '@coze-arch/idl/plugin_impl_api';

View File

@@ -0,0 +1,21 @@
/*
* 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.
*/
export * from '@coze-arch/idl/product_api';
export { default as default } from '@coze-arch/idl/product_api';
import { type public_api } from '@coze-arch/idl/product_api';
export type ProductInfo = public_api.ProductInfo;

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/resource';
export { default as default } from '@coze-arch/idl/resource';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/social_api';
export { default as default } from '@coze-arch/idl/social_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/trade';
export { default as default } from '@coze-arch/idl/trade';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/ui_builder';
export { default as default } from '@coze-arch/idl/ui_builder';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/workflow_api';
export { default as default } from '@coze-arch/idl/workflow_api';

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from '@coze-arch/idl/xmemory_api';
export { default as default } from '@coze-arch/idl/xmemory_api';

View File

@@ -0,0 +1,27 @@
/*
* 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 IncentiveService from './idl/incentive';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const incentiveApi = new IncentiveService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, ['Agw-Js-Conv']: 'str' },
}),
});

View File

@@ -0,0 +1,84 @@
/*
* 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.
*/
export { default as DeveloperApiService } from './idl/developer_api';
export { default as PlaygroundApiService } from './idl/playground_api';
export { default as KnowledgeService } from './idl/knowledge';
export { default as PluginImplApi } from './idl/plugin_impl_api';
export { DeveloperApi } from './developer-api';
export { PlaygroundApi } from './playground-api';
export { ProductApi } from './product-api';
export { NotifyApi } from './notify-api';
export { MemoryApi, SubLinkDiscoveryTaskStatus } from './memory-api';
export { devopsEvaluationApi } from './devops-evaluation-api';
export { evaluationLiteApi } from './evaluation-lite-api';
export { workflowApi } from './workflow-api';
export { fileboxApi, ObjType } from './filebox-api';
export { PluginDevelopApi } from './plugin-develop';
export { cardApi } from './card-api';
export { appBuilderApi } from './app-builder-api';
export { uiBuilderApi } from './ui-builder-api';
export { obDataApi } from './ob-data-api';
export { permissionAuthzApi } from './permission-authz-api';
export { type PaymentMethodInfo } from './idl/trade';
export { tradeApi } from './trade-api';
export { benefitApi } from './benefit-api';
export { incentiveApi } from './incentive-api';
export { dpManageApi } from './dp-manage-api';
export { marketInteractionApi } from './market-interaction-api';
export { debuggerApi } from './debugger-api';
export { connectorApi } from './connector-api';
export { type BotAPIRequestConfig } from './axios';
export { xMemoryApi } from './xmemory-api';
export { obQueryApi } from './ob-query-api';
export { fulfillApi } from './fulfill-api';
export { patPermissionApi } from './pat-permission-api';
export { KnowledgeApi } from './knowledge-api';
export { developerBackendApi } from './developer-backend';
export { hubApi } from './hub-api';
export { SocialApi } from './social-api';
export {
APIErrorEvent,
handleAPIErrorEvent,
removeAPIErrorEvent,
addGlobalRequestInterceptor,
removeGlobalRequestInterceptor,
addGlobalResponseInterceptor,
} from '@coze-arch/bot-http';
export { AgentInstanceInfo, AgentInfo } from './idl/card';
export { permissionOAuth2Api } from './permission-oauth2-api';
export { basicApi } from './basic-api';
export { Resource } from './resource';
export { intelligenceApi } from './intelligence-api';
export { MultimediaApi } from './multimedia-api';
export { fornaxMlFlowApi } from './fornax-ml-flow-api';
export { fornaxPromptApi } from './fornax-prompt';
export { StoneEvaluationApi } from './stone-fornax-evaluation';
export { fornaxObApi } from './fornax-ob-api';
export { fornaxApi } from './fornax-api';
export { evaluationApi } from './fornax-evaluation-api';
export { cozeSpaceApi } from './coze-space-api';

View File

@@ -0,0 +1,27 @@
/*
* 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 IntelligenceApiService from './idl/intelligence_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const intelligenceApi = new IntelligenceApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, 'Agw-Js-Conv': 'str' },
}),
});

View 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.
*/
import KnowledgeService from './idl/knowledge';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
// eslint-disable-next-line @typescript-eslint/naming-convention
export const KnowledgeApi = new KnowledgeService<BotAPIRequestConfig>({
request: (params, config = {}) => {
const { headers } = config;
const reqHeaders = {
...headers,
'Agw-Js-Conv': 'str',
};
return axiosInstance.request({ ...params, ...config, headers: reqHeaders });
},
});

View File

@@ -0,0 +1,28 @@
/*
* 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 MarketInteractionApiService from './idl/market_interaction_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const marketInteractionApi =
new MarketInteractionApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, 'Agw-Js-Conv': 'str' },
}),
});

View File

@@ -0,0 +1,32 @@
/*
* 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 MemoryService from './idl/memory';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
/* eslint-disable @typescript-eslint/naming-convention */
export const MemoryApi = new MemoryService<BotAPIRequestConfig>({
request: (params, config = {}) => {
const { headers } = config;
const reqHeaders = {
...headers,
'Agw-Js-Conv': 'str',
};
return axiosInstance.request({ ...params, ...config, headers: reqHeaders });
},
});
export { SubLinkDiscoveryTaskStatus } from './idl/memory';

View File

@@ -0,0 +1,29 @@
/*
* 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 MultimediaService from './idl/multimedia_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
// eslint-disable-next-line @typescript-eslint/naming-convention
export const MultimediaApi = new MultimediaService<BotAPIRequestConfig>({
request: (params, config = {}) => {
config.headers = Object.assign(config.headers || {}, {
'Agw-Js-Conv': 'str',
});
return axiosInstance.request({ ...params, ...config });
},
});

View File

@@ -0,0 +1,29 @@
/*
* 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 NotifyApiService from './idl/notify_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
// eslint-disable-next-line @typescript-eslint/naming-convention
export const NotifyApi = new NotifyApiService<BotAPIRequestConfig>({
request: (params, config = {}) => {
config.headers = Object.assign(config.headers || {}, {
'Agw-Js-Conv': 'str',
});
return axiosInstance.request({ ...params, ...config });
},
});

View File

@@ -0,0 +1,27 @@
/*
* 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 ObDataService from './idl/ob_data';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const obDataApi = new ObDataService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, ['Agw-Js-Conv']: 'str' },
}),
});

View File

@@ -0,0 +1,27 @@
/*
* 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 ObQueryApiService from './idl/ob_query_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const obQueryApi = new ObQueryApiService<BotAPIRequestConfig>({
request: (params, config = {}) => {
const headers = {
'Agw-Js-Conv': 'str',
};
return axiosInstance.request({ ...params, ...config, headers });
},
});

View File

@@ -0,0 +1,23 @@
/*
* 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 PATPermissionService from './idl/pat_permission_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const patPermissionApi = new PATPermissionService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({ ...params, ...config }),
});

View File

@@ -0,0 +1,24 @@
/*
* 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 PermissionAuthzService from './idl/permission_authz';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const permissionAuthzApi =
new PermissionAuthzService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({ ...params, ...config }),
});

View File

@@ -0,0 +1,24 @@
/*
* 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 PermissionOAuth2Service from './idl/permission_oauth2';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const permissionOAuth2Api =
new PermissionOAuth2Service<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({ ...params, ...config }),
});

View File

@@ -0,0 +1,29 @@
/*
* 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 PlaygroundApiService from './idl/playground_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
// eslint-disable-next-line @typescript-eslint/naming-convention
export const PlaygroundApi = new PlaygroundApiService<BotAPIRequestConfig>({
request: (params, config = {}) => {
config.headers = Object.assign(config.headers || {}, {
'Agw-Js-Conv': 'str',
});
return axiosInstance.request({ ...params, ...config });
},
});

View 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.
*/
import PluginDevelopApiService from './idl/plugin_develop';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
// eslint-disable-next-line @typescript-eslint/naming-convention
export const PluginDevelopApi =
new PluginDevelopApiService<BotAPIRequestConfig>({
request: (params, config = {}) => {
config.headers = Object.assign(config.headers || {}, {
'Agw-Js-Conv': 'str',
});
return axiosInstance.request({ ...params, ...config });
},
});

View File

@@ -0,0 +1,34 @@
/*
* 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 qs from 'query-string';
import ProductApiService from './idl/product_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
// eslint-disable-next-line @typescript-eslint/naming-convention
export const ProductApi = new ProductApiService<BotAPIRequestConfig>({
request: (params, config = {}) => {
config.paramsSerializer =
config.paramsSerializer ||
(p => qs.stringify(p, { arrayFormat: 'comma' }));
config.headers = Object.assign(config.headers || {}, {
'Agw-Js-Conv': 'str',
});
return axiosInstance.request({ ...params, ...config });
},
});

View File

@@ -0,0 +1,24 @@
/*
* 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 ResourceService from './idl/resource';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
// eslint-disable-next-line @typescript-eslint/naming-convention
export const Resource = new ResourceService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({ ...params, ...config }),
});

View 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.
*/
import SocialApiService from './idl/social_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
// eslint-disable-next-line @typescript-eslint/naming-convention -- what can I say
export const SocialApi = new SocialApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...{
...config,
headers: Object.assign(config.headers || {}, { 'Agw-Js-Conv': 'str' }),
},
}),
});

View File

@@ -0,0 +1,34 @@
/*
* 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 StoneFornaxEvaluationService from '@coze-arch/idl/stone_fornax_evaluation';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
// eslint-disable-next-line @typescript-eslint/naming-convention -- what can I say
export const StoneEvaluationApi =
new StoneFornaxEvaluationService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...{
...config,
headers: Object.assign(config.headers || {}, {
'Agw-Js-Conv': 'str',
}),
},
}),
});

View File

@@ -0,0 +1,27 @@
/*
* 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 TradeApiService from './idl/trade';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const tradeApi = new TradeApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({
...params,
...config,
headers: { ...params.headers, ...config.headers, ['Agw-Js-Conv']: 'str' },
}),
});

View File

@@ -0,0 +1,29 @@
/*
* 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 UiBuilderApiService from './idl/ui-builder';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const uiBuilderApi = new UiBuilderApiService<BotAPIRequestConfig>({
request: (params, config = {}) => {
const reqHeaders = {
...config.headers,
...params.headers,
'Agw-Js-Conv': 'str',
};
return axiosInstance.request({ ...params, ...config, headers: reqHeaders });
},
});

View File

@@ -0,0 +1,28 @@
/*
* 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 WorkflowApiService from './idl/workflow_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const workflowApi = new WorkflowApiService<BotAPIRequestConfig>({
request: (params, config = {}) => {
config.headers = Object.assign(config.headers || {}, {
'Agw-Js-Conv': 'str',
});
return axiosInstance.request({ ...params, ...config });
},
});

View File

@@ -0,0 +1,23 @@
/*
* 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 XmemoryApiService from './idl/xmemory_api';
import { axiosInstance, type BotAPIRequestConfig } from './axios';
export const xMemoryApi = new XmemoryApiService<BotAPIRequestConfig>({
request: (params, config = {}) =>
axiosInstance.request({ ...params, ...config }),
});

View File

@@ -0,0 +1,39 @@
{
"extends": "@coze-arch/ts-config/tsconfig.web.json",
"compilerOptions": {
"jsx": "preserve",
"useUnknownInCatchVariables": false,
"types": ["vitest/globals"],
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo"
},
"include": ["./src"],
"references": [
{
"path": "../bot-http/tsconfig.build.json"
},
{
"path": "../../components/bot-semi/tsconfig.build.json"
},
{
"path": "../../../config/eslint-config/tsconfig.build.json"
},
{
"path": "../../../config/ts-config/tsconfig.build.json"
},
{
"path": "../../../config/vitest-config/tsconfig.build.json"
},
{
"path": "../idl/tsconfig.build.json"
},
{
"path": "../../../infra/utils/fs-enhance/tsconfig.build.json"
},
{
"path": "../logger/tsconfig.build.json"
}
],
"$schema": "https://json.schemastore.org/tsconfig"
}

View File

@@ -0,0 +1,15 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"composite": true
},
"references": [
{
"path": "./tsconfig.build.json"
},
{
"path": "./tsconfig.misc.json"
}
],
"exclude": ["**/*"]
}

View File

@@ -0,0 +1,18 @@
{
"extends": "@coze-arch/ts-config/tsconfig.web.json",
"$schema": "https://json.schemastore.org/tsconfig",
"include": ["__tests__", "vitest.config.mts"],
"exclude": ["./dist"],
"references": [
{
"path": "./tsconfig.build.json"
}
],
"compilerOptions": {
"jsx": "preserve",
"rootDir": "./",
"outDir": "./dist",
"useUnknownInCatchVariables": false,
"types": ["vitest/globals"]
}
}

View File

@@ -0,0 +1,14 @@
import { defaultExclude } from 'vitest/config';
import { defineConfig } from '@coze-arch/vitest-config';
export default defineConfig({
dirname: __dirname,
preset: 'web',
test: {
exclude: [...defaultExclude, 'src/auto-generate'],
coverage: {
all: false,
include: ['src/axios.ts'],
},
},
});