chore: format all frontend files (#430)

This commit is contained in:
tecvan
2025-07-31 23:15:48 +08:00
committed by GitHub
parent 8b078ff013
commit 6995cec404
8787 changed files with 11975 additions and 10924 deletions

View File

@@ -13,6 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-function
export const createMinimalBrowserClient = () => {};

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { vi } from 'vitest';
import { fetchStream, FetchStreamErrorCode } from '@coze-arch/fetch-stream';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
CustomEventEmitter,
RetryCounter,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReportLog } from '@/report-log';
import { type ChatCoreError } from '@/custom-error';
import {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import ChatSDK from '@/chat-sdk';
describe('ChatSDK', () => {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { vi } from 'vitest';
import { PreSendLocalMessageEventsEnum } from '@/message/types';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManagerService } from '@/chat-sdk/services/message-manager-service';
describe('MessageManagerService', () => {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { UploadPluginConstructor } from '@/plugins/upload-plugin/types/plugin-upload';
import { PluginsService } from '@/chat-sdk/services/plugins-service';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReportLog } from '@/report-log';
import {
ContentType,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Mock from 'mockjs';
import { ContentType, type ChunkRaw, type Message } from '../src/message/types';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ChunkProcessor, StreamBufferHelper } from '@/message/chunk-processor';
describe('StreamBufferHelper', () => {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager } from '@/message/message-manager';
describe('MessageManager', () => {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ApiError, isApiError } from '@/request-manager/api-error';
describe('ApiError', () => {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { vi } from 'vitest';
import { RequestScene } from '@/request-manager/types';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { RequestScene } from '@/request-manager/types';
import { getDefaultSceneConfig } from '@/request-manager/request-config';
import { ApiError } from '@/request-manager/api-error';

View File

@@ -37,13 +37,13 @@
"test:cov": "npm run test -- --coverage"
},
"dependencies": {
"@coze-arch/bot-flags": "workspace:*",
"@coze-arch/fetch-stream": "workspace:*",
"@coze-arch/logger": "workspace:*",
"@coze-common/chat-area-utils": "workspace:*",
"@coze-studio/file-kit": "workspace:*",
"@coze-studio/slardar-adapter": "workspace:*",
"@coze-studio/uploader-adapter": "workspace:*",
"@coze-arch/bot-flags": "workspace:*",
"@coze-arch/fetch-stream": "workspace:*",
"@coze-arch/logger": "workspace:*",
"@mattiasbuelens/web-streams-adapter": "~0.1.0",
"axios": "^1.4.0",
"eventemitter3": "^5.0.1",

View File

@@ -13,6 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const FONTIER_LOGID_PLACEHOLDER = 'FONTIER_LOGID_PLACEHOLDER';
export const ABORT_HTTP_CHUNK_MESSAGE = 'ABORT_FETCH';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export enum HttpChunkEvents {
// Received message
MESSAGE_RECEIVED = 'http_chunk_message_received',

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* HTTP chunk slardar custom event
*/

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FetchStreamErrorCode, fetchStream } from '@coze-arch/fetch-stream';
import { ABORT_HTTP_CHUNK_MESSAGE } from '../constant';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
type FetchSteamConfig,
FetchStreamErrorCode,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import EventEmitter from 'eventemitter3';
import { type FetchSteamConfig } from '@coze-arch/fetch-stream';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export enum SdkEventsEnum {
MESSAGE_RECEIVED_AND_UPDATE = 'message_received_and_update',
/**

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReportLog, type Tracer } from '../../report-log';
import type { ChatCoreError } from '../../custom-error';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @module @coze-common/chat-core
* Expose all external interfaces

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ReportLog } from '@/report-log';
import type { EventPayloadMaps } from '@/plugins/upload-plugin/types/plugin-upload';
import type {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type EventEmitter from 'eventemitter3';
import { type ReportLog } from '@/report-log';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { filterEmptyField } from '@/shared/utils/data-handler';
import { type ReportLog } from '@/report-log';
import type {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BETWEEN_CHUNK_TIMEOUT, SEND_MESSAGE_TIMEOUT } from '@/shared/const';
import { RequestScene } from '@/request-manager/types';
import { type ReportLog } from '@/report-log';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { SdkEventsEnum } from '../events/sdk-events';
import { type DeployVersion, type ENV } from '../../shared/const';
import { type RequestManagerOptions } from '../../request-manager/types';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
type ChatASRProps,
type BreakMessageProps,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import TokenManager from './token-manager';
export { TokenManager };

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Responsible for token verification, automatically refresh the token
* Exposed to the service party, the service party decides whether to single-case or multiple-case authentication

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface ExtErrorInfo {
code?: number;
local_message_id?: string;

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/// <reference types='@coze-arch/bot-typings' />

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import ChatCore from './chat-sdk';
export { TokenManager } from './credential';
export {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Process received Chunk messages
* 1. Pretreatment: Deserialization

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Undertake all sdk slardar custom events
*/

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* 1. Responsible for standardizing imported parameters exported parameters of various types of message creation to reduce message creation costs
* 2. For the received message, spit out the specified message format for different message types

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* message management related
* 1. Get chat history

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import EventEmitter from 'eventemitter3';
import {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* 1. Responsible for standardizing imported parameters exported parameters of various types of message creation to reduce message creation costs
* 2. For the received message, spit out the specified message format for different message types

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Expose the pre-sent message instance, the pre-sent message is used to be uploaded to the screen after the message is created, and the message format is consistent with Message < T >
*/

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type RequiredAction } from '@coze-arch/bot-api/developer_api';
import { type PartiallyRequired } from '../../shared/utils/data-handler';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
type Message,
type ContentType,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { EventEmitter } from 'eventemitter3';
import {
getUploader,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export type UploadEventName = 'complete' | 'error' | 'progress';
export interface UploadResult {
// Image & file URI resource ID, used in exchange for url ·

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
logger,
reporter,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { isEmpty } from 'lodash-es';
import { type ReportLogProps } from './index';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
import {
createMinimalBrowserClient,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AxiosError, type AxiosResponse } from 'axios';
export class ApiError extends AxiosError {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { merge } from 'lodash-es';
import axios, {
type AxiosInstance,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type AxiosResponse, type InternalAxiosRequestConfig } from 'axios';
import { type DefaultRequestManagerOptions, RequestScene } from './types';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
type InternalAxiosRequestConfig,
type AxiosResponse,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* SDK version number
*/

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { pickBy, type merge, mergeWith, isArray } from 'lodash-es';
export const filterEmptyField = <T extends Record<string, unknown>>(

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type ENV, type DeployVersion } from '../const';
/**

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const safeJSONParse = <T = unknown>(
value: string,
fallback: T | null,

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare module '@coze-arch/vitest-config';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { defineConfig } from '@coze-arch/vitest-config';
export default defineConfig({