node-karin 1.3.4 → 1.3.5
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/CHANGELOG.md +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [1.3.5](https://github.com/KarinJS/Karin/compare/core-v1.3.4...core-v1.3.5) (2025-02-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 🐛 Bug Fixes
|
|
7
|
+
|
|
8
|
+
* 抽象的EventEmitter ([3c5402b](https://github.com/KarinJS/Karin/commit/3c5402b46ae23c49c76fddb101748d298a384538))
|
|
9
|
+
|
|
3
10
|
## [1.3.4](https://github.com/KarinJS/Karin/compare/core-v1.3.3...core-v1.3.4) (2025-02-11)
|
|
4
11
|
|
|
5
12
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -10020,6 +10020,7 @@ var init_sandbox = __esm({
|
|
|
10020
10020
|
// src/server/api/plugins/config.ts
|
|
10021
10021
|
import fs21 from "node:fs";
|
|
10022
10022
|
import path15 from "node:path";
|
|
10023
|
+
import util3 from "node:util";
|
|
10023
10024
|
import { pathToFileURL } from "node:url";
|
|
10024
10025
|
var WEB_CONFIG_NAME, getConfigPath, loadConfig, getConfig, saveConfig, isConfigExist;
|
|
10025
10026
|
var init_config3 = __esm({
|
|
@@ -10067,7 +10068,9 @@ var init_config3 = __esm({
|
|
|
10067
10068
|
}
|
|
10068
10069
|
const list2 = [];
|
|
10069
10070
|
const { components: components2 } = await loadConfig(configPath2);
|
|
10070
|
-
components2()
|
|
10071
|
+
let result = components2();
|
|
10072
|
+
result = util3.types.isPromise(result) ? await result : result;
|
|
10073
|
+
result.forEach((item) => {
|
|
10071
10074
|
if (typeof (item == null ? void 0 : item.toJSON) === "function") {
|
|
10072
10075
|
list2.push(item.toJSON());
|
|
10073
10076
|
} else {
|
|
@@ -11587,7 +11590,7 @@ var init_watcher = __esm({
|
|
|
11587
11590
|
import fs25 from "node:fs";
|
|
11588
11591
|
import lodash7 from "lodash";
|
|
11589
11592
|
import path21 from "node:path";
|
|
11590
|
-
import
|
|
11593
|
+
import util4 from "node:util";
|
|
11591
11594
|
import schedule from "node-schedule";
|
|
11592
11595
|
var seq, LoaderPlugin;
|
|
11593
11596
|
var init_loader = __esm({
|
|
@@ -11790,7 +11793,7 @@ var init_loader = __esm({
|
|
|
11790
11793
|
try {
|
|
11791
11794
|
val.log(`[\u5B9A\u65F6\u4EFB\u52A1][${val.name}][${val.cron}]: \u5F00\u59CB\u6267\u884C`);
|
|
11792
11795
|
const result2 = val.fnc();
|
|
11793
|
-
if (
|
|
11796
|
+
if (util4.types.isPromise(result2)) await result2;
|
|
11794
11797
|
val.log(`[\u5B9A\u65F6\u4EFB\u52A1][${val.name}][${val.cron}]: \u6267\u884C\u5B8C\u6210`);
|
|
11795
11798
|
} catch (error) {
|
|
11796
11799
|
errorHandler.taskStart(val.name, val.name, error);
|
|
@@ -13192,8 +13195,7 @@ var init_ws2 = __esm({
|
|
|
13192
13195
|
}
|
|
13193
13196
|
reject(new Error(`[sendApi] \u8BF7\u6C42\u9519\u8BEF:
|
|
13194
13197
|
action: ${action}
|
|
13195
|
-
params: ${str2}
|
|
13196
|
-
error: ${data2}}`));
|
|
13198
|
+
params: ${str2}`, { cause: data2 }));
|
|
13197
13199
|
});
|
|
13198
13200
|
});
|
|
13199
13201
|
}
|
|
@@ -13513,7 +13515,7 @@ var init_import = __esm({
|
|
|
13513
13515
|
});
|
|
13514
13516
|
|
|
13515
13517
|
// src/service/handler.ts
|
|
13516
|
-
import
|
|
13518
|
+
import util5 from "node:util";
|
|
13517
13519
|
var call, has, handler;
|
|
13518
13520
|
var init_handler2 = __esm({
|
|
13519
13521
|
"src/service/handler.ts"() {
|
|
@@ -13529,7 +13531,7 @@ var init_handler2 = __esm({
|
|
|
13529
13531
|
done = false;
|
|
13530
13532
|
};
|
|
13531
13533
|
const res = info.fnc(args, next);
|
|
13532
|
-
result =
|
|
13534
|
+
result = util5.types.isPromise(res) ? await res : res;
|
|
13533
13535
|
if (done) {
|
|
13534
13536
|
logger.mark(`[Handler][Done]: [${info.pkg.name}][${info.file.method}][${key}]`);
|
|
13535
13537
|
return result;
|