chore: format all frontend files (#430)
This commit is contained in:
@@ -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 = () => {};
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
CustomEventEmitter,
|
||||
RetryCounter,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* HTTP chunk slardar custom event
|
||||
*/
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type FetchSteamConfig,
|
||||
FetchStreamErrorCode,
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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',
|
||||
/**
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type ChatASRProps,
|
||||
type BreakMessageProps,
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/// <reference types='@coze-arch/bot-typings' />
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Undertake all sdk slardar custom events
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import EventEmitter from 'eventemitter3';
|
||||
|
||||
import {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 >
|
||||
*/
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type Message,
|
||||
type ContentType,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { EventEmitter } from 'eventemitter3';
|
||||
import {
|
||||
getUploader,
|
||||
|
||||
@@ -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 ·
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
logger,
|
||||
reporter,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
type InternalAxiosRequestConfig,
|
||||
type AxiosResponse,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* SDK version number
|
||||
*/
|
||||
|
||||
@@ -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>>(
|
||||
|
||||
@@ -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';
|
||||
|
||||
/**
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
declare module '@coze-arch/vitest-config';
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user