@karinjs/adapter-qqbot 1.2.10 → 1.3.1

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.
Files changed (61) hide show
  1. package/README.md +869 -84
  2. package/dist/chunk-PYOUSZ6B.js +1501 -0
  3. package/dist/index.d.ts +499 -0
  4. package/dist/index.js +100 -0
  5. package/dist/web.config.d.ts +25 -0
  6. package/dist/web.config.js +224 -0
  7. package/package.json +22 -15
  8. package/config/comment/config.json +0 -3
  9. package/config/config/config.yaml +0 -53
  10. package/lib/cli/pr.d.ts +0 -2
  11. package/lib/cli/pr.js +0 -73
  12. package/lib/core/adapter/adapter.d.ts +0 -91
  13. package/lib/core/adapter/adapter.js +0 -144
  14. package/lib/core/adapter/handler.d.ts +0 -49
  15. package/lib/core/adapter/handler.js +0 -140
  16. package/lib/core/adapter/markdown.d.ts +0 -38
  17. package/lib/core/adapter/markdown.js +0 -220
  18. package/lib/core/adapter/normal.d.ts +0 -30
  19. package/lib/core/adapter/normal.js +0 -263
  20. package/lib/core/api/index.d.ts +0 -167
  21. package/lib/core/api/index.js +0 -180
  22. package/lib/core/api/sign.d.ts +0 -22
  23. package/lib/core/api/sign.js +0 -40
  24. package/lib/core/api/types.d.ts +0 -236
  25. package/lib/core/api/types.js +0 -1
  26. package/lib/core/event/conver.d.ts +0 -10
  27. package/lib/core/event/conver.js +0 -57
  28. package/lib/core/event/index.d.ts +0 -9
  29. package/lib/core/event/index.js +0 -98
  30. package/lib/core/event/message.d.ts +0 -27
  31. package/lib/core/event/message.js +0 -95
  32. package/lib/core/event/notice.d.ts +0 -50
  33. package/lib/core/event/notice.js +0 -133
  34. package/lib/core/event/types.d.ts +0 -473
  35. package/lib/core/event/types.js +0 -1
  36. package/lib/core/internal/axios.d.ts +0 -25
  37. package/lib/core/internal/axios.js +0 -46
  38. package/lib/core/internal/sign.d.ts +0 -22
  39. package/lib/core/internal/sign.js +0 -40
  40. package/lib/core/webhook/c2c.d.ts +0 -2
  41. package/lib/core/webhook/c2c.js +0 -14
  42. package/lib/core/webhook/http.d.ts +0 -2
  43. package/lib/core/webhook/http.js +0 -35
  44. package/lib/core/webhook/index.d.ts +0 -17
  45. package/lib/core/webhook/index.js +0 -87
  46. package/lib/core/webhook/ws.d.ts +0 -2
  47. package/lib/core/webhook/ws.js +0 -79
  48. package/lib/index.d.ts +0 -1
  49. package/lib/index.js +0 -5
  50. package/lib/root.d.ts +0 -5
  51. package/lib/root.js +0 -9
  52. package/lib/types/config.d.ts +0 -53
  53. package/lib/types/config.js +0 -1
  54. package/lib/utils/common.d.ts +0 -80
  55. package/lib/utils/common.js +0 -198
  56. package/lib/utils/config.d.ts +0 -9
  57. package/lib/utils/config.js +0 -54
  58. package/lib/utils/dir.d.ts +0 -1
  59. package/lib/utils/dir.js +0 -1
  60. package/lib/utils/index.d.ts +0 -4
  61. package/lib/utils/index.js +0 -4
@@ -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);
@@ -1 +0,0 @@
1
- export * from '../root';
package/lib/utils/dir.js DELETED
@@ -1 +0,0 @@
1
- export * from '../root';
@@ -1,4 +0,0 @@
1
- export * from './dir';
2
- export * from './config';
3
- export * as common from './common';
4
- export * as config from './config';
@@ -1,4 +0,0 @@
1
- export * from './dir';
2
- export * from './config';
3
- export * as common from './common';
4
- export * as config from './config';