@glodon-aiot/agent-cli-sdk 2.4.7 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -41
- package/dist/agent-cli-sdk.js +28505 -30335
- package/dist/agent-cli-sdk.umd.cjs +113 -123
- package/dist/src/AgentSession.d.ts +4 -3
- package/dist/src/BotClient.d.ts +7 -5
- package/dist/src/DialogSession.d.ts +4 -3
- package/dist/src/Session.d.ts +70 -16
- package/dist/src/api/fetchEventSource/fetch.d.ts +1 -1
- package/dist/src/api/fetchEventSource/index.d.ts +1 -1
- package/package.json +13 -22
- package/dist/cdn/agent-cli-sdk.js +0 -32945
- package/dist/cdn/agent-cli-sdk.umd.cjs +0 -140
- package/dist/cdn/src/AgentPlugin.d.ts +0 -17
- package/dist/cdn/src/AgentSession.d.ts +0 -8
- package/dist/cdn/src/BotClient.d.ts +0 -46
- package/dist/cdn/src/Config.d.ts +0 -32
- package/dist/cdn/src/DialogSession.d.ts +0 -21
- package/dist/cdn/src/EventBus.d.ts +0 -23
- package/dist/cdn/src/Logger.d.ts +0 -12
- package/dist/cdn/src/PayloadTypes.d.ts +0 -84
- package/dist/cdn/src/Session.d.ts +0 -156
- package/dist/cdn/src/__ tests __/AgentClient.spec.d.ts +0 -1
- package/dist/cdn/src/__ tests __/AgentSession.spec.d.ts +0 -1
- package/dist/cdn/src/__ tests __/DialogClient.spec.d.ts +0 -1
- package/dist/cdn/src/api/fetchEventSource/fetch.d.ts +0 -44
- package/dist/cdn/src/api/fetchEventSource/index.d.ts +0 -1
- package/dist/cdn/src/api/fetchEventSource/parse.d.ts +0 -36
- package/dist/cdn/src/api/index.d.ts +0 -2
- package/dist/cdn/src/index.d.ts +0 -5
- package/dist/cdn/src/utils.d.ts +0 -4
- package/dist/es/AgentPlugin.mjs +0 -20
- package/dist/es/AgentSession.mjs +0 -243
- package/dist/es/BotClient.mjs +0 -242
- package/dist/es/Config.mjs +0 -34
- package/dist/es/DialogSession.mjs +0 -281
- package/dist/es/EventBus.mjs +0 -64
- package/dist/es/Logger.mjs +0 -31
- package/dist/es/PayloadTypes.mjs +0 -4
- package/dist/es/Session.mjs +0 -527
- package/dist/es/_virtual/_commonjsHelpers.mjs +0 -4
- package/dist/es/_virtual/index.mjs +0 -4
- package/dist/es/_virtual/index2.mjs +0 -4
- package/dist/es/_virtual/index3.mjs +0 -4
- package/dist/es/_virtual/minio-zj.mjs +0 -4
- package/dist/es/api/fetchEventSource/fetch.mjs +0 -112
- package/dist/es/api/fetchEventSource/parse.mjs +0 -97
- package/dist/es/api/index.mjs +0 -48
- package/dist/es/index.mjs +0 -11
- package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +0 -26485
- package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +0 -54
- package/dist/es/node_modules/base64-js/index.mjs +0 -47
- package/dist/es/node_modules/buffer/index.mjs +0 -927
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +0 -9
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +0 -18
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +0 -24
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +0 -19
- package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +0 -4
- package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +0 -317
- package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +0 -113
- package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +0 -11
- package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +0 -273
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +0 -8
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +0 -87
- package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +0 -52
- package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +0 -21
- package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +0 -23
- package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +0 -21
- package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +0 -14
- package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +0 -39
- package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +0 -28
- package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +0 -105
- package/dist/es/node_modules/ieee754/index.mjs +0 -28
- package/dist/es/node_modules/js-base64/base64.mjs +0 -31
- package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +0 -26
- package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +0 -25
- package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +0 -242
- package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +0 -8
- package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +0 -608
- package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +0 -19
- package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +0 -52
- package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +0 -203
- package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +0 -26
- package/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -6
- package/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +0 -10
- package/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -9
- package/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +0 -19
- package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +0 -4
- package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +0 -8
- package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +0 -8
- package/dist/es/packages/apis/dist/es/base/index.mjs +0 -154
- package/dist/es/packages/apis/dist/es/cvforce/index.mjs +0 -431
- package/dist/es/packages/apis/dist/es/cvforce/model.mjs +0 -5
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -1
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -3
- package/dist/es/utils.mjs +0 -11
- package/dist/lib/index.js +0 -126
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ISession } from '@glodon-aiot/apis';
|
|
2
|
-
import
|
|
1
|
+
import { IApplication, ISession } from '@glodon-aiot/apis';
|
|
2
|
+
import Session, { QuestionBody, QuestionConfig } from './Session';
|
|
3
|
+
import BotClient from './BotClient';
|
|
3
4
|
export default class AgentSession extends Session {
|
|
4
|
-
constructor(token: string, _id?: string, _data?: Partial<ISession>, lazyload?: boolean);
|
|
5
|
+
constructor(token: string, _id?: string, _data?: Partial<ISession>, lazyload?: boolean, application?: IApplication, client?: BotClient);
|
|
5
6
|
prepareConnection(): Promise<boolean>;
|
|
6
7
|
sendQuestion(questionBody: QuestionBody, configs: QuestionConfig): Promise<false | undefined>;
|
|
7
8
|
stopAnswer(): void;
|
package/dist/src/BotClient.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Session from './Session';
|
|
2
2
|
import { BotClientConfig } from './Config';
|
|
3
|
-
import { IApplication, IPrompt, ISession, SessionQueryParams } from '@glodon-aiot/apis';
|
|
4
|
-
import
|
|
3
|
+
import { IApplication, IPrompt, ISession, ISessionPrompt, SessionQueryParams } from '@glodon-aiot/apis';
|
|
4
|
+
import EventBus from './EventBus';
|
|
5
5
|
export type ClientEventName = 'ready' | 'application:loaded';
|
|
6
6
|
export default class BotClient {
|
|
7
7
|
private _token;
|
|
@@ -35,8 +35,10 @@ export default class BotClient {
|
|
|
35
35
|
set activeSession(sessionId: string);
|
|
36
36
|
private createSession;
|
|
37
37
|
getSessions(queryParams?: SessionQueryParams): Promise<Session[]>;
|
|
38
|
-
loadSession(sessionId?: string, sessionParams?: Partial<ISession
|
|
39
|
-
|
|
38
|
+
loadSession(sessionId?: string, sessionParams?: Partial<ISession & {
|
|
39
|
+
promptVariables?: ISessionPrompt[];
|
|
40
|
+
}>): Promise<Session>;
|
|
41
|
+
reload(): Promise<this>;
|
|
40
42
|
reloadSession(sessionId?: string): Promise<Session | undefined>;
|
|
41
43
|
setTop(sessionId: string, top: boolean, order?: string): Promise<Session[] | undefined>;
|
|
42
44
|
addEventListener(eventName: ClientEventName, callback: any, once?: boolean): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ISession } from '@glodon-aiot/apis';
|
|
2
|
-
import
|
|
1
|
+
import { IApplication, ISession } from '@glodon-aiot/apis';
|
|
2
|
+
import Session, { QuestionBody, QuestionConfig } from './Session';
|
|
3
|
+
import BotClient from './BotClient';
|
|
3
4
|
export default class DialogSession extends Session {
|
|
4
5
|
private ctrl;
|
|
5
|
-
constructor(token: string, _id?: string, _data?: Partial<ISession>, lazyload?: boolean);
|
|
6
|
+
constructor(token: string, _id?: string, _data?: Partial<ISession>, lazyload?: boolean, application?: IApplication, client?: BotClient);
|
|
6
7
|
prepareConnection(): Promise<boolean>;
|
|
7
8
|
postChatV2EventSource(applicationId: string, sessionId: string, params: any, signal: AbortSignal, options: {
|
|
8
9
|
onopen?: any;
|
package/dist/src/Session.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { ChatMessageRole, IChatMessage, ISession, ISessionPrompt
|
|
1
|
+
import { ChatMessageRole, IApplication, IChatMessage, ICommentParam, ISession, ISessionPrompt } from '@glodon-aiot/apis';
|
|
2
2
|
import { Socket } from 'socket.io-client';
|
|
3
|
-
import
|
|
3
|
+
import EventBus from './EventBus';
|
|
4
4
|
import { ActionPayload, PluginFunctionBasic, Thought } from './PayloadTypes';
|
|
5
|
-
import {
|
|
5
|
+
import { CVForceApi } from '@glodon-aiot/apis';
|
|
6
|
+
import { ChatHistoryParams, IKnowledge } from '@glodon-aiot/apis';
|
|
7
|
+
import BotClient from './BotClient';
|
|
8
|
+
export declare enum NetOpen {
|
|
9
|
+
enable = 1,
|
|
10
|
+
disable = 2
|
|
11
|
+
}
|
|
6
12
|
export interface QuestionBody {
|
|
7
13
|
content: string;
|
|
8
14
|
stream: boolean;
|
|
@@ -18,7 +24,7 @@ export interface QuestionConfig {
|
|
|
18
24
|
oldMessageId?: string;
|
|
19
25
|
}
|
|
20
26
|
type ActionPayloadBasic = ActionPayload<PluginFunctionBasic & Thought>;
|
|
21
|
-
export type SessionEventName = 'init' | 'data:loading' | 'data:loaded' | 'data:updating' | 'data:updated' | 'data:creating' | 'data:created' | 'data:deleting' | 'data:deleted' | '
|
|
27
|
+
export type SessionEventName = 'init' | 'ready' | 'activated' | 'inactivated' | 'frozen' | 'data:loading' | 'data:loaded' | 'data:updating' | 'data:updated' | 'data:updated:promptVariables' | 'data:updated:knowledges' | 'data:creating' | 'data:created' | 'data:deleting' | 'data:deleted' | 'socket:connect' | 'socket:disconnect' | 'error' | 'destroy' | 'history:loading' | 'history:loaded' | 'history:moreloading' | 'history:moreloaded' | 'history:add' | 'message:new' | 'message:updated' | 'message:action' | 'message:content' | 'message:reference' | 'message:relatedQuesion:loading' | 'message:relatedQuesion:loaded' | 'message:comment' | 'message:error' | 'answer:finish';
|
|
22
28
|
export declare enum SessionErrors {
|
|
23
29
|
DataRequestFailed = "data request error",
|
|
24
30
|
SocketConnectionFailed = "socket error",
|
|
@@ -51,27 +57,53 @@ export default abstract class Session {
|
|
|
51
57
|
protected _ready: boolean;
|
|
52
58
|
protected event: EventBus;
|
|
53
59
|
_applicationId: string;
|
|
60
|
+
_application: IApplication | null;
|
|
54
61
|
data: ISession | null;
|
|
62
|
+
readonly client: BotClient | null;
|
|
55
63
|
messages: IChatMessage[];
|
|
56
64
|
protected _loadingMessages: boolean;
|
|
57
65
|
protected _loadingMessagesSize: number;
|
|
58
66
|
cvforceApi: CVForceApi;
|
|
59
67
|
socket: Socket | null;
|
|
60
68
|
protected _promptVariables: ISessionPrompt[];
|
|
69
|
+
protected _netOpen: boolean;
|
|
61
70
|
protected active: boolean;
|
|
71
|
+
protected activing: boolean;
|
|
62
72
|
protected _stopAnswer: boolean;
|
|
63
73
|
private _dataLoading;
|
|
64
74
|
private _dataLoaded;
|
|
65
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Session 类的构造函数,用于初始化会话实例。
|
|
77
|
+
* @param token - 用户的身份验证令牌,用于解析应用 ID。
|
|
78
|
+
* @param _id - 会话的 ID,可选参数,默认为空字符串。
|
|
79
|
+
* @param _data - 会话的初始数据,可选参数,包含提示变量、知识库等信息。
|
|
80
|
+
* @param lazyload - 是否懒加载数据,可选参数,默认为 undefined。
|
|
81
|
+
* @param _application - 应用信息,可选参数。
|
|
82
|
+
* @param client - Bot 客户端实例,可选参数。
|
|
83
|
+
*/
|
|
84
|
+
constructor(token: string, _id?: string, _data?: Partial<ISession & {
|
|
85
|
+
promptVariables?: Partial<ISessionPrompt>[];
|
|
86
|
+
}>, lazyload?: boolean | undefined, _application?: IApplication, client?: BotClient);
|
|
87
|
+
fetchData(): Promise<ISession>;
|
|
66
88
|
get id(): string | undefined;
|
|
67
89
|
get applicationId(): string;
|
|
90
|
+
get application(): IApplication | null;
|
|
91
|
+
loadApplicationInfo(): Promise<IApplication>;
|
|
68
92
|
get ready(): boolean;
|
|
69
93
|
get frozen(): boolean;
|
|
70
94
|
protected set frozen(v: boolean);
|
|
71
|
-
get knowledges(): IKnowledge[];
|
|
95
|
+
get knowledges(): IKnowledge[] | undefined;
|
|
72
96
|
setKnowledges(knowledges?: IKnowledge[]): Promise<IKnowledge[] | undefined>;
|
|
97
|
+
validateConfigs(): void;
|
|
73
98
|
get promptVariables(): ISessionPrompt[];
|
|
74
|
-
setPromptVariables(v: ISessionPrompt[]): Promise<
|
|
99
|
+
setPromptVariables(v: ISessionPrompt[]): Promise<ISessionPrompt[] | undefined>;
|
|
100
|
+
get netOpen(): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* 异步设置会话的网络访问开关状态
|
|
103
|
+
* @param v - 布尔值,表示是否开启网络访问,true 为开启,false 为关闭
|
|
104
|
+
* @returns 如果设置成功,返回最终的网络访问开关状态;若不满足设置条件,则提前返回 undefined
|
|
105
|
+
*/
|
|
106
|
+
setNetOpen(v: boolean): Promise<boolean | undefined>;
|
|
75
107
|
private getService;
|
|
76
108
|
addEventListener(eventName: SessionEventName, callback: any, once?: boolean): void;
|
|
77
109
|
removeEventListener(eventName: SessionEventName, callback: any): void;
|
|
@@ -89,15 +121,15 @@ export default abstract class Session {
|
|
|
89
121
|
role: ChatMessageRole;
|
|
90
122
|
userId?: string | undefined;
|
|
91
123
|
sessionId: string;
|
|
92
|
-
reference: import(
|
|
93
|
-
searchReference: import(
|
|
94
|
-
comment?: import(
|
|
124
|
+
reference: import("@glodon-aiot/apis").IReference[];
|
|
125
|
+
searchReference: import("@glodon-aiot/apis").ISearchRefernce[];
|
|
126
|
+
comment?: import("@glodon-aiot/apis/dist/src/cvforce").ICommentParam | undefined;
|
|
95
127
|
knowledges?: IKnowledge[] | undefined;
|
|
96
128
|
isLoading?: boolean | undefined;
|
|
97
129
|
messageTime: string;
|
|
98
130
|
fileId?: string | undefined;
|
|
99
|
-
file?: import(
|
|
100
|
-
chatMode?: import(
|
|
131
|
+
file?: import("@glodon-aiot/apis/dist/src/cvforce").KnowledgeFileMetadata | undefined;
|
|
132
|
+
chatMode?: import("@glodon-aiot/apis").ChatMode | undefined;
|
|
101
133
|
llmModel?: string | undefined;
|
|
102
134
|
isContext?: boolean | undefined;
|
|
103
135
|
index?: number | undefined;
|
|
@@ -116,21 +148,22 @@ export default abstract class Session {
|
|
|
116
148
|
stream?: boolean | undefined;
|
|
117
149
|
fileIds?: string[] | undefined;
|
|
118
150
|
isReplying?: boolean | undefined;
|
|
119
|
-
files?: import(
|
|
151
|
+
files?: import("@glodon-aiot/apis").ChatMessageFile[] | undefined;
|
|
120
152
|
thinkingSecs?: number | undefined;
|
|
121
153
|
thinkingStatus?: "end" | "start" | undefined;
|
|
122
154
|
reasoningContent?: string | undefined;
|
|
123
155
|
}[]>;
|
|
124
156
|
rename(name: string): Promise<boolean>;
|
|
125
157
|
protected pushMessage(message: IChatMessage): Promise<void>;
|
|
126
|
-
reloadSessionInfo(): Promise<
|
|
127
|
-
reload(): Promise<
|
|
158
|
+
reloadSessionInfo(): Promise<this>;
|
|
159
|
+
reload(): Promise<unknown>;
|
|
128
160
|
delete(): Promise<string | false>;
|
|
129
|
-
activate(): Promise<
|
|
161
|
+
activate(): Promise<unknown>;
|
|
130
162
|
inactivate(immediately?: boolean): boolean;
|
|
131
163
|
abstract prepareConnection(): Promise<boolean>;
|
|
132
164
|
abstract sendQuestion(params: QuestionBody, configs: QuestionConfig): any;
|
|
133
165
|
abstract stopAnswer(): any;
|
|
166
|
+
get dataLoaded(): boolean;
|
|
134
167
|
send(params: {
|
|
135
168
|
text?: string;
|
|
136
169
|
uuid?: string;
|
|
@@ -148,8 +181,29 @@ export default abstract class Session {
|
|
|
148
181
|
protected fillMessageReference(message: IChatMessage): Promise<IChatMessage>;
|
|
149
182
|
answerAgain(configs?: QuestionConfig): Promise<void>;
|
|
150
183
|
setTop(top: boolean): Promise<void>;
|
|
184
|
+
/**
|
|
185
|
+
* 暂停当前会话的回答过程
|
|
186
|
+
* 该方法会停止当前回答,标记回答停止状态,处理正在进行的消息和操作,
|
|
187
|
+
* 并根据情况更新消息内容或添加新的系统消息。
|
|
188
|
+
* @returns 返回当前会话实例
|
|
189
|
+
*/
|
|
151
190
|
suspend(): this | undefined;
|
|
191
|
+
/**
|
|
192
|
+
* 异步提交评论信息
|
|
193
|
+
* @param params - 评论参数,包含评论相关的信息,如消息 ID 等
|
|
194
|
+
* @returns 返回调用 API 提交评论后的响应结果
|
|
195
|
+
*/
|
|
196
|
+
postMessageComment(params: ICommentParam): Promise<string>;
|
|
197
|
+
/**
|
|
198
|
+
* 清除当前会话的上下文信息
|
|
199
|
+
* 该方法会调用 API 清除指定会话的上下文,并在操作成功后触发相应事件
|
|
200
|
+
* @returns 如果会话 ID 存在且清除操作成功,返回一个解析为 true 的 Promise;若会话 ID 不存在,抛出错误
|
|
201
|
+
*/
|
|
152
202
|
clear(): Promise<boolean>;
|
|
203
|
+
/**
|
|
204
|
+
* 销毁当前会话实例,执行清理操作并触发销毁事件
|
|
205
|
+
* @returns 返回当前会话的 ID,如果会话 ID 不存在则返回空字符串
|
|
206
|
+
*/
|
|
153
207
|
destroy(): string;
|
|
154
208
|
}
|
|
155
209
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./fetch";
|
package/package.json
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glodon-aiot/agent-cli-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"author": "glodoncv",
|
|
5
5
|
"description": "aiot agent client js sdk",
|
|
6
|
-
"publishConfig": {
|
|
7
|
-
"access": "public"
|
|
8
|
-
},
|
|
9
6
|
"type": "module",
|
|
10
7
|
"keywords": [
|
|
11
8
|
"aiot",
|
|
@@ -18,11 +15,11 @@
|
|
|
18
15
|
],
|
|
19
16
|
"module": "./dist/agent-cli-sdk.js",
|
|
20
17
|
"main": "./dist/agent-cli-sdk.umd.cjs",
|
|
21
|
-
"typings": "./src/index.ts",
|
|
18
|
+
"typings": "./dist/src/index.d.ts",
|
|
22
19
|
"exports": {
|
|
23
|
-
"import": "./
|
|
24
|
-
"require": "./
|
|
25
|
-
"
|
|
20
|
+
"import": "./dist/agent-cli-sdk.js",
|
|
21
|
+
"require": "./dist/agent-cli-sdk.umd.cjs",
|
|
22
|
+
"types": "./dist/src/index.d.ts"
|
|
26
23
|
},
|
|
27
24
|
"license": "MIT",
|
|
28
25
|
"scripts": {
|
|
@@ -30,30 +27,20 @@
|
|
|
30
27
|
"example": "node ./example/server.js",
|
|
31
28
|
"dev": "npm-run-all -p watch example",
|
|
32
29
|
"start": "vite",
|
|
33
|
-
"build": "
|
|
30
|
+
"build": "tsc && vite build --mode prod",
|
|
34
31
|
"build:npm": "tsc && vite build --mode prod",
|
|
35
32
|
"build:cdn": "tsc && vite build --mode prod --config ./vite.config.cdn.ts",
|
|
36
33
|
"preview": "vite preview",
|
|
37
34
|
"check": "yarn prettier --check .",
|
|
38
35
|
"write": "yarn prettier --write .",
|
|
39
36
|
"lint": "eslint --ext .tsx,.ts --fix ./example -c .eslintrc.js",
|
|
40
|
-
"test": "yarn dev && yarn jest"
|
|
41
|
-
"storybook": "start-storybook -p 6006",
|
|
42
|
-
"docs": "start-storybook -p 6006",
|
|
43
|
-
"build-storybook": "build-storybook",
|
|
44
|
-
"vpublish:major": "sh ./publish.sh major",
|
|
45
|
-
"vpublish:minor": "sh ./publish.sh minor",
|
|
46
|
-
"vpublish:patch": "sh ./publish.sh patch",
|
|
47
|
-
"vpublish:premajor": "sh ./publish.sh premajor",
|
|
48
|
-
"vpublish:preminor": "sh ./publish.sh preminor",
|
|
49
|
-
"vpublish:prepatch": "sh ./publish.sh prepatch",
|
|
50
|
-
"vpublish:prerelease": "sh ./publish.sh prerelease",
|
|
51
|
-
"vpublish": "npm publish --registry=https://packages.glodon.com/artifactory/api/npm/npm-GGM-releases/"
|
|
37
|
+
"test": "yarn dev && yarn jest"
|
|
52
38
|
},
|
|
53
39
|
"devDependencies": {
|
|
54
40
|
"@babel/core": "^7.20.12",
|
|
55
41
|
"@commitlint/cli": "^17.0.3",
|
|
56
42
|
"@commitlint/config-conventional": "^17.0.3",
|
|
43
|
+
"@jest/globals": "^29.7.0",
|
|
57
44
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
58
45
|
"@testing-library/jest-dom": "^6.6.3",
|
|
59
46
|
"@types/express": "^4",
|
|
@@ -89,8 +76,12 @@
|
|
|
89
76
|
"lint-staged": {
|
|
90
77
|
"*.{js,css,md,jsx,less,ts,tsx,json}": "prettier --write"
|
|
91
78
|
},
|
|
79
|
+
"publishConfig": {
|
|
80
|
+
"access": "public",
|
|
81
|
+
"registry": "https://registry.npmjs.org/"
|
|
82
|
+
},
|
|
92
83
|
"dependencies": {
|
|
93
|
-
"@glodon-aiot/apis": "^
|
|
84
|
+
"@glodon-aiot/apis": "^3.0.4",
|
|
94
85
|
"axios": "0.24.0",
|
|
95
86
|
"buffer": "^6.0.3",
|
|
96
87
|
"dayjs": "^1.11.13",
|