node-karin 1.8.6 → 1.8.8
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 +15 -0
- package/default/config/pm2.json +3 -0
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.mjs +64 -21
- package/dist/global.d.d.ts +1 -2
- package/dist/index.d.ts +6 -8
- package/dist/index.mjs +1282 -7413
- package/dist/types-BJk0oTwW.d.ts +146 -0
- package/dist/web/assets/js/components-CLB7wkmN.js.br +0 -0
- package/dist/web/assets/js/entry-T2jwWprd.js.br +0 -0
- package/dist/web/assets/js/hooks-DGvDG8bg.js.br +0 -0
- package/dist/web/assets/js/page-404.tsx-rh3UIlox.js +1 -0
- package/dist/web/assets/js/page-dashboard-BIzbCQc5.js.br +0 -0
- package/dist/web/assets/js/page-loading.tsx-Cz1_t9kn.js.br +0 -0
- package/dist/web/assets/js/page-login.tsx-CU4MLQqo.js.br +0 -0
- package/dist/web/assets/js/{utils-x5AKiszG.js → utils-BewWhq0h.js} +1 -1
- package/dist/web/assets/js/vendor-heroui-DwwsJlXF.js.br +0 -0
- package/dist/web/assets/js/vendor-others-D7Rwl1O6.js.br +0 -0
- package/dist/web/assets/js/vendor-react-BDRVXu1f.js.br +0 -0
- package/dist/web/assets/js/vendor-visual-BMhnpZxY.js.br +0 -0
- package/dist/web/index.html +9 -9
- package/package.json +2 -3
- package/README.md +0 -32
- package/dist/logger-DVUGuzNj.d.ts +0 -101
- package/dist/web/assets/js/components-SKlAGqzh.js.br +0 -0
- package/dist/web/assets/js/entry-vKz092kA.js.br +0 -0
- package/dist/web/assets/js/hooks-Cx1Yu0OX.js.br +0 -0
- package/dist/web/assets/js/page-404.tsx-BXEV4NBF.js +0 -1
- package/dist/web/assets/js/page-dashboard-BU7cB7ZI.js.br +0 -0
- package/dist/web/assets/js/page-loading.tsx-CJaYj8cR.js.br +0 -0
- package/dist/web/assets/js/page-login.tsx-CfavJf9W.js.br +0 -0
- package/dist/web/assets/js/vendor-heroui-D6FhP6a0.js.br +0 -0
- package/dist/web/assets/js/vendor-others-B6NXaB-r.js.br +0 -0
- package/dist/web/assets/js/vendor-react-Hg1DVPZt.js.br +0 -0
- package/dist/web/assets/js/vendor-visual-mzxhMYK3.js.br +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import EventEmitter from 'events';
|
|
2
|
+
import chalk__default from 'chalk';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @description 所有日志等级
|
|
6
|
+
* @description 请使用`LogMethodNames`类型来获取日志方法名称
|
|
7
|
+
*/
|
|
8
|
+
type LoggerLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'mark' | 'off';
|
|
9
|
+
/** 日志方法名称 */
|
|
10
|
+
type LogMethodNames = Exclude<LoggerLevel, 'off'>;
|
|
11
|
+
/** 仅包含日志方法的Logger类型 */
|
|
12
|
+
type LogMethodsOnly = Pick<Logger, LogMethodNames>;
|
|
13
|
+
/**
|
|
14
|
+
* @description 日志接口
|
|
15
|
+
*/
|
|
16
|
+
interface Logger {
|
|
17
|
+
/** @description chalk模块 */
|
|
18
|
+
chalk: typeof chalk__default;
|
|
19
|
+
/** @description 将文本设置为红色 */
|
|
20
|
+
red: typeof chalk__default.red;
|
|
21
|
+
/** @description 将文本设置为绿色 */
|
|
22
|
+
green: typeof chalk__default.green;
|
|
23
|
+
/** @description 将文本设置为黄色 */
|
|
24
|
+
yellow: typeof chalk__default.yellow;
|
|
25
|
+
/** @description 将文本设置为蓝色 */
|
|
26
|
+
blue: typeof chalk__default.blue;
|
|
27
|
+
/** @description 将文本设置为品红色 */
|
|
28
|
+
magenta: typeof chalk__default.magenta;
|
|
29
|
+
/** @description 将文本设置为青色 */
|
|
30
|
+
cyan: typeof chalk__default.cyan;
|
|
31
|
+
/** @description 将文本设置为白色 */
|
|
32
|
+
white: typeof chalk__default.white;
|
|
33
|
+
/** @description 将文本设置为灰色 */
|
|
34
|
+
gray: typeof chalk__default.gray;
|
|
35
|
+
/** @description 将文本设置为紫色 */
|
|
36
|
+
violet: ReturnType<typeof chalk__default.hex>;
|
|
37
|
+
/** @description 将文本设置为触发函数的颜色 */
|
|
38
|
+
fnc: ReturnType<typeof chalk__default.hex>;
|
|
39
|
+
/**
|
|
40
|
+
* @description 打印Bot前缀日志
|
|
41
|
+
* @param level - 日志等级
|
|
42
|
+
* @param id - Bot ID
|
|
43
|
+
* @param args - 日志内容
|
|
44
|
+
*/
|
|
45
|
+
bot: (level: LogMethodNames, id: string, ...args: any[]) => void;
|
|
46
|
+
/**
|
|
47
|
+
* @description 构建自定义前缀函数
|
|
48
|
+
* @param prefix - 前缀
|
|
49
|
+
* @returns 返回一个函数
|
|
50
|
+
*/
|
|
51
|
+
prefix: (prefix: string) => (level: LogMethodNames, ...args: any[]) => void;
|
|
52
|
+
/** @description 打印追踪日志 */
|
|
53
|
+
trace(...args: any[]): void;
|
|
54
|
+
/** @description 打印调试日志 */
|
|
55
|
+
debug(...args: any[]): void;
|
|
56
|
+
/** @description 打印信息日志 */
|
|
57
|
+
info(...args: any[]): void;
|
|
58
|
+
/** @description 打印警告日志 */
|
|
59
|
+
warn(...args: any[]): void;
|
|
60
|
+
/** @description 打印错误日志 */
|
|
61
|
+
error(...args: any[]): void;
|
|
62
|
+
/** @description 打印致命日志 */
|
|
63
|
+
fatal(...args: any[]): void;
|
|
64
|
+
/** @description 打印标记日志 */
|
|
65
|
+
mark(...args: any[]): void;
|
|
66
|
+
/** @description 关闭日志 */
|
|
67
|
+
off(): void;
|
|
68
|
+
/** @description 打印日志 跟`info`日志相同 */
|
|
69
|
+
log(...args: any[]): void;
|
|
70
|
+
/** @description 获取、设置日志等级 */
|
|
71
|
+
level: LoggerLevel;
|
|
72
|
+
/** @description 获取当前配置 */
|
|
73
|
+
readonly config: LoggerConfig;
|
|
74
|
+
/**
|
|
75
|
+
* @description 设置新的配置
|
|
76
|
+
* @param config - 日志配置
|
|
77
|
+
*/
|
|
78
|
+
configure(config: Partial<LoggerConfig>): void;
|
|
79
|
+
/** @description 关闭并清理资源 */
|
|
80
|
+
close(): void;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @description 文件日志配置
|
|
84
|
+
*/
|
|
85
|
+
interface FileLogConfig {
|
|
86
|
+
/** @description 是否启用文件日志 @default false */
|
|
87
|
+
enabled: boolean;
|
|
88
|
+
/** @description 日志文件目录 @default 'logs' */
|
|
89
|
+
dir: string;
|
|
90
|
+
/** @description 文件日志级别(默认与控制台相同) */
|
|
91
|
+
level?: LoggerLevel;
|
|
92
|
+
/** @description 日志文件保留天数 @default 14 */
|
|
93
|
+
daysToKeep: number;
|
|
94
|
+
/**
|
|
95
|
+
* @description 是否启用整体化模式(按日期每天一个日志文件)
|
|
96
|
+
* @default true
|
|
97
|
+
*/
|
|
98
|
+
enableWholeMode: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* @description 是否启用碎片化模式(按大小分片)
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
enableFragmentMode: boolean;
|
|
104
|
+
/** @description 碎片化模式下,单个日志文件的最大大小(MB) @default 10 */
|
|
105
|
+
maxFileSize: number;
|
|
106
|
+
/** @description 是否单独保存错误和致命日志 @default true */
|
|
107
|
+
separateErrorLog: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @description 日志配置
|
|
111
|
+
*/
|
|
112
|
+
interface LoggerConfig {
|
|
113
|
+
/** @description 日志前缀 @default '' */
|
|
114
|
+
prefix: string;
|
|
115
|
+
/** @description 日志级别 @default 'info' */
|
|
116
|
+
level: LoggerLevel;
|
|
117
|
+
/** @description `logger.fnc`自定义颜色 @default '#FFFF00' */
|
|
118
|
+
color?: string;
|
|
119
|
+
/** @description 文件日志配置 */
|
|
120
|
+
file: FileLogConfig;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @description 默认配置
|
|
124
|
+
*/
|
|
125
|
+
declare const DEFAULT_LOGGER_CONFIG: LoggerConfig;
|
|
126
|
+
/**
|
|
127
|
+
* @description 日志级别优先级
|
|
128
|
+
*/
|
|
129
|
+
declare const LoggerLevelPriority: Record<LoggerLevel, number>;
|
|
130
|
+
/**
|
|
131
|
+
* @description 日志输出接口
|
|
132
|
+
*/
|
|
133
|
+
interface LogWriter {
|
|
134
|
+
/**
|
|
135
|
+
* @description 输出日志
|
|
136
|
+
* @param level - 日志级别
|
|
137
|
+
* @param message - 日志消息
|
|
138
|
+
*/
|
|
139
|
+
write(level: LoggerLevel, message: string): void;
|
|
140
|
+
/**
|
|
141
|
+
* @description 关闭输出
|
|
142
|
+
*/
|
|
143
|
+
close?(): void;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { DEFAULT_LOGGER_CONFIG as D, type FileLogConfig as F, type Logger as L, type LogMethodNames as a, type LoggerLevel as b, type LogMethodsOnly as c, type LoggerConfig as d, LoggerLevelPriority as e, type LogWriter as f };
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./vendor-react-BDRVXu1f.js";import{P as r}from"./components-CLB7wkmN.js";import"./vendor-others-D7Rwl1O6.js";import"./vendor-editor-B8hjWfkw.js";import"./vendor-ui-utils-5rYIvRjL.js";import"./vendor-heroui-DwwsJlXF.js";import"./page-dashboard-BIzbCQc5.js";import"./hooks-DGvDG8bg.js";import"./utils-BewWhq0h.js";import"./vendor-visual-BMhnpZxY.js";const x=()=>t.jsx("div",{className:"min-h-screen flex items-center justify-center",children:t.jsx(r,{})});export{x as default};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as p}from"./vendor-react-
|
|
1
|
+
import{V as p}from"./vendor-react-BDRVXu1f.js";import{a5 as g}from"./components-CLB7wkmN.js";const k=async(t,n,e,r)=>{const{setIsLogModalOpen:i,setTaskId:c,setTaskLogs:o,setTaskName:f}=n;f("更新插件");const a=["开始创建更新任务...",`options: ${JSON.stringify(t)}`];o(a);try{const s=await g(t);if(s.success&&s.taskId)c(s.taskId),o([...a,`
|
|
2
2
|
任务创建成功!`,`任务ID: ${s.taskId}`,"正在连接任务执行日志..."]),i(!0),typeof e=="function"&&e(),typeof r=="function"&&r();else throw new Error(s.message||"未知错误")}catch(s){console.error("更新失败:",s),p.error(`更新失败: ${s.message}`)}};export{k as c};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/web/index.html
CHANGED
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
content="viewport-fit=cover, width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
|
|
15
15
|
name="viewport" />
|
|
16
16
|
<link href="/web/assets/ico/favicon-BoqZd694.ico" rel="icon" />
|
|
17
|
-
<script type="module" crossorigin src="/web/assets/js/entry-
|
|
17
|
+
<script type="module" crossorigin src="/web/assets/js/entry-T2jwWprd.js"></script>
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-editor-B8hjWfkw.js">
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-others-
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-others-D7Rwl1O6.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-ui-utils-5rYIvRjL.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-react-
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-heroui-
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/hooks-
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-visual-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/components-
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/utils-
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/page-dashboard-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-react-BDRVXu1f.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-heroui-DwwsJlXF.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/hooks-DGvDG8bg.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-visual-BMhnpZxY.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/components-CLB7wkmN.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/utils-BewWhq0h.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/page-dashboard-BIzbCQc5.js">
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/web/assets/css/vendor-editor-CFbL2ovg.css">
|
|
29
29
|
<link rel="stylesheet" crossorigin href="/web/assets/css/vendor-others-ZgkIHsf0.css">
|
|
30
30
|
<link rel="stylesheet" crossorigin href="/web/assets/css/components-ep7vm38G.css">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-karin",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.8",
|
|
4
4
|
"description": "Lightweight, efficient, concise, and stable robot framework.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -179,8 +179,7 @@
|
|
|
179
179
|
"@types/lodash": "^4.17.16",
|
|
180
180
|
"cross-env": "^7.0.3",
|
|
181
181
|
"dotenv": "npm:@karinjs/dotenv@^1.1.2",
|
|
182
|
-
"jsonwebtoken": "npm:@karinjs/jsonwebtoken@^1.1.1"
|
|
183
|
-
"log4js": "npm:@karinjs/log4js@1.1.4"
|
|
182
|
+
"jsonwebtoken": "npm:@karinjs/jsonwebtoken@^1.1.1"
|
|
184
183
|
},
|
|
185
184
|
"engines": {
|
|
186
185
|
"node": ">=18"
|
package/README.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
|
-
## 项目介绍
|
|
4
|
-
|
|
5
|
-
`karin` 中译为「卡琳」,这个名字由[fuqiuluo](https://github.com/fuqiuluo)提供~
|
|
6
|
-
|
|
7
|
-
## 快速开始
|
|
8
|
-
|
|
9
|
-
[点击跳转文档](https://karin.fun/)
|
|
10
|
-
|
|
11
|
-
当前文档可能存在滞后性,正在努力更新中。
|
|
12
|
-
|
|
13
|
-
有其他问题请加群讨论: 967068507
|
|
14
|
-
|
|
15
|
-
## 温馨提示
|
|
16
|
-
|
|
17
|
-
当前`1.0.0`仍处于测试阶段,欢迎大家提出宝贵意见,我们会尽快修复。
|
|
18
|
-
|
|
19
|
-
## 鸣谢
|
|
20
|
-
|
|
21
|
-
- webui: [bietiaop](https://github.com/bietiaop)
|
|
22
|
-
- docs: [ikenxuan](https://github.com/ikenxuan)
|
|
23
|
-
|
|
24
|
-
> ps: 感谢两位大佬~
|
|
25
|
-
|
|
26
|
-
### 贡献者
|
|
27
|
-
|
|
28
|
-
> 🌟 星光闪烁,你们的智慧如同璀璨的夜空。感谢所有为**Karin**做出贡献的人!
|
|
29
|
-
|
|
30
|
-
[](https://github.com/KarinJS/Karin/graphs/contributors)
|
|
31
|
-
|
|
32
|
-

|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import EventEmitter from 'events';
|
|
2
|
-
import chalk__default from 'chalk';
|
|
3
|
-
import { Logger as Logger$1, Configuration } from 'log4js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 日志等级
|
|
7
|
-
* - `all`:所有日志
|
|
8
|
-
* - `trace`:追踪
|
|
9
|
-
* - `debug`:调试
|
|
10
|
-
* - `mark`:标记
|
|
11
|
-
* - `info`:信息
|
|
12
|
-
* - `warn`:警告
|
|
13
|
-
* - `error`:错误
|
|
14
|
-
* - `fatal`:致命
|
|
15
|
-
* - `off`:关闭
|
|
16
|
-
*/
|
|
17
|
-
type LoggerLevel = 'all' | 'trace' | 'debug' | 'mark' | 'info' | 'warn' | 'error' | 'fatal' | 'off';
|
|
18
|
-
/**
|
|
19
|
-
* 创建日志模块配置
|
|
20
|
-
*/
|
|
21
|
-
type LoggerOptions = {
|
|
22
|
-
config?: Configuration;
|
|
23
|
-
log4jsCfg?: {
|
|
24
|
-
level: LoggerLevel;
|
|
25
|
-
daysToKeep: number;
|
|
26
|
-
maxLogSize: number;
|
|
27
|
-
logColor: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* 拓展日志模块
|
|
32
|
-
*/
|
|
33
|
-
interface LoggerExpand {
|
|
34
|
-
/**
|
|
35
|
-
* 颜色模块
|
|
36
|
-
*/
|
|
37
|
-
chalk: typeof chalk__default;
|
|
38
|
-
/**
|
|
39
|
-
* 构建红色文本
|
|
40
|
-
* @param text - 文本
|
|
41
|
-
*/
|
|
42
|
-
red: (text: string) => string;
|
|
43
|
-
/**
|
|
44
|
-
* 构建绿色文本
|
|
45
|
-
* @param text - 文本
|
|
46
|
-
*/
|
|
47
|
-
green: (text: string) => string;
|
|
48
|
-
/**
|
|
49
|
-
* 构建黄色文本
|
|
50
|
-
* @param text - 文本
|
|
51
|
-
*/
|
|
52
|
-
yellow: (text: string) => string;
|
|
53
|
-
/**
|
|
54
|
-
* 构建蓝色文本
|
|
55
|
-
* @param text - 文本
|
|
56
|
-
*/
|
|
57
|
-
blue: (text: string) => string;
|
|
58
|
-
/**
|
|
59
|
-
* 构建品红色文本
|
|
60
|
-
* @param text - 文本
|
|
61
|
-
*/
|
|
62
|
-
magenta: (text: string) => string;
|
|
63
|
-
/**
|
|
64
|
-
* 构建青色文本
|
|
65
|
-
* @param text - 文本
|
|
66
|
-
*/
|
|
67
|
-
cyan: (text: string) => string;
|
|
68
|
-
/**
|
|
69
|
-
* 构建白色文本
|
|
70
|
-
* @param text - 文本
|
|
71
|
-
*/
|
|
72
|
-
white: (text: string) => string;
|
|
73
|
-
/**
|
|
74
|
-
* 构建灰色文本
|
|
75
|
-
* @param text - 文本
|
|
76
|
-
*/
|
|
77
|
-
gray: (text: string) => string;
|
|
78
|
-
/**
|
|
79
|
-
* 构建紫色文本
|
|
80
|
-
* @param text - 文本
|
|
81
|
-
*/
|
|
82
|
-
violet: (text: string) => string;
|
|
83
|
-
/**
|
|
84
|
-
* 构建函数文本
|
|
85
|
-
* @param text - 文本
|
|
86
|
-
*/
|
|
87
|
-
fnc: (text: string) => string;
|
|
88
|
-
/**
|
|
89
|
-
* 专属Bot前缀日志模块
|
|
90
|
-
* @param level 等级
|
|
91
|
-
* @param id 机器人ID
|
|
92
|
-
* @param args 参数
|
|
93
|
-
*/
|
|
94
|
-
bot: (level: LoggerLevel, id: string, ...args: any[]) => void;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* 日志模块
|
|
98
|
-
*/
|
|
99
|
-
type Logger = Logger$1 & LoggerExpand;
|
|
100
|
-
|
|
101
|
-
export type { Logger as L, LoggerLevel as a, LoggerOptions as b, LoggerExpand as c };
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./vendor-react-Hg1DVPZt.js";import{P as r}from"./components-SKlAGqzh.js";import"./vendor-others-B6NXaB-r.js";import"./vendor-editor-B8hjWfkw.js";import"./vendor-ui-utils-5rYIvRjL.js";import"./vendor-heroui-D6FhP6a0.js";import"./page-dashboard-BU7cB7ZI.js";import"./hooks-Cx1Yu0OX.js";import"./utils-x5AKiszG.js";import"./vendor-visual-mzxhMYK3.js";const x=()=>t.jsx("div",{className:"min-h-screen flex items-center justify-center",children:t.jsx(r,{})});export{x as default};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|