@glodon-aiot/chat-app-sdk 0.0.1-alpha.0 → 0.0.1-alpha.2
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 +12 -6
- package/libs/cn/370.index.esm.js +1 -0
- package/libs/cn/499.index.esm.js +1 -0
- package/libs/cn/index.esm.js +33 -0
- package/libs/cn/index.js +1 -1
- package/package.json +8 -6
- package/src/index.ts +0 -56
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glodon-aiot/chat-app-sdk",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.2",
|
|
4
4
|
"description": "Glodon AIoT Chat App SDK - A lightweight wrapper for @coze-studio/chat-app-sdk",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Glodon AIoT Team",
|
|
@@ -10,25 +10,27 @@
|
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
"import": "./libs/cn/index.js",
|
|
13
|
+
"import": "./libs/cn/index.esm.js",
|
|
14
14
|
"require": "./libs/cn/index.js",
|
|
15
15
|
"types": "./libs/cn/index.d.ts"
|
|
16
16
|
},
|
|
17
17
|
"./client": "@coze-studio/chat-app-sdk/src/client",
|
|
18
18
|
"./types/*": "@coze-studio/chat-app-sdk/src/types/*"
|
|
19
19
|
},
|
|
20
|
-
"main": "
|
|
20
|
+
"main": "libs/cn/index.js",
|
|
21
21
|
"unpkg": true,
|
|
22
|
-
"
|
|
22
|
+
"module": "libs/cn/index.esm.js",
|
|
23
|
+
"types": "libs/cn/index.d.ts",
|
|
23
24
|
"files": [
|
|
24
25
|
"libs",
|
|
25
26
|
"README.md"
|
|
26
27
|
],
|
|
27
28
|
"scripts": {
|
|
28
|
-
"build": "rm -rf libs && npm run rsbuild",
|
|
29
|
+
"build": "rm -rf libs && npm run rsbuild:umd && npm run rsbuild:esm",
|
|
29
30
|
"dev": "IS_OPEN_SOURCE=true NODE_ENV=development rspack serve -c ./rspack-config/dev.config.ts",
|
|
30
31
|
"lint": "eslint ./ --cache",
|
|
31
|
-
"rsbuild": "NODE_ENV=production rspack build -c ./rspack-config/build.config.ts",
|
|
32
|
+
"rsbuild:esm": "NODE_ENV=production rspack build -c ./rspack-config/build-esm.config.ts",
|
|
33
|
+
"rsbuild:umd": "NODE_ENV=production rspack build -c ./rspack-config/build.config.ts",
|
|
32
34
|
"test": "vitest --run --passWithNoTests"
|
|
33
35
|
},
|
|
34
36
|
"dependencies": {},
|
package/src/index.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2025 Glodon AIoT Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// 导入原包的 WebChatClient 类
|
|
18
|
-
// 注意:由于原包的入口文件只暴露到全局,我们需要从具体路径导入
|
|
19
|
-
import type { CozeChatOptions } from '@coze-studio/chat-app-sdk/src/types/client';
|
|
20
|
-
import { WebChatClient as CozeWebChatClient } from '@coze-studio/chat-app-sdk/src/client';
|
|
21
|
-
import './style.less';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Glodon AIoT Web Chat Client
|
|
25
|
-
*
|
|
26
|
-
* 基于 @coze-studio/chat-app-sdk 的轻量级包装类
|
|
27
|
-
* 保持 100% API 兼容性,同时提供品牌定制能力
|
|
28
|
-
*/
|
|
29
|
-
export class WebChatClient extends CozeWebChatClient {
|
|
30
|
-
constructor(options: CozeChatOptions) {
|
|
31
|
-
super(options);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// 全局命名空间暴露
|
|
36
|
-
if (typeof window !== 'undefined') {
|
|
37
|
-
if (!window.GlodonAIoT) {
|
|
38
|
-
window.GlodonAIoT = { WebChatClient };
|
|
39
|
-
} else {
|
|
40
|
-
window.GlodonAIoT.WebChatClient = WebChatClient;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// 导出类型定义
|
|
45
|
-
export type {
|
|
46
|
-
CozeChatOptions,
|
|
47
|
-
RenderMode,
|
|
48
|
-
} from '@coze-studio/chat-app-sdk/src/types/client';
|
|
49
|
-
|
|
50
|
-
// 新增:导出常用的枚举和类型
|
|
51
|
-
export {
|
|
52
|
-
ChatType,
|
|
53
|
-
AuthType,
|
|
54
|
-
Layout,
|
|
55
|
-
Language,
|
|
56
|
-
} from '@coze-studio/open-chat/types';
|