@karinjs/adapter-qqbot 1.2.10 → 2.0.0
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 +326 -85
- package/dist/apps/login.d.ts +20 -0
- package/dist/apps/login.js +57 -0
- package/dist/config-H7LrvlNU.js +197 -0
- package/dist/index.d.ts +670 -0
- package/dist/index.js +2847 -0
- package/dist/onboard-BX8g8Wik.js +249 -0
- package/dist/utils-DO4gEkVN.js +3 -0
- package/dist/web.config.d.ts +22 -0
- package/dist/web.config.js +173 -0
- package/package.json +34 -21
- package/config/comment/config.json +0 -3
- package/config/config/config.yaml +0 -53
- package/lib/cli/pr.d.ts +0 -2
- package/lib/cli/pr.js +0 -73
- package/lib/core/adapter/adapter.d.ts +0 -91
- package/lib/core/adapter/adapter.js +0 -144
- package/lib/core/adapter/handler.d.ts +0 -49
- package/lib/core/adapter/handler.js +0 -140
- package/lib/core/adapter/markdown.d.ts +0 -38
- package/lib/core/adapter/markdown.js +0 -220
- package/lib/core/adapter/normal.d.ts +0 -30
- package/lib/core/adapter/normal.js +0 -263
- package/lib/core/api/index.d.ts +0 -167
- package/lib/core/api/index.js +0 -180
- package/lib/core/api/sign.d.ts +0 -22
- package/lib/core/api/sign.js +0 -40
- package/lib/core/api/types.d.ts +0 -236
- package/lib/core/api/types.js +0 -1
- package/lib/core/event/conver.d.ts +0 -10
- package/lib/core/event/conver.js +0 -57
- package/lib/core/event/index.d.ts +0 -9
- package/lib/core/event/index.js +0 -98
- package/lib/core/event/message.d.ts +0 -27
- package/lib/core/event/message.js +0 -95
- package/lib/core/event/notice.d.ts +0 -50
- package/lib/core/event/notice.js +0 -133
- package/lib/core/event/types.d.ts +0 -473
- package/lib/core/event/types.js +0 -1
- package/lib/core/internal/axios.d.ts +0 -25
- package/lib/core/internal/axios.js +0 -46
- package/lib/core/internal/sign.d.ts +0 -22
- package/lib/core/internal/sign.js +0 -40
- package/lib/core/webhook/c2c.d.ts +0 -2
- package/lib/core/webhook/c2c.js +0 -14
- package/lib/core/webhook/http.d.ts +0 -2
- package/lib/core/webhook/http.js +0 -35
- package/lib/core/webhook/index.d.ts +0 -17
- package/lib/core/webhook/index.js +0 -87
- package/lib/core/webhook/ws.d.ts +0 -2
- package/lib/core/webhook/ws.js +0 -79
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -5
- package/lib/root.d.ts +0 -5
- package/lib/root.js +0 -9
- package/lib/types/config.d.ts +0 -53
- package/lib/types/config.js +0 -1
- package/lib/utils/common.d.ts +0 -80
- package/lib/utils/common.js +0 -198
- package/lib/utils/config.d.ts +0 -9
- package/lib/utils/config.js +0 -54
- package/lib/utils/dir.d.ts +0 -1
- package/lib/utils/dir.js +0 -1
- package/lib/utils/index.d.ts +0 -4
- package/lib/utils/index.js +0 -4
package/lib/utils/config.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { dirPath } from '@/utils';
|
|
2
|
-
import { watch, basePath, filesByExt, copyConfigSync, requireFileSync, } from 'node-karin';
|
|
3
|
-
let cache;
|
|
4
|
-
/**
|
|
5
|
-
* @description package.json
|
|
6
|
-
*/
|
|
7
|
-
export const pkg = () => requireFileSync(`${dirPath}/package.json`);
|
|
8
|
-
/** 用户配置的插件名称 */
|
|
9
|
-
const pluginName = pkg().name.replace(/\//g, '-');
|
|
10
|
-
/** 用户配置 */
|
|
11
|
-
const dirConfig = `${basePath}/${pluginName}/config`;
|
|
12
|
-
/** 默认配置 */
|
|
13
|
-
const defConfig = `${dirPath}/config/config`;
|
|
14
|
-
/**
|
|
15
|
-
* @description 初始化配置文件
|
|
16
|
-
*/
|
|
17
|
-
copyConfigSync(defConfig, dirConfig, ['.yaml']);
|
|
18
|
-
/**
|
|
19
|
-
* @description 配置文件
|
|
20
|
-
*/
|
|
21
|
-
export const config = () => {
|
|
22
|
-
if (cache)
|
|
23
|
-
return cache;
|
|
24
|
-
const user = requireFileSync(`${dirConfig}/config.yaml`);
|
|
25
|
-
const def = requireFileSync(`${defConfig}/config.yaml`);
|
|
26
|
-
const result = { default: Object.assign(def.default, user.default) };
|
|
27
|
-
for (const key in user) {
|
|
28
|
-
if (key === 'default')
|
|
29
|
-
continue;
|
|
30
|
-
result[key] = {
|
|
31
|
-
...result.default,
|
|
32
|
-
...user[key],
|
|
33
|
-
event: {
|
|
34
|
-
...result.default.event,
|
|
35
|
-
...user?.[key]?.event
|
|
36
|
-
},
|
|
37
|
-
markdown: {
|
|
38
|
-
...result.default.markdown,
|
|
39
|
-
...user?.[key]?.markdown
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
cache = result;
|
|
44
|
-
return result;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* @description 监听配置文件
|
|
48
|
-
*/
|
|
49
|
-
setTimeout(() => {
|
|
50
|
-
const list = filesByExt(dirConfig, '.yaml', 'abs');
|
|
51
|
-
list.forEach(file => watch(file, (old, now) => {
|
|
52
|
-
cache = undefined;
|
|
53
|
-
}));
|
|
54
|
-
}, 2000);
|
package/lib/utils/dir.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../root';
|
package/lib/utils/dir.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../root';
|
package/lib/utils/index.d.ts
DELETED
package/lib/utils/index.js
DELETED