@chatbi-v/core 2.0.1 → 2.0.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 +45 -20
- package/dist/chunk-G3OU7D3Y.mjs +47 -0
- package/dist/{config-manager-YVMVSPES.mjs → config-manager-ZARQENTB.mjs} +1 -1
- package/dist/domain/plugin-manager.d.ts +9 -0
- package/dist/domain/plugin-runtime.d.ts +5 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +58 -392
- package/dist/index.plugin.js +5106 -0
- package/package.json +13 -12
- package/dist/chunk-IOE2RMEZ.mjs +0 -75
- package/dist/index.cjs +0 -2521
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatbi-v/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -18,23 +18,24 @@
|
|
|
18
18
|
},
|
|
19
19
|
"./package.json": "./package.json"
|
|
20
20
|
},
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "chatbi-cli build",
|
|
23
|
-
"dev": "chatbi-cli build --watch",
|
|
24
|
-
"test": "vitest",
|
|
25
|
-
"lint": "eslint src/"
|
|
26
|
-
},
|
|
27
21
|
"dependencies": {
|
|
28
|
-
"axios": "^1.13.2"
|
|
22
|
+
"axios": "^1.13.2",
|
|
23
|
+
"dayjs": "^1.11.10"
|
|
29
24
|
},
|
|
30
25
|
"peerDependencies": {
|
|
31
26
|
"react": ">=18.0.0",
|
|
32
27
|
"react-dom": ">=18.0.0"
|
|
33
28
|
},
|
|
34
29
|
"devDependencies": {
|
|
35
|
-
"@chatbi-v/cli": "workspace:*",
|
|
36
|
-
"@chatbi-v/tsconfig": "workspace:*",
|
|
37
30
|
"tsup": "^8.5.1",
|
|
38
|
-
"vite": "^5.4.21"
|
|
31
|
+
"vite": "^5.4.21",
|
|
32
|
+
"@chatbi-v/cli": "2.0.2",
|
|
33
|
+
"@chatbi-v/tsconfig": "2.0.2"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "chatbi-cli build",
|
|
37
|
+
"dev": "chatbi-cli build --watch",
|
|
38
|
+
"test": "vitest",
|
|
39
|
+
"lint": "eslint src/"
|
|
39
40
|
}
|
|
40
|
-
}
|
|
41
|
+
}
|
package/dist/chunk-IOE2RMEZ.mjs
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
-
mod
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
// src/config-manager.ts
|
|
28
|
-
var ConfigManager = class {
|
|
29
|
-
/** 存储配置的 Map */
|
|
30
|
-
config = /* @__PURE__ */ new Map();
|
|
31
|
-
/**
|
|
32
|
-
* 设置配置项
|
|
33
|
-
* @param key 配置键
|
|
34
|
-
* @param value 配置值
|
|
35
|
-
*/
|
|
36
|
-
set(key, value) {
|
|
37
|
-
this.config.set(key, value);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* 获取配置项
|
|
41
|
-
* @param key 配置键
|
|
42
|
-
*/
|
|
43
|
-
get(key) {
|
|
44
|
-
return this.config.get(key);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* 合并配置
|
|
48
|
-
* @param config 配置对象
|
|
49
|
-
*/
|
|
50
|
-
merge(config) {
|
|
51
|
-
Object.keys(config).forEach((key) => {
|
|
52
|
-
const existing = this.config.get(key);
|
|
53
|
-
const incoming = config[key];
|
|
54
|
-
if (existing && typeof existing === "object" && incoming && typeof incoming === "object") {
|
|
55
|
-
this.config.set(key, { ...existing, ...incoming });
|
|
56
|
-
} else {
|
|
57
|
-
this.config.set(key, incoming);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* 获取所有配置
|
|
63
|
-
*/
|
|
64
|
-
getAll() {
|
|
65
|
-
return Object.fromEntries(this.config);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
var configManager = new ConfigManager();
|
|
69
|
-
|
|
70
|
-
export {
|
|
71
|
-
__commonJS,
|
|
72
|
-
__toESM,
|
|
73
|
-
ConfigManager,
|
|
74
|
-
configManager
|
|
75
|
-
};
|